mywebapi-sdk 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cplugin_webapi_sdk/__init__.py +79 -0
- cplugin_webapi_sdk/_generated/__init__.py +8 -0
- cplugin_webapi_sdk/_generated/api/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_authentication/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_authentication/post_api_v_2_mt4_trade_platform_user_password_check_login.py +306 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_authentication/post_api_v_2_mt4_trade_platform_user_password_set_login.py +377 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_info_orders_mode.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_info_users_mode.py +262 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_request_orders_file.py +285 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_request_users_file.py +325 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup_destructive/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup_destructive/post_api_v_2_mt4_trade_platform_backup_restore_orders.py +332 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_backup_destructive/post_api_v_2_mt4_trade_platform_backup_restore_users.py +344 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_common/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_common/get_api_v_2_mt4_trade_platform_journal_request.py +326 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_common/get_api_v_2_mt4_trade_platform_manager_common.py +229 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_common/get_api_v_2_mt4_trade_platform_server_time.py +225 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_access.py +280 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_backup.py +241 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_common.py +237 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_data_server.py +276 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_feeder.py +276 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_gateway_account.py +280 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_gateway_markup.py +280 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_gateway_rule.py +272 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_holiday.py +296 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_live_update.py +272 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_manager.py +272 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_sync.py +276 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_time.py +245 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_access_pos.py +254 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_data_server_pos.py +234 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_feeder_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_gateway_account_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_gateway_markup_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_gateway_rule_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_holiday_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_live_update_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_manager_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_symbol_pos.py +238 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_sync_pos.py +230 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_access_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_data_server_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_feeder_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_gateway_account_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_gateway_markup_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_gateway_rule_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_group_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_holiday_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_live_update_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_manager_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_plugin_pos.py +266 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_symbol_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_sync_pos.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_access_pos.py +378 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_backup.py +361 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_common.py +389 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_data_server_pos.py +354 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_feeder.py +305 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_gateway_account.py +361 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_gateway_markup.py +345 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_gateway_rule.py +377 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_holiday_pos.py +350 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_live_update.py +385 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_manager.py +385 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_symbol_group_pos.py +342 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_sync.py +349 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_time.py +421 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_ensure_group_name_exist_group.py +274 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_group_record_get_group.py +242 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_group_sec_groups_get_group.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_group_sec_margins_get_group.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_groups_get.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_groups_request.py +256 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/patch_api_v_2_mt4_trade_platform_group_record_group.py +255 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/post_api_v_2_mt4_trade_platform_group_record_update_group.py +542 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_history/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_history/get_api_v_2_mt4_trade_platform_trades_user_history_login.py +292 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_mail/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_mail/get_api_v_2_mt4_trade_platform_mail_last.py +225 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/get_api_v_2_mt4_trade_platform_margin_level_get_login.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/get_api_v_2_mt4_trade_platform_margin_level_request_login.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/get_api_v_2_mt4_trade_platform_margins_get.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_news/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_body_get_key.py +238 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_get.py +237 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_topic_get_pos.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_total.py +225 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_news/post_api_v_2_mt4_trade_platform_news_body_request_key.py +254 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_online/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_online/get_api_v_2_mt4_trade_platform_online_get.py +276 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_online/get_api_v_2_mt4_trade_platform_online_request.py +276 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_plugins/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_plugins/post_api_v_2_mt4_trade_platform_external_command_json.py +309 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_chart_request_symbol.py +332 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_tick_info_last.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_tick_info_last_symbol.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_ticks_request_symbol.py +311 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_chart_add_symbol.py +375 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_chart_delete_symbol.py +375 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_chart_update_symbol.py +367 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_history_correct_symbol.py +274 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_daily_reports_request.py +362 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_daily_reports_request_ex.py +334 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_performance_request.py +281 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_reports_request.py +370 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/post_api_v_2_mt4_trade_platform_daily_sync_read.py +253 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/post_api_v_2_mt4_trade_platform_daily_sync_start.py +289 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/get_api_v_2_mt4_trade_platform_license_check_license_name.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/get_api_v_2_mt4_trade_platform_srv_feeder_log_name.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/get_api_v_2_mt4_trade_platform_srv_feeders.py +288 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/post_api_v_2_mt4_trade_platform_notifications_send.py +289 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_charts_sync.py +257 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_feeds_restart.py +253 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_live_update_start.py +253 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_restart.py +281 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_trades_snapshot.py +245 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_trades_sync_read.py +249 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_users_snapshot.py +257 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_users_sync_read.py +253 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_external_command/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_external_command/post_api_v_2_mt4_trade_platform_external_command_binary.py +393 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/get_api_v_2_mt4_trade_platform_mails_request.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/post_api_v_2_mt4_trade_platform_mail_send.py +317 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/post_api_v_2_mt4_trade_platform_news_send.py +309 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/get_api_v_2_mt4_trade_platform_cfg_request_plugin.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/get_api_v_2_mt4_trade_platform_plugin_param_get_pos.py +242 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/get_api_v_2_mt4_trade_platform_plugins_get.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/post_api_v_2_mt4_trade_platform_cfg_update_plugin.py +301 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/post_api_v_2_mt4_trade_platform_plugin_update.py +293 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_cfg_request_symbol.py +229 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_cfg_request_symbol_symbol.py +242 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbol_info_get.py +253 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbol_info_updated.py +268 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbol_sessions_get_symbol.py +258 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbols_groups_get.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/patch_api_v_2_mt4_trade_platform_symbol_config_symbol.py +255 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_cfg_update_symbol_symbol.py +530 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_add_symbol.py +270 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_change.py +417 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_hide_symbol.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_send_tick.py +319 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbols_refresh.py +233 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_adm_trades_request_group.py +266 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trade_record_get_order.py +246 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trade_record_request_order.py +258 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trade_records_request.py +278 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get.py +252 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_by_login_login_group.py +259 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_by_market.py +229 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_by_symbol.py +249 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_ticket.py +254 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_request.py +299 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_adm_trade_record_modify_ticket.py +462 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_adm_trades_delete.py +290 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trade_check_stops.py +453 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trade_clear_rollback_order.py +262 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trade_transaction.py +453 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trades_sync_start.py +261 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_adm_balance_check.py +266 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_adm_balance_check_login.py +266 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_adm_users_request_safe_group.py +274 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_user_record_get_login.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_user_record_request_login.py +250 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_user_records_request.py +274 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_users_request.py +276 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/patch_api_v_2_mt4_trade_platform_user_record_login.py +283 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_adm_balance_fix.py +290 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_user_record_new.py +465 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_user_record_update_login.py +678 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_users_group_op.py +349 -0
- cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_users_sync_start.py +273 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_common/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_common/get_api_v_2_mt5_trade_platform_server_time.py +205 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_common/get_api_v_2_mt5_trade_platform_time_get.py +205 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_groups/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_groups/get_api_v_2_mt5_trade_platform_group_get_group.py +218 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_groups/patch_api_v_2_mt5_trade_platform_group_record_group.py +255 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_managers/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_managers/get_api_v_2_mt5_trade_platform_manager_current.py +205 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_symbols/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_symbols/get_api_v_2_mt5_trade_platform_symbol_get_symbol.py +218 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_symbols/patch_api_v_2_mt5_trade_platform_symbol_record_symbol.py +255 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/get_api_v_2_mt5_trade_platform_deal_by_group_mask.py +265 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/get_api_v_2_mt5_trade_platform_order_by_group_mask.py +265 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/get_api_v_2_mt5_trade_platform_position_by_group_mask.py +265 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_users/__init__.py +1 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_users/get_api_v_2_mt5_trade_platform_user_get_login.py +218 -0
- cplugin_webapi_sdk/_generated/api/mt5_v_2_users/patch_api_v_2_mt5_trade_platform_user_record_login.py +255 -0
- cplugin_webapi_sdk/_generated/client.py +271 -0
- cplugin_webapi_sdk/_generated/errors.py +14 -0
- cplugin_webapi_sdk/_generated/models/__init__.py +469 -0
- cplugin_webapi_sdk/_generated/models/activation_modes.py +10 -0
- cplugin_webapi_sdk/_generated/models/activation_type.py +15 -0
- cplugin_webapi_sdk/_generated/models/api_error.py +135 -0
- cplugin_webapi_sdk/_generated/models/api_meta.py +114 -0
- cplugin_webapi_sdk/_generated/models/arc_backup_execution_period.py +10 -0
- cplugin_webapi_sdk/_generated/models/arc_backup_store_period.py +11 -0
- cplugin_webapi_sdk/_generated/models/backup_execution_period.py +9 -0
- cplugin_webapi_sdk/_generated/models/backup_store_period.py +10 -0
- cplugin_webapi_sdk/_generated/models/boolean_api_response.py +143 -0
- cplugin_webapi_sdk/_generated/models/chart_period.py +15 -0
- cplugin_webapi_sdk/_generated/models/data_feed_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/date_time_api_response.py +154 -0
- cplugin_webapi_sdk/_generated/models/deal_action.py +27 -0
- cplugin_webapi_sdk/_generated/models/deal_reason.py +26 -0
- cplugin_webapi_sdk/_generated/models/en_auth_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/en_auth_otp_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_calc_mode.py +21 -0
- cplugin_webapi_sdk/_generated/models/en_chart_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_comm_action_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_comm_charge_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_comm_entry_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_comm_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_comm_profit_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_comm_range_mode.py +11 -0
- cplugin_webapi_sdk/_generated/models/en_commission_mode.py +14 -0
- cplugin_webapi_sdk/_generated/models/en_commission_volume_type.py +8 -0
- cplugin_webapi_sdk/_generated/models/en_execution_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/en_free_margin_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/en_gateway_account_flags.py +8 -0
- cplugin_webapi_sdk/_generated/models/en_gtc_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_history_limit.py +13 -0
- cplugin_webapi_sdk/_generated/models/en_industries.py +172 -0
- cplugin_webapi_sdk/_generated/models/en_instant_mode.py +7 -0
- cplugin_webapi_sdk/_generated/models/en_log_type.py +14 -0
- cplugin_webapi_sdk/_generated/models/en_mail_mode.py +8 -0
- cplugin_webapi_sdk/_generated/models/en_manager_limit.py +13 -0
- cplugin_webapi_sdk/_generated/models/en_manager_rights.py +82 -0
- cplugin_webapi_sdk/_generated/models/en_margin_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_news_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_option_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/en_reports_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/en_sectors.py +22 -0
- cplugin_webapi_sdk/_generated/models/en_splice_time_type.py +7 -0
- cplugin_webapi_sdk/_generated/models/en_splice_type.py +9 -0
- cplugin_webapi_sdk/_generated/models/en_stop_out_mode.py +8 -0
- cplugin_webapi_sdk/_generated/models/en_swap_days.py +14 -0
- cplugin_webapi_sdk/_generated/models/en_swap_mode.py +16 -0
- cplugin_webapi_sdk/_generated/models/en_trade_mode.py +11 -0
- cplugin_webapi_sdk/_generated/models/en_transfer_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/entry_flag.py +10 -0
- cplugin_webapi_sdk/_generated/models/export_execution_period.py +11 -0
- cplugin_webapi_sdk/_generated/models/gtc_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/int_32_api_response.py +143 -0
- cplugin_webapi_sdk/_generated/models/int_32mt4_daily_report_list_dictionary_api_response.py +170 -0
- cplugin_webapi_sdk/_generated/models/int_32mt4_daily_report_list_dictionary_api_response_data_type_0.py +107 -0
- cplugin_webapi_sdk/_generated/models/json_node.py +155 -0
- cplugin_webapi_sdk/_generated/models/json_node_api_response.py +170 -0
- cplugin_webapi_sdk/_generated/models/json_node_options.py +60 -0
- cplugin_webapi_sdk/_generated/models/margin_calculation_mode.py +11 -0
- cplugin_webapi_sdk/_generated/models/margin_controlling_type.py +8 -0
- cplugin_webapi_sdk/_generated/models/margin_level_type.py +9 -0
- cplugin_webapi_sdk/_generated/models/margin_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/mt4_access.py +106 -0
- cplugin_webapi_sdk/_generated/models/mt4_access_api_response.py +173 -0
- cplugin_webapi_sdk/_generated/models/mt4_access_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_backup.py +442 -0
- cplugin_webapi_sdk/_generated/models/mt4_backup_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_backup_info.py +107 -0
- cplugin_webapi_sdk/_generated/models/mt4_backup_info_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_balance_diff.py +74 -0
- cplugin_webapi_sdk/_generated/models/mt4_balance_diff_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_balance_diff_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_chart_bar.py +121 -0
- cplugin_webapi_sdk/_generated/models/mt4_chart_bar_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_chart_write_request.py +103 -0
- cplugin_webapi_sdk/_generated/models/mt4_common.py +124 -0
- cplugin_webapi_sdk/_generated/models/mt4_common_api_response.py +172 -0
- cplugin_webapi_sdk/_generated/models/mt4_common_update.py +201 -0
- cplugin_webapi_sdk/_generated/models/mt4_daily_report.py +212 -0
- cplugin_webapi_sdk/_generated/models/mt4_daily_report_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_data_server.py +153 -0
- cplugin_webapi_sdk/_generated/models/mt4_data_server_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_data_server_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_external_command_binary_request.py +77 -0
- cplugin_webapi_sdk/_generated/models/mt4_external_command_binary_response.py +74 -0
- cplugin_webapi_sdk/_generated/models/mt4_external_command_binary_response_api_response.py +171 -0
- cplugin_webapi_sdk/_generated/models/mt4_feeder.py +235 -0
- cplugin_webapi_sdk/_generated/models/mt4_feeder_api_response.py +172 -0
- cplugin_webapi_sdk/_generated/models/mt4_feeder_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_account.py +190 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_account_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_account_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_markup.py +157 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_markup_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_markup_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_rule.py +234 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_rule_api_response.py +177 -0
- cplugin_webapi_sdk/_generated/models/mt4_gateway_rule_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_group.py +505 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_api_response.py +193 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_margin.py +104 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_margin_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_sec.py +321 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_sec_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_group_update.py +467 -0
- cplugin_webapi_sdk/_generated/models/mt4_holiday.py +153 -0
- cplugin_webapi_sdk/_generated/models/mt4_holiday_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_holiday_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_live_update.py +165 -0
- cplugin_webapi_sdk/_generated/models/mt4_live_update_api_response.py +177 -0
- cplugin_webapi_sdk/_generated/models/mt4_live_update_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_mail_box.py +148 -0
- cplugin_webapi_sdk/_generated/models/mt4_mail_box_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_mail_send_request.py +160 -0
- cplugin_webapi_sdk/_generated/models/mt4_manager_rights.py +338 -0
- cplugin_webapi_sdk/_generated/models/mt4_manager_rights_api_response.py +175 -0
- cplugin_webapi_sdk/_generated/models/mt4_manager_rights_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_margin_level.py +201 -0
- cplugin_webapi_sdk/_generated/models/mt4_margin_level_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_margin_level_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_news_send_request.py +127 -0
- cplugin_webapi_sdk/_generated/models/mt4_news_topic.py +177 -0
- cplugin_webapi_sdk/_generated/models/mt4_news_topic_api_response.py +178 -0
- cplugin_webapi_sdk/_generated/models/mt4_news_topic_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_notifications_send_request.py +114 -0
- cplugin_webapi_sdk/_generated/models/mt4_online.py +88 -0
- cplugin_webapi_sdk/_generated/models/mt4_online_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_performance.py +124 -0
- cplugin_webapi_sdk/_generated/models/mt4_performance_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_plugin.py +153 -0
- cplugin_webapi_sdk/_generated/models/mt4_plugin_config.py +96 -0
- cplugin_webapi_sdk/_generated/models/mt4_plugin_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_plugin_param.py +137 -0
- cplugin_webapi_sdk/_generated/models/mt4_plugin_param_api_response.py +171 -0
- cplugin_webapi_sdk/_generated/models/mt4_plugin_param_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_server_log.py +151 -0
- cplugin_webapi_sdk/_generated/models/mt4_server_log_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_server_time.py +95 -0
- cplugin_webapi_sdk/_generated/models/mt4_server_time_api_response.py +178 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_change_request.py +148 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_config.py +683 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_config_api_response.py +177 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_config_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_config_update.py +608 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_day_sessions.py +171 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_day_sessions_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_group.py +99 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_group_api_response.py +174 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_group_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_info.py +210 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_info_api_response.py +178 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_info_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_symbol_session.py +91 -0
- cplugin_webapi_sdk/_generated/models/mt4_sync.py +176 -0
- cplugin_webapi_sdk/_generated/models/mt4_sync_api_response.py +173 -0
- cplugin_webapi_sdk/_generated/models/mt4_sync_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_tick_info.py +117 -0
- cplugin_webapi_sdk/_generated/models/mt4_tick_info_api_response.py +175 -0
- cplugin_webapi_sdk/_generated/models/mt4_tick_info_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_tick_record.py +126 -0
- cplugin_webapi_sdk/_generated/models/mt4_tick_record_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade.py +409 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_api_response.py +179 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_restore_input.py +274 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_restore_result.py +72 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_restore_result_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_transaction.py +262 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_transaction_api_response.py +181 -0
- cplugin_webapi_sdk/_generated/models/mt4_trade_update.py +165 -0
- cplugin_webapi_sdk/_generated/models/mt4_user.py +533 -0
- cplugin_webapi_sdk/_generated/models/mt4_user_api_response.py +184 -0
- cplugin_webapi_sdk/_generated/models/mt4_user_create.py +420 -0
- cplugin_webapi_sdk/_generated/models/mt4_user_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt4_user_restore_input.py +193 -0
- cplugin_webapi_sdk/_generated/models/mt4_user_update.py +441 -0
- cplugin_webapi_sdk/_generated/models/mt4_users_group_op.py +140 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_comm_tier.py +246 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_commission.py +409 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_group.py +1162 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_group_api_response.py +170 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_group_commissions_type_0.py +83 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_manager.py +227 -0
- cplugin_webapi_sdk/_generated/models/mt5_con_manager_api_response.py +156 -0
- cplugin_webapi_sdk/_generated/models/mt5_deal.py +1045 -0
- cplugin_webapi_sdk/_generated/models/mt5_deal_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt5_order.py +1008 -0
- cplugin_webapi_sdk/_generated/models/mt5_order_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt5_position.py +829 -0
- cplugin_webapi_sdk/_generated/models/mt5_position_list_api_response.py +180 -0
- cplugin_webapi_sdk/_generated/models/mt5_symbol.py +2743 -0
- cplugin_webapi_sdk/_generated/models/mt5_symbol_api_response.py +170 -0
- cplugin_webapi_sdk/_generated/models/mt5_symbol_margin_rate_initial_type_0.py +124 -0
- cplugin_webapi_sdk/_generated/models/mt5_symbol_margin_rate_maintenance_type_0.py +124 -0
- cplugin_webapi_sdk/_generated/models/mt5_symbol_session.py +182 -0
- cplugin_webapi_sdk/_generated/models/mt5_time.py +101 -0
- cplugin_webapi_sdk/_generated/models/mt5_time_api_response.py +170 -0
- cplugin_webapi_sdk/_generated/models/mt5_user.py +752 -0
- cplugin_webapi_sdk/_generated/models/mt5_user_api_response.py +172 -0
- cplugin_webapi_sdk/_generated/models/news_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/order_filling.py +10 -0
- cplugin_webapi_sdk/_generated/models/order_reason.py +26 -0
- cplugin_webapi_sdk/_generated/models/order_state.py +16 -0
- cplugin_webapi_sdk/_generated/models/order_time.py +10 -0
- cplugin_webapi_sdk/_generated/models/order_type.py +15 -0
- cplugin_webapi_sdk/_generated/models/otp_mode.py +8 -0
- cplugin_webapi_sdk/_generated/models/paging_meta.py +88 -0
- cplugin_webapi_sdk/_generated/models/patch_api_v2mt4_trade_platform_group_record_group_json_body.py +66 -0
- cplugin_webapi_sdk/_generated/models/patch_api_v2mt4_trade_platform_symbol_config_symbol_json_body.py +66 -0
- cplugin_webapi_sdk/_generated/models/patch_api_v2mt4_trade_platform_user_record_login_json_body.py +66 -0
- cplugin_webapi_sdk/_generated/models/patch_api_v2mt5_trade_platform_group_record_group_json_body.py +66 -0
- cplugin_webapi_sdk/_generated/models/patch_api_v2mt5_trade_platform_symbol_record_symbol_json_body.py +66 -0
- cplugin_webapi_sdk/_generated/models/patch_api_v2mt5_trade_platform_user_record_login_json_body.py +66 -0
- cplugin_webapi_sdk/_generated/models/position_actions.py +8 -0
- cplugin_webapi_sdk/_generated/models/position_reasons.py +26 -0
- cplugin_webapi_sdk/_generated/models/profit_calculation_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/request_mode.py +10 -0
- cplugin_webapi_sdk/_generated/models/result_code.py +46 -0
- cplugin_webapi_sdk/_generated/models/server_role.py +9 -0
- cplugin_webapi_sdk/_generated/models/string_api_response.py +155 -0
- cplugin_webapi_sdk/_generated/models/swap_type.py +10 -0
- cplugin_webapi_sdk/_generated/models/symbol_exec_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/symbol_price_direction.py +9 -0
- cplugin_webapi_sdk/_generated/models/synchronization_mode.py +11 -0
- cplugin_webapi_sdk/_generated/models/trade_command.py +14 -0
- cplugin_webapi_sdk/_generated/models/trade_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/trade_record_reason.py +14 -0
- cplugin_webapi_sdk/_generated/models/trade_record_state.py +13 -0
- cplugin_webapi_sdk/_generated/models/watchdog_failover_mode.py +9 -0
- cplugin_webapi_sdk/_generated/models/watchdog_state.py +9 -0
- cplugin_webapi_sdk/_generated/models/web_api_error_code.py +17 -0
- cplugin_webapi_sdk/_generated/operation_timeouts.py +181 -0
- cplugin_webapi_sdk/_generated/types.py +53 -0
- cplugin_webapi_sdk/auth.py +278 -0
- cplugin_webapi_sdk/client.py +1215 -0
- cplugin_webapi_sdk/discovery.py +109 -0
- cplugin_webapi_sdk/envelope.py +77 -0
- cplugin_webapi_sdk/environments.py +45 -0
- cplugin_webapi_sdk/errors.py +79 -0
- cplugin_webapi_sdk/flags.py +36 -0
- cplugin_webapi_sdk/pagination.py +141 -0
- cplugin_webapi_sdk/realtime.py +408 -0
- cplugin_webapi_sdk/timeouts.py +197 -0
- cplugin_webapi_sdk/unwrap.py +153 -0
- mywebapi_sdk-0.3.0.dist-info/METADATA +312 -0
- mywebapi_sdk-0.3.0.dist-info/RECORD +456 -0
- mywebapi_sdk-0.3.0.dist-info/WHEEL +4 -0
- mywebapi_sdk-0.3.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""OIDC discovery — fetches ``.well-known/openid-configuration`` once and
|
|
2
|
+
caches the parsed document for the lifetime of the process.
|
|
3
|
+
|
|
4
|
+
Sync and async paths share the same cache: the first caller to populate it
|
|
5
|
+
wins, all subsequent callers (sync or async) get the cached document with no
|
|
6
|
+
further network IO. Locks guard only the *first* fetch — once cached, reads
|
|
7
|
+
are lock-free.
|
|
8
|
+
"""
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import asyncio
|
|
12
|
+
import threading
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
import httpx
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class OidcDiscovery:
|
|
19
|
+
"""Single-flight OIDC discovery document fetcher."""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
identity_url: str,
|
|
24
|
+
http_sync: httpx.Client | None = None,
|
|
25
|
+
http_async: httpx.AsyncClient | None = None,
|
|
26
|
+
) -> None:
|
|
27
|
+
self._identity_url = identity_url.rstrip("/")
|
|
28
|
+
self._http_sync = http_sync
|
|
29
|
+
self._http_async = http_async
|
|
30
|
+
self._cached: dict[str, Any] | None = None
|
|
31
|
+
self._lock_sync = threading.Lock()
|
|
32
|
+
self._lock_async = asyncio.Lock()
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def discovery_url(self) -> str:
|
|
36
|
+
return f"{self._identity_url}/.well-known/openid-configuration"
|
|
37
|
+
|
|
38
|
+
def get_sync(self) -> dict[str, Any]:
|
|
39
|
+
# Fast path — lock-free read once populated.
|
|
40
|
+
if self._cached is not None:
|
|
41
|
+
return self._cached
|
|
42
|
+
with self._lock_sync:
|
|
43
|
+
if self._cached is not None:
|
|
44
|
+
return self._cached
|
|
45
|
+
client = self._http_sync or httpx.Client()
|
|
46
|
+
owns_client = self._http_sync is None
|
|
47
|
+
try:
|
|
48
|
+
r = client.get(self.discovery_url)
|
|
49
|
+
finally:
|
|
50
|
+
if owns_client:
|
|
51
|
+
client.close()
|
|
52
|
+
self._cached = self._validate_doc(self._parse_response(r))
|
|
53
|
+
return self._cached
|
|
54
|
+
|
|
55
|
+
async def get_async(self) -> dict[str, Any]:
|
|
56
|
+
if self._cached is not None:
|
|
57
|
+
return self._cached
|
|
58
|
+
async with self._lock_async:
|
|
59
|
+
if self._cached is not None:
|
|
60
|
+
return self._cached
|
|
61
|
+
client = self._http_async or httpx.AsyncClient()
|
|
62
|
+
owns_client = self._http_async is None
|
|
63
|
+
try:
|
|
64
|
+
r = await client.get(self.discovery_url)
|
|
65
|
+
finally:
|
|
66
|
+
if owns_client:
|
|
67
|
+
await client.aclose()
|
|
68
|
+
self._cached = self._validate_doc(self._parse_response(r))
|
|
69
|
+
return self._cached
|
|
70
|
+
|
|
71
|
+
@staticmethod
|
|
72
|
+
def _parse_response(r: httpx.Response) -> dict[str, Any]:
|
|
73
|
+
# Defer import to avoid circular dependency at module import time.
|
|
74
|
+
from .auth import OAuth2TokenError
|
|
75
|
+
|
|
76
|
+
if r.status_code < 200 or r.status_code >= 300:
|
|
77
|
+
raise OAuth2TokenError(
|
|
78
|
+
status_code=r.status_code,
|
|
79
|
+
error="discovery_failed",
|
|
80
|
+
error_description=f"OIDC discovery returned HTTP {r.status_code}",
|
|
81
|
+
)
|
|
82
|
+
try:
|
|
83
|
+
doc = r.json()
|
|
84
|
+
except Exception as e: # noqa: BLE001
|
|
85
|
+
raise OAuth2TokenError(
|
|
86
|
+
status_code=r.status_code,
|
|
87
|
+
error="discovery_failed",
|
|
88
|
+
error_description=f"OIDC discovery response was not JSON: {e}",
|
|
89
|
+
) from e
|
|
90
|
+
if not isinstance(doc, dict):
|
|
91
|
+
raise OAuth2TokenError(
|
|
92
|
+
status_code=r.status_code,
|
|
93
|
+
error="discovery_failed",
|
|
94
|
+
error_description="OIDC discovery document was not a JSON object",
|
|
95
|
+
)
|
|
96
|
+
return doc
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def _validate_doc(doc: dict[str, Any]) -> dict[str, Any]:
|
|
100
|
+
from .auth import OAuth2TokenError
|
|
101
|
+
|
|
102
|
+
endpoint = doc.get("token_endpoint")
|
|
103
|
+
if not isinstance(endpoint, str) or not endpoint:
|
|
104
|
+
raise OAuth2TokenError(
|
|
105
|
+
status_code=0,
|
|
106
|
+
error="discovery_invalid",
|
|
107
|
+
error_description="OIDC discovery document missing token_endpoint",
|
|
108
|
+
)
|
|
109
|
+
return doc
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""v2 response envelope: {data, error, meta}.
|
|
2
|
+
|
|
3
|
+
Mirrors the TS SDK's ApiEnvelope[T] / ApiErrorBody / ApiMeta / PagingMeta.
|
|
4
|
+
The server always returns HTTP 200 and signals failure in-envelope via a
|
|
5
|
+
non-null ``error``. Field aliases map the server's camelCase JSON to
|
|
6
|
+
snake_case Python attributes.
|
|
7
|
+
|
|
8
|
+
Schema reference: spec/v2.json components.schemas.{ApiError,ApiMeta,PagingMeta}.
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from typing import Generic, TypeVar
|
|
13
|
+
|
|
14
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T")
|
|
17
|
+
|
|
18
|
+
# * Stable transport-level error codes (WebApiErrorCode). Kept as a plain str
|
|
19
|
+
# so unknown future codes never raise on parse. The spec defines a fixed enum
|
|
20
|
+
# (Ok, NoConnect, Validation, …, Timeout, OutcomeUnknown, Busy, Internal) but the
|
|
21
|
+
# wire type is a string — new codes would otherwise be rejected by a Literal union.
|
|
22
|
+
# Named constants: timeouts.ErrorCode.
|
|
23
|
+
WebApiErrorCode = str
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class PagingMeta(BaseModel):
|
|
27
|
+
"""Pagination cursor returned on list endpoints."""
|
|
28
|
+
|
|
29
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
30
|
+
|
|
31
|
+
# * nextCursor is the opaque page token; pass it back as ?cursor=.
|
|
32
|
+
next_cursor: str | None = Field(default=None, alias="nextCursor")
|
|
33
|
+
# * hasMore is the explicit boolean sentinel so callers avoid null-string checks.
|
|
34
|
+
has_more: bool = Field(default=False, alias="hasMore")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ApiMeta(BaseModel):
|
|
38
|
+
"""Response metadata present on every v2 response."""
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
41
|
+
|
|
42
|
+
# * W3C trace id — correlate this response in Seq/SigNoz logs.
|
|
43
|
+
activity_id: str | None = Field(default=None, alias="activityId")
|
|
44
|
+
# * Pagination info; null for non-list endpoints.
|
|
45
|
+
paging: PagingMeta | None = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class ApiErrorBody(BaseModel):
|
|
49
|
+
"""Parsed representation of the ``error`` field in a v2 envelope.
|
|
50
|
+
|
|
51
|
+
``code`` is the stable transport-level error code (WebApiErrorCode).
|
|
52
|
+
``manager_code`` is the raw MT4/MT5 ResultCode: a string for named enum
|
|
53
|
+
members, an integer for unrecognised numeric codes.
|
|
54
|
+
``message`` is the human-readable description.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
58
|
+
|
|
59
|
+
code: WebApiErrorCode
|
|
60
|
+
# ! Raw MT4/MT5 ResultCode: a string for a named member, a number otherwise.
|
|
61
|
+
manager_code: str | int | None = Field(default=None, alias="managerCode")
|
|
62
|
+
message: str | None = None
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class ApiEnvelope(BaseModel, Generic[T]):
|
|
66
|
+
"""Top-level v2 envelope: {data, error, meta}.
|
|
67
|
+
|
|
68
|
+
``data`` carries the typed payload on success (non-null).
|
|
69
|
+
``error`` is non-null on failure; the transport raises ApiError in that case.
|
|
70
|
+
``meta`` carries correlation and pagination metadata.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
74
|
+
|
|
75
|
+
data: T | None = None
|
|
76
|
+
error: ApiErrorBody | None = None
|
|
77
|
+
meta: ApiMeta | None = None
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Environment presets for the v2 SDK. Presets carry only customer-facing
|
|
2
|
+
base URLs — no internal hosts, tokens, or credentials.
|
|
3
|
+
"""
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
EnvironmentName = Literal["prod", "staging", "custom"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True)
|
|
13
|
+
class ResolvedEnvironment:
|
|
14
|
+
api_base_url: str
|
|
15
|
+
authority: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
_PRESETS: dict[str, ResolvedEnvironment] = {
|
|
19
|
+
"prod": ResolvedEnvironment("https://cloud.mywebapi.com", "https://auth.cplugin.net"),
|
|
20
|
+
"staging": ResolvedEnvironment("https://pre.mywebapi.com", "https://pre.auth.cplugin.net"),
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _strip(u: str) -> str:
|
|
25
|
+
# * Strip trailing slashes from URLs to normalize custom environment inputs.
|
|
26
|
+
return u.rstrip("/")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def resolve_environment(
|
|
30
|
+
env: EnvironmentName,
|
|
31
|
+
*,
|
|
32
|
+
api_base_url: str | None = None,
|
|
33
|
+
authority: str | None = None,
|
|
34
|
+
) -> ResolvedEnvironment:
|
|
35
|
+
# * Resolve environment configuration by name (preset) or custom URLs.
|
|
36
|
+
# * For custom env, both api_base_url and authority are required and trailing slashes
|
|
37
|
+
# * are stripped to normalize the URLs.
|
|
38
|
+
if env == "custom":
|
|
39
|
+
if not api_base_url or not authority:
|
|
40
|
+
raise ValueError("custom environment requires both api_base_url and authority")
|
|
41
|
+
return ResolvedEnvironment(_strip(api_base_url), _strip(authority))
|
|
42
|
+
preset = _PRESETS.get(env)
|
|
43
|
+
if preset is None:
|
|
44
|
+
raise ValueError(f"unknown environment: {env!r}")
|
|
45
|
+
return preset
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""ApiError — raised when a v2 envelope carries a non-null ``error``.
|
|
2
|
+
|
|
3
|
+
Public surface mirrors the TS SDK: {code, description, activity_id}.
|
|
4
|
+
``manager_code`` and ``status`` are retained as extras for diagnostics;
|
|
5
|
+
``outcome``, ``applied_timeout`` and ``headers`` come from the response headers
|
|
6
|
+
and say what a timeout means for the operation (see ``timeouts``).
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from collections.abc import Mapping
|
|
11
|
+
|
|
12
|
+
from .envelope import ApiErrorBody, ApiMeta, WebApiErrorCode
|
|
13
|
+
from .timeouts import (
|
|
14
|
+
APPLIED_TIMEOUT_HEADER,
|
|
15
|
+
OUTCOME_HEADER,
|
|
16
|
+
is_outcome_unknown,
|
|
17
|
+
is_safe_to_retry,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _header(headers: Mapping[str, str], name: str) -> str | None:
|
|
22
|
+
# * httpx.Headers is case-insensitive; a plain dict (tests, custom shims) may not be.
|
|
23
|
+
value = headers.get(name)
|
|
24
|
+
if value is None:
|
|
25
|
+
lowered = name.lower()
|
|
26
|
+
value = next((v for k, v in headers.items() if k.lower() == lowered), None)
|
|
27
|
+
return value
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ApiError(Exception):
|
|
31
|
+
"""Raised by the transport when an envelope's ``error`` field is non-null.
|
|
32
|
+
|
|
33
|
+
Attributes:
|
|
34
|
+
code: Stable error code (``ErrorCode``), e.g. ``"OutcomeUnknown"``.
|
|
35
|
+
description: Human-readable message from the server.
|
|
36
|
+
activity_id: Trace id to quote when reporting the problem.
|
|
37
|
+
manager_code: Raw trade-platform result code, when there is one.
|
|
38
|
+
status: HTTP status (v2 answers 200 even on errors).
|
|
39
|
+
outcome: ``X-Request-Outcome`` header (``RequestOutcome``): ``"timeout"``,
|
|
40
|
+
``"unknown"``, ``"not-started"``, ``"in-progress"``, or ``None``.
|
|
41
|
+
applied_timeout: ``X-Request-Timeout-Applied`` header — the deadline the server
|
|
42
|
+
used, in seconds — or ``None``.
|
|
43
|
+
headers: All response headers.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
body: ApiErrorBody,
|
|
49
|
+
meta: ApiMeta | None,
|
|
50
|
+
status: int,
|
|
51
|
+
headers: Mapping[str, str] | None = None,
|
|
52
|
+
) -> None:
|
|
53
|
+
self.code: WebApiErrorCode = body.code
|
|
54
|
+
self.description: str | None = body.message
|
|
55
|
+
self.activity_id: str | None = meta.activity_id if meta is not None else None
|
|
56
|
+
self.manager_code: str | int | None = body.manager_code
|
|
57
|
+
self.status: int = status
|
|
58
|
+
self.headers: Mapping[str, str] = headers if headers is not None else {}
|
|
59
|
+
|
|
60
|
+
outcome = _header(self.headers, OUTCOME_HEADER)
|
|
61
|
+
self.outcome: str | None = outcome.strip().lower() if outcome and outcome.strip() else None
|
|
62
|
+
|
|
63
|
+
applied = _header(self.headers, APPLIED_TIMEOUT_HEADER)
|
|
64
|
+
try:
|
|
65
|
+
self.applied_timeout: float | None = float(applied) if applied else None
|
|
66
|
+
except ValueError:
|
|
67
|
+
self.applied_timeout = None
|
|
68
|
+
|
|
69
|
+
super().__init__(self.description or f"v2 error: {body.code}")
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def outcome_unknown(self) -> bool:
|
|
73
|
+
"""The operation may still be applied — check before repeating (see ``is_outcome_unknown``)."""
|
|
74
|
+
return is_outcome_unknown(self)
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def safe_to_retry(self) -> bool:
|
|
78
|
+
"""Repeating the request cannot apply the operation twice (see ``is_safe_to_retry``)."""
|
|
79
|
+
return is_safe_to_retry(self)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Flag fields — user rights, group permissions, symbol flags, …
|
|
2
|
+
|
|
3
|
+
They travel as the names of the set bits joined by ", ": ``"Enabled, Password"``. No bit set is ``"None"``; a
|
|
4
|
+
set bit the API has no name for is ``"Bit<n>"`` — keep it when writing the value back, the trading platform may
|
|
5
|
+
rely on it. The names and bit values of every flag type are in the OpenAPI spec (``x-enum-varnames`` /
|
|
6
|
+
``x-enum-values``).
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from collections.abc import Iterable
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def parse_flags(value: str | None) -> list[str]:
|
|
14
|
+
"""Names of the set bits; ``"None"``, an empty string and ``None`` give an empty list."""
|
|
15
|
+
if not value:
|
|
16
|
+
return []
|
|
17
|
+
return [n for n in (part.strip() for part in value.split(",")) if n and n.lower() != "none"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def format_flags(names: Iterable[str]) -> str:
|
|
21
|
+
"""The wire form of a set of bit names; no names give ``"None"``. Duplicates are dropped, order is kept."""
|
|
22
|
+
unique = list(dict.fromkeys(n.strip() for n in names if n.strip() and n.strip().lower() != "none"))
|
|
23
|
+
return ", ".join(unique) if unique else "None"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def has_flag(value: str | None, name: str) -> bool:
|
|
27
|
+
"""Whether the bit ``name`` is set (names compare case-insensitively, as the API reads them)."""
|
|
28
|
+
wanted = name.lower()
|
|
29
|
+
return any(n.lower() == wanted for n in parse_flags(value))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def with_flag(value: str | None, name: str, on: bool = True) -> str:
|
|
33
|
+
"""``value`` with the bit ``name`` set (``on=True``) or cleared; every other bit, unnamed ones included, is kept."""
|
|
34
|
+
wanted = name.lower()
|
|
35
|
+
rest = [n for n in parse_flags(value) if n.lower() != wanted]
|
|
36
|
+
return format_flags([*rest, name] if on else rest)
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"""Cursor pagination over the v2 envelope's ``meta.paging``.
|
|
2
|
+
|
|
3
|
+
Mirrors the TS SDK's ``paginate()`` / ``collectAll()`` helpers with sync AND
|
|
4
|
+
async symmetry.
|
|
5
|
+
|
|
6
|
+
The ``fetch_page(cursor)`` callback contract
|
|
7
|
+
-------------------------------------------
|
|
8
|
+
- Accepts a cursor token (``str | None``; ``None`` means "first page").
|
|
9
|
+
- Returns ``(items, meta)`` — the same tuple that namespace ``*_request``
|
|
10
|
+
methods produce via ``unwrap_with_meta``. ``meta`` may be ``None`` on
|
|
11
|
+
non-paged endpoints; the helpers stop gracefully in that case.
|
|
12
|
+
|
|
13
|
+
Continuation rule
|
|
14
|
+
-----------------
|
|
15
|
+
- Continue while ``meta.paging.has_more is True`` AND
|
|
16
|
+
``meta.paging.next_cursor`` is non-empty.
|
|
17
|
+
- Either sentinel alone stops iteration:
|
|
18
|
+
- ``has_more=False`` → stop (even if ``next_cursor`` happens to be set).
|
|
19
|
+
- ``next_cursor=None/""`` → stop (defensive guard against server omission).
|
|
20
|
+
- ``meta=None`` or ``meta.paging=None`` → treat as last page and stop.
|
|
21
|
+
"""
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
from typing import Any, AsyncGenerator, Awaitable, Callable, Iterator
|
|
25
|
+
|
|
26
|
+
from .envelope import ApiMeta
|
|
27
|
+
|
|
28
|
+
# * Type aliases describing the callback contract.
|
|
29
|
+
_PageResult = tuple[list[Any], ApiMeta | None]
|
|
30
|
+
PageFetcherSync = Callable[[str | None], _PageResult]
|
|
31
|
+
PageFetcherAsync = Callable[[str | None], Awaitable[_PageResult]]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# ---------------------------------------------------------------------------
|
|
35
|
+
# Internal helper
|
|
36
|
+
# ---------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
def _next_cursor(meta: ApiMeta | None) -> str | None:
|
|
39
|
+
"""Extract the next cursor from a page's metadata, or ``None`` to stop.
|
|
40
|
+
|
|
41
|
+
Returns ``None`` when:
|
|
42
|
+
- ``meta`` is ``None`` (non-paged endpoint or server omission).
|
|
43
|
+
- ``meta.paging`` is ``None``.
|
|
44
|
+
- ``meta.paging.has_more`` is ``False``.
|
|
45
|
+
- ``meta.paging.next_cursor`` is ``None`` or empty string.
|
|
46
|
+
"""
|
|
47
|
+
if meta is None or meta.paging is None:
|
|
48
|
+
return None
|
|
49
|
+
if not meta.paging.has_more:
|
|
50
|
+
return None
|
|
51
|
+
# * Treat empty string the same as None — defensive against server quirks.
|
|
52
|
+
return meta.paging.next_cursor or None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# ---------------------------------------------------------------------------
|
|
56
|
+
# Public sync API
|
|
57
|
+
# ---------------------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
def paginate_sync(fetch_page: PageFetcherSync) -> Iterator[list[Any]]:
|
|
60
|
+
"""Yield successive pages from a cursor-paginated endpoint (sync).
|
|
61
|
+
|
|
62
|
+
``fetch_page`` is called with the current cursor (``None`` for the first
|
|
63
|
+
page) and must return ``(items, meta)``. Iteration stops when
|
|
64
|
+
``meta.paging.has_more`` is ``False`` or ``next_cursor`` is absent.
|
|
65
|
+
|
|
66
|
+
Example::
|
|
67
|
+
|
|
68
|
+
for page in paginate_sync(lambda cur: client.mt4.users_request(tp, cursor=cur)):
|
|
69
|
+
for user in page:
|
|
70
|
+
process(user)
|
|
71
|
+
"""
|
|
72
|
+
cursor: str | None = None
|
|
73
|
+
while True:
|
|
74
|
+
items, meta = fetch_page(cursor)
|
|
75
|
+
yield items
|
|
76
|
+
cursor = _next_cursor(meta)
|
|
77
|
+
if cursor is None:
|
|
78
|
+
return
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def collect_all_sync(fetch_page: PageFetcherSync) -> list[Any]:
|
|
82
|
+
"""Drain all pages into a single flat list (sync).
|
|
83
|
+
|
|
84
|
+
Convenience wrapper around :func:`paginate_sync`. For large collections
|
|
85
|
+
prefer :func:`paginate_sync` to avoid materialising all records in memory.
|
|
86
|
+
|
|
87
|
+
Example::
|
|
88
|
+
|
|
89
|
+
all_users = collect_all_sync(
|
|
90
|
+
lambda cur: client.mt4.users_request(tp, cursor=cur)
|
|
91
|
+
)
|
|
92
|
+
"""
|
|
93
|
+
out: list[Any] = []
|
|
94
|
+
for page in paginate_sync(fetch_page):
|
|
95
|
+
out.extend(page)
|
|
96
|
+
return out
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# ---------------------------------------------------------------------------
|
|
100
|
+
# Public async API
|
|
101
|
+
# ---------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
async def paginate_async(fetch_page: PageFetcherAsync) -> AsyncGenerator[list[Any], None]:
|
|
104
|
+
"""Async generator yielding successive pages from a cursor-paginated endpoint.
|
|
105
|
+
|
|
106
|
+
``fetch_page`` must be an async callable accepting a cursor and returning
|
|
107
|
+
``(items, meta)``. Mirrors :func:`paginate_sync` exactly.
|
|
108
|
+
|
|
109
|
+
Example::
|
|
110
|
+
|
|
111
|
+
async for page in paginate_async(
|
|
112
|
+
lambda cur: client.mt4.users_request(tp, cursor=cur)
|
|
113
|
+
):
|
|
114
|
+
for user in page:
|
|
115
|
+
await process(user)
|
|
116
|
+
"""
|
|
117
|
+
cursor: str | None = None
|
|
118
|
+
while True:
|
|
119
|
+
items, meta = await fetch_page(cursor)
|
|
120
|
+
yield items
|
|
121
|
+
cursor = _next_cursor(meta)
|
|
122
|
+
if cursor is None:
|
|
123
|
+
return
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
async def collect_all_async(fetch_page: PageFetcherAsync) -> list[Any]:
|
|
127
|
+
"""Drain all pages into a single flat list (async).
|
|
128
|
+
|
|
129
|
+
Convenience wrapper around :func:`paginate_async`. For large collections
|
|
130
|
+
prefer :func:`paginate_async` to avoid materialising all records in memory.
|
|
131
|
+
|
|
132
|
+
Example::
|
|
133
|
+
|
|
134
|
+
all_users = await collect_all_async(
|
|
135
|
+
lambda cur: client.mt4.users_request(tp, cursor=cur)
|
|
136
|
+
)
|
|
137
|
+
"""
|
|
138
|
+
out: list[Any] = []
|
|
139
|
+
async for page in paginate_async(fetch_page):
|
|
140
|
+
out.extend(page)
|
|
141
|
+
return out
|