smplkit 3.0.82 → 3.0.83

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb +420 -0
  3. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb +281 -0
  4. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/usage_api.rb +82 -0
  5. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_client.rb +441 -0
  6. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_error.rb +58 -0
  7. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_model_base.rb +88 -0
  8. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/configuration.rb +392 -0
  9. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/http_header.rb +220 -0
  10. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job.rb +401 -0
  11. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_create_request.rb +165 -0
  12. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_create_resource.rb +237 -0
  13. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_http_configuration.rb +368 -0
  14. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_list_response.rb +193 -0
  15. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_request.rb +165 -0
  16. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_resource.rb +186 -0
  17. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_response.rb +165 -0
  18. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/list_meta.rb +165 -0
  19. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/pagination_meta.rb +215 -0
  20. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run.rb +405 -0
  21. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_links.rb +149 -0
  22. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_meta.rb +166 -0
  23. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_response.rb +203 -0
  24. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_resource.rb +202 -0
  25. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_response.rb +165 -0
  26. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage.rb +274 -0
  27. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage_resource.rb +187 -0
  28. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage_response.rb +165 -0
  29. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/version.rb +15 -0
  30. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client.rb +63 -0
  31. data/lib/smplkit/_generated/jobs/spec/api/jobs_api_spec.rb +111 -0
  32. data/lib/smplkit/_generated/jobs/spec/api/runs_api_spec.rb +85 -0
  33. data/lib/smplkit/_generated/jobs/spec/api/usage_api_spec.rb +47 -0
  34. data/lib/smplkit/_generated/jobs/spec/models/http_header_spec.rb +42 -0
  35. data/lib/smplkit/_generated/jobs/spec/models/job_create_request_spec.rb +36 -0
  36. data/lib/smplkit/_generated/jobs/spec/models/job_create_resource_spec.rb +52 -0
  37. data/lib/smplkit/_generated/jobs/spec/models/job_http_configuration_spec.rb +82 -0
  38. data/lib/smplkit/_generated/jobs/spec/models/job_list_response_spec.rb +42 -0
  39. data/lib/smplkit/_generated/jobs/spec/models/job_request_spec.rb +36 -0
  40. data/lib/smplkit/_generated/jobs/spec/models/job_resource_spec.rb +48 -0
  41. data/lib/smplkit/_generated/jobs/spec/models/job_response_spec.rb +36 -0
  42. data/lib/smplkit/_generated/jobs/spec/models/job_spec.rb +110 -0
  43. data/lib/smplkit/_generated/jobs/spec/models/list_meta_spec.rb +36 -0
  44. data/lib/smplkit/_generated/jobs/spec/models/pagination_meta_spec.rb +54 -0
  45. data/lib/smplkit/_generated/jobs/spec/models/run_list_links_spec.rb +36 -0
  46. data/lib/smplkit/_generated/jobs/spec/models/run_list_meta_spec.rb +36 -0
  47. data/lib/smplkit/_generated/jobs/spec/models/run_list_response_spec.rb +48 -0
  48. data/lib/smplkit/_generated/jobs/spec/models/run_resource_spec.rb +48 -0
  49. data/lib/smplkit/_generated/jobs/spec/models/run_response_spec.rb +36 -0
  50. data/lib/smplkit/_generated/jobs/spec/models/run_spec.rb +138 -0
  51. data/lib/smplkit/_generated/jobs/spec/models/usage_resource_spec.rb +48 -0
  52. data/lib/smplkit/_generated/jobs/spec/models/usage_response_spec.rb +36 -0
  53. data/lib/smplkit/_generated/jobs/spec/models/usage_spec.rb +60 -0
  54. data/lib/smplkit/_generated/jobs/spec/spec_helper.rb +111 -0
  55. metadata +54 -1
@@ -0,0 +1,281 @@
1
+ =begin
2
+ #smplkit Jobs API
3
+
4
+ #Scheduled HTTP job execution API for smplkit.
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::Jobs
16
+ class RunsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Cancel Run
23
+ # Cancel a pending or running run. Returns `409` if the run is already in a terminal state. Canceling a running run stops us tracking it, but the HTTP request may already be in flight — cancel means \"stop tracking,\" not \"guaranteed it didn't happen.\"
24
+ # @param run_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [RunResponse]
27
+ def cancel_run(run_id, opts = {})
28
+ data, _status_code, _headers = cancel_run_with_http_info(run_id, opts)
29
+ data
30
+ end
31
+
32
+ # Cancel Run
33
+ # Cancel a pending or running run. Returns `409` if the run is already in a terminal state. Canceling a running run stops us tracking it, but the HTTP request may already be in flight — cancel means \"stop tracking,\" not \"guaranteed it didn't happen.\"
34
+ # @param run_id [String]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(RunResponse, Integer, Hash)>] RunResponse data, response status code and response headers
37
+ def cancel_run_with_http_info(run_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: RunsApi.cancel_run ...'
40
+ end
41
+ # verify the required parameter 'run_id' is set
42
+ if @api_client.config.client_side_validation && run_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling RunsApi.cancel_run"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/v1/runs/{run_id}/actions/cancel'.sub('{run_id}', CGI.escape(run_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'RunResponse'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"RunsApi.cancel_run",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: RunsApi#cancel_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Get Run
86
+ # Retrieve a single run by its id.
87
+ # @param run_id [String]
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [RunResponse]
90
+ def get_run(run_id, opts = {})
91
+ data, _status_code, _headers = get_run_with_http_info(run_id, opts)
92
+ data
93
+ end
94
+
95
+ # Get Run
96
+ # Retrieve a single run by its id.
97
+ # @param run_id [String]
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(RunResponse, Integer, Hash)>] RunResponse data, response status code and response headers
100
+ def get_run_with_http_info(run_id, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: RunsApi.get_run ...'
103
+ end
104
+ # verify the required parameter 'run_id' is set
105
+ if @api_client.config.client_side_validation && run_id.nil?
106
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling RunsApi.get_run"
107
+ end
108
+ # resource path
109
+ local_var_path = '/api/v1/runs/{run_id}'.sub('{run_id}', CGI.escape(run_id.to_s))
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+
114
+ # header parameters
115
+ header_params = opts[:header_params] || {}
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
118
+
119
+ # form parameters
120
+ form_params = opts[:form_params] || {}
121
+
122
+ # http body (model)
123
+ post_body = opts[:debug_body]
124
+
125
+ # return_type
126
+ return_type = opts[:debug_return_type] || 'RunResponse'
127
+
128
+ # auth_names
129
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
130
+
131
+ new_options = opts.merge(
132
+ :operation => :"RunsApi.get_run",
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: RunsApi#get_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # List Runs
149
+ # List runs for this account, newest first (cursor paginated). Use `filter[job]={slug}` for a single job's run history.
150
+ # @param [Hash] opts the optional parameters
151
+ # @option opts [String] :filter_job
152
+ # @option opts [Integer] :page_size
153
+ # @option opts [String] :page_after
154
+ # @return [RunListResponse]
155
+ def list_runs(opts = {})
156
+ data, _status_code, _headers = list_runs_with_http_info(opts)
157
+ data
158
+ end
159
+
160
+ # List Runs
161
+ # List runs for this account, newest first (cursor paginated). Use &#x60;filter[job]&#x3D;{slug}&#x60; for a single job&#39;s run history.
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [String] :filter_job
164
+ # @option opts [Integer] :page_size
165
+ # @option opts [String] :page_after
166
+ # @return [Array<(RunListResponse, Integer, Hash)>] RunListResponse data, response status code and response headers
167
+ def list_runs_with_http_info(opts = {})
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug 'Calling API: RunsApi.list_runs ...'
170
+ end
171
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
172
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling RunsApi.list_runs, must be greater than or equal to 1.'
173
+ end
174
+
175
+ # resource path
176
+ local_var_path = '/api/v1/runs'
177
+
178
+ # query parameters
179
+ query_params = opts[:query_params] || {}
180
+ query_params[:'filter[job]'] = opts[:'filter_job'] if !opts[:'filter_job'].nil?
181
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
182
+ query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
183
+
184
+ # header parameters
185
+ header_params = opts[:header_params] || {}
186
+ # HTTP header 'Accept' (if needed)
187
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
188
+
189
+ # form parameters
190
+ form_params = opts[:form_params] || {}
191
+
192
+ # http body (model)
193
+ post_body = opts[:debug_body]
194
+
195
+ # return_type
196
+ return_type = opts[:debug_return_type] || 'RunListResponse'
197
+
198
+ # auth_names
199
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
200
+
201
+ new_options = opts.merge(
202
+ :operation => :"RunsApi.list_runs",
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type
209
+ )
210
+
211
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: RunsApi#list_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+
218
+ # Rerun Run
219
+ # Spawn a new run from a prior run, using the job's current configuration. Returns `409` if the run's parent job has been deleted.
220
+ # @param run_id [String]
221
+ # @param [Hash] opts the optional parameters
222
+ # @return [RunResponse]
223
+ def rerun_run(run_id, opts = {})
224
+ data, _status_code, _headers = rerun_run_with_http_info(run_id, opts)
225
+ data
226
+ end
227
+
228
+ # Rerun Run
229
+ # Spawn a new run from a prior run, using the job&#39;s current configuration. Returns &#x60;409&#x60; if the run&#39;s parent job has been deleted.
230
+ # @param run_id [String]
231
+ # @param [Hash] opts the optional parameters
232
+ # @return [Array<(RunResponse, Integer, Hash)>] RunResponse data, response status code and response headers
233
+ def rerun_run_with_http_info(run_id, opts = {})
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug 'Calling API: RunsApi.rerun_run ...'
236
+ end
237
+ # verify the required parameter 'run_id' is set
238
+ if @api_client.config.client_side_validation && run_id.nil?
239
+ fail ArgumentError, "Missing the required parameter 'run_id' when calling RunsApi.rerun_run"
240
+ end
241
+ # resource path
242
+ local_var_path = '/api/v1/runs/{run_id}/actions/rerun'.sub('{run_id}', CGI.escape(run_id.to_s))
243
+
244
+ # query parameters
245
+ query_params = opts[:query_params] || {}
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
251
+
252
+ # form parameters
253
+ form_params = opts[:form_params] || {}
254
+
255
+ # http body (model)
256
+ post_body = opts[:debug_body]
257
+
258
+ # return_type
259
+ return_type = opts[:debug_return_type] || 'RunResponse'
260
+
261
+ # auth_names
262
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
263
+
264
+ new_options = opts.merge(
265
+ :operation => :"RunsApi.rerun_run",
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: RunsApi#rerun_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+ end
281
+ end
@@ -0,0 +1,82 @@
1
+ =begin
2
+ #smplkit Jobs API
3
+
4
+ #Scheduled HTTP job execution API for smplkit.
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::Jobs
16
+ class UsageApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Usage
23
+ # Report this account's current-period usage against its plan allotments. `runs_used` is the number of runs metered so far this calendar month; `active_jobs` is the number of currently-enabled jobs.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :filter_period (default to 'current')
26
+ # @return [UsageResponse]
27
+ def get_usage(opts = {})
28
+ data, _status_code, _headers = get_usage_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Get Usage
33
+ # Report this account&#39;s current-period usage against its plan allotments. &#x60;runs_used&#x60; is the number of runs metered so far this calendar month; &#x60;active_jobs&#x60; is the number of currently-enabled jobs.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :filter_period (default to 'current')
36
+ # @return [Array<(UsageResponse, Integer, Hash)>] UsageResponse data, response status code and response headers
37
+ def get_usage_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: UsageApi.get_usage ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/api/v1/usage'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+ query_params[:'filter[period]'] = opts[:'filter_period'] if !opts[:'filter_period'].nil?
47
+
48
+ # header parameters
49
+ header_params = opts[:header_params] || {}
50
+ # HTTP header 'Accept' (if needed)
51
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
52
+
53
+ # form parameters
54
+ form_params = opts[:form_params] || {}
55
+
56
+ # http body (model)
57
+ post_body = opts[:debug_body]
58
+
59
+ # return_type
60
+ return_type = opts[:debug_return_type] || 'UsageResponse'
61
+
62
+ # auth_names
63
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
64
+
65
+ new_options = opts.merge(
66
+ :operation => :"UsageApi.get_usage",
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: UsageApi#get_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+ end
82
+ end