phrase 4.25.0 → 4.27.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/README.md +26 -4
- data/docs/AutomationEvent.md +33 -0
- data/docs/AutomationEventProject.md +19 -0
- data/docs/AutomationEventsApi.md +168 -0
- data/docs/AutomationsCreateParameters.md +1 -1
- data/docs/AutomationsCreateParameters1.md +1 -1
- data/docs/CheckIssue.md +33 -0
- data/docs/ChecksApi.md +146 -0
- data/docs/DocumentsApi.md +4 -4
- data/docs/ICUApi.md +1 -1
- data/docs/IcuSkeletonError.md +17 -0
- data/docs/IcuSkeletonParameters.md +11 -11
- data/docs/JobCreateParameters.md +1 -1
- data/docs/JobsApi.md +2 -2
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyFormatAnnotationsApi.md +74 -0
- data/docs/KeyFormatAnnotationsList200ResponseInner.md +19 -0
- data/docs/KeyLinksBatchDestroyParameters.md +6 -4
- data/docs/KeyLinksCreateParameters.md +2 -2
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LinkedKeysApi.md +14 -13
- data/docs/Locale.md +6 -0
- data/docs/LocaleCreateParameters.md +2 -0
- data/docs/LocaleDetails.md +6 -0
- data/docs/LocaleUpdateParameters.md +2 -0
- data/docs/MachineTranslationApi.md +263 -0
- data/docs/MachineTranslationLocaleProviderMapping.md +21 -0
- data/docs/MachineTranslationLocaleProviderMappingsCreateParameters.md +21 -0
- data/docs/MachineTranslationSettings.md +23 -0
- data/docs/MachineTranslationSettingsUpdateParameters.md +17 -0
- data/docs/PreTranslation.md +29 -0
- data/docs/PreTranslationCreateParameters.md +19 -0
- data/docs/PreTranslationsApi.md +210 -0
- data/docs/ProjectCreateParameters.md +8 -2
- data/docs/ProjectDetails.md +3 -1
- data/docs/ProjectUpdateParameters.md +8 -2
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/ScreenshotsApi.md +2 -2
- data/docs/Upload.md +3 -1
- data/docs/UploadsApi.md +4 -4
- data/lib/phrase/api/automation_events_api.rb +215 -0
- data/lib/phrase/api/checks_api.rb +174 -0
- data/lib/phrase/api/documents_api.rb +6 -6
- data/lib/phrase/api/icu_api.rb +2 -6
- data/lib/phrase/api/key_format_annotations_api.rb +85 -0
- data/lib/phrase/api/linked_keys_api.rb +19 -23
- data/lib/phrase/api/machine_translation_api.rb +302 -0
- data/lib/phrase/api/pre_translations_api.rb +240 -0
- data/lib/phrase/api/screenshots_api.rb +4 -4
- data/lib/phrase/api/uploads_api.rb +6 -6
- data/lib/phrase/models/automation_event.rb +325 -0
- data/lib/phrase/models/automation_event_project.rb +208 -0
- data/lib/phrase/models/automations_create_parameters.rb +1 -1
- data/lib/phrase/models/automations_create_parameters1.rb +1 -1
- data/lib/phrase/models/check_issue.rb +319 -0
- data/lib/phrase/models/{key_links_index400_response.rb → icu_skeleton_error.rb} +11 -10
- data/lib/phrase/models/icu_skeleton_parameters.rb +6 -6
- data/lib/phrase/models/job_create_parameters.rb +1 -1
- data/lib/phrase/models/key_format_annotations_list200_response_inner.rb +207 -0
- data/lib/phrase/models/key_links_batch_destroy_parameters.rb +52 -6
- data/lib/phrase/models/key_links_create_parameters.rb +1 -1
- data/lib/phrase/models/locale.rb +31 -1
- data/lib/phrase/models/locale_create_parameters.rb +11 -1
- data/lib/phrase/models/locale_details.rb +31 -1
- data/lib/phrase/models/locale_update_parameters.rb +11 -1
- data/lib/phrase/models/machine_translation_locale_provider_mapping.rb +217 -0
- data/lib/phrase/models/machine_translation_locale_provider_mappings_create_parameters.rb +232 -0
- data/lib/phrase/models/machine_translation_settings.rb +230 -0
- data/lib/phrase/models/machine_translation_settings_update_parameters.rb +198 -0
- data/lib/phrase/models/pre_translation.rb +301 -0
- data/lib/phrase/models/pre_translation_create_parameters.rb +241 -0
- data/lib/phrase/models/project_create_parameters.rb +35 -1
- data/lib/phrase/models/project_details.rb +10 -1
- data/lib/phrase/models/project_update_parameters.rb +35 -1
- data/lib/phrase/models/upload.rb +13 -1
- data/lib/phrase/response.rb +2 -2
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +16 -1
- data/phrase.gemspec +1 -1
- data/spec/api/automation_events_api_spec.rb +67 -0
- data/spec/api/checks_api_spec.rb +56 -0
- data/spec/api/documents_api_spec.rb +3 -3
- data/spec/api/icu_api_spec.rb +1 -1
- data/spec/api/key_format_annotations_api_spec.rb +38 -0
- data/spec/api/linked_keys_api_spec.rb +7 -7
- data/spec/api/machine_translation_api_spec.rb +79 -0
- data/spec/api/pre_translations_api_spec.rb +70 -0
- data/spec/api/screenshots_api_spec.rb +2 -2
- data/spec/models/automation_event_project_spec.rb +35 -0
- data/spec/models/automation_event_spec.rb +85 -0
- data/spec/models/check_issue_spec.rb +85 -0
- data/spec/models/{key_links_index400_response_spec.rb → icu_skeleton_error_spec.rb} +7 -7
- data/spec/models/key_format_annotations_list200_response_inner_spec.rb +35 -0
- data/spec/models/key_links_batch_destroy_parameters_spec.rb +10 -0
- data/spec/models/locale_create_parameters_spec.rb +6 -0
- data/spec/models/locale_details_spec.rb +18 -0
- data/spec/models/locale_spec.rb +18 -0
- data/spec/models/locale_update_parameters_spec.rb +6 -0
- data/spec/models/machine_translation_locale_provider_mapping_spec.rb +41 -0
- data/spec/models/machine_translation_locale_provider_mappings_create_parameters_spec.rb +41 -0
- data/spec/models/machine_translation_settings_spec.rb +47 -0
- data/spec/models/machine_translation_settings_update_parameters_spec.rb +29 -0
- data/spec/models/pre_translation_create_parameters_spec.rb +39 -0
- data/spec/models/pre_translation_spec.rb +73 -0
- data/spec/models/project_create_parameters_spec.rb +18 -0
- data/spec/models/project_details_spec.rb +6 -0
- data/spec/models/project_update_parameters_spec.rb +18 -0
- data/spec/models/upload_spec.rb +6 -0
- data/spec/response_spec.rb +53 -0
- metadata +313 -251
- 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
|
|
@@ -14,6 +14,12 @@ module Phrase
|
|
|
14
14
|
# Indicates whether the project should share the account's translation memory
|
|
15
15
|
attr_accessor :shares_translation_memory
|
|
16
16
|
|
|
17
|
+
# List of TMS translation memory IDs, used to provide reference translations for the AI translation agent.
|
|
18
|
+
attr_accessor :tm_ids
|
|
19
|
+
|
|
20
|
+
# List of TMS term base IDs, used to ensure consistent terminology for the AI translation agent.
|
|
21
|
+
attr_accessor :term_base_ids
|
|
22
|
+
|
|
17
23
|
# Image to identify the project
|
|
18
24
|
attr_accessor :project_image
|
|
19
25
|
|
|
@@ -74,6 +80,9 @@ module Phrase
|
|
|
74
80
|
# (Optional) Requires autotranslate_enabled to be true
|
|
75
81
|
attr_accessor :autotranslate_overwrite_unverified_translations
|
|
76
82
|
|
|
83
|
+
# (Optional) When enabled, the fallback locale's translation is used on export for unverified translations in addition to empty ones. Requires a fallback locale to be configured on the locale.
|
|
84
|
+
attr_accessor :fallback_for_unverified_translations
|
|
85
|
+
|
|
77
86
|
# (Optional) Enable autocomplete-job behavior so that newly created keys and locales are automatically added to in-progress jobs.
|
|
78
87
|
attr_accessor :autocomplete_job_enabled
|
|
79
88
|
|
|
@@ -130,6 +139,8 @@ module Phrase
|
|
|
130
139
|
:'main_format' => :'main_format',
|
|
131
140
|
:'media' => :'media',
|
|
132
141
|
:'shares_translation_memory' => :'shares_translation_memory',
|
|
142
|
+
:'tm_ids' => :'tm_ids',
|
|
143
|
+
:'term_base_ids' => :'term_base_ids',
|
|
133
144
|
:'project_image' => :'project_image',
|
|
134
145
|
:'remove_project_image' => :'remove_project_image',
|
|
135
146
|
:'account_id' => :'account_id',
|
|
@@ -150,6 +161,7 @@ module Phrase
|
|
|
150
161
|
:'autotranslate_use_machine_translation' => :'autotranslate_use_machine_translation',
|
|
151
162
|
:'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory',
|
|
152
163
|
:'autotranslate_overwrite_unverified_translations' => :'autotranslate_overwrite_unverified_translations',
|
|
164
|
+
:'fallback_for_unverified_translations' => :'fallback_for_unverified_translations',
|
|
153
165
|
:'autocomplete_job_enabled' => :'autocomplete_job_enabled',
|
|
154
166
|
:'job_locking_enabled' => :'job_locking_enabled',
|
|
155
167
|
:'smart_suggest_enabled' => :'smart_suggest_enabled',
|
|
@@ -169,6 +181,8 @@ module Phrase
|
|
|
169
181
|
:'main_format' => :'String',
|
|
170
182
|
:'media' => :'String',
|
|
171
183
|
:'shares_translation_memory' => :'Boolean',
|
|
184
|
+
:'tm_ids' => :'Array<String>',
|
|
185
|
+
:'term_base_ids' => :'Array<String>',
|
|
172
186
|
:'project_image' => :'File',
|
|
173
187
|
:'remove_project_image' => :'Boolean',
|
|
174
188
|
:'account_id' => :'String',
|
|
@@ -189,6 +203,7 @@ module Phrase
|
|
|
189
203
|
:'autotranslate_use_machine_translation' => :'Boolean',
|
|
190
204
|
:'autotranslate_use_translation_memory' => :'Boolean',
|
|
191
205
|
:'autotranslate_overwrite_unverified_translations' => :'Boolean',
|
|
206
|
+
:'fallback_for_unverified_translations' => :'Boolean',
|
|
192
207
|
:'autocomplete_job_enabled' => :'Boolean',
|
|
193
208
|
:'job_locking_enabled' => :'Boolean',
|
|
194
209
|
:'smart_suggest_enabled' => :'Boolean',
|
|
@@ -238,6 +253,18 @@ module Phrase
|
|
|
238
253
|
self.shares_translation_memory = attributes[:'shares_translation_memory']
|
|
239
254
|
end
|
|
240
255
|
|
|
256
|
+
if attributes.key?(:'tm_ids')
|
|
257
|
+
if (value = attributes[:'tm_ids']).is_a?(Array)
|
|
258
|
+
self.tm_ids = value
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if attributes.key?(:'term_base_ids')
|
|
263
|
+
if (value = attributes[:'term_base_ids']).is_a?(Array)
|
|
264
|
+
self.term_base_ids = value
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
241
268
|
if attributes.key?(:'project_image')
|
|
242
269
|
self.project_image = attributes[:'project_image']
|
|
243
270
|
end
|
|
@@ -318,6 +345,10 @@ module Phrase
|
|
|
318
345
|
self.autotranslate_overwrite_unverified_translations = attributes[:'autotranslate_overwrite_unverified_translations']
|
|
319
346
|
end
|
|
320
347
|
|
|
348
|
+
if attributes.key?(:'fallback_for_unverified_translations')
|
|
349
|
+
self.fallback_for_unverified_translations = attributes[:'fallback_for_unverified_translations']
|
|
350
|
+
end
|
|
351
|
+
|
|
321
352
|
if attributes.key?(:'autocomplete_job_enabled')
|
|
322
353
|
self.autocomplete_job_enabled = attributes[:'autocomplete_job_enabled']
|
|
323
354
|
end
|
|
@@ -396,6 +427,8 @@ module Phrase
|
|
|
396
427
|
main_format == o.main_format &&
|
|
397
428
|
media == o.media &&
|
|
398
429
|
shares_translation_memory == o.shares_translation_memory &&
|
|
430
|
+
tm_ids == o.tm_ids &&
|
|
431
|
+
term_base_ids == o.term_base_ids &&
|
|
399
432
|
project_image == o.project_image &&
|
|
400
433
|
remove_project_image == o.remove_project_image &&
|
|
401
434
|
account_id == o.account_id &&
|
|
@@ -416,6 +449,7 @@ module Phrase
|
|
|
416
449
|
autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
|
|
417
450
|
autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
|
|
418
451
|
autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
|
|
452
|
+
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
419
453
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
420
454
|
job_locking_enabled == o.job_locking_enabled &&
|
|
421
455
|
smart_suggest_enabled == o.smart_suggest_enabled &&
|
|
@@ -436,7 +470,7 @@ module Phrase
|
|
|
436
470
|
# Calculates hash code according to all attributes.
|
|
437
471
|
# @return [Integer] Hash code
|
|
438
472
|
def hash
|
|
439
|
-
[name, main_format, media, shares_translation_memory, project_image, remove_project_image, account_id, point_of_contact, source_project_id, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, autocomplete_job_enabled, job_locking_enabled, smart_suggest_enabled, smart_suggest_use_glossary, smart_suggest_use_machine_translation, translation_keys_sort_collation, default_encoding, cldr_version, placeholder_styles].hash
|
|
473
|
+
[name, main_format, media, shares_translation_memory, tm_ids, term_base_ids, project_image, remove_project_image, account_id, point_of_contact, source_project_id, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, fallback_for_unverified_translations, autocomplete_job_enabled, job_locking_enabled, smart_suggest_enabled, smart_suggest_use_glossary, smart_suggest_use_machine_translation, translation_keys_sort_collation, default_encoding, cldr_version, placeholder_styles].hash
|
|
440
474
|
end
|
|
441
475
|
|
|
442
476
|
# Builds the object from hash
|
|
@@ -54,6 +54,8 @@ module Phrase
|
|
|
54
54
|
|
|
55
55
|
attr_accessor :autotranslate_overwrite_unverified_translations
|
|
56
56
|
|
|
57
|
+
attr_accessor :fallback_for_unverified_translations
|
|
58
|
+
|
|
57
59
|
attr_accessor :autocomplete_job_enabled
|
|
58
60
|
|
|
59
61
|
attr_accessor :default_encoding
|
|
@@ -95,6 +97,7 @@ module Phrase
|
|
|
95
97
|
:'autotranslate_use_machine_translation' => :'autotranslate_use_machine_translation',
|
|
96
98
|
:'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory',
|
|
97
99
|
:'autotranslate_overwrite_unverified_translations' => :'autotranslate_overwrite_unverified_translations',
|
|
100
|
+
:'fallback_for_unverified_translations' => :'fallback_for_unverified_translations',
|
|
98
101
|
:'autocomplete_job_enabled' => :'autocomplete_job_enabled',
|
|
99
102
|
:'default_encoding' => :'default_encoding',
|
|
100
103
|
:'cldr_version' => :'cldr_version',
|
|
@@ -133,6 +136,7 @@ module Phrase
|
|
|
133
136
|
:'autotranslate_use_machine_translation' => :'Boolean',
|
|
134
137
|
:'autotranslate_use_translation_memory' => :'Boolean',
|
|
135
138
|
:'autotranslate_overwrite_unverified_translations' => :'Boolean',
|
|
139
|
+
:'fallback_for_unverified_translations' => :'Boolean',
|
|
136
140
|
:'autocomplete_job_enabled' => :'Boolean',
|
|
137
141
|
:'default_encoding' => :'String',
|
|
138
142
|
:'cldr_version' => :'String',
|
|
@@ -274,6 +278,10 @@ module Phrase
|
|
|
274
278
|
self.autotranslate_overwrite_unverified_translations = attributes[:'autotranslate_overwrite_unverified_translations']
|
|
275
279
|
end
|
|
276
280
|
|
|
281
|
+
if attributes.key?(:'fallback_for_unverified_translations')
|
|
282
|
+
self.fallback_for_unverified_translations = attributes[:'fallback_for_unverified_translations']
|
|
283
|
+
end
|
|
284
|
+
|
|
277
285
|
if attributes.key?(:'autocomplete_job_enabled')
|
|
278
286
|
self.autocomplete_job_enabled = attributes[:'autocomplete_job_enabled']
|
|
279
287
|
end
|
|
@@ -345,6 +353,7 @@ module Phrase
|
|
|
345
353
|
autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
|
|
346
354
|
autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
|
|
347
355
|
autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
|
|
356
|
+
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
348
357
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
349
358
|
default_encoding == o.default_encoding &&
|
|
350
359
|
cldr_version == o.cldr_version &&
|
|
@@ -362,7 +371,7 @@ module Phrase
|
|
|
362
371
|
# Calculates hash code according to all attributes.
|
|
363
372
|
# @return [Integer] Hash code
|
|
364
373
|
def hash
|
|
365
|
-
[id, name, slug, main_format, project_image_url, media, account, space, point_of_contact, created_at, updated_at, shares_translation_memory, machine_translation_enabled, zero_plural_form_enabled, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, enable_branching, protect_master_branch, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, autocomplete_job_enabled, default_encoding, cldr_version, job_locking_enabled, placeholder_styles, branch].hash
|
|
374
|
+
[id, name, slug, main_format, project_image_url, media, account, space, point_of_contact, created_at, updated_at, shares_translation_memory, machine_translation_enabled, zero_plural_form_enabled, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, enable_branching, protect_master_branch, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, fallback_for_unverified_translations, autocomplete_job_enabled, default_encoding, cldr_version, job_locking_enabled, placeholder_styles, branch].hash
|
|
366
375
|
end
|
|
367
376
|
|
|
368
377
|
# Builds the object from hash
|
|
@@ -20,6 +20,12 @@ module Phrase
|
|
|
20
20
|
# (Optional) Indicates whether the project should share the account's translation memory
|
|
21
21
|
attr_accessor :shares_translation_memory
|
|
22
22
|
|
|
23
|
+
# List of TMS translation memory IDs, used to provide reference translations for the AI translation agent.
|
|
24
|
+
attr_accessor :tm_ids
|
|
25
|
+
|
|
26
|
+
# List of TMS term base IDs, used to ensure consistent terminology for the AI translation agent.
|
|
27
|
+
attr_accessor :term_base_ids
|
|
28
|
+
|
|
23
29
|
# (Optional) Image to identify the project
|
|
24
30
|
attr_accessor :project_image
|
|
25
31
|
|
|
@@ -71,6 +77,9 @@ module Phrase
|
|
|
71
77
|
# (Optional) Requires autotranslate_enabled to be true
|
|
72
78
|
attr_accessor :autotranslate_overwrite_unverified_translations
|
|
73
79
|
|
|
80
|
+
# (Optional) When enabled, the fallback locale's translation is used on export for unverified translations in addition to empty ones. Requires a fallback locale to be configured on the locale.
|
|
81
|
+
attr_accessor :fallback_for_unverified_translations
|
|
82
|
+
|
|
74
83
|
# (Optional) Sets the default encoding for Uploads. If you leave it empty, we will try to guess it automatically for you when you Upload a file. You can still override this value by setting the [`file_encoding`](/en/api/strings/uploads/upload-a-new-file) parameter for Uploads.
|
|
75
84
|
attr_accessor :default_encoding
|
|
76
85
|
|
|
@@ -129,6 +138,8 @@ module Phrase
|
|
|
129
138
|
:'main_format' => :'main_format',
|
|
130
139
|
:'media' => :'media',
|
|
131
140
|
:'shares_translation_memory' => :'shares_translation_memory',
|
|
141
|
+
:'tm_ids' => :'tm_ids',
|
|
142
|
+
:'term_base_ids' => :'term_base_ids',
|
|
132
143
|
:'project_image' => :'project_image',
|
|
133
144
|
:'remove_project_image' => :'remove_project_image',
|
|
134
145
|
:'workflow' => :'workflow',
|
|
@@ -146,6 +157,7 @@ module Phrase
|
|
|
146
157
|
:'autotranslate_use_machine_translation' => :'autotranslate_use_machine_translation',
|
|
147
158
|
:'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory',
|
|
148
159
|
:'autotranslate_overwrite_unverified_translations' => :'autotranslate_overwrite_unverified_translations',
|
|
160
|
+
:'fallback_for_unverified_translations' => :'fallback_for_unverified_translations',
|
|
149
161
|
:'default_encoding' => :'default_encoding',
|
|
150
162
|
:'placeholder_styles' => :'placeholder_styles',
|
|
151
163
|
:'autocomplete_job_enabled' => :'autocomplete_job_enabled',
|
|
@@ -167,6 +179,8 @@ module Phrase
|
|
|
167
179
|
:'main_format' => :'String',
|
|
168
180
|
:'media' => :'String',
|
|
169
181
|
:'shares_translation_memory' => :'Boolean',
|
|
182
|
+
:'tm_ids' => :'Array<String>',
|
|
183
|
+
:'term_base_ids' => :'Array<String>',
|
|
170
184
|
:'project_image' => :'File',
|
|
171
185
|
:'remove_project_image' => :'Boolean',
|
|
172
186
|
:'workflow' => :'String',
|
|
@@ -184,6 +198,7 @@ module Phrase
|
|
|
184
198
|
:'autotranslate_use_machine_translation' => :'Boolean',
|
|
185
199
|
:'autotranslate_use_translation_memory' => :'Boolean',
|
|
186
200
|
:'autotranslate_overwrite_unverified_translations' => :'Boolean',
|
|
201
|
+
:'fallback_for_unverified_translations' => :'Boolean',
|
|
187
202
|
:'default_encoding' => :'String',
|
|
188
203
|
:'placeholder_styles' => :'Array<String>',
|
|
189
204
|
:'autocomplete_job_enabled' => :'Boolean',
|
|
@@ -241,6 +256,18 @@ module Phrase
|
|
|
241
256
|
self.shares_translation_memory = attributes[:'shares_translation_memory']
|
|
242
257
|
end
|
|
243
258
|
|
|
259
|
+
if attributes.key?(:'tm_ids')
|
|
260
|
+
if (value = attributes[:'tm_ids']).is_a?(Array)
|
|
261
|
+
self.tm_ids = value
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'term_base_ids')
|
|
266
|
+
if (value = attributes[:'term_base_ids']).is_a?(Array)
|
|
267
|
+
self.term_base_ids = value
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
244
271
|
if attributes.key?(:'project_image')
|
|
245
272
|
self.project_image = attributes[:'project_image']
|
|
246
273
|
end
|
|
@@ -309,6 +336,10 @@ module Phrase
|
|
|
309
336
|
self.autotranslate_overwrite_unverified_translations = attributes[:'autotranslate_overwrite_unverified_translations']
|
|
310
337
|
end
|
|
311
338
|
|
|
339
|
+
if attributes.key?(:'fallback_for_unverified_translations')
|
|
340
|
+
self.fallback_for_unverified_translations = attributes[:'fallback_for_unverified_translations']
|
|
341
|
+
end
|
|
342
|
+
|
|
312
343
|
if attributes.key?(:'default_encoding')
|
|
313
344
|
self.default_encoding = attributes[:'default_encoding']
|
|
314
345
|
end
|
|
@@ -384,6 +415,8 @@ module Phrase
|
|
|
384
415
|
main_format == o.main_format &&
|
|
385
416
|
media == o.media &&
|
|
386
417
|
shares_translation_memory == o.shares_translation_memory &&
|
|
418
|
+
tm_ids == o.tm_ids &&
|
|
419
|
+
term_base_ids == o.term_base_ids &&
|
|
387
420
|
project_image == o.project_image &&
|
|
388
421
|
remove_project_image == o.remove_project_image &&
|
|
389
422
|
workflow == o.workflow &&
|
|
@@ -401,6 +434,7 @@ module Phrase
|
|
|
401
434
|
autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
|
|
402
435
|
autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
|
|
403
436
|
autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
|
|
437
|
+
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
404
438
|
default_encoding == o.default_encoding &&
|
|
405
439
|
placeholder_styles == o.placeholder_styles &&
|
|
406
440
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
@@ -421,7 +455,7 @@ module Phrase
|
|
|
421
455
|
# Calculates hash code according to all attributes.
|
|
422
456
|
# @return [Integer] Hash code
|
|
423
457
|
def hash
|
|
424
|
-
[account_id, name, point_of_contact, main_format, media, shares_translation_memory, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, default_encoding, placeholder_styles, autocomplete_job_enabled, job_locking_enabled, smart_suggest_enabled, smart_suggest_use_glossary, smart_suggest_use_machine_translation, translation_keys_sort_collation, cldr_version].hash
|
|
458
|
+
[account_id, name, point_of_contact, main_format, media, shares_translation_memory, tm_ids, term_base_ids, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, fallback_for_unverified_translations, default_encoding, placeholder_styles, autocomplete_job_enabled, job_locking_enabled, smart_suggest_enabled, smart_suggest_use_glossary, smart_suggest_use_machine_translation, translation_keys_sort_collation, cldr_version].hash
|
|
425
459
|
end
|
|
426
460
|
|
|
427
461
|
# Builds the object from hash
|
data/lib/phrase/models/upload.rb
CHANGED
|
@@ -8,8 +8,12 @@ module Phrase
|
|
|
8
8
|
|
|
9
9
|
attr_accessor :format
|
|
10
10
|
|
|
11
|
+
# Processing state of the upload: `initialized`, `processing`, `success`, or `error`. `error` means processing failed — for example the file could not be parsed, or a provided `file_format` didn't match the file's actual content. Poll this field until it leaves `initialized`/`processing` to get the final outcome.
|
|
11
12
|
attr_accessor :state
|
|
12
13
|
|
|
14
|
+
# A user-facing message explaining why the upload failed, or `null` if the upload did not fail. This message is intended for display only. Its wording may change at any time and it should not be parsed or relied upon programmatically.
|
|
15
|
+
attr_accessor :error_message
|
|
16
|
+
|
|
13
17
|
# Unique tag of the upload
|
|
14
18
|
attr_accessor :tag
|
|
15
19
|
|
|
@@ -34,6 +38,7 @@ module Phrase
|
|
|
34
38
|
:'filename' => :'filename',
|
|
35
39
|
:'format' => :'format',
|
|
36
40
|
:'state' => :'state',
|
|
41
|
+
:'error_message' => :'error_message',
|
|
37
42
|
:'tag' => :'tag',
|
|
38
43
|
:'tags' => :'tags',
|
|
39
44
|
:'url' => :'url',
|
|
@@ -51,6 +56,7 @@ module Phrase
|
|
|
51
56
|
:'filename' => :'String',
|
|
52
57
|
:'format' => :'String',
|
|
53
58
|
:'state' => :'String',
|
|
59
|
+
:'error_message' => :'String',
|
|
54
60
|
:'tag' => :'String',
|
|
55
61
|
:'tags' => :'Array<String>',
|
|
56
62
|
:'url' => :'String',
|
|
@@ -64,6 +70,7 @@ module Phrase
|
|
|
64
70
|
# List of attributes with nullable: true
|
|
65
71
|
def self.openapi_nullable
|
|
66
72
|
Set.new([
|
|
73
|
+
:'error_message',
|
|
67
74
|
])
|
|
68
75
|
end
|
|
69
76
|
|
|
@@ -98,6 +105,10 @@ module Phrase
|
|
|
98
105
|
self.state = attributes[:'state']
|
|
99
106
|
end
|
|
100
107
|
|
|
108
|
+
if attributes.key?(:'error_message')
|
|
109
|
+
self.error_message = attributes[:'error_message']
|
|
110
|
+
end
|
|
111
|
+
|
|
101
112
|
if attributes.key?(:'tag')
|
|
102
113
|
self.tag = attributes[:'tag']
|
|
103
114
|
end
|
|
@@ -151,6 +162,7 @@ module Phrase
|
|
|
151
162
|
filename == o.filename &&
|
|
152
163
|
format == o.format &&
|
|
153
164
|
state == o.state &&
|
|
165
|
+
error_message == o.error_message &&
|
|
154
166
|
tag == o.tag &&
|
|
155
167
|
tags == o.tags &&
|
|
156
168
|
url == o.url &&
|
|
@@ -169,7 +181,7 @@ module Phrase
|
|
|
169
181
|
# Calculates hash code according to all attributes.
|
|
170
182
|
# @return [Integer] Hash code
|
|
171
183
|
def hash
|
|
172
|
-
[id, filename, format, state, tag, tags, url, user, summary, created_at, updated_at].hash
|
|
184
|
+
[id, filename, format, state, error_message, tag, tags, url, user, summary, created_at, updated_at].hash
|
|
173
185
|
end
|
|
174
186
|
|
|
175
187
|
# Builds the object from hash
|
data/lib/phrase/response.rb
CHANGED
|
@@ -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,
|
|
14
|
-
next_page_link = parsed_links[
|
|
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
|
data/lib/phrase/version.rb
CHANGED