phrase 2.5.1 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -4
- data/docs/IcuSkeletonParameters.md +2 -0
- data/docs/Invitation.md +3 -3
- data/docs/JobComment.md +29 -0
- data/docs/JobCommentCreateParameters.md +17 -0
- data/docs/JobCommentUpdateParameters.md +17 -0
- data/docs/JobCommentsApi.md +343 -0
- data/docs/JobCreateParameters.md +3 -1
- data/docs/JobsApi.md +130 -0
- data/docs/KeyCreateParameters.md +2 -0
- data/docs/Member.md +1 -1
- data/docs/ScreenshotsApi.md +12 -6
- data/docs/StyleguideCreateParameters.md +1 -1
- data/docs/StyleguideUpdateParameters.md +1 -1
- data/docs/{Team1.md → TeamShort.md} +2 -2
- data/lib/phrase/api/job_comments_api.rb +411 -0
- data/lib/phrase/api/jobs_api.rb +146 -0
- data/lib/phrase/api/screenshots_api.rb +17 -11
- data/lib/phrase/models/icu_skeleton_parameters.rb +11 -1
- data/lib/phrase/models/invitation.rb +13 -13
- data/lib/phrase/models/job_comment.rb +250 -0
- data/lib/phrase/models/job_comment_create_parameters.rb +195 -0
- data/lib/phrase/models/job_comment_update_parameters.rb +195 -0
- data/lib/phrase/models/job_create_parameters.rb +14 -4
- data/lib/phrase/models/key_create_parameters.rb +11 -1
- data/lib/phrase/models/member.rb +1 -1
- data/lib/phrase/models/{team1.rb → team_short.rb} +3 -3
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -1
- data/spec/api/job_comments_api_spec.rb +101 -0
- data/spec/api/jobs_api_spec.rb +30 -0
- data/spec/api/screenshots_api_spec.rb +4 -1
- data/spec/models/icu_skeleton_parameters_spec.rb +6 -0
- data/spec/models/invitation_spec.rb +6 -6
- data/spec/models/job_comment_create_parameters_spec.rb +29 -0
- data/spec/models/job_comment_spec.rb +65 -0
- data/spec/models/job_comment_update_parameters_spec.rb +29 -0
- data/spec/models/job_create_parameters_spec.rb +6 -0
- data/spec/models/key_create_parameters_spec.rb +6 -0
- data/spec/models/{team1_spec.rb → team_short_spec.rb} +6 -6
- metadata +217 -201
data/docs/JobsApi.md
CHANGED
@@ -9,9 +9,11 @@ Method | HTTP request | Description
|
|
9
9
|
[**job_delete**](JobsApi.md#job_delete) | **DELETE** /projects/{project_id}/jobs/{id} | Delete a job
|
10
10
|
[**job_keys_create**](JobsApi.md#job_keys_create) | **POST** /projects/{project_id}/jobs/{id}/keys | Add keys to job
|
11
11
|
[**job_keys_delete**](JobsApi.md#job_keys_delete) | **DELETE** /projects/{project_id}/jobs/{id}/keys | Remove keys from job
|
12
|
+
[**job_lock**](JobsApi.md#job_lock) | **POST** /projects/{project_id}/jobs/{id}/lock | Lock a job
|
12
13
|
[**job_reopen**](JobsApi.md#job_reopen) | **POST** /projects/{project_id}/jobs/{id}/reopen | Reopen a job
|
13
14
|
[**job_show**](JobsApi.md#job_show) | **GET** /projects/{project_id}/jobs/{id} | Get a single job
|
14
15
|
[**job_start**](JobsApi.md#job_start) | **POST** /projects/{project_id}/jobs/{id}/start | Start a job
|
16
|
+
[**job_unlock**](JobsApi.md#job_unlock) | **POST** /projects/{project_id}/jobs/{id}/unlock | Unlock a job
|
15
17
|
[**job_update**](JobsApi.md#job_update) | **PATCH** /projects/{project_id}/jobs/{id} | Update a job
|
16
18
|
[**jobs_by_account**](JobsApi.md#jobs_by_account) | **GET** /accounts/{account_id}/jobs | List account jobs
|
17
19
|
[**jobs_list**](JobsApi.md#jobs_list) | **GET** /projects/{project_id}/jobs | List jobs
|
@@ -341,6 +343,70 @@ Response<(nil (empty response body))>
|
|
341
343
|
- **Accept**: Not defined
|
342
344
|
|
343
345
|
|
346
|
+
## job_lock
|
347
|
+
|
348
|
+
> job_lock(project_id, id, opts)
|
349
|
+
|
350
|
+
Lock a job
|
351
|
+
|
352
|
+
If you are the job owner, you may lock a job using this API request.
|
353
|
+
|
354
|
+
### Example
|
355
|
+
|
356
|
+
```ruby
|
357
|
+
# load the gem
|
358
|
+
require 'phrase'
|
359
|
+
# setup authorization
|
360
|
+
Phrase.configure do |config|
|
361
|
+
# Configure HTTP basic authorization: Basic
|
362
|
+
config.username = 'YOUR USERNAME'
|
363
|
+
config.password = 'YOUR PASSWORD'
|
364
|
+
|
365
|
+
# Configure API key authorization: Token
|
366
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
367
|
+
config.api_key_prefix['Authorization'] = 'token'
|
368
|
+
end
|
369
|
+
|
370
|
+
api_instance = Phrase::JobsApi.new
|
371
|
+
project_id = 'project_id_example' # String | Project ID
|
372
|
+
id = 'id_example' # String | ID
|
373
|
+
opts = {
|
374
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
375
|
+
branch: 'my-feature-branch' # String | specify the branch to use
|
376
|
+
}
|
377
|
+
|
378
|
+
begin
|
379
|
+
#Lock a job
|
380
|
+
api_instance.job_lock(project_id, id, opts)
|
381
|
+
rescue Phrase::ApiError => e
|
382
|
+
puts "Exception when calling JobsApi->job_lock: #{e}"
|
383
|
+
end
|
384
|
+
```
|
385
|
+
|
386
|
+
### Parameters
|
387
|
+
|
388
|
+
|
389
|
+
Name | Type | Description | Notes
|
390
|
+
------------- | ------------- | ------------- | -------------
|
391
|
+
**project_id** | **String**| Project ID |
|
392
|
+
**id** | **String**| ID |
|
393
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
394
|
+
**branch** | **String**| specify the branch to use | [optional]
|
395
|
+
|
396
|
+
### Return type
|
397
|
+
|
398
|
+
Response<(nil (empty response body))>
|
399
|
+
|
400
|
+
### Authorization
|
401
|
+
|
402
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
403
|
+
|
404
|
+
### HTTP request headers
|
405
|
+
|
406
|
+
- **Content-Type**: Not defined
|
407
|
+
- **Accept**: Not defined
|
408
|
+
|
409
|
+
|
344
410
|
## job_reopen
|
345
411
|
|
346
412
|
> JobDetails job_reopen(project_id, id, job_reopen_parameters, opts)
|
@@ -536,6 +602,70 @@ Response<([**JobDetails**](JobDetails.md))>
|
|
536
602
|
- **Accept**: application/json
|
537
603
|
|
538
604
|
|
605
|
+
## job_unlock
|
606
|
+
|
607
|
+
> job_unlock(project_id, id, opts)
|
608
|
+
|
609
|
+
Unlock a job
|
610
|
+
|
611
|
+
If you are the job owner, you may unlock a locked job using this API request.
|
612
|
+
|
613
|
+
### Example
|
614
|
+
|
615
|
+
```ruby
|
616
|
+
# load the gem
|
617
|
+
require 'phrase'
|
618
|
+
# setup authorization
|
619
|
+
Phrase.configure do |config|
|
620
|
+
# Configure HTTP basic authorization: Basic
|
621
|
+
config.username = 'YOUR USERNAME'
|
622
|
+
config.password = 'YOUR PASSWORD'
|
623
|
+
|
624
|
+
# Configure API key authorization: Token
|
625
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
626
|
+
config.api_key_prefix['Authorization'] = 'token'
|
627
|
+
end
|
628
|
+
|
629
|
+
api_instance = Phrase::JobsApi.new
|
630
|
+
project_id = 'project_id_example' # String | Project ID
|
631
|
+
id = 'id_example' # String | ID
|
632
|
+
opts = {
|
633
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
634
|
+
branch: 'my-feature-branch' # String | specify the branch to use
|
635
|
+
}
|
636
|
+
|
637
|
+
begin
|
638
|
+
#Unlock a job
|
639
|
+
api_instance.job_unlock(project_id, id, opts)
|
640
|
+
rescue Phrase::ApiError => e
|
641
|
+
puts "Exception when calling JobsApi->job_unlock: #{e}"
|
642
|
+
end
|
643
|
+
```
|
644
|
+
|
645
|
+
### Parameters
|
646
|
+
|
647
|
+
|
648
|
+
Name | Type | Description | Notes
|
649
|
+
------------- | ------------- | ------------- | -------------
|
650
|
+
**project_id** | **String**| Project ID |
|
651
|
+
**id** | **String**| ID |
|
652
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
653
|
+
**branch** | **String**| specify the branch to use | [optional]
|
654
|
+
|
655
|
+
### Return type
|
656
|
+
|
657
|
+
Response<(nil (empty response body))>
|
658
|
+
|
659
|
+
### Authorization
|
660
|
+
|
661
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
662
|
+
|
663
|
+
### HTTP request headers
|
664
|
+
|
665
|
+
- **Content-Type**: Not defined
|
666
|
+
- **Accept**: Not defined
|
667
|
+
|
668
|
+
|
539
669
|
## job_update
|
540
670
|
|
541
671
|
> JobDetails job_update(project_id, id, job_update_parameters, opts)
|
data/docs/KeyCreateParameters.md
CHANGED
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
|
|
15
15
|
**screenshot** | **File** | Screenshot/image for the key. This parameter is deprecated. Please use the Screenshots endpoint instead. | [optional]
|
16
16
|
**remove_screenshot** | **Boolean** | Indicates whether the screenshot will be deleted. This parameter is deprecated. Please use the Screenshots endpoint instead. | [optional]
|
17
17
|
**unformatted** | **Boolean** | Indicates whether the key should be exported as \"unformatted\". Supported by Android XML and other formats. | [optional]
|
18
|
+
**default_translation_content** | **String** | Creates a translation in the default locale with the specified content | [optional]
|
18
19
|
**xml_space_preserve** | **Boolean** | Indicates whether the key should be exported with \"xml:space=preserve\". Supported by several XML-based formats. | [optional]
|
19
20
|
**original_file** | **String** | Original file attribute. Used in some formats, e.g. XLIFF. | [optional]
|
20
21
|
**localized_format_string** | **String** | NSStringLocalizedFormatKey attribute. Used in .stringsdict format. | [optional]
|
@@ -36,6 +37,7 @@ instance = Phrase::KeyCreateParameters.new(branch: my-feature-branch,
|
|
36
37
|
screenshot: null,
|
37
38
|
remove_screenshot: null,
|
38
39
|
unformatted: null,
|
40
|
+
default_translation_content: Default translation content,
|
39
41
|
xml_space_preserve: null,
|
40
42
|
original_file: null,
|
41
43
|
localized_format_string: null,
|
data/docs/Member.md
CHANGED
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
|
|
13
13
|
**projects** | [**Array<ProjectLocales>**](ProjectLocales.md) | | [optional]
|
14
14
|
**permissions** | [**Object**](.md) | | [optional]
|
15
15
|
**default_locale_codes** | **Array<String>** | | [optional]
|
16
|
-
**teams** | [**Array<
|
16
|
+
**teams** | [**Array<TeamShort>**](TeamShort.md) | | [optional]
|
17
17
|
**spaces** | [**Array<MemberSpaces>**](MemberSpaces.md) | | [optional]
|
18
18
|
|
19
19
|
## Code Sample
|
data/docs/ScreenshotsApi.md
CHANGED
@@ -14,7 +14,7 @@ Method | HTTP request | Description
|
|
14
14
|
|
15
15
|
## screenshot_create
|
16
16
|
|
17
|
-
> Screenshot screenshot_create(project_id,
|
17
|
+
> Screenshot screenshot_create(project_id, opts)
|
18
18
|
|
19
19
|
Create a screenshot
|
20
20
|
|
@@ -38,14 +38,17 @@ end
|
|
38
38
|
|
39
39
|
api_instance = Phrase::ScreenshotsApi.new
|
40
40
|
project_id = 'project_id_example' # String | Project ID
|
41
|
-
screenshot_create_parameters = Phrase::ScreenshotCreateParameters.new # ScreenshotCreateParameters |
|
42
41
|
opts = {
|
43
|
-
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
42
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
43
|
+
branch: 'branch_example', # String | specify the branch to use
|
44
|
+
name: 'name_example', # String | Name of the screenshot
|
45
|
+
description: 'description_example', # String | Description of the screenshot
|
46
|
+
filename: File.new('/path/to/file') # File | Screenshot file
|
44
47
|
}
|
45
48
|
|
46
49
|
begin
|
47
50
|
#Create a screenshot
|
48
|
-
result = api_instance.screenshot_create(project_id,
|
51
|
+
result = api_instance.screenshot_create(project_id, opts)
|
49
52
|
pp result
|
50
53
|
rescue Phrase::ApiError => e
|
51
54
|
puts "Exception when calling ScreenshotsApi->screenshot_create: #{e}"
|
@@ -58,8 +61,11 @@ end
|
|
58
61
|
Name | Type | Description | Notes
|
59
62
|
------------- | ------------- | ------------- | -------------
|
60
63
|
**project_id** | **String**| Project ID |
|
61
|
-
**screenshot_create_parameters** | [**ScreenshotCreateParameters**](ScreenshotCreateParameters.md)| |
|
62
64
|
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
65
|
+
**branch** | **String**| specify the branch to use | [optional]
|
66
|
+
**name** | **String**| Name of the screenshot | [optional]
|
67
|
+
**description** | **String**| Description of the screenshot | [optional]
|
68
|
+
**filename** | **File**| Screenshot file | [optional]
|
63
69
|
|
64
70
|
### Return type
|
65
71
|
|
@@ -71,7 +77,7 @@ Response<([**Screenshot**](Screenshot.md))>
|
|
71
77
|
|
72
78
|
### HTTP request headers
|
73
79
|
|
74
|
-
- **Content-Type**:
|
80
|
+
- **Content-Type**: multipart/form-data
|
75
81
|
- **Accept**: application/json
|
76
82
|
|
77
83
|
|
@@ -31,7 +31,7 @@ instance = Phrase::StyleguideCreateParameters.new(title: Web application style g
|
|
31
31
|
business: We are a travel site that helps customers find the best hotels and flights.,
|
32
32
|
company_branding: ACME Inc. should never be translated.,
|
33
33
|
formatting: Never use capital letters,
|
34
|
-
glossary_terms:
|
34
|
+
glossary_terms: Apartment, cabin, loft,
|
35
35
|
grammar_consistency: null,
|
36
36
|
literal_translation: Neutral,
|
37
37
|
overall_tone: Tone should be fun and light,
|
@@ -31,7 +31,7 @@ instance = Phrase::StyleguideUpdateParameters.new(title: Web application style g
|
|
31
31
|
business: We are a travel site that helps customers find the best hotels and flights.,
|
32
32
|
company_branding: ACME Inc. should never be translated.,
|
33
33
|
formatting: Never use capital letters,
|
34
|
-
glossary_terms:
|
34
|
+
glossary_terms: Apartment, cabin, loft,
|
35
35
|
grammar_consistency: null,
|
36
36
|
literal_translation: Neutral,
|
37
37
|
overall_tone: Tone should be fun and light,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Phrase::
|
1
|
+
# Phrase::TeamShort
|
2
2
|
|
3
3
|
## Properties
|
4
4
|
|
@@ -14,7 +14,7 @@ Name | Type | Description | Notes
|
|
14
14
|
```ruby
|
15
15
|
require 'Phrase'
|
16
16
|
|
17
|
-
instance = Phrase::
|
17
|
+
instance = Phrase::TeamShort.new(id: null,
|
18
18
|
name: null,
|
19
19
|
created_at: null,
|
20
20
|
updated_at: null)
|
@@ -0,0 +1,411 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class JobCommentsApi
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(api_client = ApiClient.default)
|
8
|
+
@api_client = api_client
|
9
|
+
end
|
10
|
+
# Create a job comment
|
11
|
+
# Create a new comment for a job.
|
12
|
+
# @param project_id [String] Project ID
|
13
|
+
# @param job_id [String] Job ID
|
14
|
+
# @param job_comment_create_parameters [JobCommentCreateParameters]
|
15
|
+
# @param [Hash] opts the optional parameters
|
16
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
17
|
+
# @return [JobComment]
|
18
|
+
def job_comment_create(project_id, job_id, job_comment_create_parameters, opts = {})
|
19
|
+
data, _status_code, _headers = job_comment_create_with_http_info(project_id, job_id, job_comment_create_parameters, opts)
|
20
|
+
data
|
21
|
+
end
|
22
|
+
|
23
|
+
# Create a job comment
|
24
|
+
# Create a new comment for a job.
|
25
|
+
# @param project_id [String] Project ID
|
26
|
+
# @param job_id [String] Job ID
|
27
|
+
# @param job_comment_create_parameters [JobCommentCreateParameters]
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
30
|
+
# @return [Array<(Response<(JobComment)>, Integer, Hash)>] Response<(JobComment)> data, response status code and response headers
|
31
|
+
def job_comment_create_with_http_info(project_id, job_id, job_comment_create_parameters, opts = {})
|
32
|
+
if @api_client.config.debugging
|
33
|
+
@api_client.config.logger.debug 'Calling API: JobCommentsApi.job_comment_create ...'
|
34
|
+
end
|
35
|
+
# verify the required parameter 'project_id' is set
|
36
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
37
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling JobCommentsApi.job_comment_create"
|
38
|
+
end
|
39
|
+
# verify the required parameter 'job_id' is set
|
40
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobCommentsApi.job_comment_create"
|
42
|
+
end
|
43
|
+
# verify the required parameter 'job_comment_create_parameters' is set
|
44
|
+
if @api_client.config.client_side_validation && job_comment_create_parameters.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'job_comment_create_parameters' when calling JobCommentsApi.job_comment_create"
|
46
|
+
end
|
47
|
+
# resource path
|
48
|
+
local_var_path = '/projects/{project_id}/jobs/{job_id}/comments'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))
|
49
|
+
|
50
|
+
# query parameters
|
51
|
+
query_params = opts[:query_params] || {}
|
52
|
+
|
53
|
+
# header parameters
|
54
|
+
header_params = opts[:header_params] || {}
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
+
# HTTP header 'Content-Type'
|
58
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
59
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:body] || @api_client.object_to_http_body(job_comment_create_parameters)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:return_type] || 'JobComment'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:header_params => header_params,
|
75
|
+
:query_params => query_params,
|
76
|
+
:form_params => form_params,
|
77
|
+
:body => post_body,
|
78
|
+
:auth_names => auth_names,
|
79
|
+
:return_type => return_type
|
80
|
+
)
|
81
|
+
|
82
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
83
|
+
if @api_client.config.debugging
|
84
|
+
@api_client.config.logger.debug "API called: JobCommentsApi#job_comment_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
85
|
+
end
|
86
|
+
response = ::Phrase::Response.new(data, headers)
|
87
|
+
return response, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Delete a job comment
|
91
|
+
# Delete an existing job comment.
|
92
|
+
# @param project_id [String] Project ID
|
93
|
+
# @param job_id [String] Job ID
|
94
|
+
# @param id [String] ID
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
97
|
+
# @option opts [String] :branch specify the branch to use
|
98
|
+
# @return [nil]
|
99
|
+
def job_comment_delete(project_id, job_id, id, opts = {})
|
100
|
+
data, _status_code, _headers = job_comment_delete_with_http_info(project_id, job_id, id, opts)
|
101
|
+
data
|
102
|
+
end
|
103
|
+
|
104
|
+
# Delete a job comment
|
105
|
+
# Delete an existing job comment.
|
106
|
+
# @param project_id [String] Project ID
|
107
|
+
# @param job_id [String] Job ID
|
108
|
+
# @param id [String] ID
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
111
|
+
# @option opts [String] :branch specify the branch to use
|
112
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
113
|
+
def job_comment_delete_with_http_info(project_id, job_id, id, opts = {})
|
114
|
+
if @api_client.config.debugging
|
115
|
+
@api_client.config.logger.debug 'Calling API: JobCommentsApi.job_comment_delete ...'
|
116
|
+
end
|
117
|
+
# verify the required parameter 'project_id' is set
|
118
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
119
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling JobCommentsApi.job_comment_delete"
|
120
|
+
end
|
121
|
+
# verify the required parameter 'job_id' is set
|
122
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
123
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobCommentsApi.job_comment_delete"
|
124
|
+
end
|
125
|
+
# verify the required parameter 'id' is set
|
126
|
+
if @api_client.config.client_side_validation && id.nil?
|
127
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobCommentsApi.job_comment_delete"
|
128
|
+
end
|
129
|
+
# resource path
|
130
|
+
local_var_path = '/projects/{project_id}/jobs/{job_id}/comments/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
131
|
+
|
132
|
+
# query parameters
|
133
|
+
query_params = opts[:query_params] || {}
|
134
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
135
|
+
|
136
|
+
# header parameters
|
137
|
+
header_params = opts[:header_params] || {}
|
138
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
139
|
+
|
140
|
+
# form parameters
|
141
|
+
form_params = opts[:form_params] || {}
|
142
|
+
|
143
|
+
# http body (model)
|
144
|
+
post_body = opts[:body]
|
145
|
+
|
146
|
+
# return_type
|
147
|
+
return_type = opts[:return_type]
|
148
|
+
|
149
|
+
# auth_names
|
150
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
151
|
+
|
152
|
+
new_options = opts.merge(
|
153
|
+
:header_params => header_params,
|
154
|
+
:query_params => query_params,
|
155
|
+
:form_params => form_params,
|
156
|
+
:body => post_body,
|
157
|
+
:auth_names => auth_names,
|
158
|
+
:return_type => return_type
|
159
|
+
)
|
160
|
+
|
161
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
162
|
+
if @api_client.config.debugging
|
163
|
+
@api_client.config.logger.debug "API called: JobCommentsApi#job_comment_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
164
|
+
end
|
165
|
+
response = ::Phrase::Response.new(data, headers)
|
166
|
+
return response, status_code, headers
|
167
|
+
end
|
168
|
+
|
169
|
+
# Get a single job comment
|
170
|
+
# Get details on a single job comment.
|
171
|
+
# @param project_id [String] Project ID
|
172
|
+
# @param job_id [String] Job ID
|
173
|
+
# @param id [String] ID
|
174
|
+
# @param [Hash] opts the optional parameters
|
175
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
176
|
+
# @option opts [String] :branch specify the branch to use
|
177
|
+
# @return [Object]
|
178
|
+
def job_comment_show(project_id, job_id, id, opts = {})
|
179
|
+
data, _status_code, _headers = job_comment_show_with_http_info(project_id, job_id, id, opts)
|
180
|
+
data
|
181
|
+
end
|
182
|
+
|
183
|
+
# Get a single job comment
|
184
|
+
# Get details on a single job comment.
|
185
|
+
# @param project_id [String] Project ID
|
186
|
+
# @param job_id [String] Job ID
|
187
|
+
# @param id [String] ID
|
188
|
+
# @param [Hash] opts the optional parameters
|
189
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
190
|
+
# @option opts [String] :branch specify the branch to use
|
191
|
+
# @return [Array<(Response<(Object)>, Integer, Hash)>] Response<(Object)> data, response status code and response headers
|
192
|
+
def job_comment_show_with_http_info(project_id, job_id, id, opts = {})
|
193
|
+
if @api_client.config.debugging
|
194
|
+
@api_client.config.logger.debug 'Calling API: JobCommentsApi.job_comment_show ...'
|
195
|
+
end
|
196
|
+
# verify the required parameter 'project_id' is set
|
197
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
198
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling JobCommentsApi.job_comment_show"
|
199
|
+
end
|
200
|
+
# verify the required parameter 'job_id' is set
|
201
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
202
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobCommentsApi.job_comment_show"
|
203
|
+
end
|
204
|
+
# verify the required parameter 'id' is set
|
205
|
+
if @api_client.config.client_side_validation && id.nil?
|
206
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobCommentsApi.job_comment_show"
|
207
|
+
end
|
208
|
+
# resource path
|
209
|
+
local_var_path = '/projects/{project_id}/jobs/{job_id}/comments/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
210
|
+
|
211
|
+
# query parameters
|
212
|
+
query_params = opts[:query_params] || {}
|
213
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
214
|
+
|
215
|
+
# header parameters
|
216
|
+
header_params = opts[:header_params] || {}
|
217
|
+
# HTTP header 'Accept' (if needed)
|
218
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
219
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
220
|
+
|
221
|
+
# form parameters
|
222
|
+
form_params = opts[:form_params] || {}
|
223
|
+
|
224
|
+
# http body (model)
|
225
|
+
post_body = opts[:body]
|
226
|
+
|
227
|
+
# return_type
|
228
|
+
return_type = opts[:return_type] || 'Object'
|
229
|
+
|
230
|
+
# auth_names
|
231
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
232
|
+
|
233
|
+
new_options = opts.merge(
|
234
|
+
:header_params => header_params,
|
235
|
+
:query_params => query_params,
|
236
|
+
:form_params => form_params,
|
237
|
+
:body => post_body,
|
238
|
+
:auth_names => auth_names,
|
239
|
+
:return_type => return_type
|
240
|
+
)
|
241
|
+
|
242
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
243
|
+
if @api_client.config.debugging
|
244
|
+
@api_client.config.logger.debug "API called: JobCommentsApi#job_comment_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
245
|
+
end
|
246
|
+
response = ::Phrase::Response.new(data, headers)
|
247
|
+
return response, status_code, headers
|
248
|
+
end
|
249
|
+
|
250
|
+
# Update a job comment
|
251
|
+
# Update an existing job comment.
|
252
|
+
# @param project_id [String] Project ID
|
253
|
+
# @param key_id [String] Translation Key ID
|
254
|
+
# @param id [String] ID
|
255
|
+
# @param job_comment_update_parameters [JobCommentUpdateParameters]
|
256
|
+
# @param [Hash] opts the optional parameters
|
257
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
258
|
+
# @return [Object]
|
259
|
+
def job_comment_update(project_id, key_id, id, job_comment_update_parameters, opts = {})
|
260
|
+
data, _status_code, _headers = job_comment_update_with_http_info(project_id, key_id, id, job_comment_update_parameters, opts)
|
261
|
+
data
|
262
|
+
end
|
263
|
+
|
264
|
+
# Update a job comment
|
265
|
+
# Update an existing job comment.
|
266
|
+
# @param project_id [String] Project ID
|
267
|
+
# @param key_id [String] Translation Key ID
|
268
|
+
# @param id [String] ID
|
269
|
+
# @param job_comment_update_parameters [JobCommentUpdateParameters]
|
270
|
+
# @param [Hash] opts the optional parameters
|
271
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
272
|
+
# @return [Array<(Response<(Object)>, Integer, Hash)>] Response<(Object)> data, response status code and response headers
|
273
|
+
def job_comment_update_with_http_info(project_id, key_id, id, job_comment_update_parameters, opts = {})
|
274
|
+
if @api_client.config.debugging
|
275
|
+
@api_client.config.logger.debug 'Calling API: JobCommentsApi.job_comment_update ...'
|
276
|
+
end
|
277
|
+
# verify the required parameter 'project_id' is set
|
278
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
279
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling JobCommentsApi.job_comment_update"
|
280
|
+
end
|
281
|
+
# verify the required parameter 'key_id' is set
|
282
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
283
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling JobCommentsApi.job_comment_update"
|
284
|
+
end
|
285
|
+
# verify the required parameter 'id' is set
|
286
|
+
if @api_client.config.client_side_validation && id.nil?
|
287
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobCommentsApi.job_comment_update"
|
288
|
+
end
|
289
|
+
# verify the required parameter 'job_comment_update_parameters' is set
|
290
|
+
if @api_client.config.client_side_validation && job_comment_update_parameters.nil?
|
291
|
+
fail ArgumentError, "Missing the required parameter 'job_comment_update_parameters' when calling JobCommentsApi.job_comment_update"
|
292
|
+
end
|
293
|
+
# resource path
|
294
|
+
local_var_path = '/projects/{project_id}/jobs/{job_id}/comments/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
295
|
+
|
296
|
+
# query parameters
|
297
|
+
query_params = opts[:query_params] || {}
|
298
|
+
|
299
|
+
# header parameters
|
300
|
+
header_params = opts[:header_params] || {}
|
301
|
+
# HTTP header 'Accept' (if needed)
|
302
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
303
|
+
# HTTP header 'Content-Type'
|
304
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
305
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
306
|
+
|
307
|
+
# form parameters
|
308
|
+
form_params = opts[:form_params] || {}
|
309
|
+
|
310
|
+
# http body (model)
|
311
|
+
post_body = opts[:body] || @api_client.object_to_http_body(job_comment_update_parameters)
|
312
|
+
|
313
|
+
# return_type
|
314
|
+
return_type = opts[:return_type] || 'Object'
|
315
|
+
|
316
|
+
# auth_names
|
317
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
318
|
+
|
319
|
+
new_options = opts.merge(
|
320
|
+
:header_params => header_params,
|
321
|
+
:query_params => query_params,
|
322
|
+
:form_params => form_params,
|
323
|
+
:body => post_body,
|
324
|
+
:auth_names => auth_names,
|
325
|
+
:return_type => return_type
|
326
|
+
)
|
327
|
+
|
328
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
329
|
+
if @api_client.config.debugging
|
330
|
+
@api_client.config.logger.debug "API called: JobCommentsApi#job_comment_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
331
|
+
end
|
332
|
+
response = ::Phrase::Response.new(data, headers)
|
333
|
+
return response, status_code, headers
|
334
|
+
end
|
335
|
+
|
336
|
+
# List job comments
|
337
|
+
# List all comments for a job.
|
338
|
+
# @param project_id [String] Project ID
|
339
|
+
# @param job_id [String] Job ID
|
340
|
+
# @param [Hash] opts the optional parameters
|
341
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
342
|
+
# @option opts [String] :branch specify the branch to use
|
343
|
+
# @return [Array<Object>]
|
344
|
+
def job_comments_list(project_id, job_id, opts = {})
|
345
|
+
data, _status_code, _headers = job_comments_list_with_http_info(project_id, job_id, opts)
|
346
|
+
data
|
347
|
+
end
|
348
|
+
|
349
|
+
# List job comments
|
350
|
+
# List all comments for a job.
|
351
|
+
# @param project_id [String] Project ID
|
352
|
+
# @param job_id [String] Job ID
|
353
|
+
# @param [Hash] opts the optional parameters
|
354
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
355
|
+
# @option opts [String] :branch specify the branch to use
|
356
|
+
# @return [Array<(Response<(Array<Object>)>, Integer, Hash)>] Response<(Array<Object>)> data, response status code and response headers
|
357
|
+
def job_comments_list_with_http_info(project_id, job_id, opts = {})
|
358
|
+
if @api_client.config.debugging
|
359
|
+
@api_client.config.logger.debug 'Calling API: JobCommentsApi.job_comments_list ...'
|
360
|
+
end
|
361
|
+
# verify the required parameter 'project_id' is set
|
362
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
363
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling JobCommentsApi.job_comments_list"
|
364
|
+
end
|
365
|
+
# verify the required parameter 'job_id' is set
|
366
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
367
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobCommentsApi.job_comments_list"
|
368
|
+
end
|
369
|
+
# resource path
|
370
|
+
local_var_path = '/projects/{project_id}/jobs/{job_id}/comments'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))
|
371
|
+
|
372
|
+
# query parameters
|
373
|
+
query_params = opts[:query_params] || {}
|
374
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
375
|
+
|
376
|
+
# header parameters
|
377
|
+
header_params = opts[:header_params] || {}
|
378
|
+
# HTTP header 'Accept' (if needed)
|
379
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
380
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
381
|
+
|
382
|
+
# form parameters
|
383
|
+
form_params = opts[:form_params] || {}
|
384
|
+
|
385
|
+
# http body (model)
|
386
|
+
post_body = opts[:body]
|
387
|
+
|
388
|
+
# return_type
|
389
|
+
return_type = opts[:return_type] || 'Array<Object>'
|
390
|
+
|
391
|
+
# auth_names
|
392
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
393
|
+
|
394
|
+
new_options = opts.merge(
|
395
|
+
:header_params => header_params,
|
396
|
+
:query_params => query_params,
|
397
|
+
:form_params => form_params,
|
398
|
+
:body => post_body,
|
399
|
+
:auth_names => auth_names,
|
400
|
+
:return_type => return_type
|
401
|
+
)
|
402
|
+
|
403
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
404
|
+
if @api_client.config.debugging
|
405
|
+
@api_client.config.logger.debug "API called: JobCommentsApi#job_comments_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
406
|
+
end
|
407
|
+
response = ::Phrase::Response.new(data, headers)
|
408
|
+
return response, status_code, headers
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|