20#ifndef ORES_COMMS_MESSAGING_MESSAGE_TYPES_HPP
21#define ORES_COMMS_MESSAGING_MESSAGE_TYPES_HPP
25#include "ores.utility/serialization/error_code.hpp"
28#ifdef MAGIC_ENUM_RANGE_MIN
29#undef MAGIC_ENUM_RANGE_MIN
31#ifdef MAGIC_ENUM_RANGE_MAX
32#undef MAGIC_ENUM_RANGE_MAX
34#define MAGIC_ENUM_RANGE_MIN 0
35#define MAGIC_ENUM_RANGE_MAX 0x7000
37#include <magic_enum/magic_enum.hpp>
42constexpr std::uint32_t PROTOCOL_MAGIC = 0x4F524553;
233constexpr std::uint16_t PROTOCOL_VERSION_MAJOR = 24;
234constexpr std::uint16_t PROTOCOL_VERSION_MINOR = 0;
237constexpr std::uint16_t CORE_SUBSYSTEM_MIN = 0x0000;
238constexpr std::uint16_t CORE_SUBSYSTEM_MAX = 0x0FFF;
239constexpr std::uint16_t RISK_SUBSYSTEM_MIN = 0x1000;
240constexpr std::uint16_t RISK_SUBSYSTEM_MAX = 0x1FFF;
241constexpr std::uint16_t IAM_SUBSYSTEM_MIN = 0x2000;
242constexpr std::uint16_t IAM_SUBSYSTEM_MAX = 0x2FFF;
243constexpr std::uint16_t VARIABILITY_SUBSYSTEM_MIN = 0x3000;
244constexpr std::uint16_t VARIABILITY_SUBSYSTEM_MAX = 0x3FFF;
245constexpr std::uint16_t ASSETS_SUBSYSTEM_MIN = 0x4000;
246constexpr std::uint16_t ASSETS_SUBSYSTEM_MAX = 0x4FFF;
247constexpr std::uint16_t TELEMETRY_SUBSYSTEM_MIN = 0x5000;
248constexpr std::uint16_t TELEMETRY_SUBSYSTEM_MAX = 0x5FFF;
249constexpr std::uint16_t DQ_SUBSYSTEM_MIN = 0x6000;
250constexpr std::uint16_t DQ_SUBSYSTEM_MAX = 0x6FFF;
266enum class message_type {
268 handshake_request = 0x0001,
269 handshake_response = 0x0002,
270 handshake_ack = 0x0003,
271 error_response = 0x0004,
276 subscribe_request = 0x0010,
277 subscribe_response = 0x0011,
278 unsubscribe_request = 0x0012,
279 unsubscribe_response = 0x0013,
280 notification = 0x0014,
281 list_event_channels_request = 0x0015,
282 list_event_channels_response = 0x0016,
285 database_status_notification = 0x0020,
289 get_currencies_request = 0x1001,
290 get_currencies_response = 0x1002,
291 save_currency_request = 0x1003,
292 save_currency_response = 0x1004,
293 delete_currency_request = 0x1005,
294 delete_currency_response = 0x1006,
295 get_currency_history_request = 0x1007,
296 get_currency_history_response = 0x1008,
299 get_countries_request = 0x1009,
300 get_countries_response = 0x100A,
301 save_country_request = 0x100B,
302 save_country_response = 0x100C,
303 delete_country_request = 0x100D,
304 delete_country_response = 0x100E,
305 get_country_history_request = 0x100F,
306 get_country_history_response = 0x1010,
310 get_accounts_request = 0x2003,
311 get_accounts_response = 0x2004,
312 login_request = 0x2005,
313 login_response = 0x2006,
314 unlock_account_request = 0x2007,
315 unlock_account_response = 0x2008,
316 delete_account_request = 0x2009,
317 delete_account_response = 0x200A,
318 list_login_info_request = 0x200B,
319 list_login_info_response = 0x200C,
320 logout_request = 0x200D,
321 logout_response = 0x200E,
322 create_initial_admin_request = 0x200F,
323 create_initial_admin_response = 0x2010,
324 bootstrap_status_request = 0x2011,
325 bootstrap_status_response = 0x2012,
326 lock_account_request = 0x2013,
327 lock_account_response = 0x2014,
328 save_account_request = 0x2015,
329 save_account_response = 0x2016,
330 get_account_history_request = 0x2017,
331 get_account_history_response = 0x2018,
332 reset_password_request = 0x2019,
333 reset_password_response = 0x201A,
334 change_password_request = 0x201B,
335 change_password_response = 0x201C,
336 update_my_email_request = 0x201D,
337 update_my_email_response = 0x201E,
340 list_roles_request = 0x2020,
341 list_roles_response = 0x2021,
342 list_permissions_request = 0x2022,
343 list_permissions_response = 0x2023,
344 assign_role_request = 0x2024,
345 assign_role_response = 0x2025,
346 revoke_role_request = 0x2026,
347 revoke_role_response = 0x2027,
348 get_account_roles_request = 0x2028,
349 get_account_roles_response = 0x2029,
350 get_account_permissions_request = 0x202A,
351 get_account_permissions_response = 0x202B,
352 get_role_request = 0x202C,
353 get_role_response = 0x202D,
356 signup_request = 0x2030,
357 signup_response = 0x2031,
360 list_sessions_request = 0x2040,
361 list_sessions_response = 0x2041,
362 get_session_statistics_request = 0x2042,
363 get_session_statistics_response = 0x2043,
364 get_active_sessions_request = 0x2044,
365 get_active_sessions_response = 0x2045,
368 get_feature_flags_request = 0x3000,
369 get_feature_flags_response = 0x3001,
370 save_feature_flag_request = 0x3002,
371 save_feature_flag_response = 0x3003,
372 delete_feature_flag_request = 0x3004,
373 delete_feature_flag_response = 0x3005,
374 get_feature_flag_history_request = 0x3006,
375 get_feature_flag_history_response = 0x3007,
379 get_images_request = 0x4002,
380 get_images_response = 0x4003,
381 list_images_request = 0x4004,
382 list_images_response = 0x4005,
385 submit_log_records_request = 0x5000,
386 submit_telemetry_response = 0x5001,
387 get_telemetry_logs_request = 0x5010,
388 get_telemetry_logs_response = 0x5011,
389 get_telemetry_stats_request = 0x5020,
390 get_telemetry_stats_response = 0x5021,
394 get_catalogs_request = 0x6000,
395 get_catalogs_response = 0x6001,
396 save_catalog_request = 0x6002,
397 save_catalog_response = 0x6003,
398 delete_catalog_request = 0x6004,
399 delete_catalog_response = 0x6005,
400 get_catalog_history_request = 0x6006,
401 get_catalog_history_response = 0x6007,
403 get_data_domains_request = 0x6008,
404 get_data_domains_response = 0x6009,
405 save_data_domain_request = 0x600A,
406 save_data_domain_response = 0x600B,
407 delete_data_domain_request = 0x600C,
408 delete_data_domain_response = 0x600D,
409 get_data_domain_history_request = 0x600E,
410 get_data_domain_history_response = 0x600F,
412 get_subject_areas_request = 0x6010,
413 get_subject_areas_response = 0x6011,
414 get_subject_areas_by_domain_request = 0x6012,
415 get_subject_areas_by_domain_response = 0x6013,
416 save_subject_area_request = 0x6014,
417 save_subject_area_response = 0x6015,
418 delete_subject_area_request = 0x6016,
419 delete_subject_area_response = 0x6017,
420 get_subject_area_history_request = 0x6018,
421 get_subject_area_history_response = 0x6019,
424 get_datasets_request = 0x6020,
425 get_datasets_response = 0x6021,
426 save_dataset_request = 0x6022,
427 save_dataset_response = 0x6023,
428 delete_dataset_request = 0x6024,
429 delete_dataset_response = 0x6025,
430 get_dataset_history_request = 0x6026,
431 get_dataset_history_response = 0x6027,
433 get_methodologies_request = 0x6028,
434 get_methodologies_response = 0x6029,
435 save_methodology_request = 0x602A,
436 save_methodology_response = 0x602B,
437 delete_methodology_request = 0x602C,
438 delete_methodology_response = 0x602D,
439 get_methodology_history_request = 0x602E,
440 get_methodology_history_response = 0x602F,
443 get_coding_schemes_request = 0x6030,
444 get_coding_schemes_response = 0x6031,
445 get_coding_schemes_by_authority_type_request = 0x6032,
446 get_coding_schemes_by_authority_type_response = 0x6033,
447 save_coding_scheme_request = 0x6034,
448 save_coding_scheme_response = 0x6035,
449 delete_coding_scheme_request = 0x6036,
450 delete_coding_scheme_response = 0x6037,
451 get_coding_scheme_history_request = 0x6038,
452 get_coding_scheme_history_response = 0x6039,
454 get_coding_scheme_authority_types_request = 0x603A,
455 get_coding_scheme_authority_types_response = 0x603B,
456 save_coding_scheme_authority_type_request = 0x603C,
457 save_coding_scheme_authority_type_response = 0x603D,
458 delete_coding_scheme_authority_type_request = 0x603E,
459 delete_coding_scheme_authority_type_response = 0x603F,
460 get_coding_scheme_authority_type_history_request = 0x6040,
461 get_coding_scheme_authority_type_history_response = 0x6041,
464 get_nature_dimensions_request = 0x6050,
465 get_nature_dimensions_response = 0x6051,
466 save_nature_dimension_request = 0x6052,
467 save_nature_dimension_response = 0x6053,
468 delete_nature_dimension_request = 0x6054,
469 delete_nature_dimension_response = 0x6055,
470 get_nature_dimension_history_request = 0x6056,
471 get_nature_dimension_history_response = 0x6057,
473 get_origin_dimensions_request = 0x6058,
474 get_origin_dimensions_response = 0x6059,
475 save_origin_dimension_request = 0x605A,
476 save_origin_dimension_response = 0x605B,
477 delete_origin_dimension_request = 0x605C,
478 delete_origin_dimension_response = 0x605D,
479 get_origin_dimension_history_request = 0x605E,
480 get_origin_dimension_history_response = 0x605F,
482 get_treatment_dimensions_request = 0x6060,
483 get_treatment_dimensions_response = 0x6061,
484 save_treatment_dimension_request = 0x6062,
485 save_treatment_dimension_response = 0x6063,
486 delete_treatment_dimension_request = 0x6064,
487 delete_treatment_dimension_response = 0x6065,
488 get_treatment_dimension_history_request = 0x6066,
489 get_treatment_dimension_history_response = 0x6067,
493 get_change_reason_categories_request = 0x6070,
494 get_change_reason_categories_response = 0x6071,
495 get_change_reasons_request = 0x6072,
496 get_change_reasons_response = 0x6073,
497 get_change_reasons_by_category_request = 0x6074,
498 get_change_reasons_by_category_response = 0x6075,
499 save_change_reason_request = 0x6076,
500 save_change_reason_response = 0x6077,
501 delete_change_reason_request = 0x6078,
502 delete_change_reason_response = 0x6079,
503 get_change_reason_history_request = 0x607A,
504 get_change_reason_history_response = 0x607B,
505 save_change_reason_category_request = 0x607C,
506 save_change_reason_category_response = 0x607D,
507 delete_change_reason_category_request = 0x607E,
508 delete_change_reason_category_response = 0x607F,
509 get_change_reason_category_history_request = 0x6080,
510 get_change_reason_category_history_response = 0x6081,
513 get_dataset_dependencies_request = 0x6082,
514 get_dataset_dependencies_response = 0x6083,
515 get_dataset_dependencies_by_dataset_request = 0x6084,
516 get_dataset_dependencies_by_dataset_response = 0x6085,
519 publish_datasets_request = 0x6090,
520 publish_datasets_response = 0x6091,
521 get_publications_request = 0x6092,
522 get_publications_response = 0x6093,
523 resolve_dependencies_request = 0x6094,
524 resolve_dependencies_response = 0x6095,
527 get_dataset_bundles_request = 0x60A0,
528 get_dataset_bundles_response = 0x60A1,
529 save_dataset_bundle_request = 0x60A2,
530 save_dataset_bundle_response = 0x60A3,
531 delete_dataset_bundle_request = 0x60A4,
532 delete_dataset_bundle_response = 0x60A5,
533 get_dataset_bundle_history_request = 0x60A6,
534 get_dataset_bundle_history_response = 0x60A7,
537 get_dataset_bundle_members_request = 0x60B0,
538 get_dataset_bundle_members_response = 0x60B1,
539 get_dataset_bundle_members_by_bundle_request = 0x60B2,
540 get_dataset_bundle_members_by_bundle_response = 0x60B3,
541 save_dataset_bundle_member_request = 0x60B4,
542 save_dataset_bundle_member_response = 0x60B5,
543 delete_dataset_bundle_member_request = 0x60B6,
544 delete_dataset_bundle_member_response = 0x60B7,
547 publish_bundle_request = 0x60B8,
548 publish_bundle_response = 0x60B9,
560inline std::ostream& operator<<(std::ostream& os, message_type mt) {
561 auto name = magic_enum::enum_name(mt);
567 return os <<
" (0x" << std::hex << static_cast<std::uint16_t>(mt) << std::dec <<
")";
576inline std::ostream& operator<<(std::ostream& os, ores::utility::serialization::error_code ec) {
577 return os << magic_enum::enum_name(ec)
578 <<
" (0x" << std::hex << static_cast<std::uint16_t>(ec) << std::dec <<
")";
585 return os << magic_enum::enum_name(ct)
586 <<
" (0x" << std::hex << static_cast<std::uint8_t>(ct) << std::dec <<
")";
592inline std::string
to_string(ores::utility::serialization::error_code ec) {
593 return std::string(magic_enum::enum_name(ec));
Contains messaging related infrastructure in the comms library.
Definition assets_protocol.hpp:122
std::string to_string(ores::utility::serialization::error_code ec)
Convert error_code to string for display.
Definition message_types.hpp:592
compression_type
Compression algorithm used for payload compression.
Definition message_types.hpp:259