phrase 4.25.0 → 4.26.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +15 -4
  4. data/docs/AutomationEvent.md +33 -0
  5. data/docs/AutomationEventProject.md +19 -0
  6. data/docs/AutomationEventsApi.md +168 -0
  7. data/docs/AutomationsCreateParameters.md +1 -1
  8. data/docs/AutomationsCreateParameters1.md +1 -1
  9. data/docs/DocumentsApi.md +4 -4
  10. data/docs/ICUApi.md +1 -1
  11. data/docs/IcuSkeletonError.md +17 -0
  12. data/docs/IcuSkeletonParameters.md +11 -11
  13. data/docs/JobsApi.md +2 -2
  14. data/docs/KeyCreateParameters.md +1 -1
  15. data/docs/KeyFormatAnnotationsApi.md +74 -0
  16. data/docs/KeyFormatAnnotationsList200ResponseInner.md +19 -0
  17. data/docs/KeyLinksBatchDestroyParameters.md +6 -4
  18. data/docs/KeyLinksCreateParameters.md +2 -2
  19. data/docs/KeyUpdateParameters.md +1 -1
  20. data/docs/LinkedKeysApi.md +14 -13
  21. data/docs/PreTranslation.md +29 -0
  22. data/docs/PreTranslationCreateParameters.md +19 -0
  23. data/docs/PreTranslationsApi.md +210 -0
  24. data/docs/ProjectCreateParameters.md +1 -1
  25. data/docs/ProjectUpdateParameters.md +1 -1
  26. data/docs/ScreenshotUpdateParameters.md +1 -1
  27. data/docs/ScreenshotsApi.md +2 -2
  28. data/lib/phrase/api/automation_events_api.rb +215 -0
  29. data/lib/phrase/api/documents_api.rb +6 -6
  30. data/lib/phrase/api/icu_api.rb +2 -6
  31. data/lib/phrase/api/key_format_annotations_api.rb +85 -0
  32. data/lib/phrase/api/linked_keys_api.rb +19 -23
  33. data/lib/phrase/api/pre_translations_api.rb +240 -0
  34. data/lib/phrase/api/screenshots_api.rb +4 -4
  35. data/lib/phrase/models/automation_event.rb +325 -0
  36. data/lib/phrase/models/automation_event_project.rb +208 -0
  37. data/lib/phrase/models/automations_create_parameters.rb +1 -1
  38. data/lib/phrase/models/automations_create_parameters1.rb +1 -1
  39. data/lib/phrase/models/{key_links_index400_response.rb → icu_skeleton_error.rb} +11 -10
  40. data/lib/phrase/models/icu_skeleton_parameters.rb +6 -6
  41. data/lib/phrase/models/key_format_annotations_list200_response_inner.rb +207 -0
  42. data/lib/phrase/models/key_links_batch_destroy_parameters.rb +52 -6
  43. data/lib/phrase/models/key_links_create_parameters.rb +1 -1
  44. data/lib/phrase/models/pre_translation.rb +301 -0
  45. data/lib/phrase/models/pre_translation_create_parameters.rb +241 -0
  46. data/lib/phrase/response.rb +2 -2
  47. data/lib/phrase/version.rb +1 -1
  48. data/lib/phrase.rb +9 -1
  49. data/phrase.gemspec +1 -1
  50. data/spec/api/automation_events_api_spec.rb +67 -0
  51. data/spec/api/documents_api_spec.rb +3 -3
  52. data/spec/api/icu_api_spec.rb +1 -1
  53. data/spec/api/key_format_annotations_api_spec.rb +38 -0
  54. data/spec/api/linked_keys_api_spec.rb +7 -7
  55. data/spec/api/pre_translations_api_spec.rb +70 -0
  56. data/spec/api/screenshots_api_spec.rb +2 -2
  57. data/spec/models/automation_event_project_spec.rb +35 -0
  58. data/spec/models/automation_event_spec.rb +85 -0
  59. data/spec/models/{key_links_index400_response_spec.rb → icu_skeleton_error_spec.rb} +7 -7
  60. data/spec/models/key_format_annotations_list200_response_inner_spec.rb +35 -0
  61. data/spec/models/key_links_batch_destroy_parameters_spec.rb +10 -0
  62. data/spec/models/pre_translation_create_parameters_spec.rb +39 -0
  63. data/spec/models/pre_translation_spec.rb +73 -0
  64. data/spec/response_spec.rb +53 -0
  65. metadata +291 -257
  66. data/docs/KeyLinksIndex400Response.md +0 -17
@@ -0,0 +1,241 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class PreTranslationCreateParameters
5
+ # Resource type to pre-translate.
6
+ attr_accessor :translatable_type
7
+
8
+ # ID of the targeted resource: locale ID for `locale`, job ID for `job`, key ID for `translation_key`, upload ID for `upload`.
9
+ attr_accessor :translatable_id
10
+
11
+ class EnumAttributeValidator
12
+ attr_reader :datatype
13
+ attr_reader :allowable_values
14
+
15
+ def initialize(datatype, allowable_values)
16
+ @allowable_values = allowable_values.map do |value|
17
+ case datatype.to_s
18
+ when /Integer/i
19
+ value.to_i
20
+ when /Float/i
21
+ value.to_f
22
+ else
23
+ value
24
+ end
25
+ end
26
+ end
27
+
28
+ def valid?(value)
29
+ !value || allowable_values.include?(value)
30
+ end
31
+ end
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'translatable_type' => :'translatable_type',
37
+ :'translatable_id' => :'translatable_id'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'translatable_type' => :'String',
45
+ :'translatable_id' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::PreTranslationCreateParameters` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::PreTranslationCreateParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'translatable_type')
71
+ self.translatable_type = attributes[:'translatable_type']
72
+ end
73
+
74
+ if attributes.key?(:'translatable_id')
75
+ self.translatable_id = attributes[:'translatable_id']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ translatable_type_validator = EnumAttributeValidator.new('String', ["locale", "job", "translation_key", "upload"])
90
+ return false unless translatable_type_validator.valid?(@translatable_type)
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method checking allowed values (enum).
95
+ # @param [Object] translatable_type Object to be assigned
96
+ def translatable_type=(translatable_type)
97
+ validator = EnumAttributeValidator.new('String', ["locale", "job", "translation_key", "upload"])
98
+ unless validator.valid?(translatable_type)
99
+ fail ArgumentError, "invalid value for \"translatable_type\", must be one of #{validator.allowable_values}."
100
+ end
101
+ @translatable_type = translatable_type
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ translatable_type == o.translatable_type &&
110
+ translatable_id == o.translatable_id
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [translatable_type, translatable_id].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :Time
163
+ Time.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ Phrase.const_get(type).build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+ end
241
+ end
@@ -10,8 +10,8 @@ module Phrase
10
10
  link_headers = headers["link"]
11
11
  if link_headers
12
12
  @paginated = true
13
- parsed_links = LinkHeaderParser.parse(link_headers, base: 'https://api.phrase.com').group_by_relation_type
14
- next_page_link = parsed_links[:next]&.first
13
+ parsed_links = LinkHeaderParser.parse(link_headers, base_uri: 'https://api.phrase.com').group_by_relation_type
14
+ next_page_link = parsed_links["next"]&.first
15
15
  if next_page_link
16
16
  @next_page = CGI.parse(URI.parse(next_page_link.target_uri).query)["page"]&.first&.to_i
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Phrase
2
- VERSION = '4.25.0'
2
+ VERSION = '4.26.0'
3
3
  end
data/lib/phrase.rb CHANGED
@@ -18,6 +18,8 @@ require 'phrase/models/authorization_create_parameters'
18
18
  require 'phrase/models/authorization_update_parameters'
19
19
  require 'phrase/models/authorization_with_token'
20
20
  require 'phrase/models/automation'
21
+ require 'phrase/models/automation_event'
22
+ require 'phrase/models/automation_event_project'
21
23
  require 'phrase/models/automations_create_parameters'
22
24
  require 'phrase/models/automations_create_parameters1'
23
25
  require 'phrase/models/blacklisted_key'
@@ -69,6 +71,7 @@ require 'phrase/models/glossary_term_translation_update_parameters'
69
71
  require 'phrase/models/glossary_term_update_parameters'
70
72
  require 'phrase/models/glossary_update_parameters'
71
73
  require 'phrase/models/icu'
74
+ require 'phrase/models/icu_skeleton_error'
72
75
  require 'phrase/models/icu_skeleton_parameters'
73
76
  require 'phrase/models/invitation'
74
77
  require 'phrase/models/invitation_create_parameters'
@@ -105,10 +108,10 @@ require 'phrase/models/job_template_preview'
105
108
  require 'phrase/models/job_template_update_parameters'
106
109
  require 'phrase/models/job_update_parameters'
107
110
  require 'phrase/models/key_create_parameters'
111
+ require 'phrase/models/key_format_annotations_list200_response_inner'
108
112
  require 'phrase/models/key_link'
109
113
  require 'phrase/models/key_links_batch_destroy_parameters'
110
114
  require 'phrase/models/key_links_create_parameters'
111
- require 'phrase/models/key_links_index400_response'
112
115
  require 'phrase/models/key_preview'
113
116
  require 'phrase/models/key_update_parameters'
114
117
  require 'phrase/models/keys_exclude_parameters'
@@ -147,6 +150,8 @@ require 'phrase/models/organization_job_template_details'
147
150
  require 'phrase/models/organization_job_template_locale_update_parameters'
148
151
  require 'phrase/models/organization_job_template_locales_create_parameters'
149
152
  require 'phrase/models/organization_job_template_update_parameters'
153
+ require 'phrase/models/pre_translation'
154
+ require 'phrase/models/pre_translation_create_parameters'
150
155
  require 'phrase/models/project'
151
156
  require 'phrase/models/project_create_parameters'
152
157
  require 'phrase/models/project_details'
@@ -243,6 +248,7 @@ require 'phrase/models/webhook_update_parameters'
243
248
  # APIs
244
249
  require 'phrase/api/accounts_api'
245
250
  require 'phrase/api/authorizations_api'
251
+ require 'phrase/api/automation_events_api'
246
252
  require 'phrase/api/automations_api'
247
253
  require 'phrase/api/blacklisted_keys_api'
248
254
  require 'phrase/api/branches_api'
@@ -265,6 +271,7 @@ require 'phrase/api/job_locales_api'
265
271
  require 'phrase/api/job_template_locales_api'
266
272
  require 'phrase/api/job_templates_api'
267
273
  require 'phrase/api/jobs_api'
274
+ require 'phrase/api/key_format_annotations_api'
268
275
  require 'phrase/api/keys_api'
269
276
  require 'phrase/api/keys_figma_attachments_api'
270
277
  require 'phrase/api/linked_keys_api'
@@ -276,6 +283,7 @@ require 'phrase/api/notifications_api'
276
283
  require 'phrase/api/orders_api'
277
284
  require 'phrase/api/organization_job_template_locales_api'
278
285
  require 'phrase/api/organization_job_templates_api'
286
+ require 'phrase/api/pre_translations_api'
279
287
  require 'phrase/api/projects_api'
280
288
  require 'phrase/api/quality_performance_score_api'
281
289
  require 'phrase/api/release_triggers_api'
data/phrase.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.add_runtime_dependency 'typhoeus', '>= 1.0.1'
24
24
  s.add_runtime_dependency 'json', '>= 2.1.0'
25
- s.add_runtime_dependency 'link-header-parser'
25
+ s.add_runtime_dependency 'link-header-parser', '>= 7.0'
26
26
 
27
27
  s.add_development_dependency 'rspec', '>= 3.6.0'
28
28
 
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+
4
+ # Unit tests for Phrase::AutomationEventsApi
5
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
6
+ # Please update as you see appropriate
7
+ describe 'AutomationEventsApi' do
8
+ before do
9
+ # run before each test
10
+ @api_instance = Phrase::AutomationEventsApi.new
11
+ end
12
+
13
+ after do
14
+ # run after each test
15
+ end
16
+
17
+ describe 'test an instance of AutomationEventsApi' do
18
+ it 'should create an instance of AutomationEventsApi' do
19
+ expect(@api_instance).to be_instance_of(Phrase::AutomationEventsApi)
20
+ end
21
+ end
22
+
23
+ # unit tests for account_automation_events_list
24
+ # List automation events for an account
25
+ # Returns the run history across all automations in the account, newest-first. Use &#x60;automation_id&#x60; to narrow results to a single automation. Use &#x60;project_id&#x60; or &#x60;project_ids&#x60; to narrow by project. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
26
+ # @param account_id Account ID
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
29
+ # @option opts [Integer] :page Page number
30
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
31
+ # @option opts [String] :automation_id Filter events to a single automation by its ID.
32
+ # @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
33
+ # @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
34
+ # @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
35
+ # @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
36
+ # @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
37
+ # @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
38
+ # @return [Array<AutomationEvent>]
39
+ describe 'account_automation_events_list test' do
40
+ it 'should work' do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ # unit tests for automation_events_list
46
+ # List events for an automation
47
+ # Returns the run history for a specific automation, newest-first. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
48
+ # @param account_id Account ID
49
+ # @param id ID
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
52
+ # @option opts [Integer] :page Page number
53
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
54
+ # @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
55
+ # @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
56
+ # @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
57
+ # @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
58
+ # @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
59
+ # @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
60
+ # @return [Array<AutomationEvent>]
61
+ describe 'automation_events_list test' do
62
+ it 'should work' do
63
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
64
+ end
65
+ end
66
+
67
+ end
@@ -22,7 +22,7 @@ describe 'DocumentsApi' do
22
22
 
23
23
  # unit tests for document_delete
24
24
  # Delete document
25
- # Delete an existing document.
25
+ # Permanently deletes a document and all of its associated translation segments from the project. Use this when you want to remove a document that is no longer needed; the deletion cannot be reversed and all associated segments will be lost.
26
26
  # @param project_id Project ID
27
27
  # @param id ID
28
28
  # @param [Hash] opts the optional parameters
@@ -36,13 +36,13 @@ describe 'DocumentsApi' do
36
36
 
37
37
  # unit tests for documents_list
38
38
  # List documents
39
- # List all documents the current user has access to.
39
+ # Returns all documents in a project that the authenticated user has read access to. A Document is a source file — an HTML or DOCX file — that has been uploaded to Phrase Strings and whose content is segmented into translation keys for localization. Use this endpoint to enumerate documents before downloading, previewing, or triggering translation workflows for individual files. The q parameter performs a prefix match on the document name (case-insensitive). For example, passing q&#x3D;invoice returns documents whose names begin with \&quot;invoice\&quot; but not documents containing \&quot;invoice\&quot; elsewhere in the name.
40
40
  # @param project_id Project ID
41
41
  # @param [Hash] opts the optional parameters
42
42
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
43
43
  # @option opts [Integer] :page Page number
44
44
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
45
- # @option opts [String] :q Search query. Filters documents by name (case-insensitive substring match).
45
+ # @option opts [String] :q Filter documents by name prefix. Returns documents whose name starts with the given value (case-insensitive).
46
46
  # @return [Array<Document>]
47
47
  describe 'documents_list test' do
48
48
  it 'should work' do
@@ -22,7 +22,7 @@ describe 'ICUApi' do
22
22
 
23
23
  # unit tests for icu_skeleton
24
24
  # Build ICU skeletons
25
- # Returns ICU skeletons for multiple locale codes based on a source content.
25
+ # Generates ICU (International Components for Unicode) message format skeletons for a given source string across one or more locales. An ICU skeleton strips the literal text from a pluralized or select message while preserving its structural rules — argument names, plural categories, select cases, and ordinal forms — adjusted to the pluralization rules of each requested locale. Use this endpoint to normalize translation templates before importing them into locale files, or to validate that a source string carries the plural forms required by a target language. Either &#x60;content&#x60; or &#x60;id&#x60; must be provided — supplying both or neither returns 400. When &#x60;id&#x60; is used and the referenced translation does not exist, the endpoint returns 404. When the source string is not valid ICU message format syntax, the endpoint returns 422 with an &#x60;error&#x60; field describing the parse failure.
26
26
  # @param icu_skeleton_parameters
27
27
  # @param [Hash] opts the optional parameters
28
28
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+
4
+ # Unit tests for Phrase::KeyFormatAnnotationsApi
5
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
6
+ # Please update as you see appropriate
7
+ describe 'KeyFormatAnnotationsApi' do
8
+ before do
9
+ # run before each test
10
+ @api_instance = Phrase::KeyFormatAnnotationsApi.new
11
+ end
12
+
13
+ after do
14
+ # run after each test
15
+ end
16
+
17
+ describe 'test an instance of KeyFormatAnnotationsApi' do
18
+ it 'should create an instance of KeyFormatAnnotationsApi' do
19
+ expect(@api_instance).to be_instance_of(Phrase::KeyFormatAnnotationsApi)
20
+ end
21
+ end
22
+
23
+ # unit tests for key_format_annotations_list
24
+ # List format annotations for a key
25
+ # Returns the format annotations stored on a translation key. Format annotations capture file-format data recorded when the key was imported — for example, an ARB placeholder block or an XLIFF note. Results are limited to 1,000 entries.
26
+ # @param project_id Project ID
27
+ # @param id ID
28
+ # @param [Hash] opts the optional parameters
29
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
30
+ # @option opts [String] :branch Branch to use
31
+ # @return [Array<KeyFormatAnnotationsList200ResponseInner>]
32
+ describe 'key_format_annotations_list test' do
33
+ it 'should work' do
34
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
35
+ end
36
+ end
37
+
38
+ end
@@ -22,13 +22,13 @@ describe 'LinkedKeysApi' do
22
22
 
23
23
  # unit tests for key_links_batch_destroy
24
24
  # Batch unlink child keys from a parent key
25
- # Unlinks multiple child keys from a given parent key in a single operation.
25
+ # Removes one or more child keys from a parent key&#39;s linked-key group, or dissolves the entire group by setting unlink_parent to true. Use this when you need to detach specific child keys from a shared translation source, or to fully break apart a linked-key group so each key manages its own translations independently. When child keys are unlinked, their translations are updated with a copy of the parent&#39;s current content (strategy keep_content, the default) or cleared (strategy remove_content). This operation is only available on main projects. It returns 422 when a child key in &#x60;child_key_ids&#x60; is not currently linked to the parent, or when a translation update fails while unlinking.
26
26
  # @param project_id Project ID
27
27
  # @param id Parent Translation Key ID
28
- # @param key_links_batch_destroy_parameters
29
28
  # @param [Hash] opts the optional parameters
30
29
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
31
- # @return [nil]
30
+ # @option opts [KeyLinksBatchDestroyParameters] :key_links_batch_destroy_parameters
31
+ # @return [KeyLink]
32
32
  describe 'key_links_batch_destroy test' do
33
33
  it 'should work' do
34
34
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -37,7 +37,7 @@ describe 'LinkedKeysApi' do
37
37
 
38
38
  # unit tests for key_links_create
39
39
  # Link child keys to a parent key
40
- # Creates links between a given parent key and one or more child keys.
40
+ # Designates a translation key as a parent and links one or more child keys to it. Once linked, child keys receive a special reference marker as their translation content, signalling that their translations are derived from the parent. Use this when you want to group related keys — for example, a short label and its long-form variant — so translators see them in context together. Pass an empty child_key_ids array to mark the key as a parent without linking any children yet. Both the parent key and every child key must belong to the main project; branch keys cannot participate in key links. A child key can have at most one parent at a time; attempting to link a child that already has a parent returns a 422 error with code CHILD_IS_ALREADY_LINKED. Parent and child key plurality must match — linking a plural child to a non-plural parent (or vice versa) also returns a 422.
41
41
  # @param project_id Project ID
42
42
  # @param id Parent Translation Key ID
43
43
  # @param key_links_create_parameters
@@ -52,10 +52,10 @@ describe 'LinkedKeysApi' do
52
52
 
53
53
  # unit tests for key_links_destroy
54
54
  # Unlink a child key from a parent key
55
- # Unlinks a single child key from a given parent key.
55
+ # Removes a single child key from a parent key&#39;s link group. A link group is the relationship model that keeps child keys synchronized with a parent: while linked, a child key&#39;s translations are derived from the parent&#39;s content. When you call this endpoint, the child key leaves the group and becomes independent — its existing translations are updated with the parent&#39;s current content and then marked unverified, signalling that reviewers should confirm the content is still appropriate for the child&#39;s context. Use this endpoint when you need to detach one specific child key while keeping other children linked. To detach multiple children at once, use the batch unlink endpoint. This operation is only available on main projects. It returns 422 when the child key is not currently linked to the specified parent key, or when a translation update fails during the unlink process.
56
56
  # @param project_id Project ID
57
57
  # @param id Parent Translation Key ID
58
- # @param child_key_id The ID of the child key to unlink.
58
+ # @param child_key_id The ID of the child translation key to unlink from the parent.
59
59
  # @param [Hash] opts the optional parameters
60
60
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
61
61
  # @return [nil]
@@ -67,7 +67,7 @@ describe 'LinkedKeysApi' do
67
67
 
68
68
  # unit tests for key_links_index
69
69
  # List child keys of a parent key
70
- # Returns detailed information about a parent key, including its linked child keys.
70
+ # Returns the key link record for a parent key, including all child keys associated with it. Key linking lets translation keys share translations — a child key inherits content from its designated parent. Use this endpoint to inspect which keys are linked under a given parent before unlinking them or auditing translation consistency across related keys. The key identified by &#x60;id&#x60; must be designated as a parent key (it must have at least one child key linked to it). Listing the links of a key that is not a parent returns 400.
71
71
  # @param project_id Project ID
72
72
  # @param id Parent Translation Key ID
73
73
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,70 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+
4
+ # Unit tests for Phrase::PreTranslationsApi
5
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
6
+ # Please update as you see appropriate
7
+ describe 'PreTranslationsApi' do
8
+ before do
9
+ # run before each test
10
+ @api_instance = Phrase::PreTranslationsApi.new
11
+ end
12
+
13
+ after do
14
+ # run after each test
15
+ end
16
+
17
+ describe 'test an instance of PreTranslationsApi' do
18
+ it 'should create an instance of PreTranslationsApi' do
19
+ expect(@api_instance).to be_instance_of(Phrase::PreTranslationsApi)
20
+ end
21
+ end
22
+
23
+ # unit tests for pre_translation_create
24
+ # Create a pre-translation job
25
+ # Triggers a pre-translation job for a resource within a project, addressed by &#x60;translatable_type&#x60; (&#x60;locale&#x60;, &#x60;job&#x60;, &#x60;translation_key&#x60;, or &#x60;upload&#x60;) and &#x60;translatable_id&#x60; (its ID). Enqueues machine translation using the project&#39;s configured MT engine.
26
+ # @param project_id Project ID
27
+ # @param pre_translation_create_parameters
28
+ # @param [Hash] opts the optional parameters
29
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
30
+ # @return [PreTranslation]
31
+ describe 'pre_translation_create test' do
32
+ it 'should work' do
33
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
34
+ end
35
+ end
36
+
37
+ # unit tests for pre_translation_show
38
+ # Get a single pre-translation job
39
+ # Returns a single pre-translation job identified by its ID.
40
+ # @param project_id Project ID
41
+ # @param id ID
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
44
+ # @option opts [String] :if_modified_since Last modified condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
45
+ # @option opts [String] :if_none_match ETag condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
46
+ # @return [PreTranslation]
47
+ describe 'pre_translation_show test' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ # unit tests for pre_translations_list
54
+ # List pre-translation jobs
55
+ # Returns all pre-translation jobs scoped to a project, ordered by creation date descending.
56
+ # @param project_id Project ID
57
+ # @param [Hash] opts the optional parameters
58
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
59
+ # @option opts [String] :if_modified_since Last modified condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
60
+ # @option opts [String] :if_none_match ETag condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
61
+ # @option opts [Integer] :page Page number
62
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
63
+ # @return [Array<PreTranslation>]
64
+ describe 'pre_translations_list test' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ end
@@ -39,7 +39,7 @@ describe 'ScreenshotsApi' do
39
39
 
40
40
  # unit tests for screenshot_delete
41
41
  # Delete a screenshot
42
- # Delete an existing screenshot.
42
+ # Permanently removes a screenshot and all its associated markers from the project. Use this when you need to fully remove a screenshot that is no longer relevant — for example, after a UI redesign renders the captured screen obsolete. This is a hard delete: the screenshot record and every key-to-region marker linked to it are destroyed together and cannot be recovered.
43
43
  # @param project_id Project ID
44
44
  # @param id ID
45
45
  # @param [Hash] opts the optional parameters
@@ -54,7 +54,7 @@ describe 'ScreenshotsApi' do
54
54
 
55
55
  # unit tests for screenshot_show
56
56
  # Get a single screenshot
57
- # Get details on a single screenshot for a given project.
57
+ # Returns a single screenshot belonging to the specified project. Use this to retrieve the screenshot&#39;s name, description, hosted image URL, and marker count after uploading, or before creating, updating, or inspecting its markers. The response is a synchronous, idempotent read — repeated calls return the same record without side effects. The Attachable Screenshots feature must be enabled on the account.
58
58
  # @param project_id Project ID
59
59
  # @param id ID
60
60
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::AutomationEventProject
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'AutomationEventProject' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::AutomationEventProject.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of AutomationEventProject' do
19
+ it 'should create an instance of AutomationEventProject' do
20
+ expect(@instance).to be_instance_of(Phrase::AutomationEventProject)
21
+ end
22
+ end
23
+ describe 'test attribute "id"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "name"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ end