test-test-sink-test-test 0.0.2.pre.alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (265) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +151 -0
  3. data/lib/sink/base_client.rb +404 -0
  4. data/lib/sink/base_model.rb +226 -0
  5. data/lib/sink/client.rb +391 -0
  6. data/lib/sink/fake_page.rb +44 -0
  7. data/lib/sink/models/address.rb +55 -0
  8. data/lib/sink/models/allof_base_parent.rb +18 -0
  9. data/lib/sink/models/allof_multiple_inline_entries.rb +15 -0
  10. data/lib/sink/models/api_status.rb +18 -0
  11. data/lib/sink/models/array_float_items_response.rb +6 -0
  12. data/lib/sink/models/array_missing_items_response.rb +18 -0
  13. data/lib/sink/models/array_object_items.rb +18 -0
  14. data/lib/sink/models/array_object_items_response.rb +18 -0
  15. data/lib/sink/models/array_recursion.rb +6 -0
  16. data/lib/sink/models/balance.rb +18 -0
  17. data/lib/sink/models/basic_shared_model_object.rb +23 -0
  18. data/lib/sink/models/body_param_top_level_all_of_response.rb +28 -0
  19. data/lib/sink/models/body_param_top_level_any_of_response.rb +6 -0
  20. data/lib/sink/models/body_param_top_level_one_of_response.rb +6 -0
  21. data/lib/sink/models/body_param_union_overlapping_prop_response.rb +19 -0
  22. data/lib/sink/models/card.rb +211 -0
  23. data/lib/sink/models/card_list_response.rb +36 -0
  24. data/lib/sink/models/card_provision_foo_response.rb +18 -0
  25. data/lib/sink/models/child_inlined_response_response.rb +18 -0
  26. data/lib/sink/models/child_model.rb +36 -0
  27. data/lib/sink/models/class_.rb +18 -0
  28. data/lib/sink/models/client.rb +23 -0
  29. data/lib/sink/models/company.rb +18 -0
  30. data/lib/sink/models/company_payment.rb +18 -0
  31. data/lib/sink/models/complex_query_array_query_response.rb +26 -0
  32. data/lib/sink/models/config_tool_model_ref_from_nested_response_body_response.rb +32 -0
  33. data/lib/sink/models/currency.rb +23 -0
  34. data/lib/sink/models/decorator_test_keep_me_response.rb +18 -0
  35. data/lib/sink/models/docstring_leading_double_quote_response.rb +20 -0
  36. data/lib/sink/models/docstring_trailing_double_quote_response.rb +32 -0
  37. data/lib/sink/models/documents.rb +23 -0
  38. data/lib/sink/models/eeoc.rb +18 -0
  39. data/lib/sink/models/employment_data.rb +18 -0
  40. data/lib/sink/models/enum_basic_response.rb +62 -0
  41. data/lib/sink/models/envelope_inline_response_response.rb +18 -0
  42. data/lib/sink/models/envelope_wrapped_array_response.rb +6 -0
  43. data/lib/sink/models/export.rb +19 -0
  44. data/lib/sink/models/file_create_multipart_response.rb +18 -0
  45. data/lib/sink/models/file_everything_multipart_response.rb +19 -0
  46. data/lib/sink/models/file_no_file_multipart_response.rb +18 -0
  47. data/lib/sink/models/file_with_optional_param_response.rb +18 -0
  48. data/lib/sink/models/funding_account.rb +100 -0
  49. data/lib/sink/models/import.rb +18 -0
  50. data/lib/sink/models/interface.rb +18 -0
  51. data/lib/sink/models/keep_this_resource_keep_this_method_response.rb +19 -0
  52. data/lib/sink/models/make_ambiguous_schemas_explicit_make_ambiguous_schemas_explicit_response.rb +45 -0
  53. data/lib/sink/models/make_ambiguous_schemas_looser_make_ambiguous_schemas_looser_response.rb +45 -0
  54. data/lib/sink/models/map_nullable_items_response.rb +28 -0
  55. data/lib/sink/models/method_config_skipped_tests_all_response.rb +19 -0
  56. data/lib/sink/models/method_config_skipped_tests_go_response.rb +19 -0
  57. data/lib/sink/models/method_config_skipped_tests_java_response.rb +19 -0
  58. data/lib/sink/models/method_config_skipped_tests_kotlin_response.rb +19 -0
  59. data/lib/sink/models/method_config_skipped_tests_node_and_python_response.rb +19 -0
  60. data/lib/sink/models/method_config_skipped_tests_node_response.rb +19 -0
  61. data/lib/sink/models/method_config_skipped_tests_python_response.rb +19 -0
  62. data/lib/sink/models/method_config_skipped_tests_ruby_response.rb +19 -0
  63. data/lib/sink/models/model_from_nested_path.rb +39 -0
  64. data/lib/sink/models/model_from_nested_response_body_ref.rb +18 -0
  65. data/lib/sink/models/model_from_schemas_ref.rb +18 -0
  66. data/lib/sink/models/model_from_schemas_ref_openapi_uri.rb +18 -0
  67. data/lib/sink/models/model_from_schemas_ref_openapi_uri_jmespath.rb +19 -0
  68. data/lib/sink/models/model_from_schemas_ref_openapi_uri_jsonpath.rb +19 -0
  69. data/lib/sink/models/model_level_1.rb +22 -0
  70. data/lib/sink/models/model_level_2.rb +22 -0
  71. data/lib/sink/models/model_level_3.rb +22 -0
  72. data/lib/sink/models/model_referenced_in_parent_and_child.rb +19 -0
  73. data/lib/sink/models/model_with_nested_model.rb +24 -0
  74. data/lib/sink/models/my_model.rb +18 -0
  75. data/lib/sink/models/name_child_prop_import_clash_response.rb +37 -0
  76. data/lib/sink/models/name_properties_common_conflicts_response.rb +84 -0
  77. data/lib/sink/models/name_properties_illegal_go_identifiers_response.rb +19 -0
  78. data/lib/sink/models/name_properties_illegal_javascript_identifiers_response.rb +6 -0
  79. data/lib/sink/models/name_response_property_clashes_model_import_response.rb +24 -0
  80. data/lib/sink/models/name_response_shadows_pydantic_response.rb +24 -0
  81. data/lib/sink/models/nested_request_model_a.rb +18 -0
  82. data/lib/sink/models/nested_request_model_b.rb +18 -0
  83. data/lib/sink/models/nested_request_model_c.rb +31 -0
  84. data/lib/sink/models/object_missing_items_response.rb +18 -0
  85. data/lib/sink/models/object_mixed_known_and_unknown_response.rb +19 -0
  86. data/lib/sink/models/object_multiple_array_properties_same_ref_response.rb +73 -0
  87. data/lib/sink/models/object_multiple_properties_same_model_response.rb +29 -0
  88. data/lib/sink/models/object_multiple_properties_same_ref_response.rb +68 -0
  89. data/lib/sink/models/object_skipped_props.rb +38 -0
  90. data/lib/sink/models/object_two_dimensional_array_primitive_property_response.rb +34 -0
  91. data/lib/sink/models/object_with_any_of_null_property.rb +31 -0
  92. data/lib/sink/models/object_with_child_ref.rb +23 -0
  93. data/lib/sink/models/object_with_one_of_null_property.rb +31 -0
  94. data/lib/sink/models/object_with_union_properties.rb +23 -0
  95. data/lib/sink/models/openapi_format_array_type_one_entry_response.rb +19 -0
  96. data/lib/sink/models/openapi_format_array_type_one_entry_with_null_response.rb +19 -0
  97. data/lib/sink/models/openapi_special_used_used_as_property_name_response.rb +19 -0
  98. data/lib/sink/models/page_cursor_shared_ref_pagination.rb +23 -0
  99. data/lib/sink/models/parent_model_with_child_ref.rb +28 -0
  100. data/lib/sink/models/path_param_colon_suffix_response.rb +18 -0
  101. data/lib/sink/models/path_param_file_extension_response.rb +18 -0
  102. data/lib/sink/models/path_param_multiple_response.rb +18 -0
  103. data/lib/sink/models/path_param_query_param_response.rb +18 -0
  104. data/lib/sink/models/path_param_singular_response.rb +18 -0
  105. data/lib/sink/models/primitive_strings_response.rb +18 -0
  106. data/lib/sink/models/private.rb +18 -0
  107. data/lib/sink/models/public.rb +18 -0
  108. data/lib/sink/models/recursion_create_envelope_response.rb +19 -0
  109. data/lib/sink/models/response_allof_simple_response.rb +23 -0
  110. data/lib/sink/models/response_array_object_with_union_properties_response.rb +6 -0
  111. data/lib/sink/models/response_array_response_response.rb +6 -0
  112. data/lib/sink/models/response_missing_required_response.rb +24 -0
  113. data/lib/sink/models/response_nested_array_response.rb +36 -0
  114. data/lib/sink/models/response_object_all_properties_response.rb +65 -0
  115. data/lib/sink/models/response_object_no_properties_response.rb +14 -0
  116. data/lib/sink/models/response_object_with_additional_properties_prop_response.rb +32 -0
  117. data/lib/sink/models/response_object_with_heavily_nested_union_response.rb +19 -0
  118. data/lib/sink/models/response_only_read_only_properties_response.rb +25 -0
  119. data/lib/sink/models/responses_allof_cross_object.rb +23 -0
  120. data/lib/sink/models/return_.rb +18 -0
  121. data/lib/sink/models/root_response.rb +31 -0
  122. data/lib/sink/models/self_recursion.rb +23 -0
  123. data/lib/sink/models/shared_cursor_nested_response_prop_meta.rb +33 -0
  124. data/lib/sink/models/shared_self_recursion.rb +23 -0
  125. data/lib/sink/models/shipping_address.rb +85 -0
  126. data/lib/sink/models/simple_allof.rb +28 -0
  127. data/lib/sink/models/simple_object.rb +32 -0
  128. data/lib/sink/models/skip_this_resource_i_never_appear_response.rb +19 -0
  129. data/lib/sink/models/streaming_basic_response.rb +23 -0
  130. data/lib/sink/models/streaming_nested_params_response.rb +23 -0
  131. data/lib/sink/models/streaming_no_discriminator_response.rb +24 -0
  132. data/lib/sink/models/streaming_query_param_discriminator_response.rb +24 -0
  133. data/lib/sink/models/streaming_with_unrelated_default_param_response.rb +24 -0
  134. data/lib/sink/models/type_dates_response.rb +38 -0
  135. data/lib/sink/models/type_datetimes_response.rb +38 -0
  136. data/lib/sink/models/union_discriminated_variant_a.rb +27 -0
  137. data/lib/sink/models/union_discriminated_variant_b.rb +27 -0
  138. data/lib/sink/models/union_response_discriminated_by_property_name_response.rb +6 -0
  139. data/lib/sink/models/union_response_discriminated_with_basic_mapping_response.rb +6 -0
  140. data/lib/sink/models/union_type_mixed_types_response.rb +6 -0
  141. data/lib/sink/models/union_type_nullable_union_response.rb +6 -0
  142. data/lib/sink/models/union_type_objects_response.rb +6 -0
  143. data/lib/sink/models/union_type_super_mixed_types_response.rb +6 -0
  144. data/lib/sink/models/union_type_unknown_variant_response.rb +6 -0
  145. data/lib/sink/models/version_1_30_name_create_response.rb +18 -0
  146. data/lib/sink/models/widget.rb +19 -0
  147. data/lib/sink/models/write_only_response_simple_response.rb +21 -0
  148. data/lib/sink/page_cursor.rb +54 -0
  149. data/lib/sink/page_cursor_from_headers.rb +54 -0
  150. data/lib/sink/page_cursor_id.rb +50 -0
  151. data/lib/sink/page_cursor_nested_items.rb +84 -0
  152. data/lib/sink/page_cursor_nested_object_ref.rb +71 -0
  153. data/lib/sink/page_cursor_shared_ref.rb +72 -0
  154. data/lib/sink/page_cursor_top_level_array.rb +51 -0
  155. data/lib/sink/page_cursor_url.rb +51 -0
  156. data/lib/sink/page_cursor_with_reverse.rb +58 -0
  157. data/lib/sink/page_offset.rb +54 -0
  158. data/lib/sink/page_offset_no_start_field.rb +50 -0
  159. data/lib/sink/page_offset_total_count.rb +58 -0
  160. data/lib/sink/page_page_number.rb +58 -0
  161. data/lib/sink/page_page_number_without_current_page_response.rb +50 -0
  162. data/lib/sink/pooled_net_requester.rb +72 -0
  163. data/lib/sink/request_options.rb +89 -0
  164. data/lib/sink/resources/body_params/objects.rb +34 -0
  165. data/lib/sink/resources/body_params/unions.rb +34 -0
  166. data/lib/sink/resources/body_params.rb +630 -0
  167. data/lib/sink/resources/cards.rb +508 -0
  168. data/lib/sink/resources/casing/eeoc.rb +34 -0
  169. data/lib/sink/resources/casing.rb +16 -0
  170. data/lib/sink/resources/clients.rb +30 -0
  171. data/lib/sink/resources/company/payments.rb +30 -0
  172. data/lib/sink/resources/company.rb +18 -0
  173. data/lib/sink/resources/complex_queries.rb +60 -0
  174. data/lib/sink/resources/config_tools/parent_with_skip_node_python/child_only_skip_python.rb +99 -0
  175. data/lib/sink/resources/config_tools/parent_with_skip_node_python.rb +101 -0
  176. data/lib/sink/resources/config_tools.rb +40 -0
  177. data/lib/sink/resources/decorator_tests/keep_this_resource.rb +29 -0
  178. data/lib/sink/resources/decorator_tests/languages.rb +59 -0
  179. data/lib/sink/resources/decorator_tests/skip_this_resource.rb +28 -0
  180. data/lib/sink/resources/decorator_tests.rb +38 -0
  181. data/lib/sink/resources/deeply_nested/level_one/level_two/level_three.rb +33 -0
  182. data/lib/sink/resources/deeply_nested/level_one/level_two.rb +35 -0
  183. data/lib/sink/resources/deeply_nested/level_one.rb +33 -0
  184. data/lib/sink/resources/deeply_nested.rb +16 -0
  185. data/lib/sink/resources/docstrings.rb +82 -0
  186. data/lib/sink/resources/empty_body.rb +60 -0
  187. data/lib/sink/resources/envelopes.rb +74 -0
  188. data/lib/sink/resources/files.rb +101 -0
  189. data/lib/sink/resources/header_params.rb +81 -0
  190. data/lib/sink/resources/invalid_schemas/arrays.rb +26 -0
  191. data/lib/sink/resources/invalid_schemas/objects.rb +26 -0
  192. data/lib/sink/resources/invalid_schemas.rb +20 -0
  193. data/lib/sink/resources/make_ambiguous_schemas_explicit.rb +26 -0
  194. data/lib/sink/resources/make_ambiguous_schemas_looser.rb +26 -0
  195. data/lib/sink/resources/method_config.rb +167 -0
  196. data/lib/sink/resources/mixed_params/duplicates.rb +79 -0
  197. data/lib/sink/resources/mixed_params.rb +88 -0
  198. data/lib/sink/resources/model_referenced_in_parent_and_child/child.rb +26 -0
  199. data/lib/sink/resources/model_referenced_in_parent_and_child.rb +28 -0
  200. data/lib/sink/resources/names/can_cause_clashes/employment_data.rb +16 -0
  201. data/lib/sink/resources/names/can_cause_clashes/response.rb +32 -0
  202. data/lib/sink/resources/names/can_cause_clashes.rb +23 -0
  203. data/lib/sink/resources/names/documents.rb +28 -0
  204. data/lib/sink/resources/names/openapi_specials.rb +26 -0
  205. data/lib/sink/resources/names/params.rb +52 -0
  206. data/lib/sink/resources/names/reserved_names/import.rb +31 -0
  207. data/lib/sink/resources/names/reserved_names/methods.rb +40 -0
  208. data/lib/sink/resources/names/reserved_names/public/class_.rb +30 -0
  209. data/lib/sink/resources/names/reserved_names/public/interface.rb +30 -0
  210. data/lib/sink/resources/names/reserved_names/public/private.rb +30 -0
  211. data/lib/sink/resources/names/reserved_names/public.rb +40 -0
  212. data/lib/sink/resources/names/reserved_names.rb +46 -0
  213. data/lib/sink/resources/names.rb +170 -0
  214. data/lib/sink/resources/openapi_formats.rb +53 -0
  215. data/lib/sink/resources/pagination_tests/cursor.rb +57 -0
  216. data/lib/sink/resources/pagination_tests/cursor_id.rb +34 -0
  217. data/lib/sink/resources/pagination_tests/cursor_url.rb +34 -0
  218. data/lib/sink/resources/pagination_tests/fake_pages.rb +33 -0
  219. data/lib/sink/resources/pagination_tests/items_types.rb +34 -0
  220. data/lib/sink/resources/pagination_tests/nested_items.rb +34 -0
  221. data/lib/sink/resources/pagination_tests/offset.rb +74 -0
  222. data/lib/sink/resources/pagination_tests/page_number.rb +54 -0
  223. data/lib/sink/resources/pagination_tests/page_number_without_current_page_response.rb +55 -0
  224. data/lib/sink/resources/pagination_tests/refs.rb +55 -0
  225. data/lib/sink/resources/pagination_tests/response_headers.rb +34 -0
  226. data/lib/sink/resources/pagination_tests/schema_types.rb +54 -0
  227. data/lib/sink/resources/pagination_tests/top_level_arrays.rb +34 -0
  228. data/lib/sink/resources/pagination_tests.rb +64 -0
  229. data/lib/sink/resources/parent/child.rb +30 -0
  230. data/lib/sink/resources/parent.rb +18 -0
  231. data/lib/sink/resources/path_params.rb +210 -0
  232. data/lib/sink/resources/positional_params.rb +237 -0
  233. data/lib/sink/resources/query_params.rb +166 -0
  234. data/lib/sink/resources/recursion/shared_responses.rb +26 -0
  235. data/lib/sink/resources/recursion.rb +68 -0
  236. data/lib/sink/resources/resource_refs/paginated_model_first_ref.rb +14 -0
  237. data/lib/sink/resources/resource_refs/paginated_model_second_ref.rb +14 -0
  238. data/lib/sink/resources/resource_refs/parent/child.rb +31 -0
  239. data/lib/sink/resources/resource_refs/parent.rb +32 -0
  240. data/lib/sink/resources/resource_refs.rb +24 -0
  241. data/lib/sink/resources/resources.rb +26 -0
  242. data/lib/sink/resources/responses/union_types.rb +98 -0
  243. data/lib/sink/resources/responses.rb +319 -0
  244. data/lib/sink/resources/shared_query_params.rb +48 -0
  245. data/lib/sink/resources/streaming.rb +106 -0
  246. data/lib/sink/resources/testing.rb +24 -0
  247. data/lib/sink/resources/tests.rb +26 -0
  248. data/lib/sink/resources/tools.rb +33 -0
  249. data/lib/sink/resources/types/allofs.rb +14 -0
  250. data/lib/sink/resources/types/arrays.rb +62 -0
  251. data/lib/sink/resources/types/enums.rb +95 -0
  252. data/lib/sink/resources/types/maps.rb +29 -0
  253. data/lib/sink/resources/types/objects.rb +105 -0
  254. data/lib/sink/resources/types/primitives.rb +34 -0
  255. data/lib/sink/resources/types/read_only_params.rb +34 -0
  256. data/lib/sink/resources/types/unions.rb +126 -0
  257. data/lib/sink/resources/types/write_only_responses.rb +28 -0
  258. data/lib/sink/resources/types.rb +95 -0
  259. data/lib/sink/resources/undocumented_resource.rb +47 -0
  260. data/lib/sink/resources/version_1_30_names.rb +41 -0
  261. data/lib/sink/resources/widgets.rb +30 -0
  262. data/lib/sink/util.rb +78 -0
  263. data/lib/sink/version.rb +5 -0
  264. data/lib/sink.rb +276 -0
  265. metadata +322 -0
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class Arrays
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint with a response schema that is an array of number types.
13
+ #
14
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
15
+ #
16
+ # @return [Array<Float>]
17
+ def float_items(opts = {})
18
+ req = {
19
+ method: :get,
20
+ path: "/types/array/float_items",
21
+ model: Sink::ArrayOf.new(Float)
22
+ }
23
+ @client.request(req, opts)
24
+ end
25
+
26
+ # Endpoint with a request schema that has a property that points to an array
27
+ # model.
28
+ #
29
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
30
+ # @option params [Object, nil] :array_param
31
+ #
32
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
33
+ #
34
+ # @return [nil]
35
+ def nested_in_params(params = {}, opts = {})
36
+ req = {
37
+ method: :post,
38
+ path: "/types/array/model_nested_in_params",
39
+ body: params,
40
+ headers: {"Content-Type" => "application/json"},
41
+ model: NilClass
42
+ }
43
+ @client.request(req, opts)
44
+ end
45
+
46
+ # Endpoint with a response schema that is an array of in-line object types.
47
+ #
48
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
49
+ #
50
+ # @return [Array<Sink::Models::ArrayObjectItemsResponse::ArrayObjectItemsResponse>]
51
+ def object_items(opts = {})
52
+ req = {
53
+ method: :get,
54
+ path: "/types/array/object_items",
55
+ model: Sink::ArrayOf.new(Sink::Models::ArrayObjectItemsResponse::ArrayObjectItemsResponse)
56
+ }
57
+ @client.request(req, opts)
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class Enums
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint that has an array of enum that should generate a valid test with
13
+ # non-repeating values in the array.
14
+ #
15
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
16
+ # @option params [Array<Symbol, Body>] :body
17
+ #
18
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
19
+ #
20
+ # @return [nil]
21
+ def array_unique_values(params = {}, opts = {})
22
+ req = {
23
+ method: :post,
24
+ path: "/types/enum_tests_array_unique_values",
25
+ body: params[:body],
26
+ headers: {"Content-Type" => "application/json"},
27
+ model: NilClass
28
+ }
29
+ @client.request(req, opts)
30
+ end
31
+
32
+ # Endpoint that has an array of enum that should generate a valid test with 2
33
+ # non-repeating values in the array.
34
+ #
35
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
36
+ # @option params [Array<Symbol, Body>] :body
37
+ #
38
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
39
+ #
40
+ # @return [nil]
41
+ def array_unique_values_2_values(params = {}, opts = {})
42
+ req = {
43
+ method: :post,
44
+ path: "/types/enum_tests_array_unique_values_2_values",
45
+ body: params[:body],
46
+ headers: {"Content-Type" => "application/json"},
47
+ model: NilClass
48
+ }
49
+ @client.request(req, opts)
50
+ end
51
+
52
+ # Endpoint that has an array of enum that should generate a valid test with 2
53
+ # non-repeating values in the array.
54
+ #
55
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
56
+ # @option params [Array<Float>] :body
57
+ #
58
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
59
+ #
60
+ # @return [nil]
61
+ def array_unique_values_numbers(params = {}, opts = {})
62
+ req = {
63
+ method: :post,
64
+ path: "/types/enum_tests_array_unique_values_numbers",
65
+ body: params[:body],
66
+ headers: {"Content-Type" => "application/json"},
67
+ model: NilClass
68
+ }
69
+ @client.request(req, opts)
70
+ end
71
+
72
+ # Endpoint that has a `$ref`d enum type in the request body and the response body.
73
+ #
74
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
75
+ # @option params [Symbol, Sink::Models::Currency, nil] :input_currency This is my description for the Currency enum
76
+ # @option params [Symbol, ProblematicEnum, nil] :problematic_enum
77
+ # @option params [Symbol, UsesConst, nil] :uses_const
78
+ #
79
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
80
+ #
81
+ # @return [Sink::Models::EnumBasicResponse]
82
+ def basic(params = {}, opts = {})
83
+ req = {
84
+ method: :post,
85
+ path: "/types/enums",
86
+ body: params,
87
+ headers: {"Content-Type" => "application/json"},
88
+ model: Sink::Models::EnumBasicResponse
89
+ }
90
+ @client.request(req, opts)
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class Maps
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint with a response schema object that contains properties that use
13
+ # `additionalProperties` with a nullable items type.
14
+ #
15
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
16
+ #
17
+ # @return [Sink::Models::MapNullableItemsResponse]
18
+ def nullable_items(opts = {})
19
+ req = {
20
+ method: :get,
21
+ path: "/types/map/nullable_items",
22
+ model: Sink::Models::MapNullableItemsResponse
23
+ }
24
+ @client.request(req, opts)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class Objects
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint with a response schema object that contains a mix of known & unknown
13
+ # properties with the same value types.
14
+ #
15
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
16
+ #
17
+ # @return [Sink::Models::ObjectMixedKnownAndUnknownResponse]
18
+ def mixed_known_and_unknown(opts = {})
19
+ req = {
20
+ method: :get,
21
+ path: "/types/object/mixed_known_and_unknown",
22
+ model: Sink::Models::ObjectMixedKnownAndUnknownResponse
23
+ }
24
+ @client.request(req, opts)
25
+ end
26
+
27
+ # Endpoint with a response schema object that contains multiple properties that
28
+ # reference the same $ref in array items that is _not_ a model in the config.
29
+ # Three child types should be generated, one for each property.
30
+ #
31
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
32
+ #
33
+ # @return [Sink::Models::ObjectMultipleArrayPropertiesSameRefResponse]
34
+ def multiple_array_properties_same_ref(opts = {})
35
+ req = {
36
+ method: :get,
37
+ path: "/types/object/multiple_array_properties_same_ref",
38
+ model: Sink::Models::ObjectMultipleArrayPropertiesSameRefResponse
39
+ }
40
+ @client.request(req, opts)
41
+ end
42
+
43
+ # Endpoint with a response schema object that contains multiple properties that
44
+ # reference the same model.
45
+ #
46
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
47
+ #
48
+ # @return [Sink::Models::ObjectMultiplePropertiesSameModelResponse]
49
+ def multiple_properties_same_model(opts = {})
50
+ req = {
51
+ method: :get,
52
+ path: "/types/object/multiple_properties_same_model",
53
+ model: Sink::Models::ObjectMultiplePropertiesSameModelResponse
54
+ }
55
+ @client.request(req, opts)
56
+ end
57
+
58
+ # Endpoint with a response schema object that contains multiple properties that
59
+ # reference the same $ref that is _not_ a model in the config. Three child types
60
+ # should be generated. One for each property.
61
+ #
62
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
63
+ #
64
+ # @return [Sink::Models::ObjectMultiplePropertiesSameRefResponse]
65
+ def multiple_properties_same_ref(opts = {})
66
+ req = {
67
+ method: :get,
68
+ path: "/types/object/multiple_properties_same_ref",
69
+ model: Sink::Models::ObjectMultiplePropertiesSameRefResponse
70
+ }
71
+ @client.request(req, opts)
72
+ end
73
+
74
+ # Endpoint with a response schema object that contains properties that are
75
+ # primitive 2d arrays
76
+ #
77
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
78
+ #
79
+ # @return [Sink::Models::ObjectTwoDimensionalArrayPrimitivePropertyResponse]
80
+ def two_dimensional_array_primitive_property(opts = {})
81
+ req = {
82
+ method: :get,
83
+ path: "/types/object/2d_array_primitive_properties",
84
+ model: Sink::Models::ObjectTwoDimensionalArrayPrimitivePropertyResponse
85
+ }
86
+ @client.request(req, opts)
87
+ end
88
+
89
+ # Endpoint with a response schema object that does not define any properties
90
+ #
91
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
92
+ #
93
+ # @return [Object]
94
+ def unknown_object(opts = {})
95
+ req = {
96
+ method: :get,
97
+ path: "/types/object/unknown_object",
98
+ model: Sink::Unknown
99
+ }
100
+ @client.request(req, opts)
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class Primitives
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint that has a request body property that points to a string model &
13
+ # returns an object with a string model prop
14
+ #
15
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
16
+ # @option params [String, nil] :string_param
17
+ #
18
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
19
+ #
20
+ # @return [Sink::Models::PrimitiveStringsResponse]
21
+ def strings(params = {}, opts = {})
22
+ req = {
23
+ method: :post,
24
+ path: "/types/primitives/strings",
25
+ body: params,
26
+ headers: {"Content-Type" => "application/json"},
27
+ model: Sink::Models::PrimitiveStringsResponse
28
+ }
29
+ @client.request(req, opts)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class ReadOnlyParams
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint with a request params schema object that contains a `readOnly`
13
+ # property.
14
+ #
15
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
16
+ # @option params [String, nil] :should_show_up This should be generated in the request params type.
17
+ #
18
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
19
+ #
20
+ # @return [Hash]
21
+ def simple(params = {}, opts = {})
22
+ req = {
23
+ method: :post,
24
+ path: "/types/read_only_params/simple",
25
+ body: params,
26
+ headers: {"Content-Type" => "application/json"},
27
+ model: Hash
28
+ }
29
+ @client.request(req, opts)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,126 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class Unions
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint with an array request param schema with items discriminated union that
13
+ # just defines the `propertyName` config
14
+ #
15
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
16
+ # @option params [Array<Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB>] :body
17
+ #
18
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
19
+ #
20
+ # @return [String]
21
+ def array_param_discriminated_by_property_name(params = {}, opts = {})
22
+ req = {
23
+ method: :post,
24
+ path: "/types/unions/array_param_discriminated_by_property_name",
25
+ body: params[:body],
26
+ headers: {"Content-Type" => "application/json"},
27
+ model: String
28
+ }
29
+ @client.request(req, opts)
30
+ end
31
+
32
+ # Endpoint with an array request param schema with items discriminated union that
33
+ # also defines the `mapping` config
34
+ #
35
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
36
+ # @option params [Array<Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB>] :body
37
+ #
38
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
39
+ #
40
+ # @return [String]
41
+ def array_param_discriminated_with_basic_mapping(params = {}, opts = {})
42
+ req = {
43
+ method: :post,
44
+ path: "/types/unions/array_param_discriminated_with_basic_mapping",
45
+ body: params[:body],
46
+ headers: {"Content-Type" => "application/json"},
47
+ model: String
48
+ }
49
+ @client.request(req, opts)
50
+ end
51
+
52
+ # Endpoint with a request param schema that is a discriminated union that just
53
+ # defines the `propertyName` config
54
+ #
55
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
56
+ # @option params [String] :value
57
+ # @option params [Symbol, Type, nil] :type
58
+ #
59
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
60
+ #
61
+ # @return [String]
62
+ def param_discriminated_by_property_name(params = {}, opts = {})
63
+ req = {
64
+ method: :post,
65
+ path: "/types/unions/param_discriminated_by_property_name",
66
+ body: params,
67
+ headers: {"Content-Type" => "application/json"},
68
+ model: String
69
+ }
70
+ @client.request(req, opts)
71
+ end
72
+
73
+ # Endpoint with a request param schema that is a discriminated union that also
74
+ # defines the `mapping` config
75
+ #
76
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
77
+ # @option params [String] :value
78
+ # @option params [Symbol, Type, nil] :type
79
+ #
80
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
81
+ #
82
+ # @return [String]
83
+ def param_discriminated_with_basic_mapping(params = {}, opts = {})
84
+ req = {
85
+ method: :post,
86
+ path: "/types/unions/param_discriminated_with_basic_mapping",
87
+ body: params,
88
+ headers: {"Content-Type" => "application/json"},
89
+ model: String
90
+ }
91
+ @client.request(req, opts)
92
+ end
93
+
94
+ # Endpoint with a response schema that is a discriminated union that just defines
95
+ # the `propertyName` config
96
+ #
97
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
98
+ #
99
+ # @return [Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB]
100
+ def response_discriminated_by_property_name(opts = {})
101
+ req = {
102
+ method: :get,
103
+ path: "/types/unions/response_discriminated_by_property_name",
104
+ model: Sink::Unknown
105
+ }
106
+ @client.request(req, opts)
107
+ end
108
+
109
+ # Endpoint with a response schema that is a discriminated union that also defines
110
+ # the `mapping` config
111
+ #
112
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
113
+ #
114
+ # @return [Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB]
115
+ def response_discriminated_with_basic_mapping(opts = {})
116
+ req = {
117
+ method: :get,
118
+ path: "/types/unions/response_discriminated_with_basic_mapping",
119
+ model: Sink::Unknown
120
+ }
121
+ @client.request(req, opts)
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ class WriteOnlyResponses
7
+ # @param client [Sink::Client]
8
+ def initialize(client:)
9
+ @client = client
10
+ end
11
+
12
+ # Endpoint with a response schema object that contains a `writeOnly` property.
13
+ #
14
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
15
+ #
16
+ # @return [Sink::Models::WriteOnlyResponseSimpleResponse]
17
+ def simple(opts = {})
18
+ req = {
19
+ method: :get,
20
+ path: "/types/write_only_responses/simple",
21
+ model: Sink::Models::WriteOnlyResponseSimpleResponse
22
+ }
23
+ @client.request(req, opts)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class Types
6
+ # @return [Sink::Resources::Types::Primitives]
7
+ attr_reader :primitives
8
+
9
+ # @return [Sink::Resources::Types::ReadOnlyParams]
10
+ attr_reader :read_only_params
11
+
12
+ # @return [Sink::Resources::Types::WriteOnlyResponses]
13
+ attr_reader :write_only_responses
14
+
15
+ # @return [Sink::Resources::Types::Maps]
16
+ attr_reader :maps
17
+
18
+ # @return [Sink::Resources::Types::Enums]
19
+ attr_reader :enums
20
+
21
+ # @return [Sink::Resources::Types::Allofs]
22
+ attr_reader :allofs
23
+
24
+ # @return [Sink::Resources::Types::Unions]
25
+ attr_reader :unions
26
+
27
+ # @return [Sink::Resources::Types::Objects]
28
+ attr_reader :objects
29
+
30
+ # @return [Sink::Resources::Types::Arrays]
31
+ attr_reader :arrays
32
+
33
+ # @param client [Sink::Client]
34
+ def initialize(client:)
35
+ @client = client
36
+ @primitives = Sink::Resources::Types::Primitives.new(client: client)
37
+ @read_only_params = Sink::Resources::Types::ReadOnlyParams.new(client: client)
38
+ @write_only_responses = Sink::Resources::Types::WriteOnlyResponses.new(client: client)
39
+ @maps = Sink::Resources::Types::Maps.new(client: client)
40
+ @enums = Sink::Resources::Types::Enums.new(client: client)
41
+ @allofs = Sink::Resources::Types::Allofs.new(client: client)
42
+ @unions = Sink::Resources::Types::Unions.new(client: client)
43
+ @objects = Sink::Resources::Types::Objects.new(client: client)
44
+ @arrays = Sink::Resources::Types::Arrays.new(client: client)
45
+ end
46
+
47
+ # Endpoint that has date types should generate params/responses with rich date
48
+ # types.
49
+ #
50
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
51
+ # @option params [Date] :required_date
52
+ # @option params [Date] :required_nullable_date
53
+ # @option params [Array<Date>, nil] :list_date
54
+ # @option params [Date, Integer, nil] :oneof_date
55
+ # @option params [Date, nil] :optional_date
56
+ #
57
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
58
+ #
59
+ # @return [Sink::Models::TypeDatesResponse]
60
+ def dates(params = {}, opts = {})
61
+ req = {
62
+ method: :post,
63
+ path: "/types/dates",
64
+ body: params,
65
+ headers: {"Content-Type" => "application/json"},
66
+ model: Sink::Models::TypeDatesResponse
67
+ }
68
+ @client.request(req, opts)
69
+ end
70
+
71
+ # Endpoint that has date-time types.
72
+ #
73
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
74
+ # @option params [Time] :required_datetime
75
+ # @option params [Time] :required_nullable_datetime
76
+ # @option params [Array<Time>, nil] :list_datetime
77
+ # @option params [Integer, Time, nil] :oneof_datetime union type coming from the `oneof_datetime` property
78
+ # @option params [Time, nil] :optional_datetime
79
+ #
80
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
81
+ #
82
+ # @return [Sink::Models::TypeDatetimesResponse]
83
+ def datetimes(params = {}, opts = {})
84
+ req = {
85
+ method: :post,
86
+ path: "/types/datetimes",
87
+ body: params,
88
+ headers: {"Content-Type" => "application/json"},
89
+ model: Sink::Models::TypeDatetimesResponse
90
+ }
91
+ @client.request(req, opts)
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sink
4
+ module Resources
5
+ class UndocumentedResource
6
+ # @param client [Sink::Client]
7
+ def initialize(client:)
8
+ @client = client
9
+ end
10
+
11
+ # Initiate print and shipment of a duplicate card.
12
+ #
13
+ # Only applies to cards of type `PHYSICAL` [beta].
14
+ #
15
+ # @param card_token [String]
16
+ #
17
+ # @param params [Hash{Symbol => Object}] Attributes to send in this request.
18
+ # @option params [String, nil] :product_id Specifies the configuration (e.g. physical card art) that the card should be
19
+ # manufactured with, and only applies to cards of type `PHYSICAL` [beta]. This
20
+ # must be configured with Lithic before use.
21
+ # @option params [Symbol, ShippingMethod, nil] :shipping_method Shipping method for the card. Use of options besides `STANDARD` require
22
+ # additional permissions.
23
+ #
24
+ # - `STANDARD` - USPS regular mail or similar international option, with no
25
+ # tracking
26
+ # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
27
+ # with tracking
28
+ # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
29
+ # tracking
30
+ # @option params [Sink::Models::ShippingAddress, nil] :shipping_address If omitted, the previous shipping address will be used.
31
+ #
32
+ # @param opts [Hash, Sink::RequestOptions] Options to specify HTTP behaviour for this request.
33
+ #
34
+ # @return [Sink::Models::Card]
35
+ def reissue(card_token, params = {}, opts = {})
36
+ req = {
37
+ method: :post,
38
+ path: "/cards/#{card_token}/reissue",
39
+ body: params,
40
+ headers: {"Content-Type" => "application/json"},
41
+ model: Sink::Models::Card
42
+ }
43
+ @client.request(req, opts)
44
+ end
45
+ end
46
+ end
47
+ end