phrase 2.7.0 → 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 +11 -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/ScreenshotsApi.md +12 -6
- data/docs/StyleguideCreateParameters.md +1 -1
- data/docs/StyleguideUpdateParameters.md +1 -1
- data/lib/phrase/api/job_comments_api.rb +411 -0
- data/lib/phrase/api/screenshots_api.rb +17 -11
- 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/version.rb +1 -1
- data/lib/phrase.rb +4 -0
- data/spec/api/job_comments_api_spec.rb +101 -0
- data/spec/api/screenshots_api_spec.rb +4 -1
- 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
- metadata +214 -198
@@ -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
|
@@ -10,23 +10,29 @@ module Phrase
|
|
10
10
|
# Create a screenshot
|
11
11
|
# Create a new screenshot.
|
12
12
|
# @param project_id [String] Project ID
|
13
|
-
# @param screenshot_create_parameters [ScreenshotCreateParameters]
|
14
13
|
# @param [Hash] opts the optional parameters
|
15
14
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
15
|
+
# @option opts [String] :branch specify the branch to use
|
16
|
+
# @option opts [String] :name Name of the screenshot
|
17
|
+
# @option opts [String] :description Description of the screenshot
|
18
|
+
# @option opts [File] :filename Screenshot file
|
16
19
|
# @return [Screenshot]
|
17
|
-
def screenshot_create(project_id,
|
18
|
-
data, _status_code, _headers = screenshot_create_with_http_info(project_id,
|
20
|
+
def screenshot_create(project_id, opts = {})
|
21
|
+
data, _status_code, _headers = screenshot_create_with_http_info(project_id, opts)
|
19
22
|
data
|
20
23
|
end
|
21
24
|
|
22
25
|
# Create a screenshot
|
23
26
|
# Create a new screenshot.
|
24
27
|
# @param project_id [String] Project ID
|
25
|
-
# @param screenshot_create_parameters [ScreenshotCreateParameters]
|
26
28
|
# @param [Hash] opts the optional parameters
|
27
29
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
30
|
+
# @option opts [String] :branch specify the branch to use
|
31
|
+
# @option opts [String] :name Name of the screenshot
|
32
|
+
# @option opts [String] :description Description of the screenshot
|
33
|
+
# @option opts [File] :filename Screenshot file
|
28
34
|
# @return [Array<(Response<(Screenshot)>, Integer, Hash)>] Response<(Screenshot)> data, response status code and response headers
|
29
|
-
def screenshot_create_with_http_info(project_id,
|
35
|
+
def screenshot_create_with_http_info(project_id, opts = {})
|
30
36
|
if @api_client.config.debugging
|
31
37
|
@api_client.config.logger.debug 'Calling API: ScreenshotsApi.screenshot_create ...'
|
32
38
|
end
|
@@ -34,10 +40,6 @@ module Phrase
|
|
34
40
|
if @api_client.config.client_side_validation && project_id.nil?
|
35
41
|
fail ArgumentError, "Missing the required parameter 'project_id' when calling ScreenshotsApi.screenshot_create"
|
36
42
|
end
|
37
|
-
# verify the required parameter 'screenshot_create_parameters' is set
|
38
|
-
if @api_client.config.client_side_validation && screenshot_create_parameters.nil?
|
39
|
-
fail ArgumentError, "Missing the required parameter 'screenshot_create_parameters' when calling ScreenshotsApi.screenshot_create"
|
40
|
-
end
|
41
43
|
# resource path
|
42
44
|
local_var_path = '/projects/{project_id}/screenshots'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
43
45
|
|
@@ -49,14 +51,18 @@ module Phrase
|
|
49
51
|
# HTTP header 'Accept' (if needed)
|
50
52
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
53
|
# HTTP header 'Content-Type'
|
52
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
53
55
|
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
54
56
|
|
55
57
|
# form parameters
|
56
58
|
form_params = opts[:form_params] || {}
|
59
|
+
form_params['branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
60
|
+
form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
|
61
|
+
form_params['description'] = opts[:'description'] if !opts[:'description'].nil?
|
62
|
+
form_params['filename'] = opts[:'filename'] if !opts[:'filename'].nil?
|
57
63
|
|
58
64
|
# http body (model)
|
59
|
-
post_body = opts[:body]
|
65
|
+
post_body = opts[:body]
|
60
66
|
|
61
67
|
# return_type
|
62
68
|
return_type = opts[:return_type] || 'Screenshot'
|