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,408 @@
1
+ """Real-time SignalR clients for the MT4/MT5 v2 hubs.
2
+
3
+ ! EXPERIMENTAL. There is no official Python SignalR client; this wraps the
4
+ community library ``signalrcore``, which is an OPTIONAL dependency. Install with::
5
+
6
+ pip install "mywebapi-sdk[signalr]"
7
+
8
+ The REST surface of this SDK works without it — only these realtime clients
9
+ require it, and they raise ``SignalRNotInstalledError`` with an install hint if
10
+ it is missing.
11
+
12
+ ! ``signalrcore`` is callback-first (synchronous observer model), unlike the
13
+ TypeScript ``@microsoft/signalr`` async-iterable surface. Streams therefore
14
+ take a callback via ``.subscribe()`` and return a subscription handle, rather
15
+ than yielding via ``async for``.
16
+
17
+ Usage::
18
+
19
+ from cplugin_webapi_sdk import CPluginWebApiClient
20
+
21
+ with CPluginWebApiClient(env="staging", client_id=..., client_secret=...) as c:
22
+ rt = c.realtime.mt4("my-trade-platform-id")
23
+ rt.on_connection_status(lambda *args: print("status", args))
24
+ rt.on_tick(lambda *args: print("tick", args))
25
+
26
+ with rt: # calls start() / stop()
27
+ rt.subscribe_to_ticks("EURUSD")
28
+ import time; time.sleep(5)
29
+ """
30
+ from __future__ import annotations
31
+
32
+ from typing import Any, Callable, Optional
33
+ from urllib.parse import quote
34
+
35
+
36
+ # ---------------------------------------------------------------------------
37
+ # Error surface
38
+ # ---------------------------------------------------------------------------
39
+
40
+
41
+ class SignalRNotInstalledError(RuntimeError):
42
+ """Raised when a realtime client is constructed but ``signalrcore`` is absent.
43
+
44
+ The ``signalrcore`` package is an optional dependency of this SDK. Install it
45
+ with the ``[signalr]`` extra::
46
+
47
+ pip install "mywebapi-sdk[signalr]"
48
+ """
49
+
50
+ def __init__(self) -> None:
51
+ super().__init__(
52
+ "Real-time streaming requires the optional 'signalrcore' dependency. "
53
+ 'Install it with: pip install "mywebapi-sdk[signalr]"'
54
+ )
55
+
56
+
57
+ # ---------------------------------------------------------------------------
58
+ # Internal helpers
59
+ # ---------------------------------------------------------------------------
60
+
61
+
62
+ def _import_signalr():
63
+ """Return ``HubConnectionBuilder`` from ``signalrcore``.
64
+
65
+ * Lazy import isolated in a helper so tests can monkeypatch it and so the
66
+ * package imports cleanly when the extra is not installed.
67
+ """
68
+ try:
69
+ from signalrcore.hub_connection_builder import HubConnectionBuilder # type: ignore
70
+ except ImportError as exc: # ! callers convert this to SignalRNotInstalledError
71
+ raise ImportError("signalrcore not installed") from exc
72
+ return HubConnectionBuilder
73
+
74
+
75
+ def _build_hub_url(base_url: str, platform: str, trade_platform: str) -> str:
76
+ """Build the fully-qualified hub WebSocket URL.
77
+
78
+ * Mirror the TS hub-URL construction exactly: strip trailing slashes off
79
+ * the base, append ``/hubs/<platform>/v2``, then the URL-encoded
80
+ * ``tradePlatform`` query parameter.
81
+
82
+ Args:
83
+ base_url: Resolved API base URL (trailing slash stripped here).
84
+ platform: Hub platform segment — ``"mt4"`` or ``"mt5"``.
85
+ trade_platform: Trade platform identifier (URL-encoded in output).
86
+
87
+ Returns:
88
+ Fully-qualified URL string for the hub negotiate endpoint.
89
+ """
90
+ base = base_url.rstrip("/")
91
+ return f"{base}/hubs/{platform}/v2?tradePlatform={quote(trade_platform, safe='')}"
92
+
93
+
94
+ # ---------------------------------------------------------------------------
95
+ # Base connection lifecycle
96
+ # ---------------------------------------------------------------------------
97
+
98
+
99
+ class _BaseRealtimeClient:
100
+ """Shared connection lifecycle for the MT4/MT5 realtime clients.
101
+
102
+ ! EXPERIMENTAL — see module docstring for caveats on ``signalrcore``.
103
+
104
+ Subclasses set ``_PLATFORM`` to ``"mt4"`` or ``"mt5"`` and expose
105
+ platform-specific callback and stream methods on top.
106
+ """
107
+
108
+ # * Overridden by MT4RealtimeClient / MT5RealtimeClient.
109
+ _PLATFORM: str = ""
110
+
111
+ def __init__(
112
+ self,
113
+ *,
114
+ base_url: str,
115
+ token_factory: Callable[[], str],
116
+ trade_platform: str,
117
+ ) -> None:
118
+ """Construct and wire the hub connection.
119
+
120
+ Args:
121
+ base_url: Resolved API base URL (e.g. ``https://pre.mywebapi.com``).
122
+ token_factory: Zero-arg callable returning the current bearer token
123
+ string. ``signalrcore`` calls this at negotiate time
124
+ and attaches the result as ``?access_token=…`` on the
125
+ WebSocket handshake.
126
+ trade_platform: Platform identifier appended as ``?tradePlatform=…``
127
+ on the hub URL.
128
+
129
+ Raises:
130
+ ValueError: If ``trade_platform`` is empty.
131
+ SignalRNotInstalledError: If ``signalrcore`` is not installed.
132
+ """
133
+ if not trade_platform:
134
+ raise ValueError("trade_platform is required")
135
+
136
+ try:
137
+ builder_cls = _import_signalr()
138
+ except ImportError:
139
+ raise SignalRNotInstalledError() from None
140
+
141
+ self.hub_url: str = _build_hub_url(base_url, self._PLATFORM, trade_platform)
142
+ self._token_factory: Callable[[], str] = token_factory
143
+
144
+ # * access_token_factory lets signalrcore fetch a fresh token at negotiate
145
+ # * time and append it as ?access_token=… for the WebSocket handshake.
146
+ self._conn = (
147
+ builder_cls()
148
+ .with_url(
149
+ self.hub_url,
150
+ options={"access_token_factory": token_factory},
151
+ )
152
+ .build()
153
+ )
154
+ self._started: bool = False
155
+
156
+ # * --- lifecycle ---------------------------------------------------------
157
+
158
+ def on_connection_status(self, handler: Callable[[Any], None]) -> None:
159
+ """Register a callback for ``OnConnectionStatus`` events from the hub.
160
+
161
+ ! Register all callbacks BEFORE ``start()`` — ``signalrcore`` may drop
162
+ ! handlers registered after the connection is already open. Same race
163
+ ! the TS client guards against with a pending-handler queue.
164
+
165
+ Args:
166
+ handler: Callable invoked with the raw event payload when the hub
167
+ broadcasts a connection status change.
168
+ """
169
+ # ! Register before start() — signalrcore may drop late handlers.
170
+ self._conn.on("OnConnectionStatus", handler)
171
+
172
+ def start(self) -> None:
173
+ """Open the WebSocket connection to the hub.
174
+
175
+ ! Register all callbacks BEFORE calling ``start()`` — see the class
176
+ ! docstring for the handler-registration ordering requirement.
177
+ """
178
+ self._conn.start()
179
+ self._started = True
180
+
181
+ def stop(self) -> None:
182
+ """Close the WebSocket connection to the hub."""
183
+ if self._started:
184
+ self._conn.stop()
185
+ self._started = False
186
+
187
+ def __enter__(self) -> "_BaseRealtimeClient":
188
+ self.start()
189
+ return self
190
+
191
+ def __exit__(self, *exc: Any) -> None:
192
+ self.stop()
193
+
194
+ def _stream(self, method: str, args: Optional[list] = None):
195
+ """Return a ``StreamHandler`` for the named server-streaming method.
196
+
197
+ * ``signalrcore`` stream() returns an observable; call ``.subscribe(observer)``
198
+ * on the result to wire ``next`` / ``complete`` / ``error`` callbacks::
199
+ *
200
+ * rt.stream_trades().subscribe({
201
+ * "next": lambda item: print(item),
202
+ * "complete": lambda: print("done"),
203
+ * "error": lambda err: print("err", err),
204
+ * })
205
+
206
+ Args:
207
+ method: Server-streaming method name (e.g. ``"StreamTrades"``).
208
+ args: Optional positional arguments passed to the server method.
209
+
210
+ Returns:
211
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()`` on it.
212
+ """
213
+ return self._conn.stream(method, args or [])
214
+
215
+
216
+ # ---------------------------------------------------------------------------
217
+ # MT4 realtime client
218
+ # ---------------------------------------------------------------------------
219
+
220
+
221
+ class MT4RealtimeClient(_BaseRealtimeClient):
222
+ """Real-time client for the MT4 v2 hub (``/hubs/mt4/v2``).
223
+
224
+ ! EXPERIMENTAL — see module docstring.
225
+
226
+ Obtain via ``client.realtime.mt4(trade_platform)``; do NOT instantiate
227
+ directly unless you manage the ``base_url`` and ``token_factory`` yourself.
228
+
229
+ Server method names mirror the TypeScript SDK verbatim::
230
+
231
+ Callbacks: OnTick, OnConnectionStatus
232
+ Invokes: SubscribeToTicks, UnsubscribeFromTicks
233
+ Streams: StreamTicks, StreamTrades, StreamUserUpdates,
234
+ StreamSymbolUpdates, StreamMarginCallUpdates
235
+ """
236
+
237
+ _PLATFORM = "mt4"
238
+
239
+ # * --- callbacks --------------------------------------------------------
240
+
241
+ def on_tick(self, handler: Callable[[Any], None]) -> None:
242
+ """Register a callback for ``OnTick`` events broadcast by the hub.
243
+
244
+ ! Register before ``start()`` — see lifecycle ordering note.
245
+
246
+ Args:
247
+ handler: Callable invoked with the raw tick payload per event.
248
+ """
249
+ # ! Register before start() — signalrcore may drop late handlers.
250
+ self._conn.on("OnTick", handler)
251
+
252
+ # * --- invocations ------------------------------------------------------
253
+
254
+ def subscribe_to_ticks(self, symbol: str) -> None:
255
+ """Ask the server to start pushing ``OnTick`` events for ``symbol``.
256
+
257
+ Args:
258
+ symbol: Instrument name (e.g. ``"EURUSD"``).
259
+ """
260
+ self._conn.send("SubscribeToTicks", [symbol])
261
+
262
+ def unsubscribe_from_ticks(self, symbol: str) -> None:
263
+ """Ask the server to stop pushing ``OnTick`` events for ``symbol``.
264
+
265
+ Args:
266
+ symbol: Instrument name (e.g. ``"EURUSD"``).
267
+ """
268
+ self._conn.send("UnsubscribeFromTicks", [symbol])
269
+
270
+ # * --- server-streaming methods -----------------------------------------
271
+ # * Call .subscribe({"next": cb, "complete": cb, "error": cb}) on each.
272
+
273
+ def stream_ticks(self, symbol: str):
274
+ """Stream server-side tick data for a single symbol.
275
+
276
+ Args:
277
+ symbol: Instrument name (e.g. ``"EURUSD"``).
278
+
279
+ Returns:
280
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()``.
281
+ """
282
+ return self._stream("StreamTicks", [symbol])
283
+
284
+ def stream_trades(self):
285
+ """Stream open trade updates.
286
+
287
+ Returns:
288
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()``.
289
+ """
290
+ return self._stream("StreamTrades")
291
+
292
+ def stream_user_updates(self):
293
+ """Stream user account change events.
294
+
295
+ Returns:
296
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()``.
297
+ """
298
+ return self._stream("StreamUserUpdates")
299
+
300
+ def stream_symbol_updates(self):
301
+ """Stream symbol configuration change events.
302
+
303
+ Returns:
304
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()``.
305
+ """
306
+ return self._stream("StreamSymbolUpdates")
307
+
308
+ def stream_margin_call_updates(self):
309
+ """Stream margin-call status events.
310
+
311
+ Returns:
312
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()``.
313
+ """
314
+ return self._stream("StreamMarginCallUpdates")
315
+
316
+
317
+ # ---------------------------------------------------------------------------
318
+ # MT5 realtime client
319
+ # ---------------------------------------------------------------------------
320
+
321
+
322
+ class MT5RealtimeClient(_BaseRealtimeClient):
323
+ """Real-time client for the MT5 v2 hub (``/hubs/mt5/v2``).
324
+
325
+ ! EXPERIMENTAL — see module docstring.
326
+
327
+ Obtain via ``client.realtime.mt5(trade_platform)``; do NOT instantiate
328
+ directly unless you manage the ``base_url`` and ``token_factory`` yourself.
329
+
330
+ Server method names mirror the TypeScript SDK verbatim::
331
+
332
+ Callbacks: OnConnectionStatus
333
+ Streams: StreamMarginCallUpdates
334
+ """
335
+
336
+ _PLATFORM = "mt5"
337
+
338
+ # * --- server-streaming methods -----------------------------------------
339
+
340
+ def stream_margin_call_updates(self):
341
+ """Stream margin-call status events from the MT5 hub.
342
+
343
+ Returns:
344
+ ``signalrcore.hub.handlers.StreamHandler`` — call ``.subscribe()``.
345
+ """
346
+ return self._stream("StreamMarginCallUpdates")
347
+
348
+
349
+ # ---------------------------------------------------------------------------
350
+ # Namespace factory
351
+ # ---------------------------------------------------------------------------
352
+
353
+
354
+ class RealtimeNamespace:
355
+ """Factory bound to a client's base URL and token provider.
356
+
357
+ Exposed as ``client.realtime``; call ``.mt4(tp)`` / ``.mt5(tp)`` to create
358
+ a hub client for a specific trade platform.
359
+
360
+ ! Requires the optional ``signalrcore`` extra — see module docstring.
361
+ """
362
+
363
+ def __init__(
364
+ self,
365
+ *,
366
+ base_url: str,
367
+ token_factory: Callable[[], str],
368
+ ) -> None:
369
+ self._base_url = base_url
370
+ self._token_factory = token_factory
371
+
372
+ def mt4(self, trade_platform: str) -> MT4RealtimeClient:
373
+ """Create an MT4 realtime hub client for the given trade platform.
374
+
375
+ Args:
376
+ trade_platform: Trade platform identifier (UUID string or slug).
377
+
378
+ Returns:
379
+ A new :class:`MT4RealtimeClient` — call ``start()`` / ``stop()``
380
+ or use it as a context manager.
381
+
382
+ Raises:
383
+ SignalRNotInstalledError: If ``signalrcore`` is not installed.
384
+ """
385
+ return MT4RealtimeClient(
386
+ base_url=self._base_url,
387
+ token_factory=self._token_factory,
388
+ trade_platform=trade_platform,
389
+ )
390
+
391
+ def mt5(self, trade_platform: str) -> MT5RealtimeClient:
392
+ """Create an MT5 realtime hub client for the given trade platform.
393
+
394
+ Args:
395
+ trade_platform: Trade platform identifier (UUID string or slug).
396
+
397
+ Returns:
398
+ A new :class:`MT5RealtimeClient` — call ``start()`` / ``stop()``
399
+ or use it as a context manager.
400
+
401
+ Raises:
402
+ SignalRNotInstalledError: If ``signalrcore`` is not installed.
403
+ """
404
+ return MT5RealtimeClient(
405
+ base_url=self._base_url,
406
+ token_factory=self._token_factory,
407
+ trade_platform=trade_platform,
408
+ )
@@ -0,0 +1,197 @@
1
+ """Request timeouts, retry classification and idempotency keys.
2
+
3
+ The server gives every call addressed to a trade platform a deadline. When the
4
+ trade server does not answer in time the API still answers (v2: HTTP 200 with an
5
+ error envelope), and the error code plus the ``X-Request-Outcome`` header say
6
+ whether the operation may still be applied:
7
+
8
+ - ``Timeout`` / ``timeout`` — a read did not finish; nothing changed. Safe to retry.
9
+ - ``Busy`` / ``not-started`` — refused before it was sent. Safe to retry.
10
+ - ``OutcomeUnknown`` / ``unknown`` — a trade or change did not finish and may still
11
+ be applied. Check the result; never retry blindly.
12
+ - ``OutcomeUnknown`` / ``in-progress`` — a request with the same ``Idempotency-Key``
13
+ is still running; this one was not executed.
14
+
15
+ Default deadlines per operation kind: trade 5 s, read 10 s, change 15 s,
16
+ history 30 s, maintenance 60 s. A caller chooses its own with ``X-Request-Timeout``
17
+ (seconds, 1–300); the applied value comes back in ``X-Request-Timeout-Applied``.
18
+ """
19
+ from __future__ import annotations
20
+
21
+ import math
22
+ from typing import Any
23
+
24
+ # * Wire names.
25
+ REQUEST_TIMEOUT_HEADER = "X-Request-Timeout"
26
+ APPLIED_TIMEOUT_HEADER = "X-Request-Timeout-Applied"
27
+ OUTCOME_HEADER = "X-Request-Outcome"
28
+ IDEMPOTENCY_KEY_HEADER = "Idempotency-Key"
29
+
30
+ # * Bounds the server accepts for X-Request-Timeout; anything else answers Validation.
31
+ MIN_REQUEST_TIMEOUT = 1.0
32
+ MAX_REQUEST_TIMEOUT = 300.0
33
+
34
+ # * Longest Idempotency-Key the server accepts (draft-ietf-httpapi-idempotency-key-header).
35
+ MAX_IDEMPOTENCY_KEY_LENGTH = 255
36
+
37
+ # * How much longer than the requested server deadline the HTTP client waits.
38
+ # ! The server may extend its deadline by the time it spends opening the trade-platform
39
+ # ! connection for this request — up to 20 s — so it can answer as late as
40
+ # ! request_timeout + 20 s. 10 s more covers the network. A shorter margin makes the
41
+ # ! client give up first and lose the answer that says whether a trade was applied.
42
+ # ? Not a hard bound: the server's deadline starts after it has read the body and taken
43
+ # ? the idempotency key, and those steps have no deadline of their own.
44
+ TRANSPORT_TIMEOUT_MARGIN = 30.0
45
+
46
+ # * Default client-wide HTTP timeout. A call to a trade platform waits longer when its
47
+ # server deadline needs it (see transport_timeout); this is the floor.
48
+ DEFAULT_TRANSPORT_TIMEOUT = 30.0
49
+
50
+ # * Deadline assumed for an operation whose spec documents no X-Request-Timeout
51
+ # default: the longest server default, maintenance. Every operation of the
52
+ # current spec documents one; this covers a server that adds an operation
53
+ # before the SDK is regenerated.
54
+ UNDOCUMENTED_OPERATION_TIMEOUT = 60.0
55
+
56
+
57
+ class ErrorCode:
58
+ """Values of ``error.code`` (``ApiError.code``) in a v2 envelope.
59
+
60
+ The code is a plain string on the wire; unknown future codes arrive unchanged.
61
+ """
62
+
63
+ OK = "Ok"
64
+ NO_CONNECT = "NoConnect"
65
+ VALIDATION = "Validation"
66
+ MT4_ERROR = "MT4Error"
67
+ FORBIDDEN = "Forbidden"
68
+ NOT_FOUND = "NotFound"
69
+ MT5_ERROR = "MT5Error"
70
+ #: A read did not finish in time. Nothing changed; safe to retry.
71
+ TIMEOUT = "Timeout"
72
+ #: A trade or change did not finish in time and may still be applied, or a request
73
+ #: with the same idempotency key is still running. Check the result before retrying.
74
+ OUTCOME_UNKNOWN = "OutcomeUnknown"
75
+ #: Too many requests wait for this trade platform; not sent. Safe to retry.
76
+ BUSY = "Busy"
77
+ INTERNAL = "Internal"
78
+ #: Produced by the SDK, not the server: the body was not a v2 envelope
79
+ #: (e.g. an HTML 502/504 page from a proxy).
80
+ INVALID_RESPONSE = "InvalidResponse"
81
+
82
+
83
+ class RequestOutcome:
84
+ """Values of the ``X-Request-Outcome`` response header (``ApiError.outcome``)."""
85
+
86
+ #: The operation did not finish in time and changed nothing.
87
+ TIMEOUT = "timeout"
88
+ #: A trade or change did not finish in time and may still be applied.
89
+ UNKNOWN = "unknown"
90
+ #: The request was refused before it reached the trade server.
91
+ NOT_STARTED = "not-started"
92
+ #: A request with the same idempotency key is still being processed; this one was not executed.
93
+ IN_PROGRESS = "in-progress"
94
+
95
+
96
+ _SAFE_CODES = frozenset({ErrorCode.TIMEOUT, ErrorCode.BUSY})
97
+ _SAFE_OUTCOMES = frozenset({RequestOutcome.TIMEOUT, RequestOutcome.NOT_STARTED})
98
+ _UNKNOWN_OUTCOMES = frozenset({RequestOutcome.UNKNOWN, RequestOutcome.IN_PROGRESS})
99
+
100
+
101
+ def validate_request_timeout(value: Any, *, name: str = "request_timeout") -> float | None:
102
+ """Return ``value`` as seconds, ``None`` for ``None``; raise ``ValueError``/``TypeError`` otherwise.
103
+
104
+ The server accepts 1 to 300 seconds, fractions included.
105
+ """
106
+ if value is None:
107
+ return None
108
+ # ! bool is an int subclass: True would silently mean one second.
109
+ if isinstance(value, bool) or not isinstance(value, (int, float)):
110
+ raise TypeError(f"{name} must be a number of seconds, got {type(value).__name__}")
111
+ seconds = float(value)
112
+ if math.isnan(seconds) or not MIN_REQUEST_TIMEOUT <= seconds <= MAX_REQUEST_TIMEOUT:
113
+ raise ValueError(
114
+ f"{name} must be from {MIN_REQUEST_TIMEOUT:g} to {MAX_REQUEST_TIMEOUT:g} seconds, got {value!r}"
115
+ )
116
+ return seconds
117
+
118
+
119
+ def validate_idempotency_key(value: Any) -> str | None:
120
+ """Return the key unchanged, ``None`` for ``None``; reject empty, over-long or non-ASCII keys."""
121
+ if value is None:
122
+ return None
123
+ if not isinstance(value, str):
124
+ raise TypeError(f"idempotency_key must be a str, got {type(value).__name__}")
125
+ if not value.strip():
126
+ raise ValueError("idempotency_key must not be empty")
127
+ if len(value) > MAX_IDEMPOTENCY_KEY_LENGTH:
128
+ raise ValueError(f"idempotency_key must be at most {MAX_IDEMPOTENCY_KEY_LENGTH} characters")
129
+ # ! An HTTP header value must be printable ASCII; httpx would otherwise fail
130
+ # ! with an encoding error far from the caller's line.
131
+ if not value.isascii() or not value.isprintable():
132
+ raise ValueError("idempotency_key must be printable ASCII")
133
+ return value
134
+
135
+
136
+ def format_seconds(seconds: float) -> str:
137
+ """Seconds as the server writes them: invariant culture, up to three decimals (``10``, ``2.5``)."""
138
+ return f"{seconds:.3f}".rstrip("0").rstrip(".")
139
+
140
+
141
+ def operation_default_timeout(op_module: object) -> float:
142
+ """Server default deadline of a generated operation, from the spec; 60 s when it documents none."""
143
+ from ._generated.operation_timeouts import DEFAULTS
144
+
145
+ name = getattr(op_module, "__name__", "")
146
+ key = ".".join(name.rsplit(".", 2)[-2:])
147
+ return DEFAULTS.get(key, UNDOCUMENTED_OPERATION_TIMEOUT)
148
+
149
+
150
+ def transport_timeout(base: float | None, server_timeout: float) -> float | None:
151
+ """HTTP client timeout for one call: ``server_timeout`` + margin, never below ``base``.
152
+
153
+ ``server_timeout`` is the requested deadline, else the operation's default.
154
+ ``base`` is the client-wide timeout (``None`` = no limit, which already waits long enough).
155
+ """
156
+ if base is None:
157
+ return None
158
+ return max(base, server_timeout + TRANSPORT_TIMEOUT_MARGIN)
159
+
160
+
161
+ def _code_and_outcome(error: BaseException) -> tuple[str | None, str | None]:
162
+ code = getattr(error, "code", None)
163
+ outcome = getattr(error, "outcome", None)
164
+ return (code if isinstance(code, str) else None, outcome if isinstance(outcome, str) else None)
165
+
166
+
167
+ def is_outcome_unknown(error: BaseException) -> bool:
168
+ """Whether the failed operation may still be applied by the trade server.
169
+
170
+ True for ``OutcomeUnknown`` (``X-Request-Outcome: unknown`` or ``in-progress``).
171
+ Do not repeat such a request blindly — for a trade that means a second trade.
172
+ Check the result (orders, positions, balance, the changed record), or repeat it
173
+ with the **same** ``idempotency_key``: while the first one runs you get
174
+ ``in-progress`` again, once it has finished you get its real result without it
175
+ being executed twice.
176
+
177
+ Anything that is not an ``ApiError`` returns False: the SDK cannot tell from a
178
+ transport exception (``httpx.ReadTimeout``) whether the request was a write — for a
179
+ trade or change treat those as unknown too.
180
+ """
181
+ code, outcome = _code_and_outcome(error)
182
+ return code == ErrorCode.OUTCOME_UNKNOWN or outcome in _UNKNOWN_OUTCOMES
183
+
184
+
185
+ def is_safe_to_retry(error: BaseException) -> bool:
186
+ """Whether repeating the request cannot apply the operation twice.
187
+
188
+ True for ``Timeout`` (a read that changed nothing) and ``Busy`` (refused before
189
+ it was sent), and for the matching ``X-Request-Outcome`` values ``timeout`` and
190
+ ``not-started``. False for everything else, ``OutcomeUnknown`` above all — other
191
+ codes (``Validation``, ``NotFound``, platform errors) will not succeed on a
192
+ plain retry either.
193
+ """
194
+ if is_outcome_unknown(error):
195
+ return False
196
+ code, outcome = _code_and_outcome(error)
197
+ return code in _SAFE_CODES or outcome in _SAFE_OUTCOMES