Class: Phrase::JobsApi
- Inherits:
-
Object
- Object
- Phrase::JobsApi
- Defined in:
- lib/phrase/api/jobs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ JobsApi
constructor
A new instance of JobsApi.
-
#job_complete(project_id, id, job_complete_parameters, opts = {}) ⇒ JobDetails
Complete a job Mark a job as completed.
-
#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.
-
#job_create(project_id, job_create_parameters, opts = {}) ⇒ JobDetails
Create a job Create a new job.
-
#job_create_with_http_info(project_id, job_create_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>
Create a job Create a new job.
-
#job_delete(project_id, id, opts = {}) ⇒ nil
Delete a job Delete an existing job.
-
#job_delete_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>
Delete a job Delete an existing job.
-
#job_keys_create(project_id, id, job_keys_create_parameters, opts = {}) ⇒ JobDetails
Add keys to job Add multiple keys to a existing job.
-
#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.
-
#job_keys_delete(project_id, id, job_keys_delete_parameters, opts = {}) ⇒ nil
Remove keys from job Remove multiple keys from existing job.
-
#job_keys_delete_with_http_info(project_id, id, job_keys_delete_parameters, opts = {}) ⇒ Array<(Response, Integer, Hash)>
Remove keys from job Remove multiple keys from existing job.
-
#job_lock(project_id, id, opts = {}) ⇒ JobDetails
Lock a job If you are the job owner, you may lock a job using this API request.
-
#job_lock_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>
Lock a job If you are the job owner, you may lock a job using this API request.
-
#job_reopen(project_id, id, job_reopen_parameters, opts = {}) ⇒ JobDetails
Reopen a job Mark a job as uncompleted.
-
#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.
-
#job_show(project_id, id, opts = {}) ⇒ JobDetails
Get a single job Get details on a single job for a given project.
-
#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.
-
#job_start(project_id, id, job_start_parameters, opts = {}) ⇒ JobDetails
Start a job Starts an existing job in state draft.
-
#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.
-
#job_unlock(project_id, id, opts = {}) ⇒ JobDetails
Unlock a job If you are the job owner, you may unlock a locked job using this API request.
-
#job_unlock_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>
Unlock a job If you are the job owner, you may unlock a locked job using this API request.
-
#job_update(project_id, id, job_update_parameters, opts = {}) ⇒ JobDetails
Update a job Update an existing job.
-
#job_update_with_http_info(project_id, id, job_update_parameters, opts = {}) ⇒ Array<(Response<(JobDetails)>, Integer, Hash)>
Update a job Update an existing job.
-
#jobs_by_account(account_id, opts = {}) ⇒ Array<Job>
List account jobs List all jobs for the given account.
-
#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.
-
#jobs_list(project_id, opts = {}) ⇒ Array<Job>
List jobs List all jobs for the given project.
-
#jobs_list_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(Array<Job>)>, Integer, Hash)>
List jobs List all jobs for the given project.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
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.
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.
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'] = 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, ) 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.
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.
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'] = 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, ) 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.
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.
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 236 237 |
# 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] || {} # 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] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) 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.
247 248 249 250 |
# File 'lib/phrase/api/jobs_api.rb', line 247 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.
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 316 317 |
# File 'lib/phrase/api/jobs_api.rb', line 260 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'] = 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, ) 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, job_keys_delete_parameters, opts = {}) ⇒ nil
Remove keys from job Remove multiple keys from existing job.
327 328 329 330 |
# File 'lib/phrase/api/jobs_api.rb', line 327 def job_keys_delete(project_id, id, job_keys_delete_parameters, opts = {}) data, _status_code, _headers = job_keys_delete_with_http_info(project_id, id, job_keys_delete_parameters, opts) data end |
#job_keys_delete_with_http_info(project_id, id, job_keys_delete_parameters, opts = {}) ⇒ Array<(Response, Integer, Hash)>
Remove keys from job Remove multiple keys from existing job.
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 392 393 394 395 |
# File 'lib/phrase/api/jobs_api.rb', line 340 def job_keys_delete_with_http_info(project_id, id, job_keys_delete_parameters, 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 # verify the required parameter 'job_keys_delete_parameters' is set if @api_client.config.client_side_validation && job_keys_delete_parameters.nil? fail ArgumentError, "Missing the required parameter 'job_keys_delete_parameters' 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] || {} # header parameters header_params = opts[:header_params] || {} # 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_delete_parameters) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) 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 = {}) ⇒ JobDetails
Lock a job If you are the job owner, you may lock a job using this API request.
405 406 407 408 |
# File 'lib/phrase/api/jobs_api.rb', line 405 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<(JobDetails)>, Integer, Hash)>
Lock a job If you are the job owner, you may lock a job using this API request.
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 465 466 467 468 469 470 |
# File 'lib/phrase/api/jobs_api.rb', line 418 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] || {} # 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'] = 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, ) 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.
480 481 482 483 |
# File 'lib/phrase/api/jobs_api.rb', line 480 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.
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 545 546 547 548 549 550 |
# File 'lib/phrase/api/jobs_api.rb', line 493 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'] = 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, ) 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.
562 563 564 565 |
# File 'lib/phrase/api/jobs_api.rb', line 562 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.
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 620 621 622 623 624 625 626 627 628 629 630 631 |
# File 'lib/phrase/api/jobs_api.rb', line 577 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? query_params[:'include_annotations'] = opts[:'include_annotations'] if !opts[:'include_annotations'].nil? query_params[:'omit_translation_keys'] = opts[:'omit_translation_keys'] if !opts[:'omit_translation_keys'].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'] = 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, ) 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.
641 642 643 644 |
# File 'lib/phrase/api/jobs_api.rb', line 641 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.
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 700 701 702 703 704 705 706 707 708 709 710 711 |
# File 'lib/phrase/api/jobs_api.rb', line 654 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'] = 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, ) 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 = {}) ⇒ JobDetails
Unlock a job If you are the job owner, you may unlock a locked job using this API request.
721 722 723 724 |
# File 'lib/phrase/api/jobs_api.rb', line 721 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<(JobDetails)>, Integer, Hash)>
Unlock a job If you are the job owner, you may unlock a locked job using this API request.
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 773 774 775 776 777 778 779 780 781 782 783 784 785 786 |
# File 'lib/phrase/api/jobs_api.rb', line 734 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] || {} # 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'] = 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, ) 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.
796 797 798 799 |
# File 'lib/phrase/api/jobs_api.rb', line 796 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.
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 853 854 855 856 857 858 859 860 861 862 863 864 865 866 |
# File 'lib/phrase/api/jobs_api.rb', line 809 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'] = 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, ) 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.
880 881 882 883 |
# File 'lib/phrase/api/jobs_api.rb', line 880 def jobs_by_account(account_id, opts = {}) data, _status_code, _headers = jobs_by_account_with_http_info(account_id, 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.
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 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# File 'lib/phrase/api/jobs_api.rb', line 897 def jobs_by_account_with_http_info(account_id, 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 && account_id.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(account_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[:'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? query_params[:'updated_since'] = opts[:'updated_since'] if !opts[:'updated_since'].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'] = 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, ) 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.
967 968 969 970 |
# File 'lib/phrase/api/jobs_api.rb', line 967 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.
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 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 |
# File 'lib/phrase/api/jobs_api.rb', line 987 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? query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil? query_params[:'key_id'] = opts[:'key_id'] if !opts[:'key_id'].nil? query_params[:'updated_since'] = opts[:'updated_since'] if !opts[:'updated_since'].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'] = 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, ) 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 |