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.
Files changed (456) hide show
  1. cplugin_webapi_sdk/__init__.py +79 -0
  2. cplugin_webapi_sdk/_generated/__init__.py +8 -0
  3. cplugin_webapi_sdk/_generated/api/__init__.py +1 -0
  4. cplugin_webapi_sdk/_generated/api/mt4_v_2_authentication/__init__.py +1 -0
  5. cplugin_webapi_sdk/_generated/api/mt4_v_2_authentication/post_api_v_2_mt4_trade_platform_user_password_check_login.py +306 -0
  6. cplugin_webapi_sdk/_generated/api/mt4_v_2_authentication/post_api_v_2_mt4_trade_platform_user_password_set_login.py +377 -0
  7. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/__init__.py +1 -0
  8. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_info_orders_mode.py +246 -0
  9. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_info_users_mode.py +262 -0
  10. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_request_orders_file.py +285 -0
  11. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup/get_api_v_2_mt4_trade_platform_backup_request_users_file.py +325 -0
  12. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup_destructive/__init__.py +1 -0
  13. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup_destructive/post_api_v_2_mt4_trade_platform_backup_restore_orders.py +332 -0
  14. cplugin_webapi_sdk/_generated/api/mt4_v_2_backup_destructive/post_api_v_2_mt4_trade_platform_backup_restore_users.py +344 -0
  15. cplugin_webapi_sdk/_generated/api/mt4_v_2_common/__init__.py +1 -0
  16. cplugin_webapi_sdk/_generated/api/mt4_v_2_common/get_api_v_2_mt4_trade_platform_journal_request.py +326 -0
  17. cplugin_webapi_sdk/_generated/api/mt4_v_2_common/get_api_v_2_mt4_trade_platform_manager_common.py +229 -0
  18. cplugin_webapi_sdk/_generated/api/mt4_v_2_common/get_api_v_2_mt4_trade_platform_server_time.py +225 -0
  19. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/__init__.py +1 -0
  20. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_access.py +280 -0
  21. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_backup.py +241 -0
  22. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_common.py +237 -0
  23. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_data_server.py +276 -0
  24. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_feeder.py +276 -0
  25. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_gateway_account.py +280 -0
  26. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_gateway_markup.py +280 -0
  27. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_gateway_rule.py +272 -0
  28. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_holiday.py +296 -0
  29. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_live_update.py +272 -0
  30. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_manager.py +272 -0
  31. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_sync.py +276 -0
  32. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/get_api_v_2_mt4_trade_platform_cfg_request_time.py +245 -0
  33. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_access_pos.py +254 -0
  34. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_data_server_pos.py +234 -0
  35. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_feeder_pos.py +230 -0
  36. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_gateway_account_pos.py +230 -0
  37. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_gateway_markup_pos.py +230 -0
  38. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_gateway_rule_pos.py +230 -0
  39. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_holiday_pos.py +230 -0
  40. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_live_update_pos.py +230 -0
  41. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_manager_pos.py +230 -0
  42. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_symbol_pos.py +238 -0
  43. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_delete_sync_pos.py +230 -0
  44. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_access_pos.py +250 -0
  45. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_data_server_pos.py +250 -0
  46. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_feeder_pos.py +250 -0
  47. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_gateway_account_pos.py +250 -0
  48. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_gateway_markup_pos.py +250 -0
  49. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_gateway_rule_pos.py +250 -0
  50. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_group_pos.py +250 -0
  51. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_holiday_pos.py +250 -0
  52. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_live_update_pos.py +250 -0
  53. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_manager_pos.py +250 -0
  54. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_plugin_pos.py +266 -0
  55. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_symbol_pos.py +250 -0
  56. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_shift_sync_pos.py +250 -0
  57. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_access_pos.py +378 -0
  58. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_backup.py +361 -0
  59. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_common.py +389 -0
  60. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_data_server_pos.py +354 -0
  61. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_feeder.py +305 -0
  62. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_gateway_account.py +361 -0
  63. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_gateway_markup.py +345 -0
  64. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_gateway_rule.py +377 -0
  65. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_holiday_pos.py +350 -0
  66. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_live_update.py +385 -0
  67. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_manager.py +385 -0
  68. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_symbol_group_pos.py +342 -0
  69. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_sync.py +349 -0
  70. cplugin_webapi_sdk/_generated/api/mt4_v_2_config/post_api_v_2_mt4_trade_platform_cfg_update_time.py +421 -0
  71. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/__init__.py +1 -0
  72. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_ensure_group_name_exist_group.py +274 -0
  73. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_group_record_get_group.py +242 -0
  74. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_group_sec_groups_get_group.py +246 -0
  75. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_group_sec_margins_get_group.py +246 -0
  76. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_groups_get.py +233 -0
  77. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/get_api_v_2_mt4_trade_platform_groups_request.py +256 -0
  78. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/patch_api_v_2_mt4_trade_platform_group_record_group.py +255 -0
  79. cplugin_webapi_sdk/_generated/api/mt4_v_2_groups/post_api_v_2_mt4_trade_platform_group_record_update_group.py +542 -0
  80. cplugin_webapi_sdk/_generated/api/mt4_v_2_history/__init__.py +1 -0
  81. cplugin_webapi_sdk/_generated/api/mt4_v_2_history/get_api_v_2_mt4_trade_platform_trades_user_history_login.py +292 -0
  82. cplugin_webapi_sdk/_generated/api/mt4_v_2_mail/__init__.py +1 -0
  83. cplugin_webapi_sdk/_generated/api/mt4_v_2_mail/get_api_v_2_mt4_trade_platform_mail_last.py +225 -0
  84. cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/__init__.py +1 -0
  85. cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/get_api_v_2_mt4_trade_platform_margin_level_get_login.py +246 -0
  86. cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/get_api_v_2_mt4_trade_platform_margin_level_request_login.py +246 -0
  87. cplugin_webapi_sdk/_generated/api/mt4_v_2_margins/get_api_v_2_mt4_trade_platform_margins_get.py +233 -0
  88. cplugin_webapi_sdk/_generated/api/mt4_v_2_news/__init__.py +1 -0
  89. cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_body_get_key.py +238 -0
  90. cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_get.py +237 -0
  91. cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_topic_get_pos.py +246 -0
  92. cplugin_webapi_sdk/_generated/api/mt4_v_2_news/get_api_v_2_mt4_trade_platform_news_total.py +225 -0
  93. cplugin_webapi_sdk/_generated/api/mt4_v_2_news/post_api_v_2_mt4_trade_platform_news_body_request_key.py +254 -0
  94. cplugin_webapi_sdk/_generated/api/mt4_v_2_online/__init__.py +1 -0
  95. cplugin_webapi_sdk/_generated/api/mt4_v_2_online/get_api_v_2_mt4_trade_platform_online_get.py +276 -0
  96. cplugin_webapi_sdk/_generated/api/mt4_v_2_online/get_api_v_2_mt4_trade_platform_online_request.py +276 -0
  97. cplugin_webapi_sdk/_generated/api/mt4_v_2_plugins/__init__.py +1 -0
  98. cplugin_webapi_sdk/_generated/api/mt4_v_2_plugins/post_api_v_2_mt4_trade_platform_external_command_json.py +309 -0
  99. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/__init__.py +1 -0
  100. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_chart_request_symbol.py +332 -0
  101. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_tick_info_last.py +233 -0
  102. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_tick_info_last_symbol.py +250 -0
  103. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/get_api_v_2_mt4_trade_platform_ticks_request_symbol.py +311 -0
  104. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_chart_add_symbol.py +375 -0
  105. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_chart_delete_symbol.py +375 -0
  106. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_chart_update_symbol.py +367 -0
  107. cplugin_webapi_sdk/_generated/api/mt4_v_2_prices/post_api_v_2_mt4_trade_platform_history_correct_symbol.py +274 -0
  108. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/__init__.py +1 -0
  109. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_daily_reports_request.py +362 -0
  110. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_daily_reports_request_ex.py +334 -0
  111. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_performance_request.py +281 -0
  112. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/get_api_v_2_mt4_trade_platform_reports_request.py +370 -0
  113. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/post_api_v_2_mt4_trade_platform_daily_sync_read.py +253 -0
  114. cplugin_webapi_sdk/_generated/api/mt4_v_2_reports/post_api_v_2_mt4_trade_platform_daily_sync_start.py +289 -0
  115. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/__init__.py +1 -0
  116. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/get_api_v_2_mt4_trade_platform_license_check_license_name.py +250 -0
  117. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/get_api_v_2_mt4_trade_platform_srv_feeder_log_name.py +246 -0
  118. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/get_api_v_2_mt4_trade_platform_srv_feeders.py +288 -0
  119. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin/post_api_v_2_mt4_trade_platform_notifications_send.py +289 -0
  120. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/__init__.py +1 -0
  121. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_charts_sync.py +257 -0
  122. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_feeds_restart.py +253 -0
  123. 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
  124. cplugin_webapi_sdk/_generated/api/mt4_v_2_server_admin_destructive/post_api_v_2_mt4_trade_platform_srv_restart.py +281 -0
  125. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/__init__.py +1 -0
  126. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_trades_snapshot.py +245 -0
  127. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_trades_sync_read.py +249 -0
  128. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_users_snapshot.py +257 -0
  129. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_batch_reads/get_api_v_2_mt4_trade_platform_users_sync_read.py +253 -0
  130. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_external_command/__init__.py +1 -0
  131. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_external_command/post_api_v_2_mt4_trade_platform_external_command_binary.py +393 -0
  132. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/__init__.py +1 -0
  133. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/get_api_v_2_mt4_trade_platform_mails_request.py +233 -0
  134. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/post_api_v_2_mt4_trade_platform_mail_send.py +317 -0
  135. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_messaging/post_api_v_2_mt4_trade_platform_news_send.py +309 -0
  136. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/__init__.py +1 -0
  137. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/get_api_v_2_mt4_trade_platform_cfg_request_plugin.py +233 -0
  138. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/get_api_v_2_mt4_trade_platform_plugin_param_get_pos.py +242 -0
  139. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/get_api_v_2_mt4_trade_platform_plugins_get.py +233 -0
  140. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/post_api_v_2_mt4_trade_platform_cfg_update_plugin.py +301 -0
  141. cplugin_webapi_sdk/_generated/api/mt4_v_2_sidecar_plugins/post_api_v_2_mt4_trade_platform_plugin_update.py +293 -0
  142. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/__init__.py +1 -0
  143. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_cfg_request_symbol.py +229 -0
  144. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_cfg_request_symbol_symbol.py +242 -0
  145. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbol_info_get.py +253 -0
  146. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbol_info_updated.py +268 -0
  147. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbol_sessions_get_symbol.py +258 -0
  148. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/get_api_v_2_mt4_trade_platform_symbols_groups_get.py +233 -0
  149. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/patch_api_v_2_mt4_trade_platform_symbol_config_symbol.py +255 -0
  150. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_cfg_update_symbol_symbol.py +530 -0
  151. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_add_symbol.py +270 -0
  152. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_change.py +417 -0
  153. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_hide_symbol.py +246 -0
  154. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbol_send_tick.py +319 -0
  155. cplugin_webapi_sdk/_generated/api/mt4_v_2_symbols/post_api_v_2_mt4_trade_platform_symbols_refresh.py +233 -0
  156. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/__init__.py +1 -0
  157. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_adm_trades_request_group.py +266 -0
  158. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trade_record_get_order.py +246 -0
  159. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trade_record_request_order.py +258 -0
  160. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trade_records_request.py +278 -0
  161. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get.py +252 -0
  162. 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
  163. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_by_market.py +229 -0
  164. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_by_symbol.py +249 -0
  165. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_get_ticket.py +254 -0
  166. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/get_api_v_2_mt4_trade_platform_trades_request.py +299 -0
  167. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_adm_trade_record_modify_ticket.py +462 -0
  168. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_adm_trades_delete.py +290 -0
  169. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trade_check_stops.py +453 -0
  170. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trade_clear_rollback_order.py +262 -0
  171. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trade_transaction.py +453 -0
  172. cplugin_webapi_sdk/_generated/api/mt4_v_2_trades/post_api_v_2_mt4_trade_platform_trades_sync_start.py +261 -0
  173. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/__init__.py +1 -0
  174. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_adm_balance_check.py +266 -0
  175. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_adm_balance_check_login.py +266 -0
  176. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_adm_users_request_safe_group.py +274 -0
  177. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_user_record_get_login.py +250 -0
  178. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_user_record_request_login.py +250 -0
  179. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_user_records_request.py +274 -0
  180. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/get_api_v_2_mt4_trade_platform_users_request.py +276 -0
  181. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/patch_api_v_2_mt4_trade_platform_user_record_login.py +283 -0
  182. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_adm_balance_fix.py +290 -0
  183. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_user_record_new.py +465 -0
  184. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_user_record_update_login.py +678 -0
  185. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_users_group_op.py +349 -0
  186. cplugin_webapi_sdk/_generated/api/mt4_v_2_users/post_api_v_2_mt4_trade_platform_users_sync_start.py +273 -0
  187. cplugin_webapi_sdk/_generated/api/mt5_v_2_common/__init__.py +1 -0
  188. cplugin_webapi_sdk/_generated/api/mt5_v_2_common/get_api_v_2_mt5_trade_platform_server_time.py +205 -0
  189. cplugin_webapi_sdk/_generated/api/mt5_v_2_common/get_api_v_2_mt5_trade_platform_time_get.py +205 -0
  190. cplugin_webapi_sdk/_generated/api/mt5_v_2_groups/__init__.py +1 -0
  191. cplugin_webapi_sdk/_generated/api/mt5_v_2_groups/get_api_v_2_mt5_trade_platform_group_get_group.py +218 -0
  192. cplugin_webapi_sdk/_generated/api/mt5_v_2_groups/patch_api_v_2_mt5_trade_platform_group_record_group.py +255 -0
  193. cplugin_webapi_sdk/_generated/api/mt5_v_2_managers/__init__.py +1 -0
  194. cplugin_webapi_sdk/_generated/api/mt5_v_2_managers/get_api_v_2_mt5_trade_platform_manager_current.py +205 -0
  195. cplugin_webapi_sdk/_generated/api/mt5_v_2_symbols/__init__.py +1 -0
  196. cplugin_webapi_sdk/_generated/api/mt5_v_2_symbols/get_api_v_2_mt5_trade_platform_symbol_get_symbol.py +218 -0
  197. cplugin_webapi_sdk/_generated/api/mt5_v_2_symbols/patch_api_v_2_mt5_trade_platform_symbol_record_symbol.py +255 -0
  198. cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/__init__.py +1 -0
  199. cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/get_api_v_2_mt5_trade_platform_deal_by_group_mask.py +265 -0
  200. cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/get_api_v_2_mt5_trade_platform_order_by_group_mask.py +265 -0
  201. cplugin_webapi_sdk/_generated/api/mt5_v_2_trades/get_api_v_2_mt5_trade_platform_position_by_group_mask.py +265 -0
  202. cplugin_webapi_sdk/_generated/api/mt5_v_2_users/__init__.py +1 -0
  203. cplugin_webapi_sdk/_generated/api/mt5_v_2_users/get_api_v_2_mt5_trade_platform_user_get_login.py +218 -0
  204. cplugin_webapi_sdk/_generated/api/mt5_v_2_users/patch_api_v_2_mt5_trade_platform_user_record_login.py +255 -0
  205. cplugin_webapi_sdk/_generated/client.py +271 -0
  206. cplugin_webapi_sdk/_generated/errors.py +14 -0
  207. cplugin_webapi_sdk/_generated/models/__init__.py +469 -0
  208. cplugin_webapi_sdk/_generated/models/activation_modes.py +10 -0
  209. cplugin_webapi_sdk/_generated/models/activation_type.py +15 -0
  210. cplugin_webapi_sdk/_generated/models/api_error.py +135 -0
  211. cplugin_webapi_sdk/_generated/models/api_meta.py +114 -0
  212. cplugin_webapi_sdk/_generated/models/arc_backup_execution_period.py +10 -0
  213. cplugin_webapi_sdk/_generated/models/arc_backup_store_period.py +11 -0
  214. cplugin_webapi_sdk/_generated/models/backup_execution_period.py +9 -0
  215. cplugin_webapi_sdk/_generated/models/backup_store_period.py +10 -0
  216. cplugin_webapi_sdk/_generated/models/boolean_api_response.py +143 -0
  217. cplugin_webapi_sdk/_generated/models/chart_period.py +15 -0
  218. cplugin_webapi_sdk/_generated/models/data_feed_mode.py +9 -0
  219. cplugin_webapi_sdk/_generated/models/date_time_api_response.py +154 -0
  220. cplugin_webapi_sdk/_generated/models/deal_action.py +27 -0
  221. cplugin_webapi_sdk/_generated/models/deal_reason.py +26 -0
  222. cplugin_webapi_sdk/_generated/models/en_auth_mode.py +10 -0
  223. cplugin_webapi_sdk/_generated/models/en_auth_otp_mode.py +9 -0
  224. cplugin_webapi_sdk/_generated/models/en_calc_mode.py +21 -0
  225. cplugin_webapi_sdk/_generated/models/en_chart_mode.py +9 -0
  226. cplugin_webapi_sdk/_generated/models/en_comm_action_mode.py +9 -0
  227. cplugin_webapi_sdk/_generated/models/en_comm_charge_mode.py +9 -0
  228. cplugin_webapi_sdk/_generated/models/en_comm_entry_mode.py +9 -0
  229. cplugin_webapi_sdk/_generated/models/en_comm_mode.py +9 -0
  230. cplugin_webapi_sdk/_generated/models/en_comm_profit_mode.py +9 -0
  231. cplugin_webapi_sdk/_generated/models/en_comm_range_mode.py +11 -0
  232. cplugin_webapi_sdk/_generated/models/en_commission_mode.py +14 -0
  233. cplugin_webapi_sdk/_generated/models/en_commission_volume_type.py +8 -0
  234. cplugin_webapi_sdk/_generated/models/en_execution_mode.py +10 -0
  235. cplugin_webapi_sdk/_generated/models/en_free_margin_mode.py +10 -0
  236. cplugin_webapi_sdk/_generated/models/en_gateway_account_flags.py +8 -0
  237. cplugin_webapi_sdk/_generated/models/en_gtc_mode.py +9 -0
  238. cplugin_webapi_sdk/_generated/models/en_history_limit.py +13 -0
  239. cplugin_webapi_sdk/_generated/models/en_industries.py +172 -0
  240. cplugin_webapi_sdk/_generated/models/en_instant_mode.py +7 -0
  241. cplugin_webapi_sdk/_generated/models/en_log_type.py +14 -0
  242. cplugin_webapi_sdk/_generated/models/en_mail_mode.py +8 -0
  243. cplugin_webapi_sdk/_generated/models/en_manager_limit.py +13 -0
  244. cplugin_webapi_sdk/_generated/models/en_manager_rights.py +82 -0
  245. cplugin_webapi_sdk/_generated/models/en_margin_mode.py +9 -0
  246. cplugin_webapi_sdk/_generated/models/en_news_mode.py +9 -0
  247. cplugin_webapi_sdk/_generated/models/en_option_mode.py +10 -0
  248. cplugin_webapi_sdk/_generated/models/en_reports_mode.py +10 -0
  249. cplugin_webapi_sdk/_generated/models/en_sectors.py +22 -0
  250. cplugin_webapi_sdk/_generated/models/en_splice_time_type.py +7 -0
  251. cplugin_webapi_sdk/_generated/models/en_splice_type.py +9 -0
  252. cplugin_webapi_sdk/_generated/models/en_stop_out_mode.py +8 -0
  253. cplugin_webapi_sdk/_generated/models/en_swap_days.py +14 -0
  254. cplugin_webapi_sdk/_generated/models/en_swap_mode.py +16 -0
  255. cplugin_webapi_sdk/_generated/models/en_trade_mode.py +11 -0
  256. cplugin_webapi_sdk/_generated/models/en_transfer_mode.py +10 -0
  257. cplugin_webapi_sdk/_generated/models/entry_flag.py +10 -0
  258. cplugin_webapi_sdk/_generated/models/export_execution_period.py +11 -0
  259. cplugin_webapi_sdk/_generated/models/gtc_mode.py +9 -0
  260. cplugin_webapi_sdk/_generated/models/int_32_api_response.py +143 -0
  261. cplugin_webapi_sdk/_generated/models/int_32mt4_daily_report_list_dictionary_api_response.py +170 -0
  262. cplugin_webapi_sdk/_generated/models/int_32mt4_daily_report_list_dictionary_api_response_data_type_0.py +107 -0
  263. cplugin_webapi_sdk/_generated/models/json_node.py +155 -0
  264. cplugin_webapi_sdk/_generated/models/json_node_api_response.py +170 -0
  265. cplugin_webapi_sdk/_generated/models/json_node_options.py +60 -0
  266. cplugin_webapi_sdk/_generated/models/margin_calculation_mode.py +11 -0
  267. cplugin_webapi_sdk/_generated/models/margin_controlling_type.py +8 -0
  268. cplugin_webapi_sdk/_generated/models/margin_level_type.py +9 -0
  269. cplugin_webapi_sdk/_generated/models/margin_mode.py +10 -0
  270. cplugin_webapi_sdk/_generated/models/mt4_access.py +106 -0
  271. cplugin_webapi_sdk/_generated/models/mt4_access_api_response.py +173 -0
  272. cplugin_webapi_sdk/_generated/models/mt4_access_list_api_response.py +180 -0
  273. cplugin_webapi_sdk/_generated/models/mt4_backup.py +442 -0
  274. cplugin_webapi_sdk/_generated/models/mt4_backup_api_response.py +174 -0
  275. cplugin_webapi_sdk/_generated/models/mt4_backup_info.py +107 -0
  276. cplugin_webapi_sdk/_generated/models/mt4_backup_info_list_api_response.py +180 -0
  277. cplugin_webapi_sdk/_generated/models/mt4_balance_diff.py +74 -0
  278. cplugin_webapi_sdk/_generated/models/mt4_balance_diff_api_response.py +174 -0
  279. cplugin_webapi_sdk/_generated/models/mt4_balance_diff_list_api_response.py +180 -0
  280. cplugin_webapi_sdk/_generated/models/mt4_chart_bar.py +121 -0
  281. cplugin_webapi_sdk/_generated/models/mt4_chart_bar_list_api_response.py +180 -0
  282. cplugin_webapi_sdk/_generated/models/mt4_chart_write_request.py +103 -0
  283. cplugin_webapi_sdk/_generated/models/mt4_common.py +124 -0
  284. cplugin_webapi_sdk/_generated/models/mt4_common_api_response.py +172 -0
  285. cplugin_webapi_sdk/_generated/models/mt4_common_update.py +201 -0
  286. cplugin_webapi_sdk/_generated/models/mt4_daily_report.py +212 -0
  287. cplugin_webapi_sdk/_generated/models/mt4_daily_report_list_api_response.py +180 -0
  288. cplugin_webapi_sdk/_generated/models/mt4_data_server.py +153 -0
  289. cplugin_webapi_sdk/_generated/models/mt4_data_server_api_response.py +174 -0
  290. cplugin_webapi_sdk/_generated/models/mt4_data_server_list_api_response.py +180 -0
  291. cplugin_webapi_sdk/_generated/models/mt4_external_command_binary_request.py +77 -0
  292. cplugin_webapi_sdk/_generated/models/mt4_external_command_binary_response.py +74 -0
  293. cplugin_webapi_sdk/_generated/models/mt4_external_command_binary_response_api_response.py +171 -0
  294. cplugin_webapi_sdk/_generated/models/mt4_feeder.py +235 -0
  295. cplugin_webapi_sdk/_generated/models/mt4_feeder_api_response.py +172 -0
  296. cplugin_webapi_sdk/_generated/models/mt4_feeder_list_api_response.py +180 -0
  297. cplugin_webapi_sdk/_generated/models/mt4_gateway_account.py +190 -0
  298. cplugin_webapi_sdk/_generated/models/mt4_gateway_account_api_response.py +174 -0
  299. cplugin_webapi_sdk/_generated/models/mt4_gateway_account_list_api_response.py +180 -0
  300. cplugin_webapi_sdk/_generated/models/mt4_gateway_markup.py +157 -0
  301. cplugin_webapi_sdk/_generated/models/mt4_gateway_markup_api_response.py +174 -0
  302. cplugin_webapi_sdk/_generated/models/mt4_gateway_markup_list_api_response.py +180 -0
  303. cplugin_webapi_sdk/_generated/models/mt4_gateway_rule.py +234 -0
  304. cplugin_webapi_sdk/_generated/models/mt4_gateway_rule_api_response.py +177 -0
  305. cplugin_webapi_sdk/_generated/models/mt4_gateway_rule_list_api_response.py +180 -0
  306. cplugin_webapi_sdk/_generated/models/mt4_group.py +505 -0
  307. cplugin_webapi_sdk/_generated/models/mt4_group_api_response.py +193 -0
  308. cplugin_webapi_sdk/_generated/models/mt4_group_list_api_response.py +180 -0
  309. cplugin_webapi_sdk/_generated/models/mt4_group_margin.py +104 -0
  310. cplugin_webapi_sdk/_generated/models/mt4_group_margin_list_api_response.py +180 -0
  311. cplugin_webapi_sdk/_generated/models/mt4_group_sec.py +321 -0
  312. cplugin_webapi_sdk/_generated/models/mt4_group_sec_list_api_response.py +180 -0
  313. cplugin_webapi_sdk/_generated/models/mt4_group_update.py +467 -0
  314. cplugin_webapi_sdk/_generated/models/mt4_holiday.py +153 -0
  315. cplugin_webapi_sdk/_generated/models/mt4_holiday_api_response.py +174 -0
  316. cplugin_webapi_sdk/_generated/models/mt4_holiday_list_api_response.py +180 -0
  317. cplugin_webapi_sdk/_generated/models/mt4_live_update.py +165 -0
  318. cplugin_webapi_sdk/_generated/models/mt4_live_update_api_response.py +177 -0
  319. cplugin_webapi_sdk/_generated/models/mt4_live_update_list_api_response.py +180 -0
  320. cplugin_webapi_sdk/_generated/models/mt4_mail_box.py +148 -0
  321. cplugin_webapi_sdk/_generated/models/mt4_mail_box_list_api_response.py +180 -0
  322. cplugin_webapi_sdk/_generated/models/mt4_mail_send_request.py +160 -0
  323. cplugin_webapi_sdk/_generated/models/mt4_manager_rights.py +338 -0
  324. cplugin_webapi_sdk/_generated/models/mt4_manager_rights_api_response.py +175 -0
  325. cplugin_webapi_sdk/_generated/models/mt4_manager_rights_list_api_response.py +180 -0
  326. cplugin_webapi_sdk/_generated/models/mt4_margin_level.py +201 -0
  327. cplugin_webapi_sdk/_generated/models/mt4_margin_level_api_response.py +174 -0
  328. cplugin_webapi_sdk/_generated/models/mt4_margin_level_list_api_response.py +180 -0
  329. cplugin_webapi_sdk/_generated/models/mt4_news_send_request.py +127 -0
  330. cplugin_webapi_sdk/_generated/models/mt4_news_topic.py +177 -0
  331. cplugin_webapi_sdk/_generated/models/mt4_news_topic_api_response.py +178 -0
  332. cplugin_webapi_sdk/_generated/models/mt4_news_topic_list_api_response.py +180 -0
  333. cplugin_webapi_sdk/_generated/models/mt4_notifications_send_request.py +114 -0
  334. cplugin_webapi_sdk/_generated/models/mt4_online.py +88 -0
  335. cplugin_webapi_sdk/_generated/models/mt4_online_list_api_response.py +180 -0
  336. cplugin_webapi_sdk/_generated/models/mt4_performance.py +124 -0
  337. cplugin_webapi_sdk/_generated/models/mt4_performance_list_api_response.py +180 -0
  338. cplugin_webapi_sdk/_generated/models/mt4_plugin.py +153 -0
  339. cplugin_webapi_sdk/_generated/models/mt4_plugin_config.py +96 -0
  340. cplugin_webapi_sdk/_generated/models/mt4_plugin_list_api_response.py +180 -0
  341. cplugin_webapi_sdk/_generated/models/mt4_plugin_param.py +137 -0
  342. cplugin_webapi_sdk/_generated/models/mt4_plugin_param_api_response.py +171 -0
  343. cplugin_webapi_sdk/_generated/models/mt4_plugin_param_list_api_response.py +180 -0
  344. cplugin_webapi_sdk/_generated/models/mt4_server_log.py +151 -0
  345. cplugin_webapi_sdk/_generated/models/mt4_server_log_list_api_response.py +180 -0
  346. cplugin_webapi_sdk/_generated/models/mt4_server_time.py +95 -0
  347. cplugin_webapi_sdk/_generated/models/mt4_server_time_api_response.py +178 -0
  348. cplugin_webapi_sdk/_generated/models/mt4_symbol_change_request.py +148 -0
  349. cplugin_webapi_sdk/_generated/models/mt4_symbol_config.py +683 -0
  350. cplugin_webapi_sdk/_generated/models/mt4_symbol_config_api_response.py +177 -0
  351. cplugin_webapi_sdk/_generated/models/mt4_symbol_config_list_api_response.py +180 -0
  352. cplugin_webapi_sdk/_generated/models/mt4_symbol_config_update.py +608 -0
  353. cplugin_webapi_sdk/_generated/models/mt4_symbol_day_sessions.py +171 -0
  354. cplugin_webapi_sdk/_generated/models/mt4_symbol_day_sessions_list_api_response.py +180 -0
  355. cplugin_webapi_sdk/_generated/models/mt4_symbol_group.py +99 -0
  356. cplugin_webapi_sdk/_generated/models/mt4_symbol_group_api_response.py +174 -0
  357. cplugin_webapi_sdk/_generated/models/mt4_symbol_group_list_api_response.py +180 -0
  358. cplugin_webapi_sdk/_generated/models/mt4_symbol_info.py +210 -0
  359. cplugin_webapi_sdk/_generated/models/mt4_symbol_info_api_response.py +178 -0
  360. cplugin_webapi_sdk/_generated/models/mt4_symbol_info_list_api_response.py +180 -0
  361. cplugin_webapi_sdk/_generated/models/mt4_symbol_session.py +91 -0
  362. cplugin_webapi_sdk/_generated/models/mt4_sync.py +176 -0
  363. cplugin_webapi_sdk/_generated/models/mt4_sync_api_response.py +173 -0
  364. cplugin_webapi_sdk/_generated/models/mt4_sync_list_api_response.py +180 -0
  365. cplugin_webapi_sdk/_generated/models/mt4_tick_info.py +117 -0
  366. cplugin_webapi_sdk/_generated/models/mt4_tick_info_api_response.py +175 -0
  367. cplugin_webapi_sdk/_generated/models/mt4_tick_info_list_api_response.py +180 -0
  368. cplugin_webapi_sdk/_generated/models/mt4_tick_record.py +126 -0
  369. cplugin_webapi_sdk/_generated/models/mt4_tick_record_list_api_response.py +180 -0
  370. cplugin_webapi_sdk/_generated/models/mt4_trade.py +409 -0
  371. cplugin_webapi_sdk/_generated/models/mt4_trade_api_response.py +179 -0
  372. cplugin_webapi_sdk/_generated/models/mt4_trade_list_api_response.py +180 -0
  373. cplugin_webapi_sdk/_generated/models/mt4_trade_restore_input.py +274 -0
  374. cplugin_webapi_sdk/_generated/models/mt4_trade_restore_result.py +72 -0
  375. cplugin_webapi_sdk/_generated/models/mt4_trade_restore_result_list_api_response.py +180 -0
  376. cplugin_webapi_sdk/_generated/models/mt4_trade_transaction.py +262 -0
  377. cplugin_webapi_sdk/_generated/models/mt4_trade_transaction_api_response.py +181 -0
  378. cplugin_webapi_sdk/_generated/models/mt4_trade_update.py +165 -0
  379. cplugin_webapi_sdk/_generated/models/mt4_user.py +533 -0
  380. cplugin_webapi_sdk/_generated/models/mt4_user_api_response.py +184 -0
  381. cplugin_webapi_sdk/_generated/models/mt4_user_create.py +420 -0
  382. cplugin_webapi_sdk/_generated/models/mt4_user_list_api_response.py +180 -0
  383. cplugin_webapi_sdk/_generated/models/mt4_user_restore_input.py +193 -0
  384. cplugin_webapi_sdk/_generated/models/mt4_user_update.py +441 -0
  385. cplugin_webapi_sdk/_generated/models/mt4_users_group_op.py +140 -0
  386. cplugin_webapi_sdk/_generated/models/mt5_con_comm_tier.py +246 -0
  387. cplugin_webapi_sdk/_generated/models/mt5_con_commission.py +409 -0
  388. cplugin_webapi_sdk/_generated/models/mt5_con_group.py +1162 -0
  389. cplugin_webapi_sdk/_generated/models/mt5_con_group_api_response.py +170 -0
  390. cplugin_webapi_sdk/_generated/models/mt5_con_group_commissions_type_0.py +83 -0
  391. cplugin_webapi_sdk/_generated/models/mt5_con_manager.py +227 -0
  392. cplugin_webapi_sdk/_generated/models/mt5_con_manager_api_response.py +156 -0
  393. cplugin_webapi_sdk/_generated/models/mt5_deal.py +1045 -0
  394. cplugin_webapi_sdk/_generated/models/mt5_deal_list_api_response.py +180 -0
  395. cplugin_webapi_sdk/_generated/models/mt5_order.py +1008 -0
  396. cplugin_webapi_sdk/_generated/models/mt5_order_list_api_response.py +180 -0
  397. cplugin_webapi_sdk/_generated/models/mt5_position.py +829 -0
  398. cplugin_webapi_sdk/_generated/models/mt5_position_list_api_response.py +180 -0
  399. cplugin_webapi_sdk/_generated/models/mt5_symbol.py +2743 -0
  400. cplugin_webapi_sdk/_generated/models/mt5_symbol_api_response.py +170 -0
  401. cplugin_webapi_sdk/_generated/models/mt5_symbol_margin_rate_initial_type_0.py +124 -0
  402. cplugin_webapi_sdk/_generated/models/mt5_symbol_margin_rate_maintenance_type_0.py +124 -0
  403. cplugin_webapi_sdk/_generated/models/mt5_symbol_session.py +182 -0
  404. cplugin_webapi_sdk/_generated/models/mt5_time.py +101 -0
  405. cplugin_webapi_sdk/_generated/models/mt5_time_api_response.py +170 -0
  406. cplugin_webapi_sdk/_generated/models/mt5_user.py +752 -0
  407. cplugin_webapi_sdk/_generated/models/mt5_user_api_response.py +172 -0
  408. cplugin_webapi_sdk/_generated/models/news_mode.py +9 -0
  409. cplugin_webapi_sdk/_generated/models/order_filling.py +10 -0
  410. cplugin_webapi_sdk/_generated/models/order_reason.py +26 -0
  411. cplugin_webapi_sdk/_generated/models/order_state.py +16 -0
  412. cplugin_webapi_sdk/_generated/models/order_time.py +10 -0
  413. cplugin_webapi_sdk/_generated/models/order_type.py +15 -0
  414. cplugin_webapi_sdk/_generated/models/otp_mode.py +8 -0
  415. cplugin_webapi_sdk/_generated/models/paging_meta.py +88 -0
  416. cplugin_webapi_sdk/_generated/models/patch_api_v2mt4_trade_platform_group_record_group_json_body.py +66 -0
  417. cplugin_webapi_sdk/_generated/models/patch_api_v2mt4_trade_platform_symbol_config_symbol_json_body.py +66 -0
  418. cplugin_webapi_sdk/_generated/models/patch_api_v2mt4_trade_platform_user_record_login_json_body.py +66 -0
  419. cplugin_webapi_sdk/_generated/models/patch_api_v2mt5_trade_platform_group_record_group_json_body.py +66 -0
  420. cplugin_webapi_sdk/_generated/models/patch_api_v2mt5_trade_platform_symbol_record_symbol_json_body.py +66 -0
  421. cplugin_webapi_sdk/_generated/models/patch_api_v2mt5_trade_platform_user_record_login_json_body.py +66 -0
  422. cplugin_webapi_sdk/_generated/models/position_actions.py +8 -0
  423. cplugin_webapi_sdk/_generated/models/position_reasons.py +26 -0
  424. cplugin_webapi_sdk/_generated/models/profit_calculation_mode.py +9 -0
  425. cplugin_webapi_sdk/_generated/models/request_mode.py +10 -0
  426. cplugin_webapi_sdk/_generated/models/result_code.py +46 -0
  427. cplugin_webapi_sdk/_generated/models/server_role.py +9 -0
  428. cplugin_webapi_sdk/_generated/models/string_api_response.py +155 -0
  429. cplugin_webapi_sdk/_generated/models/swap_type.py +10 -0
  430. cplugin_webapi_sdk/_generated/models/symbol_exec_mode.py +9 -0
  431. cplugin_webapi_sdk/_generated/models/symbol_price_direction.py +9 -0
  432. cplugin_webapi_sdk/_generated/models/synchronization_mode.py +11 -0
  433. cplugin_webapi_sdk/_generated/models/trade_command.py +14 -0
  434. cplugin_webapi_sdk/_generated/models/trade_mode.py +9 -0
  435. cplugin_webapi_sdk/_generated/models/trade_record_reason.py +14 -0
  436. cplugin_webapi_sdk/_generated/models/trade_record_state.py +13 -0
  437. cplugin_webapi_sdk/_generated/models/watchdog_failover_mode.py +9 -0
  438. cplugin_webapi_sdk/_generated/models/watchdog_state.py +9 -0
  439. cplugin_webapi_sdk/_generated/models/web_api_error_code.py +17 -0
  440. cplugin_webapi_sdk/_generated/operation_timeouts.py +181 -0
  441. cplugin_webapi_sdk/_generated/types.py +53 -0
  442. cplugin_webapi_sdk/auth.py +278 -0
  443. cplugin_webapi_sdk/client.py +1215 -0
  444. cplugin_webapi_sdk/discovery.py +109 -0
  445. cplugin_webapi_sdk/envelope.py +77 -0
  446. cplugin_webapi_sdk/environments.py +45 -0
  447. cplugin_webapi_sdk/errors.py +79 -0
  448. cplugin_webapi_sdk/flags.py +36 -0
  449. cplugin_webapi_sdk/pagination.py +141 -0
  450. cplugin_webapi_sdk/realtime.py +408 -0
  451. cplugin_webapi_sdk/timeouts.py +197 -0
  452. cplugin_webapi_sdk/unwrap.py +153 -0
  453. mywebapi_sdk-0.3.0.dist-info/METADATA +312 -0
  454. mywebapi_sdk-0.3.0.dist-info/RECORD +456 -0
  455. mywebapi_sdk-0.3.0.dist-info/WHEEL +4 -0
  456. mywebapi_sdk-0.3.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1215 @@
1
+ """Ergonomic facade over the generated WebAPI v2 layer.
2
+
3
+ Both ``CPluginWebApiClient`` (sync) and ``CPluginWebApiAsyncClient`` (async)
4
+ expose ``.mt4`` / ``.mt5`` namespaces of clean snake_case methods, share one
5
+ authenticated httpx client, and surface ``list_trade_platforms()`` (v1 raw
6
+ endpoint) plus a ``paged()`` seam for cursor-based iteration.
7
+
8
+ Both expose ``.mt4`` and ``.mt5`` namespaces of clean snake_case methods over the
9
+ generated endpoint functions, sharing one authenticated httpx client. Auth is
10
+ lazy: tokens are fetched on first request, cached, refreshed before expiry, and
11
+ re-fetched on a 401 (see auth.ClientCredentialsAuth). Real-time SignalR is
12
+ available via the ``.realtime`` namespace (optional ``signalrcore`` extra; Task 9).
13
+
14
+ Usage::
15
+
16
+ client = CPluginWebApiClient(env="staging", client_id=..., client_secret=...)
17
+ t = client.mt4.get_server_time("my-tp")
18
+ for page in client.paged(lambda cur: client.mt4.users_request("my-tp", cursor=cur)):
19
+ ...
20
+ """
21
+ from __future__ import annotations
22
+
23
+ from collections.abc import Mapping
24
+ from typing import Any, Callable, Generator, AsyncGenerator
25
+ from uuid import UUID
26
+
27
+ import httpx
28
+
29
+ from .auth import BearerAuth, ClientCredentialsAuth
30
+ from .environments import EnvironmentName, resolve_environment
31
+ from .realtime import RealtimeNamespace
32
+ from .timeouts import (
33
+ DEFAULT_TRANSPORT_TIMEOUT,
34
+ IDEMPOTENCY_KEY_HEADER,
35
+ REQUEST_TIMEOUT_HEADER,
36
+ format_seconds,
37
+ operation_default_timeout,
38
+ transport_timeout,
39
+ validate_idempotency_key,
40
+ validate_request_timeout,
41
+ )
42
+ from .unwrap import unwrap, unwrap_async, unwrap_with_meta, unwrap_with_meta_async
43
+ from ._generated.types import Unset
44
+
45
+ # * Generated op modules — paths verified against ls _generated/api/.
46
+ # * Tag slugs use _v_2_ (with underscores around the digit), e.g. mt4_v_2_common.
47
+ from ._generated.api.mt4_v_2_common import (
48
+ get_api_v_2_mt4_trade_platform_server_time as _mt4_server_time,
49
+ get_api_v_2_mt4_trade_platform_manager_common as _mt4_manager_common,
50
+ )
51
+ from ._generated.api.mt4_v_2_users import (
52
+ get_api_v_2_mt4_trade_platform_users_request as _mt4_users_request,
53
+ get_api_v_2_mt4_trade_platform_user_record_get_login as _mt4_user_record_get,
54
+ patch_api_v_2_mt4_trade_platform_user_record_login as _mt4_user_record_patch,
55
+ )
56
+ from ._generated.models.patch_api_v2mt4_trade_platform_user_record_login_json_body import (
57
+ PatchApiV2MT4TradePlatformUserRecordLoginJsonBody as _MT4UserRecordPatchBody,
58
+ )
59
+ from ._generated.api.mt4_v_2_symbols import (
60
+ get_api_v_2_mt4_trade_platform_cfg_request_symbol as _mt4_symbols_list,
61
+ get_api_v_2_mt4_trade_platform_symbol_info_get as _mt4_symbol_info,
62
+ )
63
+ from ._generated.api.mt4_v_2_groups import (
64
+ get_api_v_2_mt4_trade_platform_ensure_group_name_exist_group as _mt4_group_exists,
65
+ )
66
+ from ._generated.api.mt4_v_2_trades import (
67
+ get_api_v_2_mt4_trade_platform_trades_request as _mt4_trades_request,
68
+ )
69
+ from ._generated.api.mt5_v_2_common import (
70
+ get_api_v_2_mt5_trade_platform_server_time as _mt5_server_time,
71
+ )
72
+ from ._generated.api.mt5_v_2_managers import (
73
+ get_api_v_2_mt5_trade_platform_manager_current as _mt5_manager_current,
74
+ )
75
+ from ._generated.api.mt5_v_2_users import (
76
+ get_api_v_2_mt5_trade_platform_user_get_login as _mt5_user_get,
77
+ )
78
+ from ._generated.api.mt5_v_2_groups import (
79
+ get_api_v_2_mt5_trade_platform_group_get_group as _mt5_group_get,
80
+ )
81
+ from ._generated.api.mt5_v_2_symbols import (
82
+ get_api_v_2_mt5_trade_platform_symbol_get_symbol as _mt5_symbol_get,
83
+ )
84
+ from ._generated.api.mt5_v_2_trades import (
85
+ get_api_v_2_mt5_trade_platform_position_by_group_mask as _mt5_positions_by_group,
86
+ )
87
+
88
+
89
+ # ---------------------------------------------------------------------------
90
+ # Internal helpers
91
+ # ---------------------------------------------------------------------------
92
+
93
+ class _RawResponse:
94
+ """Minimal duck-typed response object for ``unwrap`` / ``unwrap_with_meta``.
95
+
96
+ The generated ``_parse_response`` tries to deserialise ``data`` even on
97
+ error envelopes (where ``data`` is ``null``), and crashes on a type error.
98
+ Since ``unwrap`` reads only ``.content`` (raw bytes), ``.status_code`` and
99
+ ``.headers``, we bypass ``_build_response`` entirely: call ``_get_kwargs`` +
100
+ httpx.Client directly, and wrap the raw ``httpx.Response`` in this shim.
101
+ """
102
+
103
+ def __init__(self, raw: httpx.Response) -> None:
104
+ self.content = raw.content
105
+ self.status_code = raw.status_code
106
+ # * Carried so ApiError can report X-Request-Outcome / X-Request-Timeout-Applied.
107
+ self.headers = raw.headers
108
+
109
+
110
+ def _request_kwargs(
111
+ owner: Any,
112
+ op_module: Any,
113
+ request_timeout: float | None,
114
+ idempotency_key: str | None,
115
+ kwargs: dict[str, Any],
116
+ ) -> dict[str, Any]:
117
+ """Build the httpx request for a generated op, with timeout and idempotency headers.
118
+
119
+ ``request_timeout`` (seconds, 1–300) falls back to the client-wide default; when
120
+ one applies, ``X-Request-Timeout`` is sent. The HTTP timeout of the call is
121
+ stretched past the server's deadline — the one requested, else the operation's
122
+ default from the spec — so the client does not give up before the server has
123
+ said whether the operation was applied.
124
+ """
125
+ # Q-3: Guard against op_module that is not a generated endpoint module.
126
+ if not callable(getattr(op_module, "_get_kwargs", None)):
127
+ raise TypeError(
128
+ "op_module must be a generated endpoint module exposing _get_kwargs"
129
+ )
130
+ # * raw() callers may use the generated parameter name; it means the same thing.
131
+ generated = kwargs.pop("x_request_timeout", None)
132
+ if generated is not None and not isinstance(generated, Unset):
133
+ generated = validate_request_timeout(generated, name="x_request_timeout")
134
+ if request_timeout is not None and validate_request_timeout(request_timeout) != generated:
135
+ raise ValueError("request_timeout and x_request_timeout disagree; pass only one")
136
+ request_timeout = generated
137
+ seconds = validate_request_timeout(request_timeout)
138
+ if seconds is None:
139
+ seconds = owner._request_timeout
140
+ key = validate_idempotency_key(idempotency_key)
141
+
142
+ # ! _get_kwargs is a PRIVATE symbol of openapi-python-client. If a generator
143
+ # ! upgrade renames it, this raises AttributeError at call time. Re-verify after
144
+ # ! every regeneration: grep -r '_get_kwargs' src/cplugin_webapi_sdk/_generated/api/
145
+ req_kwargs = op_module._get_kwargs(**kwargs)
146
+
147
+ headers = {
148
+ k: v for k, v in (req_kwargs.get("headers") or {}).items()
149
+ if k.lower() != REQUEST_TIMEOUT_HEADER.lower()
150
+ }
151
+ if seconds is not None:
152
+ headers[REQUEST_TIMEOUT_HEADER] = format_seconds(seconds)
153
+ server_timeout = seconds if seconds is not None else operation_default_timeout(op_module)
154
+ req_kwargs["timeout"] = transport_timeout(owner._timeout, server_timeout)
155
+ if key is not None:
156
+ headers[IDEMPOTENCY_KEY_HEADER] = key
157
+ req_kwargs["headers"] = headers
158
+ return req_kwargs
159
+
160
+
161
+ def _call_sync(
162
+ owner: Any,
163
+ op_module: Any,
164
+ *,
165
+ request_timeout: float | None = None,
166
+ idempotency_key: str | None = None,
167
+ **kwargs: Any,
168
+ ) -> _RawResponse:
169
+ """Invoke a generated op by calling its ``_get_kwargs`` + the owner's shared httpx client.
170
+
171
+ This bypasses the generated ``_build_response`` / ``_parse_response`` pipeline,
172
+ which crashes on error envelopes for typed response models (e.g. datetime fields).
173
+ ``unwrap`` / ``unwrap_with_meta`` only need ``.content``, ``.status_code`` and ``.headers``.
174
+
175
+ ! Never retried here: a repeated trade or change can be applied twice. The
176
+ ! transport's ``retries`` only re-attempt opening the connection, before any
177
+ ! byte of the request is sent; the auth flow re-sends only after a 401, which
178
+ ! the server answers before running the action.
179
+ """
180
+ req_kwargs = _request_kwargs(owner, op_module, request_timeout, idempotency_key, kwargs)
181
+ raw = owner._http.request(**req_kwargs)
182
+ return _RawResponse(raw)
183
+
184
+
185
+ async def _call_async(
186
+ owner: Any,
187
+ op_module: Any,
188
+ *,
189
+ request_timeout: float | None = None,
190
+ idempotency_key: str | None = None,
191
+ **kwargs: Any,
192
+ ) -> _RawResponse:
193
+ """Async variant of ``_call_sync``."""
194
+ req_kwargs = _request_kwargs(owner, op_module, request_timeout, idempotency_key, kwargs)
195
+ raw = await owner._http.request(**req_kwargs)
196
+ return _RawResponse(raw)
197
+
198
+
199
+ def _build_auth(
200
+ client_id: str | None,
201
+ client_secret: str | None,
202
+ token: str | None,
203
+ authority: str,
204
+ scopes: list[str] | None,
205
+ ) -> httpx.Auth:
206
+ """Construct the appropriate auth handler from the provided credentials."""
207
+ if token:
208
+ return BearerAuth(token)
209
+ if not (client_id and client_secret):
210
+ raise ValueError(
211
+ "provide either token= for static-JWT auth, "
212
+ "or client_id= + client_secret= for OAuth2 client_credentials"
213
+ )
214
+ return ClientCredentialsAuth(
215
+ client_id=client_id,
216
+ client_secret=client_secret,
217
+ identity_url=authority,
218
+ scopes=scopes,
219
+ )
220
+
221
+
222
+ def _patch_body(changes: Mapping[str, Any]) -> _MT4UserRecordPatchBody:
223
+ """Wrap a mapping of changed fields into the generated merge-patch body."""
224
+ if not isinstance(changes, Mapping):
225
+ raise TypeError(f"changes must be a mapping of field names to values, got {type(changes).__name__}")
226
+ # ! An empty patch would still be a write round-trip to the trade server for nothing.
227
+ if not changes:
228
+ raise ValueError("changes must contain at least one field")
229
+ return _MT4UserRecordPatchBody.from_dict(dict(changes))
230
+
231
+
232
+ def _to_uuid(trade_platform: str | UUID) -> UUID:
233
+ """Accept a trade-platform identifier as str or UUID, always return UUID."""
234
+ if isinstance(trade_platform, UUID):
235
+ return trade_platform
236
+ return UUID(trade_platform)
237
+
238
+
239
+ # ---------------------------------------------------------------------------
240
+ # Sync namespace objects
241
+ # ---------------------------------------------------------------------------
242
+
243
+ class _MT4Namespace:
244
+ """Clean snake_case facade over the generated MT4 v2 endpoint modules.
245
+
246
+ All methods accept ``trade_platform`` as a ``str`` (UUID string) or
247
+ ``uuid.UUID`` — both are normalised internally, and a keyword-only
248
+ ``request_timeout`` (seconds, 1–300) that overrides the server deadline for
249
+ that call (default: the client's ``request_timeout``, else the server's
250
+ default for the operation). Write methods also take ``idempotency_key``.
251
+
252
+ Implementation note: we call ``_get_kwargs`` + the shared ``httpx.Client``
253
+ directly (via ``_call_sync``), bypassing the generated ``_build_response`` /
254
+ ``_parse_response`` pipeline. The generated ``_parse_response`` always tries
255
+ to deserialise the ``data`` field even on error envelopes (where ``data`` is
256
+ ``null``), which causes a crash on typed fields like ``datetime``. Since
257
+ ``unwrap`` reads only ``.content`` (raw bytes) and ``.status_code``, the
258
+ generated parsing layer is not needed here.
259
+ """
260
+
261
+ def __init__(self, owner: "CPluginWebApiClient") -> None:
262
+ self._o = owner
263
+
264
+ # * ----- common -----
265
+
266
+ def get_server_time(self, trade_platform: str | UUID, *, request_timeout: float | None = None) -> Any:
267
+ """Return current MT4 server time (ISO 8601 string)."""
268
+ return unwrap(
269
+ _call_sync(
270
+ self._o, _mt4_server_time,
271
+ trade_platform=_to_uuid(trade_platform),
272
+ request_timeout=request_timeout,
273
+ )
274
+ )
275
+
276
+ def get_manager_common(self, trade_platform: str | UUID, *, request_timeout: float | None = None) -> Any:
277
+ """Return server-wide MT4 common settings (name, broker, version, tz)."""
278
+ return unwrap(
279
+ _call_sync(
280
+ self._o, _mt4_manager_common,
281
+ trade_platform=_to_uuid(trade_platform),
282
+ request_timeout=request_timeout,
283
+ )
284
+ )
285
+
286
+ # * ----- users -----
287
+
288
+ def users_request(
289
+ self,
290
+ trade_platform: str | UUID,
291
+ *,
292
+ cursor: str | None = None,
293
+ limit: int | None = None,
294
+ request_timeout: float | None = None,
295
+ ) -> tuple[Any, Any]:
296
+ """Return ``(data, meta)`` for a paged list of MT4 user accounts.
297
+
298
+ Pass ``cursor`` from ``meta.paging.next_cursor`` to advance pages.
299
+ ``meta.paging.has_more`` signals that further pages exist.
300
+ """
301
+ from ._generated.types import UNSET
302
+
303
+ return unwrap_with_meta(
304
+ _call_sync(
305
+ self._o, _mt4_users_request,
306
+ trade_platform=_to_uuid(trade_platform),
307
+ request_timeout=request_timeout,
308
+ limit=limit if limit is not None else UNSET,
309
+ cursor=cursor if cursor is not None else UNSET,
310
+ )
311
+ )
312
+
313
+ def get_user_record(
314
+ self,
315
+ trade_platform: str | UUID,
316
+ login: int,
317
+ *,
318
+ request_timeout: float | None = None,
319
+ ) -> Any:
320
+ """Return a single MT4 user account record from the pump cache."""
321
+ return unwrap(
322
+ _call_sync(
323
+ self._o, _mt4_user_record_get,
324
+ trade_platform=_to_uuid(trade_platform),
325
+ request_timeout=request_timeout,
326
+ login=login,
327
+ )
328
+ )
329
+
330
+ def patch_user_record(
331
+ self,
332
+ trade_platform: str | UUID,
333
+ login: int,
334
+ changes: Mapping[str, Any],
335
+ *,
336
+ request_timeout: float | None = None,
337
+ idempotency_key: str | None = None,
338
+ ) -> Any:
339
+ """Change the given fields of a user record (JSON Merge Patch) and return the merged record.
340
+
341
+ ``changes`` holds only the fields to change, with their wire (camelCase)
342
+ names, e.g. ``{"leverage": 200, "comment": "vip"}``. The server reads the
343
+ current record from the trade server, overlays the changes and writes it
344
+ back; unknown keys are ignored. A change that timed out answers
345
+ ``OutcomeUnknown`` — pass ``idempotency_key`` to repeat it safely.
346
+ """
347
+ return unwrap(
348
+ _call_sync(
349
+ self._o, _mt4_user_record_patch,
350
+ trade_platform=_to_uuid(trade_platform),
351
+ request_timeout=request_timeout,
352
+ idempotency_key=idempotency_key,
353
+ login=login,
354
+ body=_patch_body(changes),
355
+ )
356
+ )
357
+
358
+ # * ----- groups -----
359
+
360
+ def group_exists(
361
+ self,
362
+ trade_platform: str | UUID,
363
+ group: str,
364
+ *,
365
+ request_timeout: float | None = None,
366
+ ) -> Any:
367
+ """Return ``True`` if ``group`` is configured on the MT4 server."""
368
+ return unwrap(
369
+ _call_sync(
370
+ self._o, _mt4_group_exists,
371
+ trade_platform=_to_uuid(trade_platform),
372
+ request_timeout=request_timeout,
373
+ group=group,
374
+ )
375
+ )
376
+
377
+ # * ----- symbols -----
378
+
379
+ def list_symbol_configs(self, trade_platform: str | UUID, *, request_timeout: float | None = None) -> Any:
380
+ """Return all symbol configuration records from the MT4 server."""
381
+ return unwrap(
382
+ _call_sync(
383
+ self._o, _mt4_symbols_list,
384
+ trade_platform=_to_uuid(trade_platform),
385
+ request_timeout=request_timeout,
386
+ )
387
+ )
388
+
389
+ def get_symbol_info(
390
+ self,
391
+ trade_platform: str | UUID,
392
+ *,
393
+ symbol: str | None = None,
394
+ request_timeout: float | None = None,
395
+ ) -> Any:
396
+ """Return live symbol info snapshot (spread, digits, sessions).
397
+
398
+ Pass ``symbol`` to filter to a single instrument. Without it, all
399
+ loaded symbols are returned.
400
+ """
401
+ from ._generated.types import UNSET
402
+
403
+ return unwrap(
404
+ _call_sync(
405
+ self._o, _mt4_symbol_info,
406
+ trade_platform=_to_uuid(trade_platform),
407
+ request_timeout=request_timeout,
408
+ symbol=symbol if symbol is not None else UNSET,
409
+ )
410
+ )
411
+
412
+ # * ----- trades -----
413
+
414
+ def trades_request(
415
+ self,
416
+ trade_platform: str | UUID,
417
+ *,
418
+ cursor: str | None = None,
419
+ limit: int | None = None,
420
+ group: str | None = None,
421
+ request_timeout: float | None = None,
422
+ ) -> tuple[Any, Any]:
423
+ """Return ``(data, meta)`` for a paged list of open trades.
424
+
425
+ Optional ``group`` filter restricts results to accounts in that group.
426
+ Pass ``cursor`` from the previous page's ``meta.paging.next_cursor``.
427
+ """
428
+ from ._generated.types import UNSET
429
+
430
+ return unwrap_with_meta(
431
+ _call_sync(
432
+ self._o, _mt4_trades_request,
433
+ trade_platform=_to_uuid(trade_platform),
434
+ request_timeout=request_timeout,
435
+ limit=limit if limit is not None else UNSET,
436
+ cursor=cursor if cursor is not None else UNSET,
437
+ group=group if group is not None else UNSET,
438
+ )
439
+ )
440
+
441
+ # * ----- escape hatch -----
442
+
443
+ def raw(
444
+ self,
445
+ op_module: Any,
446
+ *,
447
+ request_timeout: float | None = None,
448
+ idempotency_key: str | None = None,
449
+ **kwargs: Any,
450
+ ) -> Any:
451
+ """Call any generated MT4 op module via ``_get_kwargs`` + the shared httpx client.
452
+
453
+ Injects the shared authenticated httpx client automatically.
454
+ Returns a ``_RawResponse`` — call ``unwrap()`` / ``unwrap_with_meta()`` on it.
455
+
456
+ ``request_timeout`` (seconds, 1–300) sets the server deadline for this call;
457
+ ``idempotency_key`` sends ``Idempotency-Key`` so a repeat after
458
+ ``OutcomeUnknown`` returns the original result instead of executing again.
459
+
460
+ Example::
461
+
462
+ from cplugin_webapi_sdk._generated.api.mt4_v_2_history import (
463
+ get_api_v_2_mt4_trade_platform_history_request as history_op,
464
+ )
465
+ from cplugin_webapi_sdk import unwrap
466
+ resp = client.mt4.raw(history_op, trade_platform=tp_id, from_=..., to_=...)
467
+ data = unwrap(resp)
468
+ """
469
+ return _call_sync(
470
+ self._o, op_module,
471
+ request_timeout=request_timeout, idempotency_key=idempotency_key, **kwargs,
472
+ )
473
+
474
+
475
+ class _MT5Namespace:
476
+ """Clean snake_case facade over the generated MT5 v2 endpoint modules.
477
+
478
+ See ``_MT4Namespace`` for the implementation note on bypassing
479
+ ``_build_response`` / ``_parse_response``.
480
+ """
481
+
482
+ def __init__(self, owner: "CPluginWebApiClient") -> None:
483
+ self._o = owner
484
+
485
+ # * ----- common -----
486
+
487
+ def get_server_time(self, trade_platform: str | UUID, *, request_timeout: float | None = None) -> Any:
488
+ """Return current MT5 server time (ISO 8601 string)."""
489
+ return unwrap(
490
+ _call_sync(
491
+ self._o, _mt5_server_time,
492
+ trade_platform=_to_uuid(trade_platform),
493
+ request_timeout=request_timeout,
494
+ )
495
+ )
496
+
497
+ def get_manager_current(self, trade_platform: str | UUID, *, request_timeout: float | None = None) -> Any:
498
+ """Return the currently-connected MT5 manager record."""
499
+ return unwrap(
500
+ _call_sync(
501
+ self._o, _mt5_manager_current,
502
+ trade_platform=_to_uuid(trade_platform),
503
+ request_timeout=request_timeout,
504
+ )
505
+ )
506
+
507
+ # * ----- users -----
508
+
509
+ def get_user(
510
+ self,
511
+ trade_platform: str | UUID,
512
+ login: int,
513
+ *,
514
+ request_timeout: float | None = None,
515
+ ) -> Any:
516
+ """Return a single MT5 user record by login."""
517
+ return unwrap(
518
+ _call_sync(
519
+ self._o, _mt5_user_get,
520
+ trade_platform=_to_uuid(trade_platform),
521
+ request_timeout=request_timeout,
522
+ login=login,
523
+ )
524
+ )
525
+
526
+ # * ----- groups -----
527
+
528
+ def get_group(
529
+ self,
530
+ trade_platform: str | UUID,
531
+ group: str,
532
+ *,
533
+ request_timeout: float | None = None,
534
+ ) -> Any:
535
+ """Return MT5 group configuration by exact name."""
536
+ return unwrap(
537
+ _call_sync(
538
+ self._o, _mt5_group_get,
539
+ trade_platform=_to_uuid(trade_platform),
540
+ request_timeout=request_timeout,
541
+ group=group,
542
+ )
543
+ )
544
+
545
+ # * ----- symbols -----
546
+
547
+ def get_symbol(
548
+ self,
549
+ trade_platform: str | UUID,
550
+ symbol: str,
551
+ *,
552
+ request_timeout: float | None = None,
553
+ ) -> Any:
554
+ """Return MT5 symbol settings by exact symbol name."""
555
+ return unwrap(
556
+ _call_sync(
557
+ self._o, _mt5_symbol_get,
558
+ trade_platform=_to_uuid(trade_platform),
559
+ request_timeout=request_timeout,
560
+ symbol=symbol,
561
+ )
562
+ )
563
+
564
+ # * ----- trades -----
565
+
566
+ def positions_by_group(
567
+ self,
568
+ trade_platform: str | UUID,
569
+ mask: str,
570
+ *,
571
+ request_timeout: float | None = None,
572
+ ) -> Any:
573
+ """Return open positions for all logins in groups matching ``mask``."""
574
+ return unwrap(
575
+ _call_sync(
576
+ self._o, _mt5_positions_by_group,
577
+ trade_platform=_to_uuid(trade_platform),
578
+ request_timeout=request_timeout,
579
+ mask=mask,
580
+ )
581
+ )
582
+
583
+ # * ----- escape hatch -----
584
+
585
+ def raw(
586
+ self,
587
+ op_module: Any,
588
+ *,
589
+ request_timeout: float | None = None,
590
+ idempotency_key: str | None = None,
591
+ **kwargs: Any,
592
+ ) -> Any:
593
+ """Call any generated MT5 op module via ``_get_kwargs`` + the shared httpx client.
594
+
595
+ Injects the shared authenticated httpx client automatically.
596
+ Returns a ``_RawResponse`` — call ``unwrap()`` / ``unwrap_with_meta()`` on it.
597
+ ``request_timeout`` / ``idempotency_key`` as in ``_MT4Namespace.raw``.
598
+ """
599
+ return _call_sync(
600
+ self._o, op_module,
601
+ request_timeout=request_timeout, idempotency_key=idempotency_key, **kwargs,
602
+ )
603
+
604
+
605
+ # ---------------------------------------------------------------------------
606
+ # Async namespace objects
607
+ # ---------------------------------------------------------------------------
608
+
609
+ class _MT4AsyncNamespace:
610
+ """Async facade over the generated MT4 v2 endpoint modules."""
611
+
612
+ def __init__(self, owner: "CPluginWebApiAsyncClient") -> None:
613
+ self._o = owner
614
+
615
+ async def get_server_time(
616
+ self,
617
+ trade_platform: str | UUID,
618
+ *,
619
+ request_timeout: float | None = None,
620
+ ) -> Any:
621
+ """Return current MT4 server time (ISO 8601 string)."""
622
+ return unwrap(
623
+ await _call_async(
624
+ self._o, _mt4_server_time,
625
+ trade_platform=_to_uuid(trade_platform),
626
+ request_timeout=request_timeout,
627
+ )
628
+ )
629
+
630
+ async def get_manager_common(
631
+ self,
632
+ trade_platform: str | UUID,
633
+ *,
634
+ request_timeout: float | None = None,
635
+ ) -> Any:
636
+ """Return server-wide MT4 common settings."""
637
+ return unwrap(
638
+ await _call_async(
639
+ self._o, _mt4_manager_common,
640
+ trade_platform=_to_uuid(trade_platform),
641
+ request_timeout=request_timeout,
642
+ )
643
+ )
644
+
645
+ async def users_request(
646
+ self,
647
+ trade_platform: str | UUID,
648
+ *,
649
+ cursor: str | None = None,
650
+ limit: int | None = None,
651
+ request_timeout: float | None = None,
652
+ ) -> tuple[Any, Any]:
653
+ """Return ``(data, meta)`` for a paged list of MT4 user accounts."""
654
+ from ._generated.types import UNSET
655
+
656
+ return unwrap_with_meta(
657
+ await _call_async(
658
+ self._o, _mt4_users_request,
659
+ trade_platform=_to_uuid(trade_platform),
660
+ request_timeout=request_timeout,
661
+ limit=limit if limit is not None else UNSET,
662
+ cursor=cursor if cursor is not None else UNSET,
663
+ )
664
+ )
665
+
666
+ async def get_user_record(
667
+ self,
668
+ trade_platform: str | UUID,
669
+ login: int,
670
+ *,
671
+ request_timeout: float | None = None,
672
+ ) -> Any:
673
+ """Return a single MT4 user account record from the pump cache."""
674
+ return unwrap(
675
+ await _call_async(
676
+ self._o, _mt4_user_record_get,
677
+ trade_platform=_to_uuid(trade_platform),
678
+ request_timeout=request_timeout,
679
+ login=login,
680
+ )
681
+ )
682
+
683
+ async def patch_user_record(
684
+ self,
685
+ trade_platform: str | UUID,
686
+ login: int,
687
+ changes: Mapping[str, Any],
688
+ *,
689
+ request_timeout: float | None = None,
690
+ idempotency_key: str | None = None,
691
+ ) -> Any:
692
+ """Change the given fields of a user record; see the sync ``patch_user_record``."""
693
+ return unwrap(
694
+ await _call_async(
695
+ self._o, _mt4_user_record_patch,
696
+ trade_platform=_to_uuid(trade_platform),
697
+ request_timeout=request_timeout,
698
+ idempotency_key=idempotency_key,
699
+ login=login,
700
+ body=_patch_body(changes),
701
+ )
702
+ )
703
+
704
+ async def group_exists(
705
+ self,
706
+ trade_platform: str | UUID,
707
+ group: str,
708
+ *,
709
+ request_timeout: float | None = None,
710
+ ) -> Any:
711
+ """Return ``True`` if ``group`` is configured on the MT4 server."""
712
+ return unwrap(
713
+ await _call_async(
714
+ self._o, _mt4_group_exists,
715
+ trade_platform=_to_uuid(trade_platform),
716
+ request_timeout=request_timeout,
717
+ group=group,
718
+ )
719
+ )
720
+
721
+ async def list_symbol_configs(
722
+ self,
723
+ trade_platform: str | UUID,
724
+ *,
725
+ request_timeout: float | None = None,
726
+ ) -> Any:
727
+ """Return all symbol configuration records from the MT4 server."""
728
+ return unwrap(
729
+ await _call_async(
730
+ self._o, _mt4_symbols_list,
731
+ trade_platform=_to_uuid(trade_platform),
732
+ request_timeout=request_timeout,
733
+ )
734
+ )
735
+
736
+ async def get_symbol_info(
737
+ self,
738
+ trade_platform: str | UUID,
739
+ *,
740
+ symbol: str | None = None,
741
+ request_timeout: float | None = None,
742
+ ) -> Any:
743
+ """Return live symbol info snapshot (spread, digits, sessions).
744
+
745
+ Pass ``symbol`` to filter to a single instrument. Without it, all
746
+ loaded symbols are returned.
747
+ """
748
+ from ._generated.types import UNSET
749
+
750
+ return unwrap(
751
+ await _call_async(
752
+ self._o, _mt4_symbol_info,
753
+ trade_platform=_to_uuid(trade_platform),
754
+ request_timeout=request_timeout,
755
+ symbol=symbol if symbol is not None else UNSET,
756
+ )
757
+ )
758
+
759
+ async def trades_request(
760
+ self,
761
+ trade_platform: str | UUID,
762
+ *,
763
+ cursor: str | None = None,
764
+ limit: int | None = None,
765
+ group: str | None = None,
766
+ request_timeout: float | None = None,
767
+ ) -> tuple[Any, Any]:
768
+ """Return ``(data, meta)`` for a paged list of open trades."""
769
+ from ._generated.types import UNSET
770
+
771
+ return unwrap_with_meta(
772
+ await _call_async(
773
+ self._o, _mt4_trades_request,
774
+ trade_platform=_to_uuid(trade_platform),
775
+ request_timeout=request_timeout,
776
+ limit=limit if limit is not None else UNSET,
777
+ cursor=cursor if cursor is not None else UNSET,
778
+ group=group if group is not None else UNSET,
779
+ )
780
+ )
781
+
782
+ async def raw(
783
+ self,
784
+ op_module: Any,
785
+ *,
786
+ request_timeout: float | None = None,
787
+ idempotency_key: str | None = None,
788
+ **kwargs: Any,
789
+ ) -> Any:
790
+ """Call any generated MT4 op module via ``_get_kwargs`` + the shared async httpx client.
791
+
792
+ Returns a ``_RawResponse`` — call ``unwrap()`` / ``unwrap_with_meta()`` on it.
793
+ ``request_timeout`` / ``idempotency_key`` as in ``_MT4Namespace.raw``.
794
+ """
795
+ return await _call_async(
796
+ self._o, op_module,
797
+ request_timeout=request_timeout, idempotency_key=idempotency_key, **kwargs,
798
+ )
799
+
800
+
801
+ class _MT5AsyncNamespace:
802
+ """Async facade over the generated MT5 v2 endpoint modules."""
803
+
804
+ def __init__(self, owner: "CPluginWebApiAsyncClient") -> None:
805
+ self._o = owner
806
+
807
+ async def get_server_time(
808
+ self,
809
+ trade_platform: str | UUID,
810
+ *,
811
+ request_timeout: float | None = None,
812
+ ) -> Any:
813
+ """Return current MT5 server time (ISO 8601 string)."""
814
+ return unwrap(
815
+ await _call_async(
816
+ self._o, _mt5_server_time,
817
+ trade_platform=_to_uuid(trade_platform),
818
+ request_timeout=request_timeout,
819
+ )
820
+ )
821
+
822
+ async def get_manager_current(
823
+ self,
824
+ trade_platform: str | UUID,
825
+ *,
826
+ request_timeout: float | None = None,
827
+ ) -> Any:
828
+ """Return the currently-connected MT5 manager record."""
829
+ return unwrap(
830
+ await _call_async(
831
+ self._o, _mt5_manager_current,
832
+ trade_platform=_to_uuid(trade_platform),
833
+ request_timeout=request_timeout,
834
+ )
835
+ )
836
+
837
+ async def get_user(
838
+ self,
839
+ trade_platform: str | UUID,
840
+ login: int,
841
+ *,
842
+ request_timeout: float | None = None,
843
+ ) -> Any:
844
+ """Return a single MT5 user record by login."""
845
+ return unwrap(
846
+ await _call_async(
847
+ self._o, _mt5_user_get,
848
+ trade_platform=_to_uuid(trade_platform),
849
+ request_timeout=request_timeout,
850
+ login=login,
851
+ )
852
+ )
853
+
854
+ async def get_group(
855
+ self,
856
+ trade_platform: str | UUID,
857
+ group: str,
858
+ *,
859
+ request_timeout: float | None = None,
860
+ ) -> Any:
861
+ """Return MT5 group configuration by exact name."""
862
+ return unwrap(
863
+ await _call_async(
864
+ self._o, _mt5_group_get,
865
+ trade_platform=_to_uuid(trade_platform),
866
+ request_timeout=request_timeout,
867
+ group=group,
868
+ )
869
+ )
870
+
871
+ async def get_symbol(
872
+ self,
873
+ trade_platform: str | UUID,
874
+ symbol: str,
875
+ *,
876
+ request_timeout: float | None = None,
877
+ ) -> Any:
878
+ """Return MT5 symbol settings by exact symbol name."""
879
+ return unwrap(
880
+ await _call_async(
881
+ self._o, _mt5_symbol_get,
882
+ trade_platform=_to_uuid(trade_platform),
883
+ request_timeout=request_timeout,
884
+ symbol=symbol,
885
+ )
886
+ )
887
+
888
+ async def positions_by_group(
889
+ self,
890
+ trade_platform: str | UUID,
891
+ mask: str,
892
+ *,
893
+ request_timeout: float | None = None,
894
+ ) -> Any:
895
+ """Return open positions for all logins in groups matching ``mask``."""
896
+ return unwrap(
897
+ await _call_async(
898
+ self._o, _mt5_positions_by_group,
899
+ trade_platform=_to_uuid(trade_platform),
900
+ request_timeout=request_timeout,
901
+ mask=mask,
902
+ )
903
+ )
904
+
905
+ async def raw(
906
+ self,
907
+ op_module: Any,
908
+ *,
909
+ request_timeout: float | None = None,
910
+ idempotency_key: str | None = None,
911
+ **kwargs: Any,
912
+ ) -> Any:
913
+ """Call any generated MT5 op module via ``_get_kwargs`` + the shared async httpx client.
914
+
915
+ Returns a ``_RawResponse`` — call ``unwrap()`` / ``unwrap_with_meta()`` on it.
916
+ ``request_timeout`` / ``idempotency_key`` as in ``_MT4Namespace.raw``.
917
+ """
918
+ return await _call_async(
919
+ self._o, op_module,
920
+ request_timeout=request_timeout, idempotency_key=idempotency_key, **kwargs,
921
+ )
922
+
923
+
924
+ # ---------------------------------------------------------------------------
925
+ # Public sync client
926
+ # ---------------------------------------------------------------------------
927
+
928
+ class CPluginWebApiClient:
929
+ """Synchronous WebAPI v2 client.
930
+
931
+ Constructs one shared authenticated ``httpx.Client``. Auth is lazy:
932
+ tokens are fetched on first request, cached until near-expiry, and
933
+ force-refreshed on a 401 response.
934
+
935
+ Args:
936
+ env: Named environment preset — ``"prod"``, ``"staging"``, or
937
+ ``"custom"``.
938
+ client_id: OAuth2 client ID (required unless ``token=`` is supplied).
939
+ client_secret: OAuth2 client secret (required unless ``token=`` is supplied).
940
+ token: Static bearer token. Mutually exclusive with
941
+ ``client_id`` / ``client_secret``.
942
+ api_base_url: Override API base URL (required when ``env="custom"``).
943
+ authority: Override OIDC authority URL (required when ``env="custom"``).
944
+ scopes: OAuth2 scopes to request (default: server-defined).
945
+ timeout: HTTP client timeout in seconds (default: 30.0). A trade-platform
946
+ call waits at least its server deadline + 30 s — the requested
947
+ ``request_timeout``, else the operation's default from the spec
948
+ (60 s where it documents none) — so it is never cut off before
949
+ the server answers; this value is the floor.
950
+ request_timeout: Default server deadline in seconds (1–300) for every call,
951
+ sent as ``X-Request-Timeout``. ``None`` (default): the server's
952
+ own per-operation default (trade 5 s, read 10 s, change 15 s,
953
+ history 30 s, maintenance 60 s).
954
+ retries: Transport-level retry count for opening a connection (default: 2).
955
+ Only connection attempts are repeated, never a sent request:
956
+ a repeated trade could be applied twice.
957
+ transport: Custom ``httpx.BaseTransport`` (e.g. ``respx.MockTransport``
958
+ for tests). Overrides ``retries``.
959
+
960
+ Attributes for Task 9 (realtime SignalR wiring):
961
+ _api_base (str): Resolved API base URL without trailing slash.
962
+ _token_getter (callable → str): Zero-arg callable returning the current
963
+ bearer token; calls the auth flow's token-fetch if
964
+ the cached token has expired.
965
+ """
966
+
967
+ def __init__(
968
+ self,
969
+ *,
970
+ env: EnvironmentName = "prod",
971
+ client_id: str | None = None,
972
+ client_secret: str | None = None,
973
+ token: str | None = None,
974
+ api_base_url: str | None = None,
975
+ authority: str | None = None,
976
+ scopes: list[str] | None = None,
977
+ timeout: float | None = DEFAULT_TRANSPORT_TIMEOUT,
978
+ request_timeout: float | None = None,
979
+ retries: int = 2,
980
+ transport: httpx.BaseTransport | None = None,
981
+ ) -> None:
982
+ resolved = resolve_environment(env, api_base_url=api_base_url, authority=authority)
983
+
984
+ # * Validated up front: a bad client-wide default fails here, not on the first call.
985
+ self._request_timeout: float | None = validate_request_timeout(request_timeout)
986
+ self._timeout: float | None = timeout
987
+
988
+ # * Resolved base URL — stored for Task 9 realtime wiring.
989
+ self._api_base: str = resolved.api_base_url
990
+
991
+ auth = _build_auth(client_id, client_secret, token, resolved.authority, scopes)
992
+ self._auth = auth
993
+
994
+ self._http = httpx.Client(
995
+ base_url=self._api_base,
996
+ timeout=timeout,
997
+ auth=auth,
998
+ transport=transport or httpx.HTTPTransport(retries=retries),
999
+ )
1000
+
1001
+ # * Zero-arg token getter for Task 9 realtime wiring.
1002
+ # * Uses the public current_token() accessor on both auth types.
1003
+ self._token_getter: Callable[[], str] = auth.current_token
1004
+
1005
+ self.mt4 = _MT4Namespace(self)
1006
+ self.mt5 = _MT5Namespace(self)
1007
+ self._realtime: RealtimeNamespace | None = None
1008
+
1009
+ @property
1010
+ def realtime(self) -> RealtimeNamespace:
1011
+ """Real-time SignalR namespace. Requires the optional ``signalrcore`` extra.
1012
+
1013
+ Returns a :class:`~cplugin_webapi_sdk.realtime.RealtimeNamespace` bound to
1014
+ this client's base URL and token provider. Constructing a hub client from
1015
+ the namespace will raise :class:`~cplugin_webapi_sdk.realtime.SignalRNotInstalledError`
1016
+ if ``signalrcore`` is not installed.
1017
+
1018
+ Example::
1019
+
1020
+ rt = client.realtime.mt4("my-trade-platform-id")
1021
+ rt.on_tick(lambda *args: print(args))
1022
+ with rt:
1023
+ rt.subscribe_to_ticks("EURUSD")
1024
+ import time; time.sleep(5)
1025
+ """
1026
+ # * Lazily create so the client itself is usable without signalrcore.
1027
+ if self._realtime is None:
1028
+ self._realtime = RealtimeNamespace(
1029
+ base_url=self._api_base,
1030
+ token_factory=self._token_getter,
1031
+ )
1032
+ return self._realtime
1033
+
1034
+ def list_trade_platforms(self) -> list[dict]:
1035
+ """Return the raw v1 list of configured trade platforms.
1036
+
1037
+ This endpoint pre-dates the v2 envelope — it returns a plain JSON array,
1038
+ not the ``{data, error, meta}`` structure. Mirror the TS SDK's behaviour:
1039
+ raise directly on HTTP errors via ``raise_for_status()``.
1040
+ """
1041
+ # ! v1, unversioned path — NOT covered by the v2 spec / generated layer.
1042
+ r = self._http.get("/api/TradePlatforms")
1043
+ r.raise_for_status()
1044
+ return r.json()
1045
+
1046
+ def paged(
1047
+ self,
1048
+ fetch_page: Callable[[str | None], tuple[Any, Any]],
1049
+ ) -> Generator[Any, None, None]:
1050
+ """Iterate pages by calling ``fetch_page(cursor)`` until exhausted.
1051
+
1052
+ ``fetch_page`` must be a callable that accepts an opaque cursor string
1053
+ (``None`` on the first call) and returns ``(data, meta)`` — the same
1054
+ shape that namespace paged methods like ``mt4.users_request`` return.
1055
+ Each call yields the ``data`` portion of that page.
1056
+
1057
+ Example::
1058
+
1059
+ for page_data in client.paged(
1060
+ lambda cur: client.mt4.users_request("tp-id", cursor=cur)
1061
+ ):
1062
+ process(page_data)
1063
+ """
1064
+ cursor: str | None = None
1065
+ while True:
1066
+ data, meta = fetch_page(cursor)
1067
+ yield data
1068
+ paging = meta.paging if meta else None
1069
+ if not paging or not paging.has_more:
1070
+ break
1071
+ cursor = paging.next_cursor
1072
+
1073
+ def close(self) -> None:
1074
+ """Close the underlying httpx client and free connection pool resources."""
1075
+ self._http.close()
1076
+
1077
+ def __enter__(self) -> "CPluginWebApiClient":
1078
+ return self
1079
+
1080
+ def __exit__(self, *exc: Any) -> None:
1081
+ self.close()
1082
+
1083
+
1084
+ # ---------------------------------------------------------------------------
1085
+ # Public async client
1086
+ # ---------------------------------------------------------------------------
1087
+
1088
+ class CPluginWebApiAsyncClient:
1089
+ """Asynchronous WebAPI v2 client — mirrors ``CPluginWebApiClient`` exactly.
1090
+
1091
+ All namespace methods are ``async``; use ``async with`` / ``await aclose()``.
1092
+ Constructor arguments, ``timeout`` / ``request_timeout`` / ``retries`` included,
1093
+ are the same as for ``CPluginWebApiClient``.
1094
+
1095
+ Attributes for Task 9 (realtime SignalR wiring):
1096
+ _api_base (str): Resolved API base URL without trailing slash.
1097
+ _token_getter (callable → str): Zero-arg callable returning the current
1098
+ bearer token synchronously (same public accessor
1099
+ as the sync client).
1100
+ """
1101
+
1102
+ def __init__(
1103
+ self,
1104
+ *,
1105
+ env: EnvironmentName = "prod",
1106
+ client_id: str | None = None,
1107
+ client_secret: str | None = None,
1108
+ token: str | None = None,
1109
+ api_base_url: str | None = None,
1110
+ authority: str | None = None,
1111
+ scopes: list[str] | None = None,
1112
+ timeout: float | None = DEFAULT_TRANSPORT_TIMEOUT,
1113
+ request_timeout: float | None = None,
1114
+ retries: int = 2,
1115
+ transport: httpx.AsyncBaseTransport | None = None,
1116
+ ) -> None:
1117
+ resolved = resolve_environment(env, api_base_url=api_base_url, authority=authority)
1118
+
1119
+ # * Validated up front: a bad client-wide default fails here, not on the first call.
1120
+ self._request_timeout: float | None = validate_request_timeout(request_timeout)
1121
+ self._timeout: float | None = timeout
1122
+
1123
+ # * Resolved base URL — stored for Task 9 realtime wiring.
1124
+ self._api_base: str = resolved.api_base_url
1125
+
1126
+ auth = _build_auth(client_id, client_secret, token, resolved.authority, scopes)
1127
+ self._auth = auth
1128
+
1129
+ self._http = httpx.AsyncClient(
1130
+ base_url=self._api_base,
1131
+ timeout=timeout,
1132
+ auth=auth,
1133
+ transport=transport or httpx.AsyncHTTPTransport(retries=retries),
1134
+ )
1135
+
1136
+ # * Zero-arg sync token getter for Task 9 realtime wiring.
1137
+ # * Uses the public current_token() accessor on both auth types.
1138
+ # * Async callers should use the underlying auth's _get_token_async directly;
1139
+ # * this sync getter is kept for interop with realtime wiring that bootstraps
1140
+ # * synchronously.
1141
+ self._token_getter: Callable[[], str] = auth.current_token
1142
+
1143
+ self.mt4 = _MT4AsyncNamespace(self)
1144
+ self.mt5 = _MT5AsyncNamespace(self)
1145
+ self._realtime: RealtimeNamespace | None = None
1146
+
1147
+ @property
1148
+ def realtime(self) -> RealtimeNamespace:
1149
+ """Real-time SignalR namespace. Requires the optional ``signalrcore`` extra.
1150
+
1151
+ Returns a :class:`~cplugin_webapi_sdk.realtime.RealtimeNamespace` bound to
1152
+ this client's base URL and token provider. The realtime layer is always
1153
+ synchronous (``signalrcore`` manages its own thread); it is safe to use
1154
+ from an async context.
1155
+
1156
+ Example::
1157
+
1158
+ rt = client.realtime.mt5("my-trade-platform-id")
1159
+ rt.on_connection_status(lambda *args: print(args))
1160
+ with rt:
1161
+ import asyncio; await asyncio.sleep(5)
1162
+ """
1163
+ # * Lazily create so the client itself is usable without signalrcore.
1164
+ if self._realtime is None:
1165
+ self._realtime = RealtimeNamespace(
1166
+ base_url=self._api_base,
1167
+ token_factory=self._token_getter,
1168
+ )
1169
+ return self._realtime
1170
+
1171
+ async def list_trade_platforms(self) -> list[dict]:
1172
+ """Return the raw v1 list of configured trade platforms.
1173
+
1174
+ This endpoint pre-dates the v2 envelope — it returns a plain JSON array.
1175
+ Raises ``httpx.HTTPStatusError`` on non-2xx responses.
1176
+ """
1177
+ # ! v1, unversioned path — NOT covered by the v2 spec / generated layer.
1178
+ r = await self._http.get("/api/TradePlatforms")
1179
+ r.raise_for_status()
1180
+ return r.json()
1181
+
1182
+ async def paged(
1183
+ self,
1184
+ fetch_page: Callable[[str | None], Any],
1185
+ ) -> AsyncGenerator[Any, None]:
1186
+ """Async page iterator — mirrors the sync ``paged()`` seam.
1187
+
1188
+ ``fetch_page`` must be an async callable (or coroutine function) that
1189
+ accepts a cursor and returns ``(data, meta)``.
1190
+
1191
+ Example::
1192
+
1193
+ async for page_data in client.paged(
1194
+ lambda cur: client.mt4.users_request("tp-id", cursor=cur)
1195
+ ):
1196
+ await process(page_data)
1197
+ """
1198
+ cursor: str | None = None
1199
+ while True:
1200
+ data, meta = await fetch_page(cursor)
1201
+ yield data
1202
+ paging = meta.paging if meta else None
1203
+ if not paging or not paging.has_more:
1204
+ break
1205
+ cursor = paging.next_cursor
1206
+
1207
+ async def aclose(self) -> None:
1208
+ """Close the underlying async httpx client."""
1209
+ await self._http.aclose()
1210
+
1211
+ async def __aenter__(self) -> "CPluginWebApiAsyncClient":
1212
+ return self
1213
+
1214
+ async def __aexit__(self, *exc: Any) -> None:
1215
+ await self.aclose()