phrase 2.12.0 → 2.14.0
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/CHANGELOG.md +21 -0
- data/README.md +25 -13
- data/docs/Comment.md +5 -1
- data/docs/CommentReaction.md +27 -0
- data/docs/CommentReactionsApi.md +289 -0
- data/docs/CommentRepliesApi.md +427 -0
- data/docs/CommentsApi.md +5 -1
- data/docs/DistributionCreateParameters.md +1 -1
- data/docs/GitlabSyncHistory.md +2 -2
- data/docs/GitlabSyncHistoryErrors.md +19 -0
- data/docs/JobLocaleUpdateParameters.md +1 -1
- data/docs/JobLocalesApi.md +20 -20
- data/docs/JobLocalesCreateParameters.md +1 -1
- data/docs/LocalesApi.md +2 -2
- data/docs/SpacesApi.md +9 -9
- data/docs/TeamsApi.md +6 -6
- data/docs/UploadCreateParameters.md +1 -1
- data/docs/UploadsApi.md +2 -2
- data/lib/phrase/api/comment_reactions_api.rb +353 -0
- data/lib/phrase/api/comment_replies_api.rb +523 -0
- data/lib/phrase/api/comments_api.rb +6 -0
- data/lib/phrase/api/job_locales_api.rb +20 -20
- data/lib/phrase/api/locales_api.rb +2 -2
- data/lib/phrase/api/spaces_api.rb +6 -6
- data/lib/phrase/api/teams_api.rb +4 -4
- data/lib/phrase/api/uploads_api.rb +2 -2
- data/lib/phrase/models/comment.rb +24 -4
- data/lib/phrase/models/comment_reaction.rb +239 -0
- data/lib/phrase/models/distribution_create_parameters.rb +1 -1
- data/lib/phrase/models/gitlab_sync_history.rb +2 -2
- data/lib/phrase/models/gitlab_sync_history_errors.rb +203 -0
- data/lib/phrase/models/job_locale_update_parameters.rb +1 -1
- data/lib/phrase/models/job_locales_create_parameters.rb +1 -1
- data/lib/phrase/models/upload_create_parameters.rb +1 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +4 -0
- data/spec/api/comment_reactions_api_spec.rb +92 -0
- data/spec/api/comment_replies_api_spec.rb +126 -0
- data/spec/api/comments_api_spec.rb +2 -0
- data/spec/api/job_locales_api_spec.rb +10 -10
- data/spec/api/locales_api_spec.rb +1 -1
- data/spec/api/spaces_api_spec.rb +3 -3
- data/spec/api/teams_api_spec.rb +2 -2
- data/spec/api/uploads_api_spec.rb +1 -1
- data/spec/models/comment_reaction_spec.rb +59 -0
- data/spec/models/comment_spec.rb +12 -0
- data/spec/models/gitlab_sync_history_errors_spec.rb +35 -0
- metadata +228 -211
data/docs/SpacesApi.md
CHANGED
@@ -9,9 +9,9 @@ Method | HTTP request | Description
|
|
9
9
|
[**space_show**](SpacesApi.md#space_show) | **GET** /accounts/{account_id}/spaces/{id} | Get Space
|
10
10
|
[**space_update**](SpacesApi.md#space_update) | **PATCH** /accounts/{account_id}/spaces/{id} | Update Space
|
11
11
|
[**spaces_list**](SpacesApi.md#spaces_list) | **GET** /accounts/{account_id}/spaces | List Spaces
|
12
|
-
[**spaces_projects_create**](SpacesApi.md#spaces_projects_create) | **POST** /accounts/{account_id}/spaces/{space_id}/projects | Add Project
|
13
|
-
[**spaces_projects_delete**](SpacesApi.md#spaces_projects_delete) | **DELETE** /accounts/{account_id}/spaces/{space_id}/projects/{id} | Remove Project
|
14
|
-
[**spaces_projects_list**](SpacesApi.md#spaces_projects_list) | **GET** /accounts/{account_id}/spaces/{space_id}/projects | List Projects
|
12
|
+
[**spaces_projects_create**](SpacesApi.md#spaces_projects_create) | **POST** /accounts/{account_id}/spaces/{space_id}/projects | Add Project to Space
|
13
|
+
[**spaces_projects_delete**](SpacesApi.md#spaces_projects_delete) | **DELETE** /accounts/{account_id}/spaces/{space_id}/projects/{id} | Remove Project from Space
|
14
|
+
[**spaces_projects_list**](SpacesApi.md#spaces_projects_list) | **GET** /accounts/{account_id}/spaces/{space_id}/projects | List Projects in Space
|
15
15
|
|
16
16
|
|
17
17
|
|
@@ -337,7 +337,7 @@ Response<([**Array<Space>**](Space.md))>
|
|
337
337
|
|
338
338
|
> spaces_projects_create(account_id, space_id, spaces_projects_create_parameters, opts)
|
339
339
|
|
340
|
-
Add Project
|
340
|
+
Add Project to Space
|
341
341
|
|
342
342
|
Adds an existing project to the space.
|
343
343
|
|
@@ -366,7 +366,7 @@ opts = {
|
|
366
366
|
}
|
367
367
|
|
368
368
|
begin
|
369
|
-
#Add Project
|
369
|
+
#Add Project to Space
|
370
370
|
api_instance.spaces_projects_create(account_id, space_id, spaces_projects_create_parameters, opts)
|
371
371
|
rescue Phrase::ApiError => e
|
372
372
|
puts "Exception when calling SpacesApi->spaces_projects_create: #{e}"
|
@@ -401,7 +401,7 @@ Response<(nil (empty response body))>
|
|
401
401
|
|
402
402
|
> spaces_projects_delete(account_id, space_id, id, opts)
|
403
403
|
|
404
|
-
Remove Project
|
404
|
+
Remove Project from Space
|
405
405
|
|
406
406
|
Removes a specified project from the specified space.
|
407
407
|
|
@@ -430,7 +430,7 @@ opts = {
|
|
430
430
|
}
|
431
431
|
|
432
432
|
begin
|
433
|
-
#Remove Project
|
433
|
+
#Remove Project from Space
|
434
434
|
api_instance.spaces_projects_delete(account_id, space_id, id, opts)
|
435
435
|
rescue Phrase::ApiError => e
|
436
436
|
puts "Exception when calling SpacesApi->spaces_projects_delete: #{e}"
|
@@ -465,7 +465,7 @@ Response<(nil (empty response body))>
|
|
465
465
|
|
466
466
|
> Array<Project> spaces_projects_list(account_id, space_id, opts)
|
467
467
|
|
468
|
-
List Projects
|
468
|
+
List Projects in Space
|
469
469
|
|
470
470
|
List all projects for the specified Space.
|
471
471
|
|
@@ -495,7 +495,7 @@ opts = {
|
|
495
495
|
}
|
496
496
|
|
497
497
|
begin
|
498
|
-
#List Projects
|
498
|
+
#List Projects in Space
|
499
499
|
result = api_instance.spaces_projects_list(account_id, space_id, opts)
|
500
500
|
pp result
|
501
501
|
rescue Phrase::ApiError => e
|
data/docs/TeamsApi.md
CHANGED
@@ -9,8 +9,8 @@ Method | HTTP request | Description
|
|
9
9
|
[**team_show**](TeamsApi.md#team_show) | **GET** /accounts/{account_id}/teams/{id} | Get Team
|
10
10
|
[**team_update**](TeamsApi.md#team_update) | **PATCH** /accounts/{account_id}/teams/{id} | Update Team
|
11
11
|
[**teams_list**](TeamsApi.md#teams_list) | **GET** /accounts/{account_id}/teams | List Teams
|
12
|
-
[**teams_projects_create**](TeamsApi.md#teams_projects_create) | **POST** /accounts/{account_id}/teams/{team_id}/projects | Add Project
|
13
|
-
[**teams_projects_delete**](TeamsApi.md#teams_projects_delete) | **DELETE** /accounts/{account_id}/teams/{team_id}/projects/{id} | Remove Project
|
12
|
+
[**teams_projects_create**](TeamsApi.md#teams_projects_create) | **POST** /accounts/{account_id}/teams/{team_id}/projects | Add Project to Team
|
13
|
+
[**teams_projects_delete**](TeamsApi.md#teams_projects_delete) | **DELETE** /accounts/{account_id}/teams/{team_id}/projects/{id} | Remove Project from Team
|
14
14
|
[**teams_spaces_create**](TeamsApi.md#teams_spaces_create) | **POST** /accounts/{account_id}/teams/{team_id}/spaces | Add Space
|
15
15
|
[**teams_spaces_delete**](TeamsApi.md#teams_spaces_delete) | **DELETE** /accounts/{account_id}/teams/{team_id}/spaces/{id} | Remove Space
|
16
16
|
[**teams_users_create**](TeamsApi.md#teams_users_create) | **POST** /accounts/{account_id}/teams/{team_id}/users | Add User
|
@@ -340,7 +340,7 @@ Response<([**Array<Team>**](Team.md))>
|
|
340
340
|
|
341
341
|
> teams_projects_create(account_id, team_id, teams_projects_create_parameters, opts)
|
342
342
|
|
343
|
-
Add Project
|
343
|
+
Add Project to Team
|
344
344
|
|
345
345
|
Adds an existing project to the team.
|
346
346
|
|
@@ -369,7 +369,7 @@ opts = {
|
|
369
369
|
}
|
370
370
|
|
371
371
|
begin
|
372
|
-
#Add Project
|
372
|
+
#Add Project to Team
|
373
373
|
api_instance.teams_projects_create(account_id, team_id, teams_projects_create_parameters, opts)
|
374
374
|
rescue Phrase::ApiError => e
|
375
375
|
puts "Exception when calling TeamsApi->teams_projects_create: #{e}"
|
@@ -404,7 +404,7 @@ Response<(nil (empty response body))>
|
|
404
404
|
|
405
405
|
> teams_projects_delete(account_id, team_id, id, opts)
|
406
406
|
|
407
|
-
Remove Project
|
407
|
+
Remove Project from Team
|
408
408
|
|
409
409
|
Removes a specified project from the specified team.
|
410
410
|
|
@@ -433,7 +433,7 @@ opts = {
|
|
433
433
|
}
|
434
434
|
|
435
435
|
begin
|
436
|
-
#Remove Project
|
436
|
+
#Remove Project from Team
|
437
437
|
api_instance.teams_projects_delete(account_id, team_id, id, opts)
|
438
438
|
rescue Phrase::ApiError => e
|
439
439
|
puts "Exception when calling TeamsApi->teams_projects_delete: #{e}"
|
@@ -18,7 +18,7 @@ Name | Type | Description | Notes
|
|
18
18
|
**locale_mapping** | [**Object**](.md) | Optional, format specific mapping between locale names and the columns the translations to those locales are contained in. | [optional]
|
19
19
|
**format_options** | [**Object**](.md) | Additional options available for specific formats. See our format guide for complete list. | [optional]
|
20
20
|
**autotranslate** | **Boolean** | If set, translations for the uploaded language will be fetched automatically. | [optional]
|
21
|
-
**mark_reviewed** | **Boolean** | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow
|
21
|
+
**mark_reviewed** | **Boolean** | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. | [optional]
|
22
22
|
|
23
23
|
## Code Sample
|
24
24
|
|
data/docs/UploadsApi.md
CHANGED
@@ -52,7 +52,7 @@ opts = {
|
|
52
52
|
locale_mapping: nil, # Object | Optional, format specific mapping between locale names and the columns the translations to those locales are contained in.
|
53
53
|
format_options: nil, # Object | Additional options available for specific formats. See our format guide for complete list.
|
54
54
|
autotranslate: true, # Boolean | If set, translations for the uploaded language will be fetched automatically.
|
55
|
-
mark_reviewed: true # Boolean | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow
|
55
|
+
mark_reviewed: true # Boolean | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project.
|
56
56
|
}
|
57
57
|
|
58
58
|
begin
|
@@ -85,7 +85,7 @@ Name | Type | Description | Notes
|
|
85
85
|
**locale_mapping** | [**Object**](Object.md)| Optional, format specific mapping between locale names and the columns the translations to those locales are contained in. | [optional]
|
86
86
|
**format_options** | [**Object**](Object.md)| Additional options available for specific formats. See our format guide for complete list. | [optional]
|
87
87
|
**autotranslate** | **Boolean**| If set, translations for the uploaded language will be fetched automatically. | [optional]
|
88
|
-
**mark_reviewed** | **Boolean**| Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow
|
88
|
+
**mark_reviewed** | **Boolean**| Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. | [optional]
|
89
89
|
|
90
90
|
### Return type
|
91
91
|
|
@@ -0,0 +1,353 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class CommentReactionsApi
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(api_client = ApiClient.default)
|
8
|
+
@api_client = api_client
|
9
|
+
end
|
10
|
+
# Create a reaction
|
11
|
+
# Create a new reaction for a comment.
|
12
|
+
# @param project_id [String] Project ID
|
13
|
+
# @param key_id [String] Translation Key ID
|
14
|
+
# @param comment_id [String] Comment ID
|
15
|
+
# @param [Hash] opts the optional parameters
|
16
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
17
|
+
# @option opts [String] :branch specify the branch to use
|
18
|
+
# @option opts [String] :emoji specify the emoji for the reaction
|
19
|
+
# @return [CommentReaction]
|
20
|
+
def reaction_create(project_id, key_id, comment_id, opts = {})
|
21
|
+
data, _status_code, _headers = reaction_create_with_http_info(project_id, key_id, comment_id, opts)
|
22
|
+
data
|
23
|
+
end
|
24
|
+
|
25
|
+
# Create a reaction
|
26
|
+
# Create a new reaction for a comment.
|
27
|
+
# @param project_id [String] Project ID
|
28
|
+
# @param key_id [String] Translation Key ID
|
29
|
+
# @param comment_id [String] Comment ID
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
32
|
+
# @option opts [String] :branch specify the branch to use
|
33
|
+
# @option opts [String] :emoji specify the emoji for the reaction
|
34
|
+
# @return [Array<(Response<(CommentReaction)>, Integer, Hash)>] Response<(CommentReaction)> data, response status code and response headers
|
35
|
+
def reaction_create_with_http_info(project_id, key_id, comment_id, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: CommentReactionsApi.reaction_create ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'project_id' is set
|
40
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentReactionsApi.reaction_create"
|
42
|
+
end
|
43
|
+
# verify the required parameter 'key_id' is set
|
44
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentReactionsApi.reaction_create"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'comment_id' is set
|
48
|
+
if @api_client.config.client_side_validation && comment_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentReactionsApi.reaction_create"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
57
|
+
query_params[:'emoji'] = opts[:'emoji'] if !opts[:'emoji'].nil?
|
58
|
+
|
59
|
+
# header parameters
|
60
|
+
header_params = opts[:header_params] || {}
|
61
|
+
# HTTP header 'Accept' (if needed)
|
62
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
63
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = opts[:form_params] || {}
|
67
|
+
|
68
|
+
# http body (model)
|
69
|
+
post_body = opts[:body]
|
70
|
+
|
71
|
+
# return_type
|
72
|
+
return_type = opts[:return_type] || 'CommentReaction'
|
73
|
+
|
74
|
+
# auth_names
|
75
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
76
|
+
|
77
|
+
new_options = opts.merge(
|
78
|
+
:header_params => header_params,
|
79
|
+
:query_params => query_params,
|
80
|
+
:form_params => form_params,
|
81
|
+
:body => post_body,
|
82
|
+
:auth_names => auth_names,
|
83
|
+
:return_type => return_type
|
84
|
+
)
|
85
|
+
|
86
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
87
|
+
if @api_client.config.debugging
|
88
|
+
@api_client.config.logger.debug "API called: CommentReactionsApi#reaction_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
89
|
+
end
|
90
|
+
response = ::Phrase::Response.new(data, headers)
|
91
|
+
return response, status_code, headers
|
92
|
+
end
|
93
|
+
|
94
|
+
# Delete a reaction
|
95
|
+
# Delete an existing reaction.
|
96
|
+
# @param project_id [String] Project ID
|
97
|
+
# @param key_id [String] Translation Key ID
|
98
|
+
# @param comment_id [String] Comment ID
|
99
|
+
# @param id [String] ID
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
102
|
+
# @option opts [String] :branch specify the branch to use
|
103
|
+
# @return [nil]
|
104
|
+
def reaction_delete(project_id, key_id, comment_id, id, opts = {})
|
105
|
+
data, _status_code, _headers = reaction_delete_with_http_info(project_id, key_id, comment_id, id, opts)
|
106
|
+
data
|
107
|
+
end
|
108
|
+
|
109
|
+
# Delete a reaction
|
110
|
+
# Delete an existing reaction.
|
111
|
+
# @param project_id [String] Project ID
|
112
|
+
# @param key_id [String] Translation Key ID
|
113
|
+
# @param comment_id [String] Comment ID
|
114
|
+
# @param id [String] ID
|
115
|
+
# @param [Hash] opts the optional parameters
|
116
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
117
|
+
# @option opts [String] :branch specify the branch to use
|
118
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
119
|
+
def reaction_delete_with_http_info(project_id, key_id, comment_id, id, opts = {})
|
120
|
+
if @api_client.config.debugging
|
121
|
+
@api_client.config.logger.debug 'Calling API: CommentReactionsApi.reaction_delete ...'
|
122
|
+
end
|
123
|
+
# verify the required parameter 'project_id' is set
|
124
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
125
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentReactionsApi.reaction_delete"
|
126
|
+
end
|
127
|
+
# verify the required parameter 'key_id' is set
|
128
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
129
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentReactionsApi.reaction_delete"
|
130
|
+
end
|
131
|
+
# verify the required parameter 'comment_id' is set
|
132
|
+
if @api_client.config.client_side_validation && comment_id.nil?
|
133
|
+
fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentReactionsApi.reaction_delete"
|
134
|
+
end
|
135
|
+
# verify the required parameter 'id' is set
|
136
|
+
if @api_client.config.client_side_validation && id.nil?
|
137
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CommentReactionsApi.reaction_delete"
|
138
|
+
end
|
139
|
+
# resource path
|
140
|
+
local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
141
|
+
|
142
|
+
# query parameters
|
143
|
+
query_params = opts[:query_params] || {}
|
144
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
145
|
+
|
146
|
+
# header parameters
|
147
|
+
header_params = opts[:header_params] || {}
|
148
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
149
|
+
|
150
|
+
# form parameters
|
151
|
+
form_params = opts[:form_params] || {}
|
152
|
+
|
153
|
+
# http body (model)
|
154
|
+
post_body = opts[:body]
|
155
|
+
|
156
|
+
# return_type
|
157
|
+
return_type = opts[:return_type]
|
158
|
+
|
159
|
+
# auth_names
|
160
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
161
|
+
|
162
|
+
new_options = opts.merge(
|
163
|
+
:header_params => header_params,
|
164
|
+
:query_params => query_params,
|
165
|
+
:form_params => form_params,
|
166
|
+
:body => post_body,
|
167
|
+
:auth_names => auth_names,
|
168
|
+
:return_type => return_type
|
169
|
+
)
|
170
|
+
|
171
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug "API called: CommentReactionsApi#reaction_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
174
|
+
end
|
175
|
+
response = ::Phrase::Response.new(data, headers)
|
176
|
+
return response, status_code, headers
|
177
|
+
end
|
178
|
+
|
179
|
+
# Get a single reaction
|
180
|
+
# Get details on a single reaction.
|
181
|
+
# @param project_id [String] Project ID
|
182
|
+
# @param key_id [String] Translation Key ID
|
183
|
+
# @param comment_id [String] Comment ID
|
184
|
+
# @param id [String] ID
|
185
|
+
# @param [Hash] opts the optional parameters
|
186
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
187
|
+
# @option opts [String] :branch specify the branch to use
|
188
|
+
# @return [CommentReaction]
|
189
|
+
def reaction_show(project_id, key_id, comment_id, id, opts = {})
|
190
|
+
data, _status_code, _headers = reaction_show_with_http_info(project_id, key_id, comment_id, id, opts)
|
191
|
+
data
|
192
|
+
end
|
193
|
+
|
194
|
+
# Get a single reaction
|
195
|
+
# Get details on a single reaction.
|
196
|
+
# @param project_id [String] Project ID
|
197
|
+
# @param key_id [String] Translation Key ID
|
198
|
+
# @param comment_id [String] Comment ID
|
199
|
+
# @param id [String] ID
|
200
|
+
# @param [Hash] opts the optional parameters
|
201
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
202
|
+
# @option opts [String] :branch specify the branch to use
|
203
|
+
# @return [Array<(Response<(CommentReaction)>, Integer, Hash)>] Response<(CommentReaction)> data, response status code and response headers
|
204
|
+
def reaction_show_with_http_info(project_id, key_id, comment_id, id, opts = {})
|
205
|
+
if @api_client.config.debugging
|
206
|
+
@api_client.config.logger.debug 'Calling API: CommentReactionsApi.reaction_show ...'
|
207
|
+
end
|
208
|
+
# verify the required parameter 'project_id' is set
|
209
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
210
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentReactionsApi.reaction_show"
|
211
|
+
end
|
212
|
+
# verify the required parameter 'key_id' is set
|
213
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
214
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentReactionsApi.reaction_show"
|
215
|
+
end
|
216
|
+
# verify the required parameter 'comment_id' is set
|
217
|
+
if @api_client.config.client_side_validation && comment_id.nil?
|
218
|
+
fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentReactionsApi.reaction_show"
|
219
|
+
end
|
220
|
+
# verify the required parameter 'id' is set
|
221
|
+
if @api_client.config.client_side_validation && id.nil?
|
222
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CommentReactionsApi.reaction_show"
|
223
|
+
end
|
224
|
+
# resource path
|
225
|
+
local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
226
|
+
|
227
|
+
# query parameters
|
228
|
+
query_params = opts[:query_params] || {}
|
229
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
230
|
+
|
231
|
+
# header parameters
|
232
|
+
header_params = opts[:header_params] || {}
|
233
|
+
# HTTP header 'Accept' (if needed)
|
234
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
235
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
236
|
+
|
237
|
+
# form parameters
|
238
|
+
form_params = opts[:form_params] || {}
|
239
|
+
|
240
|
+
# http body (model)
|
241
|
+
post_body = opts[:body]
|
242
|
+
|
243
|
+
# return_type
|
244
|
+
return_type = opts[:return_type] || 'CommentReaction'
|
245
|
+
|
246
|
+
# auth_names
|
247
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
248
|
+
|
249
|
+
new_options = opts.merge(
|
250
|
+
:header_params => header_params,
|
251
|
+
:query_params => query_params,
|
252
|
+
:form_params => form_params,
|
253
|
+
:body => post_body,
|
254
|
+
:auth_names => auth_names,
|
255
|
+
:return_type => return_type
|
256
|
+
)
|
257
|
+
|
258
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
259
|
+
if @api_client.config.debugging
|
260
|
+
@api_client.config.logger.debug "API called: CommentReactionsApi#reaction_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
261
|
+
end
|
262
|
+
response = ::Phrase::Response.new(data, headers)
|
263
|
+
return response, status_code, headers
|
264
|
+
end
|
265
|
+
|
266
|
+
# List reactions
|
267
|
+
# List all reactions for a comment.
|
268
|
+
# @param project_id [String] Project ID
|
269
|
+
# @param key_id [String] Translation Key ID
|
270
|
+
# @param comment_id [String] Comment ID
|
271
|
+
# @param [Hash] opts the optional parameters
|
272
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
273
|
+
# @option opts [Integer] :page Page number
|
274
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
275
|
+
# @option opts [String] :branch specify the branch to use
|
276
|
+
# @return [Array<CommentReaction>]
|
277
|
+
def reactions_list(project_id, key_id, comment_id, opts = {})
|
278
|
+
data, _status_code, _headers = reactions_list_with_http_info(project_id, key_id, comment_id, opts)
|
279
|
+
data
|
280
|
+
end
|
281
|
+
|
282
|
+
# List reactions
|
283
|
+
# List all reactions for a comment.
|
284
|
+
# @param project_id [String] Project ID
|
285
|
+
# @param key_id [String] Translation Key ID
|
286
|
+
# @param comment_id [String] Comment ID
|
287
|
+
# @param [Hash] opts the optional parameters
|
288
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
289
|
+
# @option opts [Integer] :page Page number
|
290
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
291
|
+
# @option opts [String] :branch specify the branch to use
|
292
|
+
# @return [Array<(Response<(Array<CommentReaction>)>, Integer, Hash)>] Response<(Array<CommentReaction>)> data, response status code and response headers
|
293
|
+
def reactions_list_with_http_info(project_id, key_id, comment_id, opts = {})
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug 'Calling API: CommentReactionsApi.reactions_list ...'
|
296
|
+
end
|
297
|
+
# verify the required parameter 'project_id' is set
|
298
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
299
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentReactionsApi.reactions_list"
|
300
|
+
end
|
301
|
+
# verify the required parameter 'key_id' is set
|
302
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
303
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentReactionsApi.reactions_list"
|
304
|
+
end
|
305
|
+
# verify the required parameter 'comment_id' is set
|
306
|
+
if @api_client.config.client_side_validation && comment_id.nil?
|
307
|
+
fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentReactionsApi.reactions_list"
|
308
|
+
end
|
309
|
+
# resource path
|
310
|
+
local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s))
|
311
|
+
|
312
|
+
# query parameters
|
313
|
+
query_params = opts[:query_params] || {}
|
314
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
315
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
316
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
317
|
+
|
318
|
+
# header parameters
|
319
|
+
header_params = opts[:header_params] || {}
|
320
|
+
# HTTP header 'Accept' (if needed)
|
321
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
322
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
323
|
+
|
324
|
+
# form parameters
|
325
|
+
form_params = opts[:form_params] || {}
|
326
|
+
|
327
|
+
# http body (model)
|
328
|
+
post_body = opts[:body]
|
329
|
+
|
330
|
+
# return_type
|
331
|
+
return_type = opts[:return_type] || 'Array<CommentReaction>'
|
332
|
+
|
333
|
+
# auth_names
|
334
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
335
|
+
|
336
|
+
new_options = opts.merge(
|
337
|
+
:header_params => header_params,
|
338
|
+
:query_params => query_params,
|
339
|
+
:form_params => form_params,
|
340
|
+
:body => post_body,
|
341
|
+
:auth_names => auth_names,
|
342
|
+
:return_type => return_type
|
343
|
+
)
|
344
|
+
|
345
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
346
|
+
if @api_client.config.debugging
|
347
|
+
@api_client.config.logger.debug "API called: CommentReactionsApi#reactions_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
348
|
+
end
|
349
|
+
response = ::Phrase::Response.new(data, headers)
|
350
|
+
return response, status_code, headers
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|