smplkit 3.0.7 → 3.0.9

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +7 -0
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +16 -464
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +7 -0
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +7 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +7 -0
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/invitations_api.rb +7 -0
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +23 -2
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/plans_api.rb +9 -2
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/products_api.rb +9 -2
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +7 -0
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/subscription_api.rb +289 -0
  13. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +7 -0
  14. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_response.rb → admin_subscription_request.rb} +9 -20
  15. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/admin_subscription_request_attributes.rb +190 -0
  16. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_data.rb → admin_subscription_request_resource.rb} +46 -12
  17. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{next_tier_meta.rb → next_tier_response.rb} +6 -6
  18. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_change_projection.rb +321 -0
  19. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_attributes.rb → subscription_item_request.rb} +10 -21
  20. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_attributes.rb → subscription_item_response.rb} +66 -77
  21. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_attributes.rb +390 -0
  22. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_resource.rb +241 -0
  23. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{plan_change_request.rb → subscription_preview_response.rb} +20 -21
  24. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_body.rb → subscription_request.rb} +5 -5
  25. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_attributes.rb +179 -0
  26. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_resource.rb +227 -0
  27. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +4 -2
  28. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -1
  29. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_meta.rb → subscription_response_attributes.rb} +135 -62
  30. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +15 -8
  31. data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +1 -0
  32. data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +3 -86
  33. data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +1 -0
  34. data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +1 -0
  35. data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +1 -0
  36. data/lib/smplkit/_generated/app/spec/api/invitations_api_spec.rb +1 -0
  37. data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +4 -1
  38. data/lib/smplkit/_generated/app/spec/api/plans_api_spec.rb +2 -1
  39. data/lib/smplkit/_generated/app/spec/api/products_api_spec.rb +2 -1
  40. data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +1 -0
  41. data/lib/smplkit/_generated/app/spec/api/subscription_api_spec.rb +83 -0
  42. data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +1 -0
  43. data/lib/smplkit/_generated/app/spec/models/{create_subscription_attributes_spec.rb → admin_subscription_request_attributes_spec.rb} +9 -9
  44. data/lib/smplkit/_generated/app/spec/models/admin_subscription_request_resource_spec.rb +52 -0
  45. data/lib/smplkit/_generated/app/spec/models/{plan_change_request_spec.rb → admin_subscription_request_spec.rb} +7 -7
  46. data/lib/smplkit/_generated/app/spec/models/{next_tier_meta_spec.rb → next_tier_response_spec.rb} +6 -6
  47. data/lib/smplkit/_generated/app/spec/models/{subscription_list_meta_spec.rb → subscription_change_projection_spec.rb} +20 -14
  48. data/lib/smplkit/_generated/app/spec/models/{create_subscription_data_spec.rb → subscription_item_request_spec.rb} +8 -8
  49. data/lib/smplkit/_generated/app/spec/models/{subscription_attributes_spec.rb → subscription_item_response_spec.rb} +12 -18
  50. data/lib/smplkit/_generated/app/spec/models/subscription_preview_attributes_spec.rb +88 -0
  51. data/lib/smplkit/_generated/app/spec/models/subscription_preview_resource_spec.rb +56 -0
  52. data/lib/smplkit/_generated/app/spec/models/subscription_preview_response_spec.rb +36 -0
  53. data/lib/smplkit/_generated/app/spec/models/{subscription_list_response_spec.rb → subscription_request_attributes_spec.rb} +8 -8
  54. data/lib/smplkit/_generated/app/spec/models/subscription_request_resource_spec.rb +52 -0
  55. data/lib/smplkit/_generated/app/spec/models/{create_subscription_body_spec.rb → subscription_request_spec.rb} +6 -6
  56. data/lib/smplkit/_generated/app/spec/models/subscription_response_attributes_spec.rb +100 -0
  57. metadata +31 -17
@@ -217,6 +217,7 @@ module SmplkitGeneratedClient::App
217
217
  # List all context instances for the authenticated account.
218
218
  # @param [Hash] opts the optional parameters
219
219
  # @option opts [String] :filter_context_type
220
+ # @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `created_at`, `-created_at`, `key`, `-key`, `name`, `-name`, `updated_at`, `-updated_at`. (default to 'key')
220
221
  # @return [ContextListResponse]
221
222
  def list_contexts(opts = {})
222
223
  data, _status_code, _headers = list_contexts_with_http_info(opts)
@@ -227,17 +228,23 @@ module SmplkitGeneratedClient::App
227
228
  # List all context instances for the authenticated account.
228
229
  # @param [Hash] opts the optional parameters
229
230
  # @option opts [String] :filter_context_type
231
+ # @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `created_at`, `-created_at`, `key`, `-key`, `name`, `-name`, `updated_at`, `-updated_at`. (default to 'key')
230
232
  # @return [Array<(ContextListResponse, Integer, Hash)>] ContextListResponse data, response status code and response headers
231
233
  def list_contexts_with_http_info(opts = {})
232
234
  if @api_client.config.debugging
233
235
  @api_client.config.logger.debug 'Calling API: ContextsApi.list_contexts ...'
234
236
  end
237
+ allowable_values = ["created_at", "-created_at", "key", "-key", "name", "-name", "updated_at", "-updated_at"]
238
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
239
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
240
+ end
235
241
  # resource path
236
242
  local_var_path = '/api/v1/contexts'
237
243
 
238
244
  # query parameters
239
245
  query_params = opts[:query_params] || {}
240
246
  query_params[:'filter[context_type]'] = opts[:'filter_context_type'] if !opts[:'filter_context_type'].nil?
247
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
241
248
 
242
249
  # header parameters
243
250
  header_params = opts[:header_params] || {}
@@ -282,6 +282,7 @@ module SmplkitGeneratedClient::App
282
282
  # List Environments
283
283
  # List all environments for the authenticated account.
284
284
  # @param [Hash] opts the optional parameters
285
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;. (default to 'name')
285
286
  # @return [EnvironmentListResponse]
286
287
  def list_environments(opts = {})
287
288
  data, _status_code, _headers = list_environments_with_http_info(opts)
@@ -291,16 +292,22 @@ module SmplkitGeneratedClient::App
291
292
  # List Environments
292
293
  # List all environments for the authenticated account.
293
294
  # @param [Hash] opts the optional parameters
295
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;. (default to 'name')
294
296
  # @return [Array<(EnvironmentListResponse, Integer, Hash)>] EnvironmentListResponse data, response status code and response headers
295
297
  def list_environments_with_http_info(opts = {})
296
298
  if @api_client.config.debugging
297
299
  @api_client.config.logger.debug 'Calling API: EnvironmentsApi.list_environments ...'
298
300
  end
301
+ allowable_values = ["created_at", "-created_at", "key", "-key", "name", "-name", "updated_at", "-updated_at"]
302
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
303
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
304
+ end
299
305
  # resource path
300
306
  local_var_path = '/api/v1/environments'
301
307
 
302
308
  # query parameters
303
309
  query_params = opts[:query_params] || {}
310
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
304
311
 
305
312
  # header parameters
306
313
  header_params = opts[:header_params] || {}
@@ -160,6 +160,7 @@ module SmplkitGeneratedClient::App
160
160
  # @param [Hash] opts the optional parameters
161
161
  # @option opts [String] :filter_status
162
162
  # @option opts [String] :filter_token
163
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-created_at&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;email&#x60;, &#x60;-email&#x60;, &#x60;status&#x60;, &#x60;-status&#x60;. (default to '-created_at')
163
164
  # @return [InvitationListResponse]
164
165
  def list_invitations(opts = {})
165
166
  data, _status_code, _headers = list_invitations_with_http_info(opts)
@@ -171,11 +172,16 @@ module SmplkitGeneratedClient::App
171
172
  # @param [Hash] opts the optional parameters
172
173
  # @option opts [String] :filter_status
173
174
  # @option opts [String] :filter_token
175
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-created_at&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;email&#x60;, &#x60;-email&#x60;, &#x60;status&#x60;, &#x60;-status&#x60;. (default to '-created_at')
174
176
  # @return [Array<(InvitationListResponse, Integer, Hash)>] InvitationListResponse data, response status code and response headers
175
177
  def list_invitations_with_http_info(opts = {})
176
178
  if @api_client.config.debugging
177
179
  @api_client.config.logger.debug 'Calling API: InvitationsApi.list_invitations ...'
178
180
  end
181
+ allowable_values = ["created_at", "-created_at", "email", "-email", "status", "-status"]
182
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
183
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
184
+ end
179
185
  # resource path
180
186
  local_var_path = '/api/v1/invitations'
181
187
 
@@ -183,6 +189,7 @@ module SmplkitGeneratedClient::App
183
189
  query_params = opts[:query_params] || {}
184
190
  query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
185
191
  query_params[:'filter[token]'] = opts[:'filter_token'] if !opts[:'filter_token'].nil?
192
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
186
193
 
187
194
  # header parameters
188
195
  header_params = opts[:header_params] || {}
@@ -88,8 +88,9 @@ module SmplkitGeneratedClient::App
88
88
  end
89
89
 
90
90
  # List Metric Names
91
- # Return distinct metric names recorded for the account, each with a representative unit. Plain-JSON response (not JSON:API) — this is metadata for discovery, not a metric resource.
91
+ # Return distinct metric names recorded for the account, each with a representative unit. Plain-JSON response (not JSON:API) — this is metadata for discovery, not a metric resource. Default sort is `name` ascending.
92
92
  # @param [Hash] opts the optional parameters
93
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;name&#x60;, &#x60;-name&#x60;. (default to 'name')
93
94
  # @return [MetricNamesResponse]
94
95
  def list_metric_names(opts = {})
95
96
  data, _status_code, _headers = list_metric_names_with_http_info(opts)
@@ -97,18 +98,24 @@ module SmplkitGeneratedClient::App
97
98
  end
98
99
 
99
100
  # List Metric Names
100
- # Return distinct metric names recorded for the account, each with a representative unit. Plain-JSON response (not JSON:API) — this is metadata for discovery, not a metric resource.
101
+ # Return distinct metric names recorded for the account, each with a representative unit. Plain-JSON response (not JSON:API) — this is metadata for discovery, not a metric resource. Default sort is &#x60;name&#x60; ascending.
101
102
  # @param [Hash] opts the optional parameters
103
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;name&#x60;, &#x60;-name&#x60;. (default to 'name')
102
104
  # @return [Array<(MetricNamesResponse, Integer, Hash)>] MetricNamesResponse data, response status code and response headers
103
105
  def list_metric_names_with_http_info(opts = {})
104
106
  if @api_client.config.debugging
105
107
  @api_client.config.logger.debug 'Calling API: MetricsApi.list_metric_names ...'
106
108
  end
109
+ allowable_values = ["name", "-name"]
110
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
111
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
112
+ end
107
113
  # resource path
108
114
  local_var_path = '/api/v1/metric_names'
109
115
 
110
116
  # query parameters
111
117
  query_params = opts[:query_params] || {}
118
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
112
119
 
113
120
  # header parameters
114
121
  header_params = opts[:header_params] || {}
@@ -150,6 +157,7 @@ module SmplkitGeneratedClient::App
150
157
  # @param filter_rollup [String]
151
158
  # @param [Hash] opts the optional parameters
152
159
  # @option opts [String] :filter_recorded_at
160
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;bucket&#x60;. Allowed values: &#x60;bucket&#x60;, &#x60;-bucket&#x60;. (default to 'bucket')
153
161
  # @return [MetricRollupListResponse]
154
162
  def list_metric_rollups(filter_name, filter_rollup, opts = {})
155
163
  data, _status_code, _headers = list_metric_rollups_with_http_info(filter_name, filter_rollup, opts)
@@ -162,6 +170,7 @@ module SmplkitGeneratedClient::App
162
170
  # @param filter_rollup [String]
163
171
  # @param [Hash] opts the optional parameters
164
172
  # @option opts [String] :filter_recorded_at
173
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;bucket&#x60;. Allowed values: &#x60;bucket&#x60;, &#x60;-bucket&#x60;. (default to 'bucket')
165
174
  # @return [Array<(MetricRollupListResponse, Integer, Hash)>] MetricRollupListResponse data, response status code and response headers
166
175
  def list_metric_rollups_with_http_info(filter_name, filter_rollup, opts = {})
167
176
  if @api_client.config.debugging
@@ -175,6 +184,10 @@ module SmplkitGeneratedClient::App
175
184
  if @api_client.config.client_side_validation && filter_rollup.nil?
176
185
  fail ArgumentError, "Missing the required parameter 'filter_rollup' when calling MetricsApi.list_metric_rollups"
177
186
  end
187
+ allowable_values = ["bucket", "-bucket"]
188
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
189
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
190
+ end
178
191
  # resource path
179
192
  local_var_path = '/api/v1/metric_rollups'
180
193
 
@@ -183,6 +196,7 @@ module SmplkitGeneratedClient::App
183
196
  query_params[:'filter[name]'] = filter_name
184
197
  query_params[:'filter[rollup]'] = filter_rollup
185
198
  query_params[:'filter[recorded_at]'] = opts[:'filter_recorded_at'] if !opts[:'filter_recorded_at'].nil?
199
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
186
200
 
187
201
  # header parameters
188
202
  header_params = opts[:header_params] || {}
@@ -223,6 +237,7 @@ module SmplkitGeneratedClient::App
223
237
  # @param filter_name [String]
224
238
  # @param [Hash] opts the optional parameters
225
239
  # @option opts [String] :filter_recorded_at
240
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-recorded_at&#x60;. Allowed values: &#x60;recorded_at&#x60;, &#x60;-recorded_at&#x60;, &#x60;value&#x60;, &#x60;-value&#x60;. (default to '-recorded_at')
226
241
  # @return [MetricListResponse]
227
242
  def list_metrics(filter_name, opts = {})
228
243
  data, _status_code, _headers = list_metrics_with_http_info(filter_name, opts)
@@ -234,6 +249,7 @@ module SmplkitGeneratedClient::App
234
249
  # @param filter_name [String]
235
250
  # @param [Hash] opts the optional parameters
236
251
  # @option opts [String] :filter_recorded_at
252
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-recorded_at&#x60;. Allowed values: &#x60;recorded_at&#x60;, &#x60;-recorded_at&#x60;, &#x60;value&#x60;, &#x60;-value&#x60;. (default to '-recorded_at')
237
253
  # @return [Array<(MetricListResponse, Integer, Hash)>] MetricListResponse data, response status code and response headers
238
254
  def list_metrics_with_http_info(filter_name, opts = {})
239
255
  if @api_client.config.debugging
@@ -243,6 +259,10 @@ module SmplkitGeneratedClient::App
243
259
  if @api_client.config.client_side_validation && filter_name.nil?
244
260
  fail ArgumentError, "Missing the required parameter 'filter_name' when calling MetricsApi.list_metrics"
245
261
  end
262
+ allowable_values = ["recorded_at", "-recorded_at", "value", "-value"]
263
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
264
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
265
+ end
246
266
  # resource path
247
267
  local_var_path = '/api/v1/metrics'
248
268
 
@@ -250,6 +270,7 @@ module SmplkitGeneratedClient::App
250
270
  query_params = opts[:query_params] || {}
251
271
  query_params[:'filter[name]'] = filter_name
252
272
  query_params[:'filter[recorded_at]'] = opts[:'filter_recorded_at'] if !opts[:'filter_recorded_at'].nil?
273
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
253
274
 
254
275
  # header parameters
255
276
  header_params = opts[:header_params] || {}
@@ -20,8 +20,9 @@ module SmplkitGeneratedClient::App
20
20
  @api_client = api_client
21
21
  end
22
22
  # List Plans
23
- # Return all plan tier definitions as JSON:API resources.
23
+ # Return all plan tier definitions as JSON:API resources. Default sort is `sort_order` ascending — the natural ladder defined in `plans.yaml`. Pass `sort=display_name` for an alphabetical view.
24
24
  # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;sort_order&#x60;. Allowed values: &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;id&#x60;, &#x60;-id&#x60;, &#x60;sort_order&#x60;, &#x60;-sort_order&#x60;. (default to 'sort_order')
25
26
  # @return [PlanListResponse]
26
27
  def list_plans(opts = {})
27
28
  data, _status_code, _headers = list_plans_with_http_info(opts)
@@ -29,18 +30,24 @@ module SmplkitGeneratedClient::App
29
30
  end
30
31
 
31
32
  # List Plans
32
- # Return all plan tier definitions as JSON:API resources.
33
+ # Return all plan tier definitions as JSON:API resources. Default sort is &#x60;sort_order&#x60; ascending — the natural ladder defined in &#x60;plans.yaml&#x60;. Pass &#x60;sort&#x3D;display_name&#x60; for an alphabetical view.
33
34
  # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;sort_order&#x60;. Allowed values: &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;id&#x60;, &#x60;-id&#x60;, &#x60;sort_order&#x60;, &#x60;-sort_order&#x60;. (default to 'sort_order')
34
36
  # @return [Array<(PlanListResponse, Integer, Hash)>] PlanListResponse data, response status code and response headers
35
37
  def list_plans_with_http_info(opts = {})
36
38
  if @api_client.config.debugging
37
39
  @api_client.config.logger.debug 'Calling API: PlansApi.list_plans ...'
38
40
  end
41
+ allowable_values = ["display_name", "-display_name", "id", "-id", "sort_order", "-sort_order"]
42
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
43
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
44
+ end
39
45
  # resource path
40
46
  local_var_path = '/api/v1/plans'
41
47
 
42
48
  # query parameters
43
49
  query_params = opts[:query_params] || {}
50
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
44
51
 
45
52
  # header parameters
46
53
  header_params = opts[:header_params] || {}
@@ -20,8 +20,9 @@ module SmplkitGeneratedClient::App
20
20
  @api_client = api_client
21
21
  end
22
22
  # List Products
23
- # Return all flag-enabled products with their plans, limits, and marketing content.
23
+ # Return all flag-enabled products with their plans, limits, and marketing content. Default sort is `display_name` ascending.
24
24
  # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;display_name&#x60;. Allowed values: &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;id&#x60;, &#x60;-id&#x60;. (default to 'display_name')
25
26
  # @return [ProductListResponse]
26
27
  def list_products(opts = {})
27
28
  data, _status_code, _headers = list_products_with_http_info(opts)
@@ -29,18 +30,24 @@ module SmplkitGeneratedClient::App
29
30
  end
30
31
 
31
32
  # List Products
32
- # Return all flag-enabled products with their plans, limits, and marketing content.
33
+ # Return all flag-enabled products with their plans, limits, and marketing content. Default sort is &#x60;display_name&#x60; ascending.
33
34
  # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;display_name&#x60;. Allowed values: &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;id&#x60;, &#x60;-id&#x60;. (default to 'display_name')
34
36
  # @return [Array<(ProductListResponse, Integer, Hash)>] ProductListResponse data, response status code and response headers
35
37
  def list_products_with_http_info(opts = {})
36
38
  if @api_client.config.debugging
37
39
  @api_client.config.logger.debug 'Calling API: ProductsApi.list_products ...'
38
40
  end
41
+ allowable_values = ["display_name", "-display_name", "id", "-id"]
42
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
43
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
44
+ end
39
45
  # resource path
40
46
  local_var_path = '/api/v1/products'
41
47
 
42
48
  # query parameters
43
49
  query_params = opts[:query_params] || {}
50
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
44
51
 
45
52
  # header parameters
46
53
  header_params = opts[:header_params] || {}
@@ -216,6 +216,7 @@ module SmplkitGeneratedClient::App
216
216
  # List Services
217
217
  # List all services for the authenticated account.
218
218
  # @param [Hash] opts the optional parameters
219
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;. (default to 'name')
219
220
  # @return [ServiceListResponse]
220
221
  def list_services(opts = {})
221
222
  data, _status_code, _headers = list_services_with_http_info(opts)
@@ -225,16 +226,22 @@ module SmplkitGeneratedClient::App
225
226
  # List Services
226
227
  # List all services for the authenticated account.
227
228
  # @param [Hash] opts the optional parameters
229
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;. (default to 'name')
228
230
  # @return [Array<(ServiceListResponse, Integer, Hash)>] ServiceListResponse data, response status code and response headers
229
231
  def list_services_with_http_info(opts = {})
230
232
  if @api_client.config.debugging
231
233
  @api_client.config.logger.debug 'Calling API: ServicesApi.list_services ...'
232
234
  end
235
+ allowable_values = ["created_at", "-created_at", "key", "-key", "name", "-name", "updated_at", "-updated_at"]
236
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
237
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
238
+ end
233
239
  # resource path
234
240
  local_var_path = '/api/v1/services'
235
241
 
236
242
  # query parameters
237
243
  query_params = opts[:query_params] || {}
244
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
238
245
 
239
246
  # header parameters
240
247
  header_params = opts[:header_params] || {}
@@ -0,0 +1,289 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SmplkitGeneratedClient::App
16
+ class SubscriptionApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Replace Account Subscription (admin)
23
+ # Admin replacement of a specific account's subscription. Accepts the same body shape as the customer endpoint plus ``discount_override_pct``. Setting the override to 100 skips the billing provider entirely; lowering it below 100 requires a payment method on file for the target account.
24
+ # @param account_id [String]
25
+ # @param admin_subscription_request [AdminSubscriptionRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [SubscriptionResponse]
28
+ def admin_put_account_subscription(account_id, admin_subscription_request, opts = {})
29
+ data, _status_code, _headers = admin_put_account_subscription_with_http_info(account_id, admin_subscription_request, opts)
30
+ data
31
+ end
32
+
33
+ # Replace Account Subscription (admin)
34
+ # Admin replacement of a specific account&#39;s subscription. Accepts the same body shape as the customer endpoint plus &#x60;&#x60;discount_override_pct&#x60;&#x60;. Setting the override to 100 skips the billing provider entirely; lowering it below 100 requires a payment method on file for the target account.
35
+ # @param account_id [String]
36
+ # @param admin_subscription_request [AdminSubscriptionRequest]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
39
+ def admin_put_account_subscription_with_http_info(account_id, admin_subscription_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: SubscriptionApi.admin_put_account_subscription ...'
42
+ end
43
+ # verify the required parameter 'account_id' is set
44
+ if @api_client.config.client_side_validation && account_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling SubscriptionApi.admin_put_account_subscription"
46
+ end
47
+ # verify the required parameter 'admin_subscription_request' is set
48
+ if @api_client.config.client_side_validation && admin_subscription_request.nil?
49
+ fail ArgumentError, "Missing the required parameter 'admin_subscription_request' when calling SubscriptionApi.admin_put_account_subscription"
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/v1/accounts/{account_id}/subscription'.sub('{account_id}', CGI.escape(account_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(admin_subscription_request)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"SubscriptionApi.admin_put_account_subscription",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: SubscriptionApi#admin_put_account_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Get Current Subscription
97
+ # Return the authenticated account's subscription, or 404 if none exists.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [SubscriptionResponse]
100
+ def get_current_subscription(opts = {})
101
+ data, _status_code, _headers = get_current_subscription_with_http_info(opts)
102
+ data
103
+ end
104
+
105
+ # Get Current Subscription
106
+ # Return the authenticated account&#39;s subscription, or 404 if none exists.
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
109
+ def get_current_subscription_with_http_info(opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: SubscriptionApi.get_current_subscription ...'
112
+ end
113
+ # resource path
114
+ local_var_path = '/api/v1/accounts/current/subscription'
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"SubscriptionApi.get_current_subscription",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: SubscriptionApi#get_current_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Preview Subscription Change
154
+ # Project the result of replacing the subscription with the desired state. No database or billing-provider changes are made; safe to call as the customer iterates on a plan picker.
155
+ # @param subscription_request [SubscriptionRequest]
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [SubscriptionPreviewResponse]
158
+ def preview_current_subscription(subscription_request, opts = {})
159
+ data, _status_code, _headers = preview_current_subscription_with_http_info(subscription_request, opts)
160
+ data
161
+ end
162
+
163
+ # Preview Subscription Change
164
+ # Project the result of replacing the subscription with the desired state. No database or billing-provider changes are made; safe to call as the customer iterates on a plan picker.
165
+ # @param subscription_request [SubscriptionRequest]
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(SubscriptionPreviewResponse, Integer, Hash)>] SubscriptionPreviewResponse data, response status code and response headers
168
+ def preview_current_subscription_with_http_info(subscription_request, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: SubscriptionApi.preview_current_subscription ...'
171
+ end
172
+ # verify the required parameter 'subscription_request' is set
173
+ if @api_client.config.client_side_validation && subscription_request.nil?
174
+ fail ArgumentError, "Missing the required parameter 'subscription_request' when calling SubscriptionApi.preview_current_subscription"
175
+ end
176
+ # resource path
177
+ local_var_path = '/api/v1/accounts/current/subscription/actions/preview'
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
186
+ # HTTP header 'Content-Type'
187
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
188
+ if !content_type.nil?
189
+ header_params['Content-Type'] = content_type
190
+ end
191
+
192
+ # form parameters
193
+ form_params = opts[:form_params] || {}
194
+
195
+ # http body (model)
196
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_request)
197
+
198
+ # return_type
199
+ return_type = opts[:debug_return_type] || 'SubscriptionPreviewResponse'
200
+
201
+ # auth_names
202
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
203
+
204
+ new_options = opts.merge(
205
+ :operation => :"SubscriptionApi.preview_current_subscription",
206
+ :header_params => header_params,
207
+ :query_params => query_params,
208
+ :form_params => form_params,
209
+ :body => post_body,
210
+ :auth_names => auth_names,
211
+ :return_type => return_type
212
+ )
213
+
214
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
215
+ if @api_client.config.debugging
216
+ @api_client.config.logger.debug "API called: SubscriptionApi#preview_current_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
+ end
218
+ return data, status_code, headers
219
+ end
220
+
221
+ # Replace Current Subscription
222
+ # Replace the authenticated account's subscription with the desired state.
223
+ # @param subscription_request [SubscriptionRequest]
224
+ # @param [Hash] opts the optional parameters
225
+ # @return [SubscriptionResponse]
226
+ def put_current_subscription(subscription_request, opts = {})
227
+ data, _status_code, _headers = put_current_subscription_with_http_info(subscription_request, opts)
228
+ data
229
+ end
230
+
231
+ # Replace Current Subscription
232
+ # Replace the authenticated account&#39;s subscription with the desired state.
233
+ # @param subscription_request [SubscriptionRequest]
234
+ # @param [Hash] opts the optional parameters
235
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
236
+ def put_current_subscription_with_http_info(subscription_request, opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: SubscriptionApi.put_current_subscription ...'
239
+ end
240
+ # verify the required parameter 'subscription_request' is set
241
+ if @api_client.config.client_side_validation && subscription_request.nil?
242
+ fail ArgumentError, "Missing the required parameter 'subscription_request' when calling SubscriptionApi.put_current_subscription"
243
+ end
244
+ # resource path
245
+ local_var_path = '/api/v1/accounts/current/subscription'
246
+
247
+ # query parameters
248
+ query_params = opts[:query_params] || {}
249
+
250
+ # header parameters
251
+ header_params = opts[:header_params] || {}
252
+ # HTTP header 'Accept' (if needed)
253
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
254
+ # HTTP header 'Content-Type'
255
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
256
+ if !content_type.nil?
257
+ header_params['Content-Type'] = content_type
258
+ end
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_request)
265
+
266
+ # return_type
267
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
268
+
269
+ # auth_names
270
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
271
+
272
+ new_options = opts.merge(
273
+ :operation => :"SubscriptionApi.put_current_subscription",
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type
280
+ )
281
+
282
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug "API called: SubscriptionApi#put_current_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285
+ end
286
+ return data, status_code, headers
287
+ end
288
+ end
289
+ end
@@ -204,6 +204,7 @@ module SmplkitGeneratedClient::App
204
204
  # @option opts [String] :filter_search Case-insensitive substring match against display_name and email. If the value is a valid UUID, also matches user id exactly.
205
205
  # @option opts [Integer] :page_number 1-based page number (default to 1)
206
206
  # @option opts [Integer] :page_size Items per page (default to 50)
207
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;email&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;email&#x60;, &#x60;-email&#x60;. (default to 'email')
207
208
  # @return [UserListResponse]
208
209
  def list_users(opts = {})
209
210
  data, _status_code, _headers = list_users_with_http_info(opts)
@@ -218,6 +219,7 @@ module SmplkitGeneratedClient::App
218
219
  # @option opts [String] :filter_search Case-insensitive substring match against display_name and email. If the value is a valid UUID, also matches user id exactly.
219
220
  # @option opts [Integer] :page_number 1-based page number (default to 1)
220
221
  # @option opts [Integer] :page_size Items per page (default to 50)
222
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;email&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;email&#x60;, &#x60;-email&#x60;. (default to 'email')
221
223
  # @return [Array<(UserListResponse, Integer, Hash)>] UserListResponse data, response status code and response headers
222
224
  def list_users_with_http_info(opts = {})
223
225
  if @api_client.config.debugging
@@ -235,6 +237,10 @@ module SmplkitGeneratedClient::App
235
237
  fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling UsersApi.list_users, must be greater than or equal to 1.'
236
238
  end
237
239
 
240
+ allowable_values = ["created_at", "-created_at", "display_name", "-display_name", "email", "-email"]
241
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
242
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
243
+ end
238
244
  # resource path
239
245
  local_var_path = '/api/v1/users'
240
246
 
@@ -245,6 +251,7 @@ module SmplkitGeneratedClient::App
245
251
  query_params[:'filter[search]'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?
246
252
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
247
253
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
254
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
248
255
 
249
256
  # header parameters
250
257
  header_params = opts[:header_params] || {}