phrase 2.20.0 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +16 -5
  4. data/docs/CustomMetadataApi.md +353 -0
  5. data/docs/CustomMetadataDataType.md +16 -0
  6. data/docs/CustomMetadataProperty.md +33 -0
  7. data/docs/CustomMetadataPropertyCreate422Response.md +19 -0
  8. data/docs/{InvitationCreate422ResponseErrorsInner.md → CustomMetadataPropertyCreate422ResponseErrorsInner.md} +2 -2
  9. data/docs/KeyCreateParameters.md +4 -2
  10. data/docs/KeyUpdateParameters.md +4 -2
  11. data/docs/KeysApi.md +2 -2
  12. data/docs/KeysSearchParameters.md +1 -1
  13. data/docs/LocaleReport.md +43 -0
  14. data/docs/LocalesApi.md +3 -1
  15. data/docs/ProjectCreateParameters.md +1 -1
  16. data/docs/ProjectReport.md +31 -0
  17. data/docs/ProjectUpdateParameters.md +1 -1
  18. data/docs/ReportsApi.md +144 -0
  19. data/docs/ScreenshotUpdateParameters.md +1 -1
  20. data/docs/TranslationKeyDetails.md +3 -1
  21. data/docs/Upload.md +2 -0
  22. data/lib/phrase/api/custom_metadata_api.rb +409 -0
  23. data/lib/phrase/api/keys_api.rb +2 -2
  24. data/lib/phrase/api/locales_api.rb +3 -0
  25. data/lib/phrase/api/reports_api.rb +160 -0
  26. data/lib/phrase/models/custom_metadata_data_type.rb +30 -0
  27. data/lib/phrase/models/custom_metadata_property.rb +294 -0
  28. data/lib/phrase/models/{invitation_create422_response.rb → custom_metadata_property_create422_response.rb} +4 -4
  29. data/lib/phrase/models/{invitation_create422_response_errors_inner.rb → custom_metadata_property_create422_response_errors_inner.rb} +3 -3
  30. data/lib/phrase/models/key_create_parameters.rb +14 -4
  31. data/lib/phrase/models/key_update_parameters.rb +14 -4
  32. data/lib/phrase/models/keys_search_parameters.rb +1 -1
  33. data/lib/phrase/models/locale_report.rb +313 -0
  34. data/lib/phrase/models/project_report.rb +259 -0
  35. data/lib/phrase/models/translation_key_details.rb +15 -4
  36. data/lib/phrase/models/upload.rb +11 -1
  37. data/lib/phrase/version.rb +1 -1
  38. data/lib/phrase.rb +8 -2
  39. data/spec/api/custom_metadata_api_spec.rb +106 -0
  40. data/spec/api/keys_api_spec.rb +1 -1
  41. data/spec/api/reports_api_spec.rb +55 -0
  42. data/spec/models/custom_metadata_data_type_spec.rb +23 -0
  43. data/spec/models/{invitation_create422_response_errors_inner_spec.rb → custom_metadata_property_create422_response_errors_inner_spec.rb} +6 -6
  44. data/spec/models/{invitation_create422_response_spec.rb → custom_metadata_property_create422_response_spec.rb} +6 -6
  45. data/spec/models/custom_metadata_property_spec.rb +77 -0
  46. data/spec/models/key_create_parameters_spec.rb +6 -0
  47. data/spec/models/key_update_parameters_spec.rb +6 -0
  48. data/spec/models/locale_report_spec.rb +107 -0
  49. data/spec/models/project_report_spec.rb +71 -0
  50. data/spec/models/translation_key_details_spec.rb +6 -0
  51. data/spec/models/upload_spec.rb +6 -0
  52. metadata +236 -212
  53. data/docs/InvitationCreate422Response.md +0 -19
@@ -0,0 +1,409 @@
1
+ require 'cgi'
2
+
3
+ module Phrase
4
+ class CustomMetadataApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # Destroy property
11
+ # Destroy a custom metadata property of an account. This endpoint is only available to accounts with advanced plans or above.
12
+ # @param account_id [String] Account ID
13
+ # @param id [String] ID
14
+ # @param [Hash] opts the optional parameters
15
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
16
+ # @return [nil]
17
+ def custom_metadata_properties_delete(account_id, id, opts = {})
18
+ data, _status_code, _headers = custom_metadata_properties_delete_with_http_info(account_id, id, opts)
19
+ data
20
+ end
21
+
22
+ # Destroy property
23
+ # Destroy a custom metadata property of an account. This endpoint is only available to accounts with advanced plans or above.
24
+ # @param account_id [String] Account ID
25
+ # @param id [String] ID
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
28
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
29
+ def custom_metadata_properties_delete_with_http_info(account_id, id, opts = {})
30
+ if @api_client.config.debugging
31
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_properties_delete ...'
32
+ end
33
+ # verify the required parameter 'account_id' is set
34
+ if @api_client.config.client_side_validation && account_id.nil?
35
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_properties_delete"
36
+ end
37
+ # verify the required parameter 'id' is set
38
+ if @api_client.config.client_side_validation && id.nil?
39
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomMetadataApi.custom_metadata_properties_delete"
40
+ end
41
+ # resource path
42
+ local_var_path = '/accounts/{account_id}/custom_metadata/properties/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
50
+
51
+ # form parameters
52
+ form_params = opts[:form_params] || {}
53
+
54
+ # http body (model)
55
+ post_body = opts[:body]
56
+
57
+ # return_type
58
+ return_type = opts[:return_type]
59
+
60
+ # auth_names
61
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
62
+
63
+ new_options = opts.merge(
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_properties_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ response = ::Phrase::Response.new(data, headers)
77
+ return response, status_code, headers
78
+ end
79
+
80
+ # List properties
81
+ # List all custom metadata properties for an account. This endpoint is only available to accounts with advanced plans or above.
82
+ # @param account_id [String] Account ID
83
+ # @param [Hash] opts the optional parameters
84
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
85
+ # @option opts [CustomMetadataDataType] :data_type Data Type of Custom Metadata Property
86
+ # @option opts [String] :project_id id of project that the properties belong to
87
+ # @option opts [Integer] :page Page number
88
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
89
+ # @option opts [String] :sort Sort criteria. Can be one of: name, data_type, created_at.
90
+ # @option opts [String] :order Order direction. Can be one of: asc, desc.
91
+ # @return [Array<CustomMetadataProperty>]
92
+ def custom_metadata_properties_list(account_id, opts = {})
93
+ data, _status_code, _headers = custom_metadata_properties_list_with_http_info(account_id, opts)
94
+ data
95
+ end
96
+
97
+ # List properties
98
+ # List all custom metadata properties for an account. This endpoint is only available to accounts with advanced plans or above.
99
+ # @param account_id [String] Account ID
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
102
+ # @option opts [CustomMetadataDataType] :data_type Data Type of Custom Metadata Property
103
+ # @option opts [String] :project_id id of project that the properties belong to
104
+ # @option opts [Integer] :page Page number
105
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
106
+ # @option opts [String] :sort Sort criteria. Can be one of: name, data_type, created_at.
107
+ # @option opts [String] :order Order direction. Can be one of: asc, desc.
108
+ # @return [Array<(Response<(Array<CustomMetadataProperty>)>, Integer, Hash)>] Response<(Array<CustomMetadataProperty>)> data, response status code and response headers
109
+ def custom_metadata_properties_list_with_http_info(account_id, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_properties_list ...'
112
+ end
113
+ # verify the required parameter 'account_id' is set
114
+ if @api_client.config.client_side_validation && account_id.nil?
115
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_properties_list"
116
+ end
117
+ # resource path
118
+ local_var_path = '/accounts/{account_id}/custom_metadata/properties'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
119
+
120
+ # query parameters
121
+ query_params = opts[:query_params] || {}
122
+ query_params[:'data_type'] = opts[:'data_type'] if !opts[:'data_type'].nil?
123
+ query_params[:'project_id'] = opts[:'project_id'] if !opts[:'project_id'].nil?
124
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
125
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
126
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
127
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
128
+
129
+ # header parameters
130
+ header_params = opts[:header_params] || {}
131
+ # HTTP header 'Accept' (if needed)
132
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
133
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
134
+
135
+ # form parameters
136
+ form_params = opts[:form_params] || {}
137
+
138
+ # http body (model)
139
+ post_body = opts[:body]
140
+
141
+ # return_type
142
+ return_type = opts[:return_type] || 'Array<CustomMetadataProperty>'
143
+
144
+ # auth_names
145
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
146
+
147
+ new_options = opts.merge(
148
+ :header_params => header_params,
149
+ :query_params => query_params,
150
+ :form_params => form_params,
151
+ :body => post_body,
152
+ :auth_names => auth_names,
153
+ :return_type => return_type
154
+ )
155
+
156
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
157
+ if @api_client.config.debugging
158
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_properties_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
159
+ end
160
+ response = ::Phrase::Response.new(data, headers)
161
+ return response, status_code, headers
162
+ end
163
+
164
+ # Create a property
165
+ # Create a new custom metadata property.
166
+ # @param account_id [String] Account ID
167
+ # @param name [String] name of the property
168
+ # @param data_type [CustomMetadataDataType] Data Type of Custom Metadata Property
169
+ # @param [Hash] opts the optional parameters
170
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
171
+ # @option opts [String] :description description of property
172
+ # @option opts [Array<String>] :project_ids ids of projects that the property belongs to
173
+ # @option opts [Array<String>] :value_options value options of property (only applies to single or multi select properties)
174
+ # @return [CustomMetadataProperty]
175
+ def custom_metadata_property_create(account_id, name, data_type, opts = {})
176
+ data, _status_code, _headers = custom_metadata_property_create_with_http_info(account_id, name, data_type, opts)
177
+ data
178
+ end
179
+
180
+ # Create a property
181
+ # Create a new custom metadata property.
182
+ # @param account_id [String] Account ID
183
+ # @param name [String] name of the property
184
+ # @param data_type [CustomMetadataDataType] Data Type of Custom Metadata Property
185
+ # @param [Hash] opts the optional parameters
186
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
187
+ # @option opts [String] :description description of property
188
+ # @option opts [Array<String>] :project_ids ids of projects that the property belongs to
189
+ # @option opts [Array<String>] :value_options value options of property (only applies to single or multi select properties)
190
+ # @return [Array<(Response<(CustomMetadataProperty)>, Integer, Hash)>] Response<(CustomMetadataProperty)> data, response status code and response headers
191
+ def custom_metadata_property_create_with_http_info(account_id, name, data_type, opts = {})
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_property_create ...'
194
+ end
195
+ # verify the required parameter 'account_id' is set
196
+ if @api_client.config.client_side_validation && account_id.nil?
197
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_property_create"
198
+ end
199
+ # verify the required parameter 'name' is set
200
+ if @api_client.config.client_side_validation && name.nil?
201
+ fail ArgumentError, "Missing the required parameter 'name' when calling CustomMetadataApi.custom_metadata_property_create"
202
+ end
203
+ # verify the required parameter 'data_type' is set
204
+ if @api_client.config.client_side_validation && data_type.nil?
205
+ fail ArgumentError, "Missing the required parameter 'data_type' when calling CustomMetadataApi.custom_metadata_property_create"
206
+ end
207
+ # resource path
208
+ local_var_path = '/accounts/{account_id}/custom_metadata/properties'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
209
+
210
+ # query parameters
211
+ query_params = opts[:query_params] || {}
212
+ query_params[:'name'] = name
213
+ query_params[:'data_type'] = data_type
214
+ query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?
215
+ query_params[:'project_ids'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
216
+ query_params[:'value_options'] = @api_client.build_collection_param(opts[:'value_options'], :multi) if !opts[:'value_options'].nil?
217
+
218
+ # header parameters
219
+ header_params = opts[:header_params] || {}
220
+ # HTTP header 'Accept' (if needed)
221
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
222
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
223
+
224
+ # form parameters
225
+ form_params = opts[:form_params] || {}
226
+
227
+ # http body (model)
228
+ post_body = opts[:body]
229
+
230
+ # return_type
231
+ return_type = opts[:return_type] || 'CustomMetadataProperty'
232
+
233
+ # auth_names
234
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
235
+
236
+ new_options = opts.merge(
237
+ :header_params => header_params,
238
+ :query_params => query_params,
239
+ :form_params => form_params,
240
+ :body => post_body,
241
+ :auth_names => auth_names,
242
+ :return_type => return_type
243
+ )
244
+
245
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_property_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ response = ::Phrase::Response.new(data, headers)
250
+ return response, status_code, headers
251
+ end
252
+
253
+ # Get a single property
254
+ # Get details of a single custom property.
255
+ # @param account_id [String] Account ID
256
+ # @param id [String] ID
257
+ # @param [Hash] opts the optional parameters
258
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
259
+ # @return [CustomMetadataProperty]
260
+ def custom_metadata_property_show(account_id, id, opts = {})
261
+ data, _status_code, _headers = custom_metadata_property_show_with_http_info(account_id, id, opts)
262
+ data
263
+ end
264
+
265
+ # Get a single property
266
+ # Get details of a single custom property.
267
+ # @param account_id [String] Account ID
268
+ # @param id [String] ID
269
+ # @param [Hash] opts the optional parameters
270
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
271
+ # @return [Array<(Response<(CustomMetadataProperty)>, Integer, Hash)>] Response<(CustomMetadataProperty)> data, response status code and response headers
272
+ def custom_metadata_property_show_with_http_info(account_id, id, opts = {})
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_property_show ...'
275
+ end
276
+ # verify the required parameter 'account_id' is set
277
+ if @api_client.config.client_side_validation && account_id.nil?
278
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_property_show"
279
+ end
280
+ # verify the required parameter 'id' is set
281
+ if @api_client.config.client_side_validation && id.nil?
282
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomMetadataApi.custom_metadata_property_show"
283
+ end
284
+ # resource path
285
+ local_var_path = '/accounts/{account_id}/custom_metadata/properties/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
286
+
287
+ # query parameters
288
+ query_params = opts[:query_params] || {}
289
+
290
+ # header parameters
291
+ header_params = opts[:header_params] || {}
292
+ # HTTP header 'Accept' (if needed)
293
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
294
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
295
+
296
+ # form parameters
297
+ form_params = opts[:form_params] || {}
298
+
299
+ # http body (model)
300
+ post_body = opts[:body]
301
+
302
+ # return_type
303
+ return_type = opts[:return_type] || 'CustomMetadataProperty'
304
+
305
+ # auth_names
306
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
307
+
308
+ new_options = opts.merge(
309
+ :header_params => header_params,
310
+ :query_params => query_params,
311
+ :form_params => form_params,
312
+ :body => post_body,
313
+ :auth_names => auth_names,
314
+ :return_type => return_type
315
+ )
316
+
317
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_property_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ response = ::Phrase::Response.new(data, headers)
322
+ return response, status_code, headers
323
+ end
324
+
325
+ # Update a property
326
+ # Update an existing custom metadata property.
327
+ # @param account_id [String] Account ID
328
+ # @param id [String] ID
329
+ # @param [Hash] opts the optional parameters
330
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
331
+ # @option opts [String] :name name of the property
332
+ # @option opts [String] :description description of property
333
+ # @option opts [Array<String>] :project_ids ids of projects that the property belongs to
334
+ # @option opts [Array<String>] :value_options value options of property (only applies to single or multi select properties)
335
+ # @return [CustomMetadataProperty]
336
+ def custom_metadata_property_update(account_id, id, opts = {})
337
+ data, _status_code, _headers = custom_metadata_property_update_with_http_info(account_id, id, opts)
338
+ data
339
+ end
340
+
341
+ # Update a property
342
+ # Update an existing custom metadata property.
343
+ # @param account_id [String] Account ID
344
+ # @param id [String] ID
345
+ # @param [Hash] opts the optional parameters
346
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
347
+ # @option opts [String] :name name of the property
348
+ # @option opts [String] :description description of property
349
+ # @option opts [Array<String>] :project_ids ids of projects that the property belongs to
350
+ # @option opts [Array<String>] :value_options value options of property (only applies to single or multi select properties)
351
+ # @return [Array<(Response<(CustomMetadataProperty)>, Integer, Hash)>] Response<(CustomMetadataProperty)> data, response status code and response headers
352
+ def custom_metadata_property_update_with_http_info(account_id, id, opts = {})
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_property_update ...'
355
+ end
356
+ # verify the required parameter 'account_id' is set
357
+ if @api_client.config.client_side_validation && account_id.nil?
358
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_property_update"
359
+ end
360
+ # verify the required parameter 'id' is set
361
+ if @api_client.config.client_side_validation && id.nil?
362
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomMetadataApi.custom_metadata_property_update"
363
+ end
364
+ # resource path
365
+ local_var_path = '/accounts/{account_id}/custom_metadata/properties/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
366
+
367
+ # query parameters
368
+ query_params = opts[:query_params] || {}
369
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
370
+ query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?
371
+ query_params[:'project_ids'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
372
+ query_params[:'value_options'] = @api_client.build_collection_param(opts[:'value_options'], :multi) if !opts[:'value_options'].nil?
373
+
374
+ # header parameters
375
+ header_params = opts[:header_params] || {}
376
+ # HTTP header 'Accept' (if needed)
377
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
378
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
379
+
380
+ # form parameters
381
+ form_params = opts[:form_params] || {}
382
+
383
+ # http body (model)
384
+ post_body = opts[:body]
385
+
386
+ # return_type
387
+ return_type = opts[:return_type] || 'CustomMetadataProperty'
388
+
389
+ # auth_names
390
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
391
+
392
+ new_options = opts.merge(
393
+ :header_params => header_params,
394
+ :query_params => query_params,
395
+ :form_params => form_params,
396
+ :body => post_body,
397
+ :auth_names => auth_names,
398
+ :return_type => return_type
399
+ )
400
+
401
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
402
+ if @api_client.config.debugging
403
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_property_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
404
+ end
405
+ response = ::Phrase::Response.new(data, headers)
406
+ return response, status_code, headers
407
+ end
408
+ end
409
+ end
@@ -542,7 +542,7 @@ module Phrase
542
542
  # @option opts [String] :branch specify the branch to use
543
543
  # @option opts [String] :sort Sort by field. Can be one of: name, created_at, updated_at.
544
544
  # @option opts [String] :order Order direction. Can be one of: asc, desc.
545
- # @option opts [String] :q Specify a query to do broad search for keys by name (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are also supported in the search term:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;ids:key_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;name:key_name&lt;/code&gt; for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:tag_name&lt;/code&gt; to filter for keys with certain tags&lt;/li&gt; &lt;li&gt;&lt;code&gt;translated:{true|false}&lt;/code&gt; for translation status (also requires &lt;code&gt;locale_id&lt;/code&gt; to be specified)&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;li&gt;&lt;code&gt;unmentioned_in_upload:upload_id&lt;/code&gt; to filter keys unmentioned within upload&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
545
+ # @option opts [String] :q Specify a query to do broad search for keys by name (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are also supported in the search term:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;ids:key_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;name:key_name,...&lt;/code&gt; for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:tag_name,...&lt;/code&gt; to filter for keys with certain comma-seperated list of tags&lt;/li&gt; &lt;li&gt;&lt;code&gt;uploads:upload_id,...&lt;/code&gt; to filter for keys with certain comma-seperated list of uploads&lt;/li&gt; &lt;li&gt;&lt;code&gt;job:{true|false}&lt;/code&gt; to filter for keys mentioned in an active job&lt;/li&gt; &lt;li&gt;&lt;code&gt;translated:{true|false}&lt;/code&gt; for translation status (also requires &lt;code&gt;locale_id&lt;/code&gt; to be specified)&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&amp;gt;&#x3D;|&amp;lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;li&gt;&lt;code&gt;unmentioned_in_upload:upload_id&lt;/code&gt; to filter keys unmentioned within upload&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
546
546
  # @option opts [String] :locale_id Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
547
547
  # @return [Array<TranslationKey>]
548
548
  def keys_list(project_id, opts = {})
@@ -560,7 +560,7 @@ module Phrase
560
560
  # @option opts [String] :branch specify the branch to use
561
561
  # @option opts [String] :sort Sort by field. Can be one of: name, created_at, updated_at.
562
562
  # @option opts [String] :order Order direction. Can be one of: asc, desc.
563
- # @option opts [String] :q Specify a query to do broad search for keys by name (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are also supported in the search term:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;ids:key_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;name:key_name&lt;/code&gt; for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:tag_name&lt;/code&gt; to filter for keys with certain tags&lt;/li&gt; &lt;li&gt;&lt;code&gt;translated:{true|false}&lt;/code&gt; for translation status (also requires &lt;code&gt;locale_id&lt;/code&gt; to be specified)&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;li&gt;&lt;code&gt;unmentioned_in_upload:upload_id&lt;/code&gt; to filter keys unmentioned within upload&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
563
+ # @option opts [String] :q Specify a query to do broad search for keys by name (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are also supported in the search term:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;ids:key_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;name:key_name,...&lt;/code&gt; for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:tag_name,...&lt;/code&gt; to filter for keys with certain comma-seperated list of tags&lt;/li&gt; &lt;li&gt;&lt;code&gt;uploads:upload_id,...&lt;/code&gt; to filter for keys with certain comma-seperated list of uploads&lt;/li&gt; &lt;li&gt;&lt;code&gt;job:{true|false}&lt;/code&gt; to filter for keys mentioned in an active job&lt;/li&gt; &lt;li&gt;&lt;code&gt;translated:{true|false}&lt;/code&gt; for translation status (also requires &lt;code&gt;locale_id&lt;/code&gt; to be specified)&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&amp;gt;&#x3D;|&amp;lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;li&gt;&lt;code&gt;unmentioned_in_upload:upload_id&lt;/code&gt; to filter keys unmentioned within upload&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
564
564
  # @option opts [String] :locale_id Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
565
565
  # @return [Array<(Response<(Array<TranslationKey>)>, Integer, Hash)>] Response<(Array<TranslationKey>)> data, response status code and response headers
566
566
  def keys_list_with_http_info(project_id, opts = {})
@@ -250,6 +250,7 @@ module Phrase
250
250
  # @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project.
251
251
  # @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to &lt;code&gt;true&lt;/code&gt;.
252
252
  # @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a &lt;code&gt;tag&lt;/code&gt; parameter indicating a specific job.
253
+ # @option opts [Object] :custom_metadata_filters Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download.
253
254
  # @return [File]
254
255
  def locale_download(project_id, id, opts = {})
255
256
  data, _status_code, _headers = locale_download_with_http_info(project_id, id, opts)
@@ -280,6 +281,7 @@ module Phrase
280
281
  # @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project.
281
282
  # @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to &lt;code&gt;true&lt;/code&gt;.
282
283
  # @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a &lt;code&gt;tag&lt;/code&gt; parameter indicating a specific job.
284
+ # @option opts [Object] :custom_metadata_filters Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download.
283
285
  # @return [Array<(Response<(File)>, Integer, Hash)>] Response<(File)> data, response status code and response headers
284
286
  def locale_download_with_http_info(project_id, id, opts = {})
285
287
  if @api_client.config.debugging
@@ -314,6 +316,7 @@ module Phrase
314
316
  query_params[:'use_last_reviewed_version'] = opts[:'use_last_reviewed_version'] if !opts[:'use_last_reviewed_version'].nil?
315
317
  query_params[:'fallback_locale_id'] = opts[:'fallback_locale_id'] if !opts[:'fallback_locale_id'].nil?
316
318
  query_params[:'source_locale_id'] = opts[:'source_locale_id'] if !opts[:'source_locale_id'].nil?
319
+ query_params[:'custom_metadata_filters'] = opts[:'custom_metadata_filters'] if !opts[:'custom_metadata_filters'].nil?
317
320
 
318
321
  # header parameters
319
322
  header_params = opts[:header_params] || {}
@@ -0,0 +1,160 @@
1
+ require 'cgi'
2
+
3
+ module Phrase
4
+ class ReportsApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # List Locale Reports
11
+ # List all locale reports for the given project
12
+ # @param project_id [String] Project ID
13
+ # @param [Hash] opts the optional parameters
14
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
15
+ # @option opts [Integer] :page Page number
16
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
17
+ # @option opts [String] :locale_codes Locale Code
18
+ # @option opts [String] :tag tag
19
+ # @option opts [String] :branch specify the branch to use
20
+ # @return [Array<LocaleReport>]
21
+ def report_locales_list(project_id, opts = {})
22
+ data, _status_code, _headers = report_locales_list_with_http_info(project_id, opts)
23
+ data
24
+ end
25
+
26
+ # List Locale Reports
27
+ # List all locale reports for the given project
28
+ # @param project_id [String] Project ID
29
+ # @param [Hash] opts the optional parameters
30
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
31
+ # @option opts [Integer] :page Page number
32
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
33
+ # @option opts [String] :locale_codes Locale Code
34
+ # @option opts [String] :tag tag
35
+ # @option opts [String] :branch specify the branch to use
36
+ # @return [Array<(Response<(Array<LocaleReport>)>, Integer, Hash)>] Response<(Array<LocaleReport>)> data, response status code and response headers
37
+ def report_locales_list_with_http_info(project_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ReportsApi.report_locales_list ...'
40
+ end
41
+ # verify the required parameter 'project_id' is set
42
+ if @api_client.config.client_side_validation && project_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ReportsApi.report_locales_list"
44
+ end
45
+ # resource path
46
+ local_var_path = '/projects/{project_id}/report/locales'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
51
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
52
+ query_params[:'locale_codes'] = opts[:'locale_codes'] if !opts[:'locale_codes'].nil?
53
+ query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
54
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:body]
67
+
68
+ # return_type
69
+ return_type = opts[:return_type] || 'Array<LocaleReport>'
70
+
71
+ # auth_names
72
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
73
+
74
+ new_options = opts.merge(
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: ReportsApi#report_locales_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ response = ::Phrase::Response.new(data, headers)
88
+ return response, status_code, headers
89
+ end
90
+
91
+ # Get Project Report
92
+ # Get report of a single project.
93
+ # @param project_id [String] Project ID
94
+ # @param [Hash] opts the optional parameters
95
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
96
+ # @option opts [String] :branch specify the branch to use
97
+ # @return [ProjectReport]
98
+ def report_show(project_id, opts = {})
99
+ data, _status_code, _headers = report_show_with_http_info(project_id, opts)
100
+ data
101
+ end
102
+
103
+ # Get Project Report
104
+ # Get report of a single project.
105
+ # @param project_id [String] Project ID
106
+ # @param [Hash] opts the optional parameters
107
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
108
+ # @option opts [String] :branch specify the branch to use
109
+ # @return [Array<(Response<(ProjectReport)>, Integer, Hash)>] Response<(ProjectReport)> data, response status code and response headers
110
+ def report_show_with_http_info(project_id, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: ReportsApi.report_show ...'
113
+ end
114
+ # verify the required parameter 'project_id' is set
115
+ if @api_client.config.client_side_validation && project_id.nil?
116
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ReportsApi.report_show"
117
+ end
118
+ # resource path
119
+ local_var_path = '/projects/{project_id}/report'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
120
+
121
+ # query parameters
122
+ query_params = opts[:query_params] || {}
123
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
129
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+
134
+ # http body (model)
135
+ post_body = opts[:body]
136
+
137
+ # return_type
138
+ return_type = opts[:return_type] || 'ProjectReport'
139
+
140
+ # auth_names
141
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
142
+
143
+ new_options = opts.merge(
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: ReportsApi#report_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ response = ::Phrase::Response.new(data, headers)
157
+ return response, status_code, headers
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,30 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class CustomMetadataDataType
5
+ BOOLEAN = "boolean".freeze
6
+ DATE = "date".freeze
7
+ LINK = "link".freeze
8
+ MULTI_SELECT = "multi_select".freeze
9
+ NUMBER = "number".freeze
10
+ SINGLE_SELECT = "single_select".freeze
11
+ STRING = "string".freeze
12
+ TEXT = "text".freeze
13
+
14
+ # Builds the enum from string
15
+ # @param [String] The enum value in the form of the string
16
+ # @return [String] The enum value
17
+ def self.build_from_hash(value)
18
+ new.build_from_hash(value)
19
+ end
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def build_from_hash(value)
25
+ constantValues = CustomMetadataDataType.constants.select { |c| CustomMetadataDataType::const_get(c) == value }
26
+ raise "Invalid ENUM value #{value} for class #CustomMetadataDataType" if constantValues.empty?
27
+ value
28
+ end
29
+ end
30
+ end