phrase 2.13.0 → 2.15.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.
@@ -15,6 +15,7 @@ module Phrase
15
15
  # @param [Hash] opts the optional parameters
16
16
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
17
17
  # @option opts [String] :branch specify the branch to use
18
+ # @option opts [String] :emoji specify the emoji for the reaction
18
19
  # @return [CommentReaction]
19
20
  def reaction_create(project_id, key_id, comment_id, opts = {})
20
21
  data, _status_code, _headers = reaction_create_with_http_info(project_id, key_id, comment_id, opts)
@@ -29,6 +30,7 @@ module Phrase
29
30
  # @param [Hash] opts the optional parameters
30
31
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
31
32
  # @option opts [String] :branch specify the branch to use
33
+ # @option opts [String] :emoji specify the emoji for the reaction
32
34
  # @return [Array<(Response<(CommentReaction)>, Integer, Hash)>] Response<(CommentReaction)> data, response status code and response headers
33
35
  def reaction_create_with_http_info(project_id, key_id, comment_id, opts = {})
34
36
  if @api_client.config.debugging
@@ -52,6 +54,7 @@ module Phrase
52
54
  # query parameters
53
55
  query_params = opts[:query_params] || {}
54
56
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
57
+ query_params[:'emoji'] = opts[:'emoji'] if !opts[:'emoji'].nil?
55
58
 
56
59
  # header parameters
57
60
  header_params = opts[:header_params] || {}
@@ -0,0 +1,537 @@
1
+ require 'cgi'
2
+
3
+ module Phrase
4
+ class CommentRepliesApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # List replies
11
+ # List all replies 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 replies_list_parameters [RepliesListParameters]
16
+ # @param [Hash] opts the optional parameters
17
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
18
+ # @option opts [Integer] :page Page number
19
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
20
+ # @option opts [String] :branch specify the branch to use
21
+ # @option opts [String] :query Search query for comment messages
22
+ # @option opts [Array<String>] :filters Specify the filter for the comments
23
+ # @return [Array<Comment>]
24
+ def replies_list(project_id, key_id, comment_id, replies_list_parameters, opts = {})
25
+ data, _status_code, _headers = replies_list_with_http_info(project_id, key_id, comment_id, replies_list_parameters, opts)
26
+ data
27
+ end
28
+
29
+ # List replies
30
+ # List all replies for a comment.
31
+ # @param project_id [String] Project ID
32
+ # @param key_id [String] Translation Key ID
33
+ # @param comment_id [String] Comment ID
34
+ # @param replies_list_parameters [RepliesListParameters]
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
37
+ # @option opts [Integer] :page Page number
38
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
39
+ # @option opts [String] :branch specify the branch to use
40
+ # @option opts [String] :query Search query for comment messages
41
+ # @option opts [Array<String>] :filters Specify the filter for the comments
42
+ # @return [Array<(Response<(Array<Comment>)>, Integer, Hash)>] Response<(Array<Comment>)> data, response status code and response headers
43
+ def replies_list_with_http_info(project_id, key_id, comment_id, replies_list_parameters, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: CommentRepliesApi.replies_list ...'
46
+ end
47
+ # verify the required parameter 'project_id' is set
48
+ if @api_client.config.client_side_validation && project_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentRepliesApi.replies_list"
50
+ end
51
+ # verify the required parameter 'key_id' is set
52
+ if @api_client.config.client_side_validation && key_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentRepliesApi.replies_list"
54
+ end
55
+ # verify the required parameter 'comment_id' is set
56
+ if @api_client.config.client_side_validation && comment_id.nil?
57
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.replies_list"
58
+ end
59
+ # verify the required parameter 'replies_list_parameters' is set
60
+ if @api_client.config.client_side_validation && replies_list_parameters.nil?
61
+ fail ArgumentError, "Missing the required parameter 'replies_list_parameters' when calling CommentRepliesApi.replies_list"
62
+ end
63
+ # resource path
64
+ local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies'.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))
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
69
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
70
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
71
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
72
+ query_params[:'filters'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
73
+
74
+ # header parameters
75
+ header_params = opts[:header_params] || {}
76
+ # HTTP header 'Accept' (if needed)
77
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
78
+ # HTTP header 'Content-Type'
79
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
80
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
81
+
82
+ # form parameters
83
+ form_params = opts[:form_params] || {}
84
+
85
+ # http body (model)
86
+ post_body = opts[:body] || @api_client.object_to_http_body(replies_list_parameters)
87
+
88
+ # return_type
89
+ return_type = opts[:return_type] || 'Array<Comment>'
90
+
91
+ # auth_names
92
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
93
+
94
+ new_options = opts.merge(
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: CommentRepliesApi#replies_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ response = ::Phrase::Response.new(data, headers)
108
+ return response, status_code, headers
109
+ end
110
+
111
+ # Create a reply
112
+ # Create a new reply for a comment.
113
+ # @param project_id [String] Project ID
114
+ # @param key_id [String] Translation Key ID
115
+ # @param comment_id [String] Comment ID
116
+ # @param [Hash] opts the optional parameters
117
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
118
+ # @option opts [String] :branch specify the branch to use
119
+ # @option opts [String] :message specify the message for the comment
120
+ # @return [Comment]
121
+ def reply_create(project_id, key_id, comment_id, opts = {})
122
+ data, _status_code, _headers = reply_create_with_http_info(project_id, key_id, comment_id, opts)
123
+ data
124
+ end
125
+
126
+ # Create a reply
127
+ # Create a new reply for a comment.
128
+ # @param project_id [String] Project ID
129
+ # @param key_id [String] Translation Key ID
130
+ # @param comment_id [String] Comment ID
131
+ # @param [Hash] opts the optional parameters
132
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
133
+ # @option opts [String] :branch specify the branch to use
134
+ # @option opts [String] :message specify the message for the comment
135
+ # @return [Array<(Response<(Comment)>, Integer, Hash)>] Response<(Comment)> data, response status code and response headers
136
+ def reply_create_with_http_info(project_id, key_id, comment_id, opts = {})
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug 'Calling API: CommentRepliesApi.reply_create ...'
139
+ end
140
+ # verify the required parameter 'project_id' is set
141
+ if @api_client.config.client_side_validation && project_id.nil?
142
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentRepliesApi.reply_create"
143
+ end
144
+ # verify the required parameter 'key_id' is set
145
+ if @api_client.config.client_side_validation && key_id.nil?
146
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentRepliesApi.reply_create"
147
+ end
148
+ # verify the required parameter 'comment_id' is set
149
+ if @api_client.config.client_side_validation && comment_id.nil?
150
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.reply_create"
151
+ end
152
+ # resource path
153
+ local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies'.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))
154
+
155
+ # query parameters
156
+ query_params = opts[:query_params] || {}
157
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
158
+ query_params[:'message'] = opts[:'message'] if !opts[:'message'].nil?
159
+
160
+ # header parameters
161
+ header_params = opts[:header_params] || {}
162
+ # HTTP header 'Accept' (if needed)
163
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
164
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
165
+
166
+ # form parameters
167
+ form_params = opts[:form_params] || {}
168
+
169
+ # http body (model)
170
+ post_body = opts[:body]
171
+
172
+ # return_type
173
+ return_type = opts[:return_type] || 'Comment'
174
+
175
+ # auth_names
176
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
177
+
178
+ new_options = opts.merge(
179
+ :header_params => header_params,
180
+ :query_params => query_params,
181
+ :form_params => form_params,
182
+ :body => post_body,
183
+ :auth_names => auth_names,
184
+ :return_type => return_type
185
+ )
186
+
187
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: CommentRepliesApi#reply_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ response = ::Phrase::Response.new(data, headers)
192
+ return response, status_code, headers
193
+ end
194
+
195
+ # Delete a reply
196
+ # Delete an existing reply.
197
+ # @param project_id [String] Project ID
198
+ # @param key_id [String] Translation Key ID
199
+ # @param comment_id [String] Comment ID
200
+ # @param id [String] ID
201
+ # @param [Hash] opts the optional parameters
202
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
203
+ # @option opts [String] :branch specify the branch to use
204
+ # @return [nil]
205
+ def reply_delete(project_id, key_id, comment_id, id, opts = {})
206
+ data, _status_code, _headers = reply_delete_with_http_info(project_id, key_id, comment_id, id, opts)
207
+ data
208
+ end
209
+
210
+ # Delete a reply
211
+ # Delete an existing reply.
212
+ # @param project_id [String] Project ID
213
+ # @param key_id [String] Translation Key ID
214
+ # @param comment_id [String] Comment ID
215
+ # @param id [String] ID
216
+ # @param [Hash] opts the optional parameters
217
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
218
+ # @option opts [String] :branch specify the branch to use
219
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
220
+ def reply_delete_with_http_info(project_id, key_id, comment_id, id, opts = {})
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug 'Calling API: CommentRepliesApi.reply_delete ...'
223
+ end
224
+ # verify the required parameter 'project_id' is set
225
+ if @api_client.config.client_side_validation && project_id.nil?
226
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentRepliesApi.reply_delete"
227
+ end
228
+ # verify the required parameter 'key_id' is set
229
+ if @api_client.config.client_side_validation && key_id.nil?
230
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentRepliesApi.reply_delete"
231
+ end
232
+ # verify the required parameter 'comment_id' is set
233
+ if @api_client.config.client_side_validation && comment_id.nil?
234
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.reply_delete"
235
+ end
236
+ # verify the required parameter 'id' is set
237
+ if @api_client.config.client_side_validation && id.nil?
238
+ fail ArgumentError, "Missing the required parameter 'id' when calling CommentRepliesApi.reply_delete"
239
+ end
240
+ # resource path
241
+ local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies/{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))
242
+
243
+ # query parameters
244
+ query_params = opts[:query_params] || {}
245
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
250
+
251
+ # form parameters
252
+ form_params = opts[:form_params] || {}
253
+
254
+ # http body (model)
255
+ post_body = opts[:body]
256
+
257
+ # return_type
258
+ return_type = opts[:return_type]
259
+
260
+ # auth_names
261
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
262
+
263
+ new_options = opts.merge(
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => return_type
270
+ )
271
+
272
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: CommentRepliesApi#reply_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ response = ::Phrase::Response.new(data, headers)
277
+ return response, status_code, headers
278
+ end
279
+
280
+ # Mark a reply as read
281
+ # Mark a reply as read.
282
+ # @param project_id [String] Project ID
283
+ # @param key_id [String] Translation Key ID
284
+ # @param comment_id [String] Comment ID
285
+ # @param id [String] ID
286
+ # @param [Hash] opts the optional parameters
287
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
288
+ # @option opts [String] :branch specify the branch to use
289
+ # @return [nil]
290
+ def reply_mark_as_read(project_id, key_id, comment_id, id, opts = {})
291
+ data, _status_code, _headers = reply_mark_as_read_with_http_info(project_id, key_id, comment_id, id, opts)
292
+ data
293
+ end
294
+
295
+ # Mark a reply as read
296
+ # Mark a reply as read.
297
+ # @param project_id [String] Project ID
298
+ # @param key_id [String] Translation Key ID
299
+ # @param comment_id [String] Comment ID
300
+ # @param id [String] ID
301
+ # @param [Hash] opts the optional parameters
302
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
303
+ # @option opts [String] :branch specify the branch to use
304
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
305
+ def reply_mark_as_read_with_http_info(project_id, key_id, comment_id, id, opts = {})
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug 'Calling API: CommentRepliesApi.reply_mark_as_read ...'
308
+ end
309
+ # verify the required parameter 'project_id' is set
310
+ if @api_client.config.client_side_validation && project_id.nil?
311
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentRepliesApi.reply_mark_as_read"
312
+ end
313
+ # verify the required parameter 'key_id' is set
314
+ if @api_client.config.client_side_validation && key_id.nil?
315
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentRepliesApi.reply_mark_as_read"
316
+ end
317
+ # verify the required parameter 'comment_id' is set
318
+ if @api_client.config.client_side_validation && comment_id.nil?
319
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.reply_mark_as_read"
320
+ end
321
+ # verify the required parameter 'id' is set
322
+ if @api_client.config.client_side_validation && id.nil?
323
+ fail ArgumentError, "Missing the required parameter 'id' when calling CommentRepliesApi.reply_mark_as_read"
324
+ end
325
+ # resource path
326
+ local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies/{id}/mark_as_read'.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))
327
+
328
+ # query parameters
329
+ query_params = opts[:query_params] || {}
330
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
331
+
332
+ # header parameters
333
+ header_params = opts[:header_params] || {}
334
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
335
+
336
+ # form parameters
337
+ form_params = opts[:form_params] || {}
338
+
339
+ # http body (model)
340
+ post_body = opts[:body]
341
+
342
+ # return_type
343
+ return_type = opts[:return_type]
344
+
345
+ # auth_names
346
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
347
+
348
+ new_options = opts.merge(
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: CommentRepliesApi#reply_mark_as_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ response = ::Phrase::Response.new(data, headers)
362
+ return response, status_code, headers
363
+ end
364
+
365
+ # Mark a reply as unread
366
+ # Mark a reply as unread.
367
+ # @param project_id [String] Project ID
368
+ # @param key_id [String] Translation Key ID
369
+ # @param comment_id [String] Comment ID
370
+ # @param id [String] ID
371
+ # @param [Hash] opts the optional parameters
372
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
373
+ # @option opts [String] :branch specify the branch to use
374
+ # @return [nil]
375
+ def reply_mark_as_unread(project_id, key_id, comment_id, id, opts = {})
376
+ data, _status_code, _headers = reply_mark_as_unread_with_http_info(project_id, key_id, comment_id, id, opts)
377
+ data
378
+ end
379
+
380
+ # Mark a reply as unread
381
+ # Mark a reply as unread.
382
+ # @param project_id [String] Project ID
383
+ # @param key_id [String] Translation Key ID
384
+ # @param comment_id [String] Comment ID
385
+ # @param id [String] ID
386
+ # @param [Hash] opts the optional parameters
387
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
388
+ # @option opts [String] :branch specify the branch to use
389
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
390
+ def reply_mark_as_unread_with_http_info(project_id, key_id, comment_id, id, opts = {})
391
+ if @api_client.config.debugging
392
+ @api_client.config.logger.debug 'Calling API: CommentRepliesApi.reply_mark_as_unread ...'
393
+ end
394
+ # verify the required parameter 'project_id' is set
395
+ if @api_client.config.client_side_validation && project_id.nil?
396
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentRepliesApi.reply_mark_as_unread"
397
+ end
398
+ # verify the required parameter 'key_id' is set
399
+ if @api_client.config.client_side_validation && key_id.nil?
400
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentRepliesApi.reply_mark_as_unread"
401
+ end
402
+ # verify the required parameter 'comment_id' is set
403
+ if @api_client.config.client_side_validation && comment_id.nil?
404
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.reply_mark_as_unread"
405
+ end
406
+ # verify the required parameter 'id' is set
407
+ if @api_client.config.client_side_validation && id.nil?
408
+ fail ArgumentError, "Missing the required parameter 'id' when calling CommentRepliesApi.reply_mark_as_unread"
409
+ end
410
+ # resource path
411
+ local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies/{id}/mark_as_unread'.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))
412
+
413
+ # query parameters
414
+ query_params = opts[:query_params] || {}
415
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
416
+
417
+ # header parameters
418
+ header_params = opts[:header_params] || {}
419
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
420
+
421
+ # form parameters
422
+ form_params = opts[:form_params] || {}
423
+
424
+ # http body (model)
425
+ post_body = opts[:body]
426
+
427
+ # return_type
428
+ return_type = opts[:return_type]
429
+
430
+ # auth_names
431
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
432
+
433
+ new_options = opts.merge(
434
+ :header_params => header_params,
435
+ :query_params => query_params,
436
+ :form_params => form_params,
437
+ :body => post_body,
438
+ :auth_names => auth_names,
439
+ :return_type => return_type
440
+ )
441
+
442
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug "API called: CommentRepliesApi#reply_mark_as_unread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
445
+ end
446
+ response = ::Phrase::Response.new(data, headers)
447
+ return response, status_code, headers
448
+ end
449
+
450
+ # Get a single reply
451
+ # Get details on a single reply.
452
+ # @param project_id [String] Project ID
453
+ # @param key_id [String] Translation Key ID
454
+ # @param comment_id [String] Comment ID
455
+ # @param id [String] ID
456
+ # @param [Hash] opts the optional parameters
457
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
458
+ # @option opts [String] :branch specify the branch to use
459
+ # @return [Comment]
460
+ def reply_show(project_id, key_id, comment_id, id, opts = {})
461
+ data, _status_code, _headers = reply_show_with_http_info(project_id, key_id, comment_id, id, opts)
462
+ data
463
+ end
464
+
465
+ # Get a single reply
466
+ # Get details on a single reply.
467
+ # @param project_id [String] Project ID
468
+ # @param key_id [String] Translation Key ID
469
+ # @param comment_id [String] Comment ID
470
+ # @param id [String] ID
471
+ # @param [Hash] opts the optional parameters
472
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
473
+ # @option opts [String] :branch specify the branch to use
474
+ # @return [Array<(Response<(Comment)>, Integer, Hash)>] Response<(Comment)> data, response status code and response headers
475
+ def reply_show_with_http_info(project_id, key_id, comment_id, id, opts = {})
476
+ if @api_client.config.debugging
477
+ @api_client.config.logger.debug 'Calling API: CommentRepliesApi.reply_show ...'
478
+ end
479
+ # verify the required parameter 'project_id' is set
480
+ if @api_client.config.client_side_validation && project_id.nil?
481
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling CommentRepliesApi.reply_show"
482
+ end
483
+ # verify the required parameter 'key_id' is set
484
+ if @api_client.config.client_side_validation && key_id.nil?
485
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentRepliesApi.reply_show"
486
+ end
487
+ # verify the required parameter 'comment_id' is set
488
+ if @api_client.config.client_side_validation && comment_id.nil?
489
+ fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.reply_show"
490
+ end
491
+ # verify the required parameter 'id' is set
492
+ if @api_client.config.client_side_validation && id.nil?
493
+ fail ArgumentError, "Missing the required parameter 'id' when calling CommentRepliesApi.reply_show"
494
+ end
495
+ # resource path
496
+ local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies/{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))
497
+
498
+ # query parameters
499
+ query_params = opts[:query_params] || {}
500
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
501
+
502
+ # header parameters
503
+ header_params = opts[:header_params] || {}
504
+ # HTTP header 'Accept' (if needed)
505
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
506
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
507
+
508
+ # form parameters
509
+ form_params = opts[:form_params] || {}
510
+
511
+ # http body (model)
512
+ post_body = opts[:body]
513
+
514
+ # return_type
515
+ return_type = opts[:return_type] || 'Comment'
516
+
517
+ # auth_names
518
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
519
+
520
+ new_options = opts.merge(
521
+ :header_params => header_params,
522
+ :query_params => query_params,
523
+ :form_params => form_params,
524
+ :body => post_body,
525
+ :auth_names => auth_names,
526
+ :return_type => return_type
527
+ )
528
+
529
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
530
+ if @api_client.config.debugging
531
+ @api_client.config.logger.debug "API called: CommentRepliesApi#reply_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
532
+ end
533
+ response = ::Phrase::Response.new(data, headers)
534
+ return response, status_code, headers
535
+ end
536
+ end
537
+ end
@@ -14,6 +14,8 @@ module Phrase
14
14
  # @param comment_create_parameters [CommentCreateParameters]
15
15
  # @param [Hash] opts the optional parameters
16
16
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
17
+ # @option opts [String] :message specify the message for the comment
18
+ # @option opts [Array<String>] :locale_ids specify the locales for the comment
17
19
  # @return [Comment]
18
20
  def comment_create(project_id, key_id, comment_create_parameters, opts = {})
19
21
  data, _status_code, _headers = comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts)
@@ -27,6 +29,8 @@ module Phrase
27
29
  # @param comment_create_parameters [CommentCreateParameters]
28
30
  # @param [Hash] opts the optional parameters
29
31
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
32
+ # @option opts [String] :message specify the message for the comment
33
+ # @option opts [Array<String>] :locale_ids specify the locales for the comment
30
34
  # @return [Array<(Response<(Comment)>, Integer, Hash)>] Response<(Comment)> data, response status code and response headers
31
35
  def comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts = {})
32
36
  if @api_client.config.debugging
@@ -49,6 +53,8 @@ module Phrase
49
53
 
50
54
  # query parameters
51
55
  query_params = opts[:query_params] || {}
56
+ query_params[:'message'] = opts[:'message'] if !opts[:'message'].nil?
57
+ query_params[:'locale_ids'] = @api_client.build_collection_param(opts[:'locale_ids'], :multi) if !opts[:'locale_ids'].nil?
52
58
 
53
59
  # header parameters
54
60
  header_params = opts[:header_params] || {}
@@ -579,14 +585,18 @@ module Phrase
579
585
  # List all comments for a key.
580
586
  # @param project_id [String] Project ID
581
587
  # @param key_id [String] Translation Key ID
588
+ # @param comments_list_parameters [CommentsListParameters]
582
589
  # @param [Hash] opts the optional parameters
583
590
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
584
591
  # @option opts [Integer] :page Page number
585
592
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
586
593
  # @option opts [String] :branch specify the branch to use
594
+ # @option opts [String] :query Search query for comment messages
595
+ # @option opts [Array<String>] :locale_ids Search comments by their assigned locales
596
+ # @option opts [Array<String>] :filters Specify the filter for the comments
587
597
  # @return [Array<Comment>]
588
- def comments_list(project_id, key_id, opts = {})
589
- data, _status_code, _headers = comments_list_with_http_info(project_id, key_id, opts)
598
+ def comments_list(project_id, key_id, comments_list_parameters, opts = {})
599
+ data, _status_code, _headers = comments_list_with_http_info(project_id, key_id, comments_list_parameters, opts)
590
600
  data
591
601
  end
592
602
 
@@ -594,13 +604,17 @@ module Phrase
594
604
  # List all comments for a key.
595
605
  # @param project_id [String] Project ID
596
606
  # @param key_id [String] Translation Key ID
607
+ # @param comments_list_parameters [CommentsListParameters]
597
608
  # @param [Hash] opts the optional parameters
598
609
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
599
610
  # @option opts [Integer] :page Page number
600
611
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
601
612
  # @option opts [String] :branch specify the branch to use
613
+ # @option opts [String] :query Search query for comment messages
614
+ # @option opts [Array<String>] :locale_ids Search comments by their assigned locales
615
+ # @option opts [Array<String>] :filters Specify the filter for the comments
602
616
  # @return [Array<(Response<(Array<Comment>)>, Integer, Hash)>] Response<(Array<Comment>)> data, response status code and response headers
603
- def comments_list_with_http_info(project_id, key_id, opts = {})
617
+ def comments_list_with_http_info(project_id, key_id, comments_list_parameters, opts = {})
604
618
  if @api_client.config.debugging
605
619
  @api_client.config.logger.debug 'Calling API: CommentsApi.comments_list ...'
606
620
  end
@@ -612,6 +626,10 @@ module Phrase
612
626
  if @api_client.config.client_side_validation && key_id.nil?
613
627
  fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentsApi.comments_list"
614
628
  end
629
+ # verify the required parameter 'comments_list_parameters' is set
630
+ if @api_client.config.client_side_validation && comments_list_parameters.nil?
631
+ fail ArgumentError, "Missing the required parameter 'comments_list_parameters' when calling CommentsApi.comments_list"
632
+ end
615
633
  # resource path
616
634
  local_var_path = '/projects/{project_id}/keys/{key_id}/comments'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))
617
635
 
@@ -620,18 +638,23 @@ module Phrase
620
638
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
621
639
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
622
640
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
641
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
642
+ query_params[:'locale_ids'] = @api_client.build_collection_param(opts[:'locale_ids'], :multi) if !opts[:'locale_ids'].nil?
643
+ query_params[:'filters'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
623
644
 
624
645
  # header parameters
625
646
  header_params = opts[:header_params] || {}
626
647
  # HTTP header 'Accept' (if needed)
627
648
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
649
+ # HTTP header 'Content-Type'
650
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
628
651
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
629
652
 
630
653
  # form parameters
631
654
  form_params = opts[:form_params] || {}
632
655
 
633
656
  # http body (model)
634
- post_body = opts[:body]
657
+ post_body = opts[:body] || @api_client.object_to_http_body(comments_list_parameters)
635
658
 
636
659
  # return_type
637
660
  return_type = opts[:return_type] || 'Array<Comment>'