phrase 2.20.0 → 2.22.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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +27 -5
  4. data/docs/CustomMetadataApi.md +339 -0
  5. data/docs/CustomMetadataDataType.md +16 -0
  6. data/docs/CustomMetadataPropertiesCreateParameters.md +25 -0
  7. data/docs/CustomMetadataPropertiesUpdateParameters.md +23 -0
  8. data/docs/CustomMetadataProperty.md +33 -0
  9. data/docs/CustomMetadataPropertyCreate422Response.md +19 -0
  10. data/docs/{InvitationCreate422ResponseErrorsInner.md → CustomMetadataPropertyCreate422ResponseErrorsInner.md} +2 -2
  11. data/docs/Error.md +17 -0
  12. data/docs/ErrorError.md +19 -0
  13. data/docs/KeyCreateParameters.md +4 -2
  14. data/docs/KeyUpdateParameters.md +4 -2
  15. data/docs/KeysApi.md +2 -2
  16. data/docs/KeysSearchParameters.md +1 -1
  17. data/docs/LocaleReport.md +43 -0
  18. data/docs/LocalesApi.md +3 -1
  19. data/docs/ProjectCreateParameters.md +1 -1
  20. data/docs/ProjectReport.md +31 -0
  21. data/docs/ProjectUpdateParameters.md +1 -1
  22. data/docs/ProjectsQualityPerformanceScore200Response.md +21 -0
  23. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOf.md +19 -0
  24. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOfData.md +17 -0
  25. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner.md +21 -0
  26. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner.md +21 -0
  27. data/docs/ProjectsQualityPerformanceScoreRequest.md +17 -0
  28. data/docs/QualityPerformanceScoreApi.md +72 -0
  29. data/docs/ReportsApi.md +144 -0
  30. data/docs/ScreenshotUpdateParameters.md +1 -1
  31. data/docs/TranslationKeyDetails.md +3 -1
  32. data/docs/Upload.md +2 -0
  33. data/lib/phrase/api/custom_metadata_api.rb +390 -0
  34. data/lib/phrase/api/keys_api.rb +2 -2
  35. data/lib/phrase/api/locales_api.rb +3 -0
  36. data/lib/phrase/api/quality_performance_score_api.rb +84 -0
  37. data/lib/phrase/api/reports_api.rb +160 -0
  38. data/lib/phrase/models/custom_metadata_data_type.rb +30 -0
  39. data/lib/phrase/models/custom_metadata_properties_create_parameters.rb +272 -0
  40. data/lib/phrase/models/custom_metadata_properties_update_parameters.rb +231 -0
  41. data/lib/phrase/models/custom_metadata_property.rb +294 -0
  42. data/lib/phrase/models/{invitation_create422_response.rb → custom_metadata_property_create422_response.rb} +4 -4
  43. data/lib/phrase/models/{invitation_create422_response_errors_inner.rb → custom_metadata_property_create422_response_errors_inner.rb} +3 -3
  44. data/lib/phrase/models/error.rb +197 -0
  45. data/lib/phrase/models/error_error.rb +205 -0
  46. data/lib/phrase/models/key_create_parameters.rb +14 -4
  47. data/lib/phrase/models/key_update_parameters.rb +14 -4
  48. data/lib/phrase/models/keys_search_parameters.rb +1 -1
  49. data/lib/phrase/models/locale_report.rb +313 -0
  50. data/lib/phrase/models/project_report.rb +259 -0
  51. data/lib/phrase/models/projects_quality_performance_score200_response.rb +237 -0
  52. data/lib/phrase/models/projects_quality_performance_score200_response_any_of.rb +208 -0
  53. data/lib/phrase/models/projects_quality_performance_score200_response_any_of_data.rb +198 -0
  54. data/lib/phrase/models/projects_quality_performance_score200_response_any_of_data_translations_inner.rb +217 -0
  55. data/lib/phrase/models/projects_quality_performance_score200_response_any_of_errors_inner.rb +215 -0
  56. data/lib/phrase/models/projects_quality_performance_score_request.rb +199 -0
  57. data/lib/phrase/models/translation_key_details.rb +15 -4
  58. data/lib/phrase/models/upload.rb +11 -1
  59. data/lib/phrase/version.rb +1 -1
  60. data/lib/phrase.rb +19 -2
  61. data/spec/api/custom_metadata_api_spec.rb +99 -0
  62. data/spec/api/keys_api_spec.rb +1 -1
  63. data/spec/api/quality_performance_score_api_spec.rb +37 -0
  64. data/spec/api/reports_api_spec.rb +55 -0
  65. data/spec/models/custom_metadata_data_type_spec.rb +23 -0
  66. data/spec/models/custom_metadata_properties_create_parameters_spec.rb +53 -0
  67. data/spec/models/custom_metadata_properties_update_parameters_spec.rb +47 -0
  68. data/spec/models/{invitation_create422_response_errors_inner_spec.rb → custom_metadata_property_create422_response_errors_inner_spec.rb} +6 -6
  69. data/spec/models/custom_metadata_property_create422_response_spec.rb +35 -0
  70. data/spec/models/custom_metadata_property_spec.rb +77 -0
  71. data/spec/models/{invitation_create422_response_spec.rb → error_error_spec.rb} +7 -7
  72. data/spec/models/error_spec.rb +29 -0
  73. data/spec/models/key_create_parameters_spec.rb +6 -0
  74. data/spec/models/key_update_parameters_spec.rb +6 -0
  75. data/spec/models/locale_report_spec.rb +107 -0
  76. data/spec/models/project_report_spec.rb +71 -0
  77. data/spec/models/projects_quality_performance_score200_response_any_of_data_spec.rb +29 -0
  78. data/spec/models/projects_quality_performance_score200_response_any_of_data_translations_inner_spec.rb +41 -0
  79. data/spec/models/projects_quality_performance_score200_response_any_of_errors_inner_spec.rb +41 -0
  80. data/spec/models/projects_quality_performance_score200_response_any_of_spec.rb +35 -0
  81. data/spec/models/projects_quality_performance_score200_response_spec.rb +41 -0
  82. data/spec/models/projects_quality_performance_score_request_spec.rb +29 -0
  83. data/spec/models/translation_key_details_spec.rb +6 -0
  84. data/spec/models/upload_spec.rb +6 -0
  85. metadata +285 -217
  86. data/docs/InvitationCreate422Response.md +0 -19
@@ -0,0 +1,390 @@
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 custom_metadata_properties_create_parameters [CustomMetadataPropertiesCreateParameters]
168
+ # @param [Hash] opts the optional parameters
169
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
170
+ # @return [CustomMetadataProperty]
171
+ def custom_metadata_property_create(account_id, custom_metadata_properties_create_parameters, opts = {})
172
+ data, _status_code, _headers = custom_metadata_property_create_with_http_info(account_id, custom_metadata_properties_create_parameters, opts)
173
+ data
174
+ end
175
+
176
+ # Create a property
177
+ # Create a new custom metadata property.
178
+ # @param account_id [String] Account ID
179
+ # @param custom_metadata_properties_create_parameters [CustomMetadataPropertiesCreateParameters]
180
+ # @param [Hash] opts the optional parameters
181
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
182
+ # @return [Array<(Response<(CustomMetadataProperty)>, Integer, Hash)>] Response<(CustomMetadataProperty)> data, response status code and response headers
183
+ def custom_metadata_property_create_with_http_info(account_id, custom_metadata_properties_create_parameters, opts = {})
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_property_create ...'
186
+ end
187
+ # verify the required parameter 'account_id' is set
188
+ if @api_client.config.client_side_validation && account_id.nil?
189
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_property_create"
190
+ end
191
+ # verify the required parameter 'custom_metadata_properties_create_parameters' is set
192
+ if @api_client.config.client_side_validation && custom_metadata_properties_create_parameters.nil?
193
+ fail ArgumentError, "Missing the required parameter 'custom_metadata_properties_create_parameters' when calling CustomMetadataApi.custom_metadata_property_create"
194
+ end
195
+ # resource path
196
+ local_var_path = '/accounts/{account_id}/custom_metadata/properties'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
197
+
198
+ # query parameters
199
+ query_params = opts[:query_params] || {}
200
+
201
+ # header parameters
202
+ header_params = opts[:header_params] || {}
203
+ # HTTP header 'Accept' (if needed)
204
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
205
+ # HTTP header 'Content-Type'
206
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
207
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
208
+
209
+ # form parameters
210
+ form_params = opts[:form_params] || {}
211
+
212
+ # http body (model)
213
+ post_body = opts[:body] || @api_client.object_to_http_body(custom_metadata_properties_create_parameters)
214
+
215
+ # return_type
216
+ return_type = opts[:return_type] || 'CustomMetadataProperty'
217
+
218
+ # auth_names
219
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
220
+
221
+ new_options = opts.merge(
222
+ :header_params => header_params,
223
+ :query_params => query_params,
224
+ :form_params => form_params,
225
+ :body => post_body,
226
+ :auth_names => auth_names,
227
+ :return_type => return_type
228
+ )
229
+
230
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
231
+ if @api_client.config.debugging
232
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_property_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ end
234
+ response = ::Phrase::Response.new(data, headers)
235
+ return response, status_code, headers
236
+ end
237
+
238
+ # Get a single property
239
+ # Get details of a single custom property.
240
+ # @param account_id [String] Account ID
241
+ # @param id [String] ID
242
+ # @param [Hash] opts the optional parameters
243
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
244
+ # @return [CustomMetadataProperty]
245
+ def custom_metadata_property_show(account_id, id, opts = {})
246
+ data, _status_code, _headers = custom_metadata_property_show_with_http_info(account_id, id, opts)
247
+ data
248
+ end
249
+
250
+ # Get a single property
251
+ # Get details of a single custom property.
252
+ # @param account_id [String] Account ID
253
+ # @param id [String] ID
254
+ # @param [Hash] opts the optional parameters
255
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
256
+ # @return [Array<(Response<(CustomMetadataProperty)>, Integer, Hash)>] Response<(CustomMetadataProperty)> data, response status code and response headers
257
+ def custom_metadata_property_show_with_http_info(account_id, id, opts = {})
258
+ if @api_client.config.debugging
259
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_property_show ...'
260
+ end
261
+ # verify the required parameter 'account_id' is set
262
+ if @api_client.config.client_side_validation && account_id.nil?
263
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_property_show"
264
+ end
265
+ # verify the required parameter 'id' is set
266
+ if @api_client.config.client_side_validation && id.nil?
267
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomMetadataApi.custom_metadata_property_show"
268
+ end
269
+ # resource path
270
+ 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))
271
+
272
+ # query parameters
273
+ query_params = opts[:query_params] || {}
274
+
275
+ # header parameters
276
+ header_params = opts[:header_params] || {}
277
+ # HTTP header 'Accept' (if needed)
278
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
279
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
280
+
281
+ # form parameters
282
+ form_params = opts[:form_params] || {}
283
+
284
+ # http body (model)
285
+ post_body = opts[:body]
286
+
287
+ # return_type
288
+ return_type = opts[:return_type] || 'CustomMetadataProperty'
289
+
290
+ # auth_names
291
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
292
+
293
+ new_options = opts.merge(
294
+ :header_params => header_params,
295
+ :query_params => query_params,
296
+ :form_params => form_params,
297
+ :body => post_body,
298
+ :auth_names => auth_names,
299
+ :return_type => return_type
300
+ )
301
+
302
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_property_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
305
+ end
306
+ response = ::Phrase::Response.new(data, headers)
307
+ return response, status_code, headers
308
+ end
309
+
310
+ # Update a property
311
+ # Update an existing custom metadata property.
312
+ # @param account_id [String] Account ID
313
+ # @param id [String] ID
314
+ # @param custom_metadata_properties_update_parameters [CustomMetadataPropertiesUpdateParameters]
315
+ # @param [Hash] opts the optional parameters
316
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
317
+ # @return [CustomMetadataProperty]
318
+ def custom_metadata_property_update(account_id, id, custom_metadata_properties_update_parameters, opts = {})
319
+ data, _status_code, _headers = custom_metadata_property_update_with_http_info(account_id, id, custom_metadata_properties_update_parameters, opts)
320
+ data
321
+ end
322
+
323
+ # Update a property
324
+ # Update an existing custom metadata property.
325
+ # @param account_id [String] Account ID
326
+ # @param id [String] ID
327
+ # @param custom_metadata_properties_update_parameters [CustomMetadataPropertiesUpdateParameters]
328
+ # @param [Hash] opts the optional parameters
329
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
330
+ # @return [Array<(Response<(CustomMetadataProperty)>, Integer, Hash)>] Response<(CustomMetadataProperty)> data, response status code and response headers
331
+ def custom_metadata_property_update_with_http_info(account_id, id, custom_metadata_properties_update_parameters, opts = {})
332
+ if @api_client.config.debugging
333
+ @api_client.config.logger.debug 'Calling API: CustomMetadataApi.custom_metadata_property_update ...'
334
+ end
335
+ # verify the required parameter 'account_id' is set
336
+ if @api_client.config.client_side_validation && account_id.nil?
337
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CustomMetadataApi.custom_metadata_property_update"
338
+ end
339
+ # verify the required parameter 'id' is set
340
+ if @api_client.config.client_side_validation && id.nil?
341
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomMetadataApi.custom_metadata_property_update"
342
+ end
343
+ # verify the required parameter 'custom_metadata_properties_update_parameters' is set
344
+ if @api_client.config.client_side_validation && custom_metadata_properties_update_parameters.nil?
345
+ fail ArgumentError, "Missing the required parameter 'custom_metadata_properties_update_parameters' when calling CustomMetadataApi.custom_metadata_property_update"
346
+ end
347
+ # resource path
348
+ 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))
349
+
350
+ # query parameters
351
+ query_params = opts[:query_params] || {}
352
+
353
+ # header parameters
354
+ header_params = opts[:header_params] || {}
355
+ # HTTP header 'Accept' (if needed)
356
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
357
+ # HTTP header 'Content-Type'
358
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
359
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
360
+
361
+ # form parameters
362
+ form_params = opts[:form_params] || {}
363
+
364
+ # http body (model)
365
+ post_body = opts[:body] || @api_client.object_to_http_body(custom_metadata_properties_update_parameters)
366
+
367
+ # return_type
368
+ return_type = opts[:return_type] || 'CustomMetadataProperty'
369
+
370
+ # auth_names
371
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
372
+
373
+ new_options = opts.merge(
374
+ :header_params => header_params,
375
+ :query_params => query_params,
376
+ :form_params => form_params,
377
+ :body => post_body,
378
+ :auth_names => auth_names,
379
+ :return_type => return_type
380
+ )
381
+
382
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug "API called: CustomMetadataApi#custom_metadata_property_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
385
+ end
386
+ response = ::Phrase::Response.new(data, headers)
387
+ return response, status_code, headers
388
+ end
389
+ end
390
+ 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,84 @@
1
+ require 'cgi'
2
+
3
+ module Phrase
4
+ class QualityPerformanceScoreApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # Get project's translations' quality performance scores
11
+ # Get project's translations' quality performance scores
12
+ # @param id [String] ID
13
+ # @param projects_quality_performance_score_request [ProjectsQualityPerformanceScoreRequest]
14
+ # @param [Hash] opts the optional parameters
15
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
16
+ # @return [ProjectsQualityPerformanceScore200Response]
17
+ def projects_quality_performance_score(id, projects_quality_performance_score_request, opts = {})
18
+ data, _status_code, _headers = projects_quality_performance_score_with_http_info(id, projects_quality_performance_score_request, opts)
19
+ data
20
+ end
21
+
22
+ # Get project&#39;s translations&#39; quality performance scores
23
+ # Get project&#39;s translations&#39; quality performance scores
24
+ # @param id [String] ID
25
+ # @param projects_quality_performance_score_request [ProjectsQualityPerformanceScoreRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
28
+ # @return [Array<(Response<(ProjectsQualityPerformanceScore200Response)>, Integer, Hash)>] Response<(ProjectsQualityPerformanceScore200Response)> data, response status code and response headers
29
+ def projects_quality_performance_score_with_http_info(id, projects_quality_performance_score_request, opts = {})
30
+ if @api_client.config.debugging
31
+ @api_client.config.logger.debug 'Calling API: QualityPerformanceScoreApi.projects_quality_performance_score ...'
32
+ end
33
+ # verify the required parameter 'id' is set
34
+ if @api_client.config.client_side_validation && id.nil?
35
+ fail ArgumentError, "Missing the required parameter 'id' when calling QualityPerformanceScoreApi.projects_quality_performance_score"
36
+ end
37
+ # verify the required parameter 'projects_quality_performance_score_request' is set
38
+ if @api_client.config.client_side_validation && projects_quality_performance_score_request.nil?
39
+ fail ArgumentError, "Missing the required parameter 'projects_quality_performance_score_request' when calling QualityPerformanceScoreApi.projects_quality_performance_score"
40
+ end
41
+ # resource path
42
+ local_var_path = '/projects/{id}/quality_performance_score'.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
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
51
+ # HTTP header 'Content-Type'
52
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
53
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:body] || @api_client.object_to_http_body(projects_quality_performance_score_request)
60
+
61
+ # return_type
62
+ return_type = opts[:return_type] || 'ProjectsQualityPerformanceScore200Response'
63
+
64
+ # auth_names
65
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
66
+
67
+ new_options = opts.merge(
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: QualityPerformanceScoreApi#projects_quality_performance_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ response = ::Phrase::Response.new(data, headers)
81
+ return response, status_code, headers
82
+ end
83
+ end
84
+ end