Class: SmplkitGeneratedClient::Jobs::JobsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ JobsApi

Returns a new instance of JobsApi.



19
20
21
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_job(job_create_request, opts = {}) ⇒ JobResponse

Create Job Create a job for this account. The caller supplies the job’s id as ‘data.id`. Ids are unique within an account and immutable. A recurring job supplies `environments` to choose where it runs and begins scheduling immediately in each enabled environment. A one-off job is created in the environment named by the `X-Smplkit-Environment` header (implied when the credential is scoped to a single environment).

Parameters:

  • job_create_request (JobCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_smplkit_environment (String)

    The environment to operate in. Names the single environment a one-off job is born in (or a manual run executes in). Optional when the credential is scoped to a single environment (which is then implied); required when the credential can reach several environments and the choice is otherwise ambiguous. Ignored for a recurring job, whose environments come from its `environments` map.

Returns:



28
29
30
31
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 28

def create_job(job_create_request, opts = {})
  data, _status_code, _headers = create_job_with_http_info(job_create_request, opts)
  data
end

#create_job_with_http_info(job_create_request, opts = {}) ⇒ Array<(JobResponse, Integer, Hash)>

Create Job Create a job for this account. The caller supplies the job&#39;s id as &#x60;data.id&#x60;. Ids are unique within an account and immutable. A recurring job supplies &#x60;environments&#x60; to choose where it runs and begins scheduling immediately in each enabled environment. A one-off job is created in the environment named by the &#x60;X-Smplkit-Environment&#x60; header (implied when the credential is scoped to a single environment).

Parameters:

  • job_create_request (JobCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_smplkit_environment (String)

    The environment to operate in. Names the single environment a one-off job is born in (or a manual run executes in). Optional when the credential is scoped to a single environment (which is then implied); required when the credential can reach several environments and the choice is otherwise ambiguous. Ignored for a recurring job, whose environments come from its &#x60;environments&#x60; map.

Returns:

  • (Array<(JobResponse, Integer, Hash)>)

    JobResponse data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 39

def create_job_with_http_info(job_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.create_job ...'
  end
  # verify the required parameter 'job_create_request' is set
  if @api_client.config.client_side_validation && job_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'job_create_request' when calling JobsApi.create_job"
  end
  # resource path
  local_var_path = '/api/v1/jobs'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Smplkit-Environment'] = opts[:'x_smplkit_environment'] if !opts[:'x_smplkit_environment'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(job_create_request)

  # return_type
  return_type = opts[:debug_return_type] || 'JobResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"JobsApi.create_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#create_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_job(job_id, opts = {}) ⇒ nil

Delete Job Delete a job. Its run history is retained; the id may be reused later.

Parameters:

  • job_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


98
99
100
101
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 98

def delete_job(job_id, opts = {})
  delete_job_with_http_info(job_id, opts)
  nil
end

#delete_job_with_http_info(job_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Job Delete a job. Its run history is retained; the id may be reused later.

Parameters:

  • job_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 108

def delete_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.delete_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.delete_job"
  end
  # resource path
  local_var_path = '/api/v1/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"JobsApi.delete_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#delete_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_job(job_id, opts = {}) ⇒ JobResponse

Get Job Retrieve a single job by its id.

Parameters:

  • job_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



159
160
161
162
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 159

def get_job(job_id, opts = {})
  data, _status_code, _headers = get_job_with_http_info(job_id, opts)
  data
end

#get_job_with_http_info(job_id, opts = {}) ⇒ Array<(JobResponse, Integer, Hash)>

Get Job Retrieve a single job by its id.

Parameters:

  • job_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobResponse, Integer, Hash)>)

    JobResponse data, response status code and response headers



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 169

def get_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.get_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.get_job"
  end
  # resource path
  local_var_path = '/api/v1/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'JobResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"JobsApi.get_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#get_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_jobs(opts = {}) ⇒ JobListResponse

List Jobs List this account’s jobs. Default sort is ‘name` ascending. Sort by `name`, `created_at`, `updated_at`, `next_run_at`, or `enabled`, ascending or descending (prefix `-` for descending). Filter with `filter` (enabled in at least one environment), `filter`, and `filter` (case-insensitive substring match on the name); filters compose with AND. A scoped caller sees each job’s ‘environments` map narrowed to the environments it may access.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter_enabled (Boolean)
  • :filter_recurring (Boolean)
  • :filter_name (String)

    Case-insensitive substring match on the job &#x60;name&#x60; (matches when the name contains the given text).

  • :sort (String)

    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;enabled&#x60;, &#x60;-enabled&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;next_run_at&#x60;, &#x60;-next_run_at&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;. (default to ‘name’)

  • :page_number (Integer)

    1-based page number to return. Optional; defaults to &#x60;1&#x60; when omitted. Must be &#x60;&gt;&#x3D; 1&#x60; — requests with a smaller value are rejected with a 400 error. (default to 1)

  • :page_size (Integer)

    Number of items per page. Optional; defaults to &#x60;1000&#x60; when omitted. Must be between &#x60;1&#x60; and &#x60;1000&#x60; inclusive — requests outside that range are rejected with a 400 error. (default to 1000)

  • :meta_total (Boolean)

    When &#x60;true&#x60;, the response&#39;s &#x60;meta.pagination&#x60; block includes &#x60;total&#x60; (the total number of matching items across all pages) and &#x60;total_pages&#x60;. Computing these requires an extra &#x60;COUNT&#x60; query, so omit (or pass &#x60;false&#x60;) when the totals are not needed. Defaults to &#x60;false&#x60;. (default to false)

Returns:



228
229
230
231
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 228

def list_jobs(opts = {})
  data, _status_code, _headers = list_jobs_with_http_info(opts)
  data
end

#list_jobs_with_http_info(opts = {}) ⇒ Array<(JobListResponse, Integer, Hash)>

List Jobs List this account&#39;s jobs. Default sort is &#x60;name&#x60; ascending. Sort by &#x60;name&#x60;, &#x60;created_at&#x60;, &#x60;updated_at&#x60;, &#x60;next_run_at&#x60;, or &#x60;enabled&#x60;, ascending or descending (prefix &#x60;-&#x60; for descending). Filter with &#x60;filter&#x60; (enabled in at least one environment), &#x60;filter&#x60;, and &#x60;filter&#x60; (case-insensitive substring match on the name); filters compose with AND. A scoped caller sees each job&#39;s &#x60;environments&#x60; map narrowed to the environments it may access.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter_enabled (Boolean)
  • :filter_recurring (Boolean)
  • :filter_name (String)

    Case-insensitive substring match on the job &#x60;name&#x60; (matches when the name contains the given text).

  • :sort (String)

    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;enabled&#x60;, &#x60;-enabled&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;next_run_at&#x60;, &#x60;-next_run_at&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;. (default to ‘name’)

  • :page_number (Integer)

    1-based page number to return. Optional; defaults to &#x60;1&#x60; when omitted. Must be &#x60;&gt;&#x3D; 1&#x60; — requests with a smaller value are rejected with a 400 error. (default to 1)

  • :page_size (Integer)

    Number of items per page. Optional; defaults to &#x60;1000&#x60; when omitted. Must be between &#x60;1&#x60; and &#x60;1000&#x60; inclusive — requests outside that range are rejected with a 400 error. (default to 1000)

  • :meta_total (Boolean)

    When &#x60;true&#x60;, the response&#39;s &#x60;meta.pagination&#x60; block includes &#x60;total&#x60; (the total number of matching items across all pages) and &#x60;total_pages&#x60;. Computing these requires an extra &#x60;COUNT&#x60; query, so omit (or pass &#x60;false&#x60;) when the totals are not needed. Defaults to &#x60;false&#x60;. (default to false)

Returns:

  • (Array<(JobListResponse, Integer, Hash)>)

    JobListResponse data, response status code and response headers



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 244

def list_jobs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.list_jobs ...'
  end
  allowable_values = ["created_at", "-created_at", "enabled", "-enabled", "name", "-name", "next_run_at", "-next_run_at", "updated_at", "-updated_at"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v1/jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[enabled]'] = opts[:'filter_enabled'] if !opts[:'filter_enabled'].nil?
  query_params[:'filter[recurring]'] = opts[:'filter_recurring'] if !opts[:'filter_recurring'].nil?
  query_params[:'filter[name]'] = opts[:'filter_name'] if !opts[:'filter_name'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'meta[total]'] = opts[:'meta_total'] if !opts[:'meta_total'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'JobListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"JobsApi.list_jobs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#list_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#run_job_now(job_id, opts = {}) ⇒ RunResponse

Run Job Now Trigger one immediate run of the job (a ‘MANUAL` run). The job’s schedule and enabled state are untouched. The run executes in the environment named by the ‘X-Smplkit-Environment` header; when the job is enabled in exactly one environment that environment is used, and a single-environment credential implies it. The run executes the job’s effective configuration for that environment. It is enqueued and executed by the worker; if the account is over its run allotment the run will fail with reason ‘QUOTA_EXCEEDED` rather than being rejected here.

Parameters:

  • job_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_smplkit_environment (String)

    The environment to operate in. Names the single environment a one-off job is born in (or a manual run executes in). Optional when the credential is scoped to a single environment (which is then implied); required when the credential can reach several environments and the choice is otherwise ambiguous. Ignored for a recurring job, whose environments come from its &#x60;environments&#x60; map.

Returns:



305
306
307
308
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 305

def run_job_now(job_id, opts = {})
  data, _status_code, _headers = run_job_now_with_http_info(job_id, opts)
  data
end

#run_job_now_with_http_info(job_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>

Run Job Now Trigger one immediate run of the job (a &#x60;MANUAL&#x60; run). The job&#39;s schedule and enabled state are untouched. The run executes in the environment named by the &#x60;X-Smplkit-Environment&#x60; header; when the job is enabled in exactly one environment that environment is used, and a single-environment credential implies it. The run executes the job&#39;s effective configuration for that environment. It is enqueued and executed by the worker; if the account is over its run allotment the run will fail with reason &#x60;QUOTA_EXCEEDED&#x60; rather than being rejected here.

Parameters:

  • job_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_smplkit_environment (String)

    The environment to operate in. Names the single environment a one-off job is born in (or a manual run executes in). Optional when the credential is scoped to a single environment (which is then implied); required when the credential can reach several environments and the choice is otherwise ambiguous. Ignored for a recurring job, whose environments come from its &#x60;environments&#x60; map.

Returns:

  • (Array<(RunResponse, Integer, Hash)>)

    RunResponse data, response status code and response headers



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 316

def run_job_now_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.run_job_now ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.run_job_now"
  end
  # resource path
  local_var_path = '/api/v1/jobs/{job_id}/actions/run'.sub('{job_id}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
  header_params[:'X-Smplkit-Environment'] = opts[:'x_smplkit_environment'] if !opts[:'x_smplkit_environment'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RunResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"JobsApi.run_job_now",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#run_job_now\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_job(job_id, job_request, opts = {}) ⇒ JobResponse

Update Job Replace an existing job. Every writable field is overwritten. Set enablement per environment via the ‘environments` map (a recurring job), or by recreating a one-off job in the desired environment. Editing the schedule recomputes the next fire time; changing only which environments are enabled preserves the existing cadence.

Parameters:

  • job_id (String)
  • job_request (JobRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_smplkit_environment (String)

    The environment to operate in. Names the single environment a one-off job is born in (or a manual run executes in). Optional when the credential is scoped to a single environment (which is then implied); required when the credential can reach several environments and the choice is otherwise ambiguous. Ignored for a recurring job, whose environments come from its &#x60;environments&#x60; map.

Returns:



372
373
374
375
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 372

def update_job(job_id, job_request, opts = {})
  data, _status_code, _headers = update_job_with_http_info(job_id, job_request, opts)
  data
end

#update_job_with_http_info(job_id, job_request, opts = {}) ⇒ Array<(JobResponse, Integer, Hash)>

Update Job Replace an existing job. Every writable field is overwritten. Set enablement per environment via the &#x60;environments&#x60; map (a recurring job), or by recreating a one-off job in the desired environment. Editing the schedule recomputes the next fire time; changing only which environments are enabled preserves the existing cadence.

Parameters:

  • job_id (String)
  • job_request (JobRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_smplkit_environment (String)

    The environment to operate in. Names the single environment a one-off job is born in (or a manual run executes in). Optional when the credential is scoped to a single environment (which is then implied); required when the credential can reach several environments and the choice is otherwise ambiguous. Ignored for a recurring job, whose environments come from its &#x60;environments&#x60; map.

Returns:

  • (Array<(JobResponse, Integer, Hash)>)

    JobResponse data, response status code and response headers



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb', line 384

def update_job_with_http_info(job_id, job_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.update_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.update_job"
  end
  # verify the required parameter 'job_request' is set
  if @api_client.config.client_side_validation && job_request.nil?
    fail ArgumentError, "Missing the required parameter 'job_request' when calling JobsApi.update_job"
  end
  # resource path
  local_var_path = '/api/v1/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Smplkit-Environment'] = opts[:'x_smplkit_environment'] if !opts[:'x_smplkit_environment'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(job_request)

  # return_type
  return_type = opts[:debug_return_type] || 'JobResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"JobsApi.update_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#update_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end