couchbase 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -4
  3. data/ext/build_config.hxx.in +2 -0
  4. data/ext/build_version.hxx.in +11 -8
  5. data/ext/cmake/BuildTracing.cmake +1 -1
  6. data/ext/cmake/CompilerWarnings.cmake +5 -0
  7. data/ext/cmake/Testing.cmake +3 -6
  8. data/ext/couchbase/bucket.hxx +9 -1
  9. data/ext/couchbase/cbsasl/client.h +1 -1
  10. data/ext/couchbase/cluster.hxx +89 -6
  11. data/ext/couchbase/configuration.hxx +2 -0
  12. data/ext/couchbase/couchbase.cxx +1647 -507
  13. data/ext/couchbase/diagnostics.hxx +0 -3
  14. data/ext/couchbase/io/dns_client.hxx +2 -2
  15. data/ext/couchbase/io/http_command.hxx +6 -3
  16. data/ext/couchbase/io/http_session.hxx +14 -18
  17. data/ext/couchbase/io/http_session_manager.hxx +83 -2
  18. data/ext/couchbase/io/mcbp_command.hxx +4 -1
  19. data/ext/couchbase/io/mcbp_context.hxx +37 -0
  20. data/ext/couchbase/io/mcbp_session.hxx +91 -30
  21. data/ext/couchbase/operations.hxx +5 -0
  22. data/ext/couchbase/operations/analytics_dataset_create.hxx +3 -2
  23. data/ext/couchbase/operations/analytics_dataset_drop.hxx +3 -2
  24. data/ext/couchbase/operations/analytics_dataset_get_all.hxx +3 -2
  25. data/ext/couchbase/operations/analytics_dataverse_create.hxx +3 -2
  26. data/ext/couchbase/operations/analytics_dataverse_drop.hxx +3 -2
  27. data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +3 -2
  28. data/ext/couchbase/operations/analytics_index_create.hxx +3 -2
  29. data/ext/couchbase/operations/analytics_index_drop.hxx +3 -2
  30. data/ext/couchbase/operations/analytics_index_get_all.hxx +5 -2
  31. data/ext/couchbase/operations/analytics_link_connect.hxx +3 -2
  32. data/ext/couchbase/operations/analytics_link_disconnect.hxx +3 -2
  33. data/ext/couchbase/operations/bucket_create.hxx +3 -2
  34. data/ext/couchbase/operations/bucket_drop.hxx +3 -2
  35. data/ext/couchbase/operations/bucket_flush.hxx +3 -2
  36. data/ext/couchbase/operations/bucket_get.hxx +3 -2
  37. data/ext/couchbase/operations/bucket_get_all.hxx +3 -2
  38. data/ext/couchbase/operations/bucket_update.hxx +3 -2
  39. data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +3 -2
  40. data/ext/couchbase/operations/collection_create.hxx +3 -2
  41. data/ext/couchbase/operations/collection_drop.hxx +3 -2
  42. data/ext/couchbase/operations/collections_manifest_get.hxx +3 -2
  43. data/ext/couchbase/operations/document_analytics.hxx +3 -2
  44. data/ext/couchbase/operations/document_append.hxx +77 -0
  45. data/ext/couchbase/operations/document_decrement.hxx +3 -2
  46. data/ext/couchbase/operations/document_exists.hxx +3 -2
  47. data/ext/couchbase/operations/document_get.hxx +3 -2
  48. data/ext/couchbase/operations/document_get_and_lock.hxx +3 -2
  49. data/ext/couchbase/operations/document_get_and_touch.hxx +3 -2
  50. data/ext/couchbase/operations/document_get_projected.hxx +3 -2
  51. data/ext/couchbase/operations/document_increment.hxx +3 -2
  52. data/ext/couchbase/operations/document_insert.hxx +3 -2
  53. data/ext/couchbase/operations/document_lookup_in.hxx +8 -2
  54. data/ext/couchbase/operations/document_mutate_in.hxx +13 -2
  55. data/ext/couchbase/operations/document_prepend.hxx +77 -0
  56. data/ext/couchbase/operations/document_query.hxx +3 -2
  57. data/ext/couchbase/operations/document_remove.hxx +5 -2
  58. data/ext/couchbase/operations/document_replace.hxx +3 -2
  59. data/ext/couchbase/operations/document_search.hxx +3 -2
  60. data/ext/couchbase/operations/document_touch.hxx +3 -2
  61. data/ext/couchbase/operations/document_unlock.hxx +3 -2
  62. data/ext/couchbase/operations/document_upsert.hxx +3 -2
  63. data/ext/couchbase/operations/document_view.hxx +3 -2
  64. data/ext/couchbase/operations/group_drop.hxx +3 -2
  65. data/ext/couchbase/operations/group_get.hxx +3 -2
  66. data/ext/couchbase/operations/group_get_all.hxx +3 -2
  67. data/ext/couchbase/operations/group_upsert.hxx +3 -2
  68. data/ext/couchbase/operations/http_noop.hxx +78 -0
  69. data/ext/couchbase/operations/mcbp_noop.hxx +61 -0
  70. data/ext/couchbase/operations/query_index_build_deferred.hxx +3 -2
  71. data/ext/couchbase/operations/query_index_create.hxx +3 -2
  72. data/ext/couchbase/operations/query_index_drop.hxx +3 -2
  73. data/ext/couchbase/operations/query_index_get_all.hxx +3 -2
  74. data/ext/couchbase/operations/role_get_all.hxx +3 -2
  75. data/ext/couchbase/operations/scope_create.hxx +3 -2
  76. data/ext/couchbase/operations/scope_drop.hxx +3 -2
  77. data/ext/couchbase/operations/scope_get_all.hxx +3 -2
  78. data/ext/couchbase/operations/search_get_stats.hxx +3 -2
  79. data/ext/couchbase/operations/search_index_analyze_document.hxx +3 -2
  80. data/ext/couchbase/operations/search_index_control_ingest.hxx +3 -2
  81. data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +3 -2
  82. data/ext/couchbase/operations/search_index_control_query.hxx +3 -2
  83. data/ext/couchbase/operations/search_index_drop.hxx +3 -2
  84. data/ext/couchbase/operations/search_index_get.hxx +3 -2
  85. data/ext/couchbase/operations/search_index_get_all.hxx +3 -2
  86. data/ext/couchbase/operations/search_index_get_documents_count.hxx +3 -2
  87. data/ext/couchbase/operations/search_index_get_stats.hxx +3 -2
  88. data/ext/couchbase/operations/search_index_upsert.hxx +3 -2
  89. data/ext/couchbase/operations/user_drop.hxx +3 -2
  90. data/ext/couchbase/operations/user_get.hxx +3 -2
  91. data/ext/couchbase/operations/user_get_all.hxx +3 -2
  92. data/ext/couchbase/operations/user_upsert.hxx +3 -2
  93. data/ext/couchbase/operations/view_index_drop.hxx +3 -2
  94. data/ext/couchbase/operations/view_index_get.hxx +3 -2
  95. data/ext/couchbase/operations/view_index_get_all.hxx +3 -2
  96. data/ext/couchbase/operations/view_index_upsert.hxx +3 -2
  97. data/ext/couchbase/platform/terminate_handler.cc +5 -2
  98. data/ext/couchbase/protocol/client_opcode.hxx +368 -0
  99. data/ext/couchbase/protocol/cmd_append.hxx +145 -0
  100. data/ext/couchbase/protocol/cmd_hello.hxx +1 -0
  101. data/ext/couchbase/protocol/cmd_lookup_in.hxx +11 -3
  102. data/ext/couchbase/protocol/cmd_mutate_in.hxx +46 -4
  103. data/ext/couchbase/protocol/cmd_noop.hxx +82 -0
  104. data/ext/couchbase/protocol/cmd_prepend.hxx +145 -0
  105. data/ext/couchbase/protocol/durability_level.hxx +16 -0
  106. data/ext/couchbase/protocol/hello_feature.hxx +9 -0
  107. data/ext/couchbase/protocol/unsigned_leb128.h +2 -2
  108. data/ext/couchbase/service_type.hxx +1 -1
  109. data/ext/couchbase/version.hxx +18 -4
  110. data/ext/extconf.rb +9 -6
  111. data/ext/test/CMakeLists.txt +5 -0
  112. data/ext/test/test_helper.hxx +3 -3
  113. data/ext/test/test_helper_native.hxx +2 -5
  114. data/ext/test/test_native_binary_operations.cxx +186 -0
  115. data/ext/test/test_native_diagnostics.cxx +54 -3
  116. data/ext/test/test_ruby_trivial_crud.cxx +1 -1
  117. data/lib/couchbase.rb +1 -0
  118. data/lib/couchbase/analytics_options.rb +1 -71
  119. data/lib/couchbase/binary_collection.rb +60 -22
  120. data/lib/couchbase/binary_collection_options.rb +0 -76
  121. data/lib/couchbase/bucket.rb +40 -36
  122. data/lib/couchbase/cluster.rb +89 -156
  123. data/lib/couchbase/collection.rb +290 -72
  124. data/lib/couchbase/collection_options.rb +30 -243
  125. data/lib/couchbase/datastructures/couchbase_list.rb +5 -16
  126. data/lib/couchbase/datastructures/couchbase_map.rb +5 -16
  127. data/lib/couchbase/datastructures/couchbase_queue.rb +5 -16
  128. data/lib/couchbase/datastructures/couchbase_set.rb +5 -16
  129. data/lib/couchbase/diagnostics.rb +181 -0
  130. data/lib/couchbase/json_transcoder.rb +1 -1
  131. data/lib/couchbase/{common_options.rb → logger.rb} +24 -11
  132. data/lib/couchbase/management/query_index_manager.rb +1 -1
  133. data/lib/couchbase/management/user_manager.rb +3 -0
  134. data/lib/couchbase/options.rb +2094 -0
  135. data/lib/couchbase/query_options.rb +1 -144
  136. data/lib/couchbase/scope.rb +8 -25
  137. data/lib/couchbase/search_options.rb +0 -93
  138. data/lib/couchbase/version.rb +20 -1
  139. data/lib/couchbase/view_options.rb +1 -91
  140. metadata +19 -7
@@ -26,6 +26,8 @@
26
26
  #include <operations/document_insert.hxx>
27
27
  #include <operations/document_upsert.hxx>
28
28
  #include <operations/document_replace.hxx>
29
+ #include <operations/document_append.hxx>
30
+ #include <operations/document_prepend.hxx>
29
31
  #include <operations/document_remove.hxx>
30
32
  #include <operations/document_lookup_in.hxx>
31
33
  #include <operations/document_mutate_in.hxx>
@@ -36,6 +38,9 @@
36
38
  #include <operations/document_decrement.hxx>
37
39
  #include <operations/document_get_projected.hxx>
38
40
 
41
+ #include <operations/mcbp_noop.hxx>
42
+ #include <operations/http_noop.hxx>
43
+
39
44
  #include <operations/document_query.hxx>
40
45
  #include <operations/document_search.hxx>
41
46
  #include <operations/document_analytics.hxx>
@@ -53,7 +53,7 @@ struct analytics_dataset_create_request {
53
53
 
54
54
  bool ignore_if_exists{ false };
55
55
 
56
- void encode_to(encoded_request_type& encoded, http_context&)
56
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
57
57
  {
58
58
  std::string where_clause = condition ? fmt::format("WHERE {}", *condition) : "";
59
59
  std::string if_not_exists_clause = ignore_if_exists ? "IF NOT EXISTS" : "";
@@ -67,13 +67,14 @@ struct analytics_dataset_create_request {
67
67
  encoded.method = "POST";
68
68
  encoded.path = "/analytics/service";
69
69
  encoded.body = tao::json::to_string(body);
70
+ return {};
70
71
  }
71
72
  };
72
73
 
73
74
  analytics_dataset_create_response
74
75
  make_response(std::error_code ec,
75
76
  analytics_dataset_create_request& request,
76
- analytics_dataset_create_request::encoded_response_type encoded)
77
+ analytics_dataset_create_request::encoded_response_type&& encoded)
77
78
  {
78
79
  analytics_dataset_create_response response{ request.client_context_id, ec };
79
80
  if (!ec) {
@@ -50,7 +50,7 @@ struct analytics_dataset_drop_request {
50
50
 
51
51
  bool ignore_if_does_not_exist{ false };
52
52
 
53
- void encode_to(encoded_request_type& encoded, http_context&)
53
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
54
54
  {
55
55
  std::string if_exists_clause = ignore_if_does_not_exist ? "IF EXISTS" : "";
56
56
 
@@ -61,11 +61,12 @@ struct analytics_dataset_drop_request {
61
61
  encoded.method = "POST";
62
62
  encoded.path = "/analytics/service";
63
63
  encoded.body = tao::json::to_string(body);
64
+ return {};
64
65
  }
65
66
  };
66
67
 
67
68
  analytics_dataset_drop_response
68
- make_response(std::error_code ec, analytics_dataset_drop_request& request, analytics_dataset_drop_request::encoded_response_type encoded)
69
+ make_response(std::error_code ec, analytics_dataset_drop_request& request, analytics_dataset_drop_request::encoded_response_type&& encoded)
69
70
  {
70
71
  analytics_dataset_drop_response response{ request.client_context_id, ec };
71
72
  if (!ec) {
@@ -53,7 +53,7 @@ struct analytics_dataset_get_all_request {
53
53
  std::string client_context_id{ uuid::to_string(uuid::random()) };
54
54
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
55
55
 
56
- void encode_to(encoded_request_type& encoded, http_context&)
56
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
57
57
  {
58
58
  tao::json::value body{
59
59
  { "statement", "SELECT d.* FROM Metadata.`Dataset` d WHERE d.DataverseName <> \"Metadata\"" },
@@ -62,13 +62,14 @@ struct analytics_dataset_get_all_request {
62
62
  encoded.method = "POST";
63
63
  encoded.path = "/analytics/service";
64
64
  encoded.body = tao::json::to_string(body);
65
+ return {};
65
66
  }
66
67
  };
67
68
 
68
69
  analytics_dataset_get_all_response
69
70
  make_response(std::error_code ec,
70
71
  analytics_dataset_get_all_request& request,
71
- analytics_dataset_get_all_request::encoded_response_type encoded)
72
+ analytics_dataset_get_all_request::encoded_response_type&& encoded)
72
73
  {
73
74
  analytics_dataset_get_all_response response{ request.client_context_id, ec };
74
75
 
@@ -49,7 +49,7 @@ struct analytics_dataverse_create_request {
49
49
 
50
50
  bool ignore_if_exists{ false };
51
51
 
52
- void encode_to(encoded_request_type& encoded, http_context&)
52
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
53
53
  {
54
54
  std::string if_not_exists_clause = ignore_if_exists ? "IF NOT EXISTS" : "";
55
55
 
@@ -60,13 +60,14 @@ struct analytics_dataverse_create_request {
60
60
  encoded.method = "POST";
61
61
  encoded.path = "/analytics/service";
62
62
  encoded.body = tao::json::to_string(body);
63
+ return {};
63
64
  }
64
65
  };
65
66
 
66
67
  analytics_dataverse_create_response
67
68
  make_response(std::error_code ec,
68
69
  analytics_dataverse_create_request& request,
69
- analytics_dataverse_create_request::encoded_response_type encoded)
70
+ analytics_dataverse_create_request::encoded_response_type&& encoded)
70
71
  {
71
72
  analytics_dataverse_create_response response{ request.client_context_id, ec };
72
73
  if (!ec) {
@@ -49,7 +49,7 @@ struct analytics_dataverse_drop_request {
49
49
 
50
50
  bool ignore_if_does_not_exist{ false };
51
51
 
52
- void encode_to(encoded_request_type& encoded, http_context&)
52
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
53
53
  {
54
54
  std::string if_exists_clause = ignore_if_does_not_exist ? "IF EXISTS" : "";
55
55
 
@@ -60,13 +60,14 @@ struct analytics_dataverse_drop_request {
60
60
  encoded.method = "POST";
61
61
  encoded.path = "/analytics/service";
62
62
  encoded.body = tao::json::to_string(body);
63
+ return {};
63
64
  }
64
65
  };
65
66
 
66
67
  analytics_dataverse_drop_response
67
68
  make_response(std::error_code ec,
68
69
  analytics_dataverse_drop_request& request,
69
- analytics_dataverse_drop_request::encoded_response_type encoded)
70
+ analytics_dataverse_drop_request::encoded_response_type&& encoded)
70
71
  {
71
72
  analytics_dataverse_drop_response response{ request.client_context_id, ec };
72
73
  if (!ec) {
@@ -46,17 +46,18 @@ struct analytics_get_pending_mutations_request {
46
46
  std::string client_context_id{ uuid::to_string(uuid::random()) };
47
47
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
48
48
 
49
- void encode_to(encoded_request_type& encoded, http_context&)
49
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
50
50
  {
51
51
  encoded.method = "GET";
52
52
  encoded.path = "/analytics/node/agg/stats/remaining";
53
+ return {};
53
54
  }
54
55
  };
55
56
 
56
57
  analytics_get_pending_mutations_response
57
58
  make_response(std::error_code ec,
58
59
  analytics_get_pending_mutations_request& request,
59
- analytics_get_pending_mutations_request::encoded_response_type encoded)
60
+ analytics_get_pending_mutations_request::encoded_response_type&& encoded)
60
61
  {
61
62
  analytics_get_pending_mutations_response response{ request.client_context_id, ec };
62
63
  if (!ec) {
@@ -52,7 +52,7 @@ struct analytics_index_create_request {
52
52
 
53
53
  bool ignore_if_exists{ false };
54
54
 
55
- void encode_to(encoded_request_type& encoded, http_context&)
55
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
56
56
  {
57
57
  std::string if_not_exists_clause = ignore_if_exists ? "IF NOT EXISTS" : "";
58
58
  std::vector<std::string> field_specs;
@@ -74,11 +74,12 @@ struct analytics_index_create_request {
74
74
  encoded.method = "POST";
75
75
  encoded.path = "/analytics/service";
76
76
  encoded.body = tao::json::to_string(body);
77
+ return {};
77
78
  }
78
79
  };
79
80
 
80
81
  analytics_index_create_response
81
- make_response(std::error_code ec, analytics_index_create_request& request, analytics_index_create_request::encoded_response_type encoded)
82
+ make_response(std::error_code ec, analytics_index_create_request& request, analytics_index_create_request::encoded_response_type&& encoded)
82
83
  {
83
84
  analytics_index_create_response response{ request.client_context_id, ec };
84
85
  if (!ec) {
@@ -51,7 +51,7 @@ struct analytics_index_drop_request {
51
51
 
52
52
  bool ignore_if_does_not_exist{ false };
53
53
 
54
- void encode_to(encoded_request_type& encoded, http_context&)
54
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
55
55
  {
56
56
  std::string if_exists_clause = ignore_if_does_not_exist ? "IF EXISTS" : "";
57
57
 
@@ -62,11 +62,12 @@ struct analytics_index_drop_request {
62
62
  encoded.method = "POST";
63
63
  encoded.path = "/analytics/service";
64
64
  encoded.body = tao::json::to_string(body);
65
+ return {};
65
66
  }
66
67
  };
67
68
 
68
69
  analytics_index_drop_response
69
- make_response(std::error_code ec, analytics_index_drop_request& request, analytics_index_drop_request::encoded_response_type encoded)
70
+ make_response(std::error_code ec, analytics_index_drop_request& request, analytics_index_drop_request::encoded_response_type&& encoded)
70
71
  {
71
72
  analytics_index_drop_response response{ request.client_context_id, ec };
72
73
  if (!ec) {
@@ -53,7 +53,7 @@ struct analytics_index_get_all_request {
53
53
  std::string client_context_id{ uuid::to_string(uuid::random()) };
54
54
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
55
55
 
56
- void encode_to(encoded_request_type& encoded, http_context&)
56
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
57
57
  {
58
58
  tao::json::value body{
59
59
  { "statement", "SELECT d.* FROM Metadata.`Index` d WHERE d.DataverseName <> \"Metadata\"" },
@@ -63,11 +63,14 @@ struct analytics_index_get_all_request {
63
63
  encoded.method = "POST";
64
64
  encoded.path = "/analytics/service";
65
65
  encoded.body = tao::json::to_string(body);
66
+ return {};
66
67
  }
67
68
  };
68
69
 
69
70
  analytics_index_get_all_response
70
- make_response(std::error_code ec, analytics_index_get_all_request& request, analytics_index_get_all_request::encoded_response_type encoded)
71
+ make_response(std::error_code ec,
72
+ analytics_index_get_all_request& request,
73
+ analytics_index_get_all_request::encoded_response_type&& encoded)
71
74
  {
72
75
  analytics_index_get_all_response response{ request.client_context_id, ec };
73
76
 
@@ -49,7 +49,7 @@ struct analytics_link_connect_request {
49
49
  std::string link_name;
50
50
  bool force{ false };
51
51
 
52
- void encode_to(encoded_request_type& encoded, http_context&)
52
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
53
53
  {
54
54
  std::string with_clause = force ? "WITH {\"force\": true}" : "";
55
55
 
@@ -60,11 +60,12 @@ struct analytics_link_connect_request {
60
60
  encoded.method = "POST";
61
61
  encoded.path = "/analytics/service";
62
62
  encoded.body = tao::json::to_string(body);
63
+ return {};
63
64
  }
64
65
  };
65
66
 
66
67
  analytics_link_connect_response
67
- make_response(std::error_code ec, analytics_link_connect_request& request, analytics_link_connect_request::encoded_response_type encoded)
68
+ make_response(std::error_code ec, analytics_link_connect_request& request, analytics_link_connect_request::encoded_response_type&& encoded)
68
69
  {
69
70
  analytics_link_connect_response response{ request.client_context_id, ec };
70
71
  if (!ec) {
@@ -48,7 +48,7 @@ struct analytics_link_disconnect_request {
48
48
  std::string dataverse_name{ "Default" };
49
49
  std::string link_name;
50
50
 
51
- void encode_to(encoded_request_type& encoded, http_context&)
51
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
52
52
  {
53
53
  tao::json::value body{
54
54
  { "statement", fmt::format("DISCONNECT LINK `{}`.`{}`", dataverse_name, link_name) },
@@ -57,13 +57,14 @@ struct analytics_link_disconnect_request {
57
57
  encoded.method = "POST";
58
58
  encoded.path = "/analytics/service";
59
59
  encoded.body = tao::json::to_string(body);
60
+ return {};
60
61
  }
61
62
  };
62
63
 
63
64
  analytics_link_disconnect_response
64
65
  make_response(std::error_code ec,
65
66
  analytics_link_disconnect_request& request,
66
- analytics_link_disconnect_request::encoded_response_type encoded)
67
+ analytics_link_disconnect_request::encoded_response_type&& encoded)
67
68
  {
68
69
  analytics_link_disconnect_response response{ request.client_context_id, ec };
69
70
  if (!ec) {
@@ -43,7 +43,7 @@ struct bucket_create_request {
43
43
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
44
44
  std::string client_context_id{ uuid::to_string(uuid::random()) };
45
45
 
46
- void encode_to(encoded_request_type& encoded, http_context&)
46
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
47
47
  {
48
48
  encoded.method = "POST";
49
49
  encoded.path = fmt::format("/pools/default/buckets");
@@ -107,11 +107,12 @@ struct bucket_create_request {
107
107
  case bucket_settings::conflict_resolution_type::unknown:
108
108
  break;
109
109
  }
110
+ return {};
110
111
  }
111
112
  };
112
113
 
113
114
  bucket_create_response
114
- make_response(std::error_code ec, bucket_create_request& request, bucket_create_request::encoded_response_type encoded)
115
+ make_response(std::error_code ec, bucket_create_request& request, bucket_create_request::encoded_response_type&& encoded)
115
116
  {
116
117
  bucket_create_response response{ request.client_context_id, ec };
117
118
  if (!ec) {
@@ -38,15 +38,16 @@ struct bucket_drop_request {
38
38
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
39
39
  std::string client_context_id{ uuid::to_string(uuid::random()) };
40
40
 
41
- void encode_to(encoded_request_type& encoded, http_context&)
41
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
42
42
  {
43
43
  encoded.method = "DELETE";
44
44
  encoded.path = fmt::format("/pools/default/buckets/{}", name);
45
+ return {};
45
46
  }
46
47
  };
47
48
 
48
49
  bucket_drop_response
49
- make_response(std::error_code ec, bucket_drop_request& request, bucket_drop_request::encoded_response_type encoded)
50
+ make_response(std::error_code ec, bucket_drop_request& request, bucket_drop_request::encoded_response_type&& encoded)
50
51
  {
51
52
  bucket_drop_response response{ request.client_context_id, ec };
52
53
  if (!ec) {
@@ -38,15 +38,16 @@ struct bucket_flush_request {
38
38
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
39
39
  std::string client_context_id{ uuid::to_string(uuid::random()) };
40
40
 
41
- void encode_to(encoded_request_type& encoded, http_context&)
41
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
42
42
  {
43
43
  encoded.method = "POST";
44
44
  encoded.path = fmt::format("/pools/default/buckets/{}/controller/doFlush", name);
45
+ return {};
45
46
  }
46
47
  };
47
48
 
48
49
  bucket_flush_response
49
- make_response(std::error_code ec, bucket_flush_request& request, bucket_flush_request::encoded_response_type encoded)
50
+ make_response(std::error_code ec, bucket_flush_request& request, bucket_flush_request::encoded_response_type&& encoded)
50
51
  {
51
52
  bucket_flush_response response{ request.client_context_id, ec };
52
53
  if (!ec) {
@@ -42,15 +42,16 @@ struct bucket_get_request {
42
42
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
43
43
  std::string client_context_id{ uuid::to_string(uuid::random()) };
44
44
 
45
- void encode_to(encoded_request_type& encoded, http_context&)
45
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
46
46
  {
47
47
  encoded.method = "GET";
48
48
  encoded.path = fmt::format("/pools/default/buckets/{}", name);
49
+ return {};
49
50
  }
50
51
  };
51
52
 
52
53
  bucket_get_response
53
- make_response(std::error_code ec, bucket_get_request& request, bucket_get_request::encoded_response_type encoded)
54
+ make_response(std::error_code ec, bucket_get_request& request, bucket_get_request::encoded_response_type&& encoded)
54
55
  {
55
56
  bucket_get_response response{ request.client_context_id, ec };
56
57
  if (!ec) {
@@ -40,15 +40,16 @@ struct bucket_get_all_request {
40
40
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
41
41
  std::string client_context_id{ uuid::to_string(uuid::random()) };
42
42
 
43
- void encode_to(encoded_request_type& encoded, http_context&)
43
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
44
44
  {
45
45
  encoded.method = "GET";
46
46
  encoded.path = "/pools/default/buckets";
47
+ return {};
47
48
  }
48
49
  };
49
50
 
50
51
  bucket_get_all_response
51
- make_response(std::error_code ec, bucket_get_all_request& request, bucket_get_all_request::encoded_response_type encoded)
52
+ make_response(std::error_code ec, bucket_get_all_request& request, bucket_get_all_request::encoded_response_type&& encoded)
52
53
  {
53
54
  bucket_get_all_response response{ request.client_context_id, ec };
54
55
  if (!ec) {
@@ -44,7 +44,7 @@ struct bucket_update_request {
44
44
 
45
45
  bucket_settings bucket{};
46
46
 
47
- void encode_to(encoded_request_type& encoded, http_context&)
47
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
48
48
  {
49
49
  encoded.method = "POST";
50
50
  encoded.path = fmt::format("/pools/default/buckets/{}", bucket.name);
@@ -84,11 +84,12 @@ struct bucket_update_request {
84
84
  case bucket_settings::compression_mode::unknown:
85
85
  break;
86
86
  }
87
+ return {};
87
88
  }
88
89
  };
89
90
 
90
91
  bucket_update_response
91
- make_response(std::error_code ec, bucket_update_request& request, bucket_update_request::encoded_response_type encoded)
92
+ make_response(std::error_code ec, bucket_update_request& request, bucket_update_request::encoded_response_type&& encoded)
92
93
  {
93
94
  bucket_update_response response{ request.client_context_id, ec };
94
95
  if (!ec) {
@@ -39,17 +39,18 @@ struct cluster_developer_preview_enable_request {
39
39
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
40
40
  std::string client_context_id{ uuid::to_string(uuid::random()) };
41
41
 
42
- void encode_to(encoded_request_type& encoded, http_context&)
42
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
43
43
  {
44
44
  encoded.method = "POST";
45
45
  encoded.headers["content-type"] = "application/x-www-form-urlencoded";
46
46
  encoded.path = "/settings/developerPreview";
47
47
  encoded.body = "enabled=true";
48
+ return {};
48
49
  }
49
50
  };
50
51
 
51
52
  cluster_developer_preview_enable_response
52
- make_response(std::error_code ec, cluster_developer_preview_enable_request& request, scope_get_all_request::encoded_response_type encoded)
53
+ make_response(std::error_code ec, cluster_developer_preview_enable_request& request, scope_get_all_request::encoded_response_type&& encoded)
53
54
  {
54
55
  cluster_developer_preview_enable_response response{ request.client_context_id, ec };
55
56
  if (!ec) {
@@ -46,7 +46,7 @@ struct collection_create_request {
46
46
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
47
47
  std::string client_context_id{ uuid::to_string(uuid::random()) };
48
48
 
49
- void encode_to(encoded_request_type& encoded, http_context&)
49
+ [[nodiscard]] std::error_code encode_to(encoded_request_type& encoded, http_context&)
50
50
  {
51
51
  encoded.method = "POST";
52
52
  encoded.path = fmt::format("/pools/default/buckets/{}/collections/{}", bucket_name, scope_name);
@@ -55,11 +55,12 @@ struct collection_create_request {
55
55
  if (max_expiry > 0) {
56
56
  encoded.body.append(fmt::format("&maxTTL={}", max_expiry));
57
57
  }
58
+ return {};
58
59
  }
59
60
  };
60
61
 
61
62
  collection_create_response
62
- make_response(std::error_code ec, collection_create_request& request, collection_create_request::encoded_response_type encoded)
63
+ make_response(std::error_code ec, collection_create_request& request, collection_create_request::encoded_response_type&& encoded)
63
64
  {
64
65
  collection_create_response response{ request.client_context_id, ec };
65
66
  if (!ec) {