schematichq 1.4.9 → 1.4.10

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/.fern/replay.lock +344 -2
  4. data/WASM_VERSION +1 -1
  5. data/lib/schematic/catalogs/client.rb +480 -0
  6. data/lib/schematic/catalogs/types/create_catalog_request_body.rb +13 -0
  7. data/lib/schematic/catalogs/types/create_catalog_response.rb +12 -0
  8. data/lib/schematic/catalogs/types/delete_catalog_response.rb +12 -0
  9. data/lib/schematic/catalogs/types/get_catalog_response.rb +12 -0
  10. data/lib/schematic/catalogs/types/get_configuration_response.rb +12 -0
  11. data/lib/schematic/catalogs/types/get_credit_bundles_in_catalog_response.rb +12 -0
  12. data/lib/schematic/catalogs/types/get_derived_features_response.rb +12 -0
  13. data/lib/schematic/catalogs/types/get_plans_in_catalog_response.rb +12 -0
  14. data/lib/schematic/catalogs/types/list_catalogs_params.rb +15 -0
  15. data/lib/schematic/catalogs/types/list_catalogs_request.rb +14 -0
  16. data/lib/schematic/catalogs/types/list_catalogs_response.rb +12 -0
  17. data/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb +20 -0
  18. data/lib/schematic/catalogs/types/update_catalog_request_body.rb +14 -0
  19. data/lib/schematic/catalogs/types/update_catalog_response.rb +12 -0
  20. data/lib/schematic/catalogs/types/update_configuration_response.rb +12 -0
  21. data/lib/schematic/checkout/client.rb +69 -0
  22. data/lib/schematic/checkout/types/get_company_billing_details_response.rb +12 -0
  23. data/lib/schematic/checkout/types/update_company_billing_details_request_body.rb +15 -0
  24. data/lib/schematic/checkout/types/update_company_billing_details_response.rb +12 -0
  25. data/lib/schematic/client.rb +6 -1
  26. data/lib/schematic/components/client.rb +37 -0
  27. data/lib/schematic/components/types/bind_catalog_request_body.rb +12 -0
  28. data/lib/schematic/components/types/bind_catalog_response.rb +12 -0
  29. data/lib/schematic/dataexports/client.rb +76 -0
  30. data/lib/schematic/dataexports/types/create_data_export_request_body.rb +3 -3
  31. data/lib/schematic/dataexports/types/get_data_export_response.rb +12 -0
  32. data/lib/schematic/dataexports/types/list_data_exports_params.rb +15 -0
  33. data/lib/schematic/dataexports/types/list_data_exports_request.rb +14 -0
  34. data/lib/schematic/dataexports/types/list_data_exports_response.rb +12 -0
  35. data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +1 -0
  36. data/lib/schematic/types/audit_log_export_metadata.rb +13 -0
  37. data/lib/schematic/types/catalog_config_ordered_bundle.rb +9 -0
  38. data/lib/schematic/types/catalog_config_ordered_bundle_response_data.rb +9 -0
  39. data/lib/schematic/types/catalog_config_ordered_entitlement.rb +10 -0
  40. data/lib/schematic/types/catalog_config_ordered_entitlement_response_data.rb +10 -0
  41. data/lib/schematic/types/catalog_config_ordered_plan.rb +10 -0
  42. data/lib/schematic/types/catalog_config_ordered_plan_response_data.rb +10 -0
  43. data/lib/schematic/types/catalog_configuration_response_data.rb +19 -0
  44. data/lib/schematic/types/catalog_credit_bundle_i_ds_response_data.rb +9 -0
  45. data/lib/schematic/types/catalog_derived_feature_response_data.rb +11 -0
  46. data/lib/schematic/types/catalog_derived_features_response_data.rb +9 -0
  47. data/lib/schematic/types/catalog_plan_i_ds_response_data.rb +9 -0
  48. data/lib/schematic/types/catalog_response_data.rb +22 -0
  49. data/lib/schematic/types/company_billing_address_view.rb +14 -0
  50. data/lib/schematic/types/company_billing_checkout_settings.rb +11 -0
  51. data/lib/schematic/types/company_billing_details_response_data.rb +13 -0
  52. data/lib/schematic/types/company_billing_details_view.rb +13 -0
  53. data/lib/schematic/types/company_feature_usage_export_metadata.rb +25 -0
  54. data/lib/schematic/types/company_plan_detail_response_data.rb +1 -0
  55. data/lib/schematic/types/component_response_data.rb +1 -0
  56. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +1 -0
  57. data/lib/schematic/types/credits_auto_topup_success.rb +12 -0
  58. data/lib/schematic/types/credits_credit_purchase_success.rb +14 -0
  59. data/lib/schematic/types/credits_webhook_company_summary.rb +10 -0
  60. data/lib/schematic/types/credits_webhook_credit_summary.rb +10 -0
  61. data/lib/schematic/types/customer_billing_address.rb +14 -0
  62. data/lib/schematic/types/data_export_metadata.rb +14 -0
  63. data/lib/schematic/types/data_export_output_file_type.rb +3 -14
  64. data/lib/schematic/types/data_export_response_data.rb +3 -3
  65. data/lib/schematic/types/data_export_type.rb +3 -14
  66. data/lib/schematic/types/feature_entitlement.rb +1 -0
  67. data/lib/schematic/types/plan_catalog_membership_response_data.rb +10 -0
  68. data/lib/schematic/types/plan_detail_response_data.rb +1 -0
  69. data/lib/schematic/types/plan_group_plan_detail_response_data.rb +1 -0
  70. data/lib/schematic/types/plan_view_public_response_data.rb +1 -0
  71. data/lib/schematic/types/preview_subscription_discount_response_data.rb +19 -0
  72. data/lib/schematic/types/preview_subscription_finance_response_data.rb +2 -0
  73. data/lib/schematic/types/rulesengine_feature_entitlement.rb +1 -0
  74. data/lib/schematic/types/rulesengine_warning_tier.rb +10 -0
  75. data/lib/schematic/types/upsert_company_request_body.rb +2 -0
  76. data/lib/schematic/types/warning_tier.rb +10 -0
  77. data/lib/schematic/types/webhook_request_type.rb +2 -0
  78. data/lib/schematic/version.rb +1 -1
  79. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  80. data/lib/schematic.rb +91 -38
  81. data/reference.md +1231 -48
  82. metadata +55 -2
@@ -0,0 +1,480 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ class Client
6
+ # @param client [Schematic::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # @param request_options [Hash]
14
+ # @param params [Hash]
15
+ # @option request_options [String] :base_url
16
+ # @option request_options [Hash{String => Object}] :additional_headers
17
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
18
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
19
+ # @option request_options [Integer] :timeout_in_seconds
20
+ # @option params [Boolean, nil] :is_default
21
+ # @option params [String, nil] :q
22
+ # @option params [Integer, nil] :limit
23
+ # @option params [Integer, nil] :offset
24
+ #
25
+ # @return [Schematic::Catalogs::Types::ListCatalogsResponse]
26
+ def list_catalogs(request_options: {}, **params)
27
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
28
+ query_param_names = %i[is_default q limit offset]
29
+ query_params = {}
30
+ query_params["is_default"] = params[:is_default] if params.key?(:is_default)
31
+ query_params["q"] = params[:q] if params.key?(:q)
32
+ query_params["limit"] = params[:limit] if params.key?(:limit)
33
+ query_params["offset"] = params[:offset] if params.key?(:offset)
34
+ params.except(*query_param_names)
35
+
36
+ request = Schematic::Internal::JSON::Request.new(
37
+ base_url: request_options[:base_url],
38
+ method: "GET",
39
+ path: "catalogs",
40
+ query: query_params,
41
+ request_options: request_options
42
+ )
43
+ begin
44
+ response = @client.send(request)
45
+ rescue Net::HTTPRequestTimeout
46
+ raise Schematic::Errors::TimeoutError
47
+ end
48
+ code = response.code.to_i
49
+ if code.between?(200, 299)
50
+ Schematic::Catalogs::Types::ListCatalogsResponse.load(response.body)
51
+ else
52
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
53
+ raise error_class.new(response.body, code: code)
54
+ end
55
+ end
56
+
57
+ # @param request_options [Hash]
58
+ # @param params [Schematic::Catalogs::Types::CreateCatalogRequestBody]
59
+ # @option request_options [String] :base_url
60
+ # @option request_options [Hash{String => Object}] :additional_headers
61
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
62
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
63
+ # @option request_options [Integer] :timeout_in_seconds
64
+ #
65
+ # @return [Schematic::Catalogs::Types::CreateCatalogResponse]
66
+ def create_catalog(request_options: {}, **params)
67
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
68
+ request = Schematic::Internal::JSON::Request.new(
69
+ base_url: request_options[:base_url],
70
+ method: "POST",
71
+ path: "catalogs",
72
+ body: Schematic::Catalogs::Types::CreateCatalogRequestBody.new(params).to_h,
73
+ request_options: request_options
74
+ )
75
+ begin
76
+ response = @client.send(request)
77
+ rescue Net::HTTPRequestTimeout
78
+ raise Schematic::Errors::TimeoutError
79
+ end
80
+ code = response.code.to_i
81
+ if code.between?(200, 299)
82
+ Schematic::Catalogs::Types::CreateCatalogResponse.load(response.body)
83
+ else
84
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
85
+ raise error_class.new(response.body, code: code)
86
+ end
87
+ end
88
+
89
+ # @param request_options [Hash]
90
+ # @param params [Hash]
91
+ # @option request_options [String] :base_url
92
+ # @option request_options [Hash{String => Object}] :additional_headers
93
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
94
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
95
+ # @option request_options [Integer] :timeout_in_seconds
96
+ # @option params [String] :catalog_id
97
+ #
98
+ # @return [Schematic::Catalogs::Types::GetCatalogResponse]
99
+ def get_catalog(request_options: {}, **params)
100
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
101
+ request = Schematic::Internal::JSON::Request.new(
102
+ base_url: request_options[:base_url],
103
+ method: "GET",
104
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}",
105
+ request_options: request_options
106
+ )
107
+ begin
108
+ response = @client.send(request)
109
+ rescue Net::HTTPRequestTimeout
110
+ raise Schematic::Errors::TimeoutError
111
+ end
112
+ code = response.code.to_i
113
+ if code.between?(200, 299)
114
+ Schematic::Catalogs::Types::GetCatalogResponse.load(response.body)
115
+ else
116
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
117
+ raise error_class.new(response.body, code: code)
118
+ end
119
+ end
120
+
121
+ # @param request_options [Hash]
122
+ # @param params [Schematic::Catalogs::Types::UpdateCatalogRequestBody]
123
+ # @option request_options [String] :base_url
124
+ # @option request_options [Hash{String => Object}] :additional_headers
125
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
126
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
127
+ # @option request_options [Integer] :timeout_in_seconds
128
+ # @option params [String] :catalog_id
129
+ #
130
+ # @return [Schematic::Catalogs::Types::UpdateCatalogResponse]
131
+ def update_catalog(request_options: {}, **params)
132
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
133
+ request_data = Schematic::Catalogs::Types::UpdateCatalogRequestBody.new(params).to_h
134
+ non_body_param_names = ["catalog_id"]
135
+ body = request_data.except(*non_body_param_names)
136
+
137
+ request = Schematic::Internal::JSON::Request.new(
138
+ base_url: request_options[:base_url],
139
+ method: "PUT",
140
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}",
141
+ body: body,
142
+ request_options: request_options
143
+ )
144
+ begin
145
+ response = @client.send(request)
146
+ rescue Net::HTTPRequestTimeout
147
+ raise Schematic::Errors::TimeoutError
148
+ end
149
+ code = response.code.to_i
150
+ if code.between?(200, 299)
151
+ Schematic::Catalogs::Types::UpdateCatalogResponse.load(response.body)
152
+ else
153
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
154
+ raise error_class.new(response.body, code: code)
155
+ end
156
+ end
157
+
158
+ # @param request_options [Hash]
159
+ # @param params [Hash]
160
+ # @option request_options [String] :base_url
161
+ # @option request_options [Hash{String => Object}] :additional_headers
162
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
163
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
164
+ # @option request_options [Integer] :timeout_in_seconds
165
+ # @option params [String] :catalog_id
166
+ #
167
+ # @return [Schematic::Catalogs::Types::DeleteCatalogResponse]
168
+ def delete_catalog(request_options: {}, **params)
169
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
170
+ request = Schematic::Internal::JSON::Request.new(
171
+ base_url: request_options[:base_url],
172
+ method: "DELETE",
173
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}",
174
+ request_options: request_options
175
+ )
176
+ begin
177
+ response = @client.send(request)
178
+ rescue Net::HTTPRequestTimeout
179
+ raise Schematic::Errors::TimeoutError
180
+ end
181
+ code = response.code.to_i
182
+ if code.between?(200, 299)
183
+ Schematic::Catalogs::Types::DeleteCatalogResponse.load(response.body)
184
+ else
185
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
186
+ raise error_class.new(response.body, code: code)
187
+ end
188
+ end
189
+
190
+ # @param request_options [Hash]
191
+ # @param params [Hash]
192
+ # @option request_options [String] :base_url
193
+ # @option request_options [Hash{String => Object}] :additional_headers
194
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
195
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
196
+ # @option request_options [Integer] :timeout_in_seconds
197
+ # @option params [String] :catalog_id
198
+ #
199
+ # @return [Schematic::Catalogs::Types::GetConfigurationResponse]
200
+ def get_configuration(request_options: {}, **params)
201
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
202
+ request = Schematic::Internal::JSON::Request.new(
203
+ base_url: request_options[:base_url],
204
+ method: "GET",
205
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/configuration",
206
+ request_options: request_options
207
+ )
208
+ begin
209
+ response = @client.send(request)
210
+ rescue Net::HTTPRequestTimeout
211
+ raise Schematic::Errors::TimeoutError
212
+ end
213
+ code = response.code.to_i
214
+ if code.between?(200, 299)
215
+ Schematic::Catalogs::Types::GetConfigurationResponse.load(response.body)
216
+ else
217
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
218
+ raise error_class.new(response.body, code: code)
219
+ end
220
+ end
221
+
222
+ # @param request_options [Hash]
223
+ # @param params [Schematic::Catalogs::Types::UpdateCatalogConfigurationRequestBody]
224
+ # @option request_options [String] :base_url
225
+ # @option request_options [Hash{String => Object}] :additional_headers
226
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
227
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
228
+ # @option request_options [Integer] :timeout_in_seconds
229
+ # @option params [String] :catalog_id
230
+ #
231
+ # @return [Schematic::Catalogs::Types::UpdateConfigurationResponse]
232
+ def update_configuration(request_options: {}, **params)
233
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
234
+ request_data = Schematic::Catalogs::Types::UpdateCatalogConfigurationRequestBody.new(params).to_h
235
+ non_body_param_names = ["catalog_id"]
236
+ body = request_data.except(*non_body_param_names)
237
+
238
+ request = Schematic::Internal::JSON::Request.new(
239
+ base_url: request_options[:base_url],
240
+ method: "PUT",
241
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/configuration",
242
+ body: body,
243
+ request_options: request_options
244
+ )
245
+ begin
246
+ response = @client.send(request)
247
+ rescue Net::HTTPRequestTimeout
248
+ raise Schematic::Errors::TimeoutError
249
+ end
250
+ code = response.code.to_i
251
+ if code.between?(200, 299)
252
+ Schematic::Catalogs::Types::UpdateConfigurationResponse.load(response.body)
253
+ else
254
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
255
+ raise error_class.new(response.body, code: code)
256
+ end
257
+ end
258
+
259
+ # @param request_options [Hash]
260
+ # @param params [Hash]
261
+ # @option request_options [String] :base_url
262
+ # @option request_options [Hash{String => Object}] :additional_headers
263
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
264
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
265
+ # @option request_options [Integer] :timeout_in_seconds
266
+ # @option params [String] :catalog_id
267
+ #
268
+ # @return [Schematic::Catalogs::Types::GetCreditBundlesInCatalogResponse]
269
+ def get_credit_bundles_in_catalog(request_options: {}, **params)
270
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
271
+ request = Schematic::Internal::JSON::Request.new(
272
+ base_url: request_options[:base_url],
273
+ method: "GET",
274
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/credit-bundles",
275
+ request_options: request_options
276
+ )
277
+ begin
278
+ response = @client.send(request)
279
+ rescue Net::HTTPRequestTimeout
280
+ raise Schematic::Errors::TimeoutError
281
+ end
282
+ code = response.code.to_i
283
+ if code.between?(200, 299)
284
+ Schematic::Catalogs::Types::GetCreditBundlesInCatalogResponse.load(response.body)
285
+ else
286
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
287
+ raise error_class.new(response.body, code: code)
288
+ end
289
+ end
290
+
291
+ # @param request_options [Hash]
292
+ # @param params [Hash]
293
+ # @option request_options [String] :base_url
294
+ # @option request_options [Hash{String => Object}] :additional_headers
295
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
296
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
297
+ # @option request_options [Integer] :timeout_in_seconds
298
+ # @option params [String] :catalog_id
299
+ # @option params [String] :credit_bundle_id
300
+ #
301
+ # @return [untyped]
302
+ def add_credit_bundle(request_options: {}, **params)
303
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
304
+ request = Schematic::Internal::JSON::Request.new(
305
+ base_url: request_options[:base_url],
306
+ method: "POST",
307
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/credit-bundles/#{URI.encode_uri_component(params[:credit_bundle_id].to_s)}",
308
+ request_options: request_options
309
+ )
310
+ begin
311
+ response = @client.send(request)
312
+ rescue Net::HTTPRequestTimeout
313
+ raise Schematic::Errors::TimeoutError
314
+ end
315
+ code = response.code.to_i
316
+ return if code.between?(200, 299)
317
+
318
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
319
+ raise error_class.new(response.body, code: code)
320
+ end
321
+
322
+ # @param request_options [Hash]
323
+ # @param params [Hash]
324
+ # @option request_options [String] :base_url
325
+ # @option request_options [Hash{String => Object}] :additional_headers
326
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
327
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
328
+ # @option request_options [Integer] :timeout_in_seconds
329
+ # @option params [String] :catalog_id
330
+ # @option params [String] :credit_bundle_id
331
+ #
332
+ # @return [untyped]
333
+ def remove_credit_bundle(request_options: {}, **params)
334
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
335
+ request = Schematic::Internal::JSON::Request.new(
336
+ base_url: request_options[:base_url],
337
+ method: "DELETE",
338
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/credit-bundles/#{URI.encode_uri_component(params[:credit_bundle_id].to_s)}",
339
+ request_options: request_options
340
+ )
341
+ begin
342
+ response = @client.send(request)
343
+ rescue Net::HTTPRequestTimeout
344
+ raise Schematic::Errors::TimeoutError
345
+ end
346
+ code = response.code.to_i
347
+ return if code.between?(200, 299)
348
+
349
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
350
+ raise error_class.new(response.body, code: code)
351
+ end
352
+
353
+ # @param request_options [Hash]
354
+ # @param params [Hash]
355
+ # @option request_options [String] :base_url
356
+ # @option request_options [Hash{String => Object}] :additional_headers
357
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
358
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
359
+ # @option request_options [Integer] :timeout_in_seconds
360
+ # @option params [String] :catalog_id
361
+ #
362
+ # @return [Schematic::Catalogs::Types::GetDerivedFeaturesResponse]
363
+ def get_derived_features(request_options: {}, **params)
364
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
365
+ request = Schematic::Internal::JSON::Request.new(
366
+ base_url: request_options[:base_url],
367
+ method: "GET",
368
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/features",
369
+ request_options: request_options
370
+ )
371
+ begin
372
+ response = @client.send(request)
373
+ rescue Net::HTTPRequestTimeout
374
+ raise Schematic::Errors::TimeoutError
375
+ end
376
+ code = response.code.to_i
377
+ if code.between?(200, 299)
378
+ Schematic::Catalogs::Types::GetDerivedFeaturesResponse.load(response.body)
379
+ else
380
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
381
+ raise error_class.new(response.body, code: code)
382
+ end
383
+ end
384
+
385
+ # @param request_options [Hash]
386
+ # @param params [Hash]
387
+ # @option request_options [String] :base_url
388
+ # @option request_options [Hash{String => Object}] :additional_headers
389
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
390
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
391
+ # @option request_options [Integer] :timeout_in_seconds
392
+ # @option params [String] :catalog_id
393
+ #
394
+ # @return [Schematic::Catalogs::Types::GetPlansInCatalogResponse]
395
+ def get_plans_in_catalog(request_options: {}, **params)
396
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
397
+ request = Schematic::Internal::JSON::Request.new(
398
+ base_url: request_options[:base_url],
399
+ method: "GET",
400
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/plans",
401
+ request_options: request_options
402
+ )
403
+ begin
404
+ response = @client.send(request)
405
+ rescue Net::HTTPRequestTimeout
406
+ raise Schematic::Errors::TimeoutError
407
+ end
408
+ code = response.code.to_i
409
+ if code.between?(200, 299)
410
+ Schematic::Catalogs::Types::GetPlansInCatalogResponse.load(response.body)
411
+ else
412
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
413
+ raise error_class.new(response.body, code: code)
414
+ end
415
+ end
416
+
417
+ # @param request_options [Hash]
418
+ # @param params [Hash]
419
+ # @option request_options [String] :base_url
420
+ # @option request_options [Hash{String => Object}] :additional_headers
421
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
422
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
423
+ # @option request_options [Integer] :timeout_in_seconds
424
+ # @option params [String] :catalog_id
425
+ # @option params [String] :plan_id
426
+ #
427
+ # @return [untyped]
428
+ def add_plan(request_options: {}, **params)
429
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
430
+ request = Schematic::Internal::JSON::Request.new(
431
+ base_url: request_options[:base_url],
432
+ method: "POST",
433
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/plans/#{URI.encode_uri_component(params[:plan_id].to_s)}",
434
+ request_options: request_options
435
+ )
436
+ begin
437
+ response = @client.send(request)
438
+ rescue Net::HTTPRequestTimeout
439
+ raise Schematic::Errors::TimeoutError
440
+ end
441
+ code = response.code.to_i
442
+ return if code.between?(200, 299)
443
+
444
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
445
+ raise error_class.new(response.body, code: code)
446
+ end
447
+
448
+ # @param request_options [Hash]
449
+ # @param params [Hash]
450
+ # @option request_options [String] :base_url
451
+ # @option request_options [Hash{String => Object}] :additional_headers
452
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
453
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
454
+ # @option request_options [Integer] :timeout_in_seconds
455
+ # @option params [String] :catalog_id
456
+ # @option params [String] :plan_id
457
+ #
458
+ # @return [untyped]
459
+ def remove_plan(request_options: {}, **params)
460
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
461
+ request = Schematic::Internal::JSON::Request.new(
462
+ base_url: request_options[:base_url],
463
+ method: "DELETE",
464
+ path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/plans/#{URI.encode_uri_component(params[:plan_id].to_s)}",
465
+ request_options: request_options
466
+ )
467
+ begin
468
+ response = @client.send(request)
469
+ rescue Net::HTTPRequestTimeout
470
+ raise Schematic::Errors::TimeoutError
471
+ end
472
+ code = response.code.to_i
473
+ return if code.between?(200, 299)
474
+
475
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
476
+ raise error_class.new(response.body, code: code)
477
+ end
478
+ end
479
+ end
480
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class CreateCatalogRequestBody < Internal::Types::Model
7
+ field :description, -> { String }, optional: true, nullable: false
8
+ field :is_default, -> { Internal::Types::Boolean }, optional: false, nullable: false
9
+ field :name, -> { String }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class CreateCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class DeleteCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class GetCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class GetConfigurationResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogConfigurationResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class GetCreditBundlesInCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogCreditBundleIDsResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class GetDerivedFeaturesResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogDerivedFeaturesResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class GetPlansInCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogPlanIDsResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ # Input parameters
7
+ class ListCatalogsParams < Internal::Types::Model
8
+ field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ field :q, -> { String }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class ListCatalogsRequest < Internal::Types::Model
7
+ field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false
8
+ field :q, -> { String }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class ListCatalogsResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Schematic::Types::CatalogResponseData] }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Catalogs::Types::ListCatalogsParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class UpdateCatalogConfigurationRequestBody < Internal::Types::Model
7
+ field :catalog_id, -> { String }, optional: false, nullable: false
8
+ field :custom_plan_cta_text, -> { String }, optional: true, nullable: false
9
+ field :custom_plan_cta_url, -> { String }, optional: true, nullable: false
10
+ field :custom_plan_price_text, -> { String }, optional: true, nullable: false
11
+ field :custom_plans_visible, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
+ field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan] }, optional: true, nullable: false
13
+ field :ordered_bundles, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedBundle] }, optional: true, nullable: false
14
+ field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan] }, optional: true, nullable: false
15
+ field :pricing_model, -> { String }, optional: true, nullable: false
16
+ field :pricing_url, -> { String }, optional: true, nullable: false
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class UpdateCatalogRequestBody < Internal::Types::Model
7
+ field :catalog_id, -> { String }, optional: false, nullable: false
8
+ field :description, -> { String }, optional: true, nullable: false
9
+ field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+ field :name, -> { String }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end