Class: Phrase::JobsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/phrase/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.



7
8
9
# File 'lib/phrase/api/jobs_api.rb', line 7

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/phrase/api/jobs_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#job_complete(project_id, id, job_complete_parameters, opts = {}) ⇒ JobDetails

Complete a job Mark a job as completed.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



18
19
20
21
# File 'lib/phrase/api/jobs_api.rb', line 18

def job_complete(project_id, id, job_complete_parameters, opts = {})
  data, _status_code, _headers = job_complete_with_http_info(project_id, id, job_complete_parameters, opts)
  data
end

#job_complete_with_http_info(project_id, id, job_complete_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Complete a job Mark a job as completed.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



31
32
33
34
35
36
37
38
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
# File 'lib/phrase/api/jobs_api.rb', line 31

def job_complete_with_http_info(project_id, id, job_complete_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.job_complete ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling JobsApi.job_complete"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.job_complete"
  end
  # verify the required parameter 'job_complete_parameters' is set
  if @api_client.config.client_side_validation && job_complete_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'job_complete_parameters' when calling JobsApi.job_complete"
  end
  # resource path
  local_var_path = '/projects/{project_id}/jobs/{id}/complete'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_create(project_id, job_create_parameters, opts = {}) ⇒ JobDetails

Create a job Create a new job.

Parameters:

  • project_id (String)

    Project ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



97
98
99
100
# File 'lib/phrase/api/jobs_api.rb', line 97

def job_create(project_id, job_create_parameters, opts = {})
  data, _status_code, _headers = job_create_with_http_info(project_id, job_create_parameters, opts)
  data
end

#job_create_with_http_info(project_id, job_create_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Create a job Create a new job.

Parameters:

  • project_id (String)

    Project ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



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
153
154
155
156
157
158
159
160
161
162
# File 'lib/phrase/api/jobs_api.rb', line 109

def job_create_with_http_info(project_id, job_create_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.job_create ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling JobsApi.job_create"
  end
  # verify the required parameter 'job_create_parameters' is set
  if @api_client.config.client_side_validation && job_create_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'job_create_parameters' when calling JobsApi.job_create"
  end
  # resource path
  local_var_path = '/projects/{project_id}/jobs'.sub('{' + 'project_id' + '}', CGI.escape(project_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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_delete(project_id, id, opts = {}) ⇒ nil

Delete a job Delete an existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

  • (nil)


172
173
174
175
# File 'lib/phrase/api/jobs_api.rb', line 172

def job_delete(project_id, id, opts = {})
  data, _status_code, _headers = job_delete_with_http_info(project_id, id, opts)
  data
end

#job_delete_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>

Delete a job Delete an existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

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

    Response<(nil, response status code and response headers



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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/phrase/api/jobs_api.rb', line 185

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_keys_create(project_id, id, job_keys_create_parameters, opts = {}) ⇒ JobDetails

Add keys to job Add multiple keys to a existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



245
246
247
248
# File 'lib/phrase/api/jobs_api.rb', line 245

def job_keys_create(project_id, id, job_keys_create_parameters, opts = {})
  data, _status_code, _headers = job_keys_create_with_http_info(project_id, id, job_keys_create_parameters, opts)
  data
end

#job_keys_create_with_http_info(project_id, id, job_keys_create_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Add keys to job Add multiple keys to a existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/phrase/api/jobs_api.rb', line 258

def job_keys_create_with_http_info(project_id, id, job_keys_create_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.job_keys_create ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling JobsApi.job_keys_create"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.job_keys_create"
  end
  # verify the required parameter 'job_keys_create_parameters' is set
  if @api_client.config.client_side_validation && job_keys_create_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'job_keys_create_parameters' when calling JobsApi.job_keys_create"
  end
  # resource path
  local_var_path = '/projects/{project_id}/jobs/{id}/keys'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_keys_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_keys_delete(project_id, id, opts = {}) ⇒ nil

Remove keys from job Remove multiple keys from existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

  • :translation_key_ids (Array<String>)

    ids of keys that should added to the job

Returns:

  • (nil)


326
327
328
329
# File 'lib/phrase/api/jobs_api.rb', line 326

def job_keys_delete(project_id, id, opts = {})
  data, _status_code, _headers = job_keys_delete_with_http_info(project_id, id, opts)
  data
end

#job_keys_delete_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>

Remove keys from job Remove multiple keys from existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

  • :translation_key_ids (Array<String>)

    ids of keys that should added to the job

Returns:

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

    Response<(nil, response status code and response headers



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/phrase/api/jobs_api.rb', line 340

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
  query_params[:'translation_key_ids'] = @api_client.build_collection_param(opts[:'translation_key_ids'], :multi) if !opts[:'translation_key_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_keys_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_lock(project_id, id, opts = {}) ⇒ nil

Lock a job If you are the job owner, you may lock a job using this API request.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

  • (nil)


401
402
403
404
# File 'lib/phrase/api/jobs_api.rb', line 401

def job_lock(project_id, id, opts = {})
  data, _status_code, _headers = job_lock_with_http_info(project_id, id, opts)
  data
end

#job_lock_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>

Lock a job If you are the job owner, you may lock a job using this API request.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

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

    Response<(nil, response status code and response headers



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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/phrase/api/jobs_api.rb', line 414

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_lock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_reopen(project_id, id, job_reopen_parameters, opts = {}) ⇒ JobDetails

Reopen a job Mark a job as uncompleted.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



474
475
476
477
# File 'lib/phrase/api/jobs_api.rb', line 474

def job_reopen(project_id, id, job_reopen_parameters, opts = {})
  data, _status_code, _headers = job_reopen_with_http_info(project_id, id, job_reopen_parameters, opts)
  data
end

#job_reopen_with_http_info(project_id, id, job_reopen_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Reopen a job Mark a job as uncompleted.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/phrase/api/jobs_api.rb', line 487

def job_reopen_with_http_info(project_id, id, job_reopen_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.job_reopen ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling JobsApi.job_reopen"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.job_reopen"
  end
  # verify the required parameter 'job_reopen_parameters' is set
  if @api_client.config.client_side_validation && job_reopen_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'job_reopen_parameters' when calling JobsApi.job_reopen"
  end
  # resource path
  local_var_path = '/projects/{project_id}/jobs/{id}/reopen'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_reopen\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_show(project_id, id, opts = {}) ⇒ JobDetails

Get a single job Get details on a single job for a given project.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:



554
555
556
557
# File 'lib/phrase/api/jobs_api.rb', line 554

def job_show(project_id, id, opts = {})
  data, _status_code, _headers = job_show_with_http_info(project_id, id, opts)
  data
end

#job_show_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Get a single job Get details on a single job for a given project.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
# File 'lib/phrase/api/jobs_api.rb', line 567

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_start(project_id, id, job_start_parameters, opts = {}) ⇒ JobDetails

Start a job Starts an existing job in state draft.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



629
630
631
632
# File 'lib/phrase/api/jobs_api.rb', line 629

def job_start(project_id, id, job_start_parameters, opts = {})
  data, _status_code, _headers = job_start_with_http_info(project_id, id, job_start_parameters, opts)
  data
end

#job_start_with_http_info(project_id, id, job_start_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Start a job Starts an existing job in state draft.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/phrase/api/jobs_api.rb', line 642

def job_start_with_http_info(project_id, id, job_start_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.job_start ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling JobsApi.job_start"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.job_start"
  end
  # verify the required parameter 'job_start_parameters' is set
  if @api_client.config.client_side_validation && job_start_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'job_start_parameters' when calling JobsApi.job_start"
  end
  # resource path
  local_var_path = '/projects/{project_id}/jobs/{id}/start'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_unlock(project_id, id, opts = {}) ⇒ nil

Unlock a job If you are the job owner, you may unlock a locked job using this API request.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

  • (nil)


709
710
711
712
# File 'lib/phrase/api/jobs_api.rb', line 709

def job_unlock(project_id, id, opts = {})
  data, _status_code, _headers = job_unlock_with_http_info(project_id, id, opts)
  data
end

#job_unlock_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>

Unlock a job If you are the job owner, you may unlock a locked job using this API request.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :branch (String)

    specify the branch to use

Returns:

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

    Response<(nil, response status code and response headers



722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
# File 'lib/phrase/api/jobs_api.rb', line 722

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#job_unlock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#job_update(project_id, id, job_update_parameters, opts = {}) ⇒ JobDetails

Update a job Update an existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



782
783
784
785
# File 'lib/phrase/api/jobs_api.rb', line 782

def job_update(project_id, id, job_update_parameters, opts = {})
  data, _status_code, _headers = job_update_with_http_info(project_id, id, job_update_parameters, opts)
  data
end

#job_update_with_http_info(project_id, id, job_update_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>

Update a job Update an existing job.

Parameters:

  • project_id (String)

    Project ID

  • id (String)

    ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(JobDetails)>, Integer, Hash)>)

    Response<(JobDetails)> data, response status code and response headers



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
# File 'lib/phrase/api/jobs_api.rb', line 795

def job_update_with_http_info(project_id, id, job_update_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: JobsApi.job_update ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling JobsApi.job_update"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.job_update"
  end
  # verify the required parameter 'job_update_parameters' is set
  if @api_client.config.client_side_validation && job_update_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'job_update_parameters' when calling JobsApi.job_update"
  end
  # resource path
  local_var_path = '/projects/{project_id}/jobs/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'JobDetails' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#job_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#jobs_by_account(account_id, opts = {}) ⇒ Array<Job>

List account jobs List all jobs for the given account.

Parameters:

  • account_id (String)

    Account ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Limit on the number of objects to be returned, between 1 and 100. 25 by default

  • :owned_by (String)

    filter by user owning job

  • :assigned_to (String)

    filter by user assigned to job

  • :state (String)

    filter by state of job Valid states are &lt;code&gt;draft&lt;/code&gt;, &lt;code&gt;in_progress&lt;/code&gt;, &lt;code&gt;completed&lt;/code&gt;

Returns:



865
866
867
868
# File 'lib/phrase/api/jobs_api.rb', line 865

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

#jobs_by_account_with_http_info(account_id, opts = {}) ⇒ Array<(Response<(Array<Job>)>, Integer, Hash)>

List account jobs List all jobs for the given account.

Parameters:

  • account_id (String)

    Account ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Limit on the number of objects to be returned, between 1 and 100. 25 by default

  • :owned_by (String)

    filter by user owning job

  • :assigned_to (String)

    filter by user assigned to job

  • :state (String)

    filter by state of job Valid states are &lt;code&gt;draft&lt;/code&gt;, &lt;code&gt;in_progress&lt;/code&gt;, &lt;code&gt;completed&lt;/code&gt;

Returns:

  • (Array<(Response<(Array<Job>)>, Integer, Hash)>)

    Response<(Array<Job>)> data, response status code and response headers



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
# File 'lib/phrase/api/jobs_api.rb', line 881

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'owned_by'] = opts[:'owned_by'] if !opts[:'owned_by'].nil?
  query_params[:'assigned_to'] = opts[:'assigned_to'] if !opts[:'assigned_to'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'Array<Job>' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#jobs_by_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#jobs_list(project_id, opts = {}) ⇒ Array<Job>

List jobs List all jobs for the given project.

Parameters:

  • project_id (String)

    Project ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Limit on the number of objects to be returned, between 1 and 100. 25 by default

  • :branch (String)

    specify the branch to use

  • :owned_by (String)

    filter by user owning job

  • :assigned_to (String)

    filter by user assigned to job

  • :state (String)

    filter by state of job Valid states are &lt;code&gt;draft&lt;/code&gt;, &lt;code&gt;in_progress&lt;/code&gt;, &lt;code&gt;completed&lt;/code&gt;

Returns:



947
948
949
950
# File 'lib/phrase/api/jobs_api.rb', line 947

def jobs_list(project_id, opts = {})
  data, _status_code, _headers = jobs_list_with_http_info(project_id, opts)
  data
end

#jobs_list_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(Array<Job>)>, Integer, Hash)>

List jobs List all jobs for the given project.

Parameters:

  • project_id (String)

    Project ID

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

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Limit on the number of objects to be returned, between 1 and 100. 25 by default

  • :branch (String)

    specify the branch to use

  • :owned_by (String)

    filter by user owning job

  • :assigned_to (String)

    filter by user assigned to job

  • :state (String)

    filter by state of job Valid states are &lt;code&gt;draft&lt;/code&gt;, &lt;code&gt;in_progress&lt;/code&gt;, &lt;code&gt;completed&lt;/code&gt;

Returns:

  • (Array<(Response<(Array<Job>)>, Integer, Hash)>)

    Response<(Array<Job>)> data, response status code and response headers



964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
# File 'lib/phrase/api/jobs_api.rb', line 964

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
  query_params[:'owned_by'] = opts[:'owned_by'] if !opts[:'owned_by'].nil?
  query_params[:'assigned_to'] = opts[:'assigned_to'] if !opts[:'assigned_to'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'Array<Job>' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :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#jobs_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end