phrase 4.26.0 → 4.28.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 +18 -0
- data/README.md +14 -3
- data/docs/CheckIssue.md +33 -0
- data/docs/ChecksApi.md +146 -0
- data/docs/JobCreateParameters.md +1 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- 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/MemberUpdateParameters.md +2 -2
- data/docs/MembersApi.md +1 -1
- data/docs/ProjectCreateParameters.md +9 -3
- data/docs/ProjectDetails.md +5 -1
- data/docs/ProjectUpdateParameters.md +9 -3
- data/docs/ProjectsApi.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/SpacesApi.md +3 -1
- data/docs/Upload.md +3 -1
- data/docs/UploadsApi.md +4 -4
- data/lib/phrase/api/checks_api.rb +174 -0
- data/lib/phrase/api/machine_translation_api.rb +302 -0
- data/lib/phrase/api/members_api.rb +2 -2
- data/lib/phrase/api/projects_api.rb +2 -2
- data/lib/phrase/api/spaces_api.rb +3 -0
- data/lib/phrase/api/uploads_api.rb +6 -6
- data/lib/phrase/models/check_issue.rb +319 -0
- data/lib/phrase/models/job_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/member_update_parameters.rb +2 -2
- data/lib/phrase/models/project_create_parameters.rb +48 -2
- data/lib/phrase/models/project_details.rb +53 -1
- data/lib/phrase/models/project_update_parameters.rb +48 -2
- data/lib/phrase/models/upload.rb +13 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +7 -0
- data/spec/api/checks_api_spec.rb +56 -0
- data/spec/api/machine_translation_api_spec.rb +79 -0
- data/spec/api/members_api_spec.rb +1 -1
- data/spec/api/projects_api_spec.rb +1 -1
- data/spec/api/spaces_api_spec.rb +1 -0
- data/spec/models/check_issue_spec.rb +85 -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/project_create_parameters_spec.rb +22 -0
- data/spec/models/project_details_spec.rb +16 -0
- data/spec/models/project_update_parameters_spec.rb +22 -0
- data/spec/models/upload_spec.rb +6 -0
- metadata +292 -264
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
require 'date'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class MachineTranslationSettingsUpdateParameters
|
|
5
|
+
# The machine translation engine to use as the account default. Supported values: language_ai_translate, aita_translate, microsoft_translate, google_translate, amazon_translate. Pass null or an empty string to reset to the plan default.
|
|
6
|
+
attr_accessor :default_service
|
|
7
|
+
|
|
8
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
9
|
+
def self.attribute_map
|
|
10
|
+
{
|
|
11
|
+
:'default_service' => :'default_service'
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Attribute type mapping.
|
|
16
|
+
def self.openapi_types
|
|
17
|
+
{
|
|
18
|
+
:'default_service' => :'String'
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# List of attributes with nullable: true
|
|
23
|
+
def self.openapi_nullable
|
|
24
|
+
Set.new([
|
|
25
|
+
:'default_service'
|
|
26
|
+
])
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Initializes the object
|
|
30
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
31
|
+
def initialize(attributes = {})
|
|
32
|
+
if (!attributes.is_a?(Hash))
|
|
33
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::MachineTranslationSettingsUpdateParameters` initialize method"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
37
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
38
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
39
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::MachineTranslationSettingsUpdateParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
40
|
+
end
|
|
41
|
+
h[k.to_sym] = v
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if attributes.key?(:'default_service')
|
|
45
|
+
self.default_service = attributes[:'default_service']
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
50
|
+
# @return Array for valid properties with the reasons
|
|
51
|
+
def list_invalid_properties
|
|
52
|
+
invalid_properties = Array.new
|
|
53
|
+
invalid_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Check to see if the all the properties in the model are valid
|
|
57
|
+
# @return true if the model is valid
|
|
58
|
+
def valid?
|
|
59
|
+
true
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Checks equality by comparing each attribute.
|
|
63
|
+
# @param [Object] Object to be compared
|
|
64
|
+
def ==(o)
|
|
65
|
+
return true if self.equal?(o)
|
|
66
|
+
self.class == o.class &&
|
|
67
|
+
default_service == o.default_service
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @see the `==` method
|
|
71
|
+
# @param [Object] Object to be compared
|
|
72
|
+
def eql?(o)
|
|
73
|
+
self == o
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Calculates hash code according to all attributes.
|
|
77
|
+
# @return [Integer] Hash code
|
|
78
|
+
def hash
|
|
79
|
+
[default_service].hash
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Builds the object from hash
|
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
84
|
+
# @return [Object] Returns the model itself
|
|
85
|
+
def self.build_from_hash(attributes)
|
|
86
|
+
new.build_from_hash(attributes)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Builds the object from hash
|
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
91
|
+
# @return [Object] Returns the model itself
|
|
92
|
+
def build_from_hash(attributes)
|
|
93
|
+
return nil unless attributes.is_a?(Hash)
|
|
94
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
95
|
+
if type =~ /\AArray<(.*)>/i
|
|
96
|
+
# check to ensure the input is an array given that the attribute
|
|
97
|
+
# is documented as an array but the input is not
|
|
98
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
99
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
100
|
+
end
|
|
101
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
102
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
103
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
self
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Deserializes the data based on type
|
|
110
|
+
# @param string type Data type
|
|
111
|
+
# @param string value Value to be deserialized
|
|
112
|
+
# @return [Object] Deserialized data
|
|
113
|
+
def _deserialize(type, value)
|
|
114
|
+
case type.to_sym
|
|
115
|
+
when :DateTime
|
|
116
|
+
DateTime.parse(value)
|
|
117
|
+
when :Date
|
|
118
|
+
Date.parse(value)
|
|
119
|
+
when :Time
|
|
120
|
+
Time.parse(value)
|
|
121
|
+
when :String
|
|
122
|
+
value.to_s
|
|
123
|
+
when :Integer
|
|
124
|
+
value.to_i
|
|
125
|
+
when :Float
|
|
126
|
+
value.to_f
|
|
127
|
+
when :Boolean
|
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
129
|
+
true
|
|
130
|
+
else
|
|
131
|
+
false
|
|
132
|
+
end
|
|
133
|
+
when :Object
|
|
134
|
+
# generic object (usually a Hash), return directly
|
|
135
|
+
value
|
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
|
142
|
+
{}.tap do |hash|
|
|
143
|
+
value.each do |k, v|
|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
else # model
|
|
148
|
+
Phrase.const_get(type).build_from_hash(value)
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Returns the string representation of the object
|
|
153
|
+
# @return [String] String presentation of the object
|
|
154
|
+
def to_s
|
|
155
|
+
to_hash.to_s
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
|
160
|
+
def to_body
|
|
161
|
+
to_hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Returns the object in the form of hash
|
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
|
166
|
+
def to_hash
|
|
167
|
+
hash = {}
|
|
168
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
169
|
+
value = self.send(attr)
|
|
170
|
+
if value.nil?
|
|
171
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
172
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
hash[param] = _to_hash(value)
|
|
176
|
+
end
|
|
177
|
+
hash
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Outputs non-array value in the form of hash
|
|
181
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
182
|
+
# @param [Object] value Any valid value
|
|
183
|
+
# @return [Hash] Returns the value in the form of hash
|
|
184
|
+
def _to_hash(value)
|
|
185
|
+
if value.is_a?(Array)
|
|
186
|
+
value.compact.map { |v| _to_hash(v) }
|
|
187
|
+
elsif value.is_a?(Hash)
|
|
188
|
+
{}.tap do |hash|
|
|
189
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
190
|
+
end
|
|
191
|
+
elsif value.respond_to? :to_hash
|
|
192
|
+
value.to_hash
|
|
193
|
+
else
|
|
194
|
+
value
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
@@ -11,10 +11,10 @@ module Phrase
|
|
|
11
11
|
# List of project ids the user has access to.
|
|
12
12
|
attr_accessor :project_ids
|
|
13
13
|
|
|
14
|
-
# List of locale ids the user has access to.
|
|
14
|
+
# List of locale ids the user has access to. This is project-scoped and must be paired with `project_ids` (and `strategy`) to take effect; it does not grant account-wide language access.
|
|
15
15
|
attr_accessor :locale_ids
|
|
16
16
|
|
|
17
|
-
# List of default locales for the user.
|
|
17
|
+
# List of default locales for the user, applied across all of the user's projects. This is the account-level field corresponding to \"Language access\" in the translator profile UI.
|
|
18
18
|
attr_accessor :default_locale_codes
|
|
19
19
|
|
|
20
20
|
# List of spaces the user is assigned to.
|
|
@@ -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
|
|
|
@@ -95,7 +104,7 @@ module Phrase
|
|
|
95
104
|
# (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.
|
|
96
105
|
attr_accessor :default_encoding
|
|
97
106
|
|
|
98
|
-
# (Optional) CLDR plural-rule version used by the project.
|
|
107
|
+
# (Optional) CLDR plural-rule version used by the project. Pass `legacy` for pre-CLDR pluralization behaviour, or a CLDR version string such as `cldr48`. Also used as the default version for the ICU skeleton endpoint (`POST /icu/skeleton`) when its own `cldr_version` parameter is omitted.
|
|
99
108
|
attr_accessor :cldr_version
|
|
100
109
|
|
|
101
110
|
# (Optional) List of placeholder styles enabled for the project.
|
|
@@ -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
|
|
@@ -372,11 +403,23 @@ module Phrase
|
|
|
372
403
|
# @return true if the model is valid
|
|
373
404
|
def valid?
|
|
374
405
|
return false if @name.nil?
|
|
406
|
+
translation_keys_sort_collation_validator = EnumAttributeValidator.new('String', ["general_ci", "unicode_ci"])
|
|
407
|
+
return false unless translation_keys_sort_collation_validator.valid?(@translation_keys_sort_collation)
|
|
375
408
|
default_encoding_validator = EnumAttributeValidator.new('String', ["UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "ISO-8859-1"])
|
|
376
409
|
return false unless default_encoding_validator.valid?(@default_encoding)
|
|
377
410
|
true
|
|
378
411
|
end
|
|
379
412
|
|
|
413
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
414
|
+
# @param [Object] translation_keys_sort_collation Object to be assigned
|
|
415
|
+
def translation_keys_sort_collation=(translation_keys_sort_collation)
|
|
416
|
+
validator = EnumAttributeValidator.new('String', ["general_ci", "unicode_ci"])
|
|
417
|
+
unless validator.valid?(translation_keys_sort_collation)
|
|
418
|
+
fail ArgumentError, "invalid value for \"translation_keys_sort_collation\", must be one of #{validator.allowable_values}."
|
|
419
|
+
end
|
|
420
|
+
@translation_keys_sort_collation = translation_keys_sort_collation
|
|
421
|
+
end
|
|
422
|
+
|
|
380
423
|
# Custom attribute writer method checking allowed values (enum).
|
|
381
424
|
# @param [Object] default_encoding Object to be assigned
|
|
382
425
|
def default_encoding=(default_encoding)
|
|
@@ -396,6 +439,8 @@ module Phrase
|
|
|
396
439
|
main_format == o.main_format &&
|
|
397
440
|
media == o.media &&
|
|
398
441
|
shares_translation_memory == o.shares_translation_memory &&
|
|
442
|
+
tm_ids == o.tm_ids &&
|
|
443
|
+
term_base_ids == o.term_base_ids &&
|
|
399
444
|
project_image == o.project_image &&
|
|
400
445
|
remove_project_image == o.remove_project_image &&
|
|
401
446
|
account_id == o.account_id &&
|
|
@@ -416,6 +461,7 @@ module Phrase
|
|
|
416
461
|
autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
|
|
417
462
|
autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
|
|
418
463
|
autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
|
|
464
|
+
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
419
465
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
420
466
|
job_locking_enabled == o.job_locking_enabled &&
|
|
421
467
|
smart_suggest_enabled == o.smart_suggest_enabled &&
|
|
@@ -436,7 +482,7 @@ module Phrase
|
|
|
436
482
|
# Calculates hash code according to all attributes.
|
|
437
483
|
# @return [Integer] Hash code
|
|
438
484
|
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
|
|
485
|
+
[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
486
|
end
|
|
441
487
|
|
|
442
488
|
# Builds the object from hash
|
|
@@ -54,18 +54,44 @@ 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
|
|
60
62
|
|
|
61
63
|
attr_accessor :cldr_version
|
|
62
64
|
|
|
65
|
+
attr_accessor :translation_keys_sort_collation
|
|
66
|
+
|
|
63
67
|
attr_accessor :job_locking_enabled
|
|
64
68
|
|
|
65
69
|
attr_accessor :placeholder_styles
|
|
66
70
|
|
|
67
71
|
attr_accessor :branch
|
|
68
72
|
|
|
73
|
+
class EnumAttributeValidator
|
|
74
|
+
attr_reader :datatype
|
|
75
|
+
attr_reader :allowable_values
|
|
76
|
+
|
|
77
|
+
def initialize(datatype, allowable_values)
|
|
78
|
+
@allowable_values = allowable_values.map do |value|
|
|
79
|
+
case datatype.to_s
|
|
80
|
+
when /Integer/i
|
|
81
|
+
value.to_i
|
|
82
|
+
when /Float/i
|
|
83
|
+
value.to_f
|
|
84
|
+
else
|
|
85
|
+
value
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def valid?(value)
|
|
91
|
+
!value || allowable_values.include?(value)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
69
95
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
70
96
|
def self.attribute_map
|
|
71
97
|
{
|
|
@@ -95,9 +121,11 @@ module Phrase
|
|
|
95
121
|
:'autotranslate_use_machine_translation' => :'autotranslate_use_machine_translation',
|
|
96
122
|
:'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory',
|
|
97
123
|
:'autotranslate_overwrite_unverified_translations' => :'autotranslate_overwrite_unverified_translations',
|
|
124
|
+
:'fallback_for_unverified_translations' => :'fallback_for_unverified_translations',
|
|
98
125
|
:'autocomplete_job_enabled' => :'autocomplete_job_enabled',
|
|
99
126
|
:'default_encoding' => :'default_encoding',
|
|
100
127
|
:'cldr_version' => :'cldr_version',
|
|
128
|
+
:'translation_keys_sort_collation' => :'translation_keys_sort_collation',
|
|
101
129
|
:'job_locking_enabled' => :'job_locking_enabled',
|
|
102
130
|
:'placeholder_styles' => :'placeholder_styles',
|
|
103
131
|
:'branch' => :'branch'
|
|
@@ -133,9 +161,11 @@ module Phrase
|
|
|
133
161
|
:'autotranslate_use_machine_translation' => :'Boolean',
|
|
134
162
|
:'autotranslate_use_translation_memory' => :'Boolean',
|
|
135
163
|
:'autotranslate_overwrite_unverified_translations' => :'Boolean',
|
|
164
|
+
:'fallback_for_unverified_translations' => :'Boolean',
|
|
136
165
|
:'autocomplete_job_enabled' => :'Boolean',
|
|
137
166
|
:'default_encoding' => :'String',
|
|
138
167
|
:'cldr_version' => :'String',
|
|
168
|
+
:'translation_keys_sort_collation' => :'String',
|
|
139
169
|
:'job_locking_enabled' => :'Boolean',
|
|
140
170
|
:'placeholder_styles' => :'Array<String>',
|
|
141
171
|
:'branch' => :'Branch'
|
|
@@ -274,6 +304,10 @@ module Phrase
|
|
|
274
304
|
self.autotranslate_overwrite_unverified_translations = attributes[:'autotranslate_overwrite_unverified_translations']
|
|
275
305
|
end
|
|
276
306
|
|
|
307
|
+
if attributes.key?(:'fallback_for_unverified_translations')
|
|
308
|
+
self.fallback_for_unverified_translations = attributes[:'fallback_for_unverified_translations']
|
|
309
|
+
end
|
|
310
|
+
|
|
277
311
|
if attributes.key?(:'autocomplete_job_enabled')
|
|
278
312
|
self.autocomplete_job_enabled = attributes[:'autocomplete_job_enabled']
|
|
279
313
|
end
|
|
@@ -286,6 +320,10 @@ module Phrase
|
|
|
286
320
|
self.cldr_version = attributes[:'cldr_version']
|
|
287
321
|
end
|
|
288
322
|
|
|
323
|
+
if attributes.key?(:'translation_keys_sort_collation')
|
|
324
|
+
self.translation_keys_sort_collation = attributes[:'translation_keys_sort_collation']
|
|
325
|
+
end
|
|
326
|
+
|
|
289
327
|
if attributes.key?(:'job_locking_enabled')
|
|
290
328
|
self.job_locking_enabled = attributes[:'job_locking_enabled']
|
|
291
329
|
end
|
|
@@ -311,9 +349,21 @@ module Phrase
|
|
|
311
349
|
# Check to see if the all the properties in the model are valid
|
|
312
350
|
# @return true if the model is valid
|
|
313
351
|
def valid?
|
|
352
|
+
translation_keys_sort_collation_validator = EnumAttributeValidator.new('String', ["general_ci", "unicode_ci"])
|
|
353
|
+
return false unless translation_keys_sort_collation_validator.valid?(@translation_keys_sort_collation)
|
|
314
354
|
true
|
|
315
355
|
end
|
|
316
356
|
|
|
357
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
358
|
+
# @param [Object] translation_keys_sort_collation Object to be assigned
|
|
359
|
+
def translation_keys_sort_collation=(translation_keys_sort_collation)
|
|
360
|
+
validator = EnumAttributeValidator.new('String', ["general_ci", "unicode_ci"])
|
|
361
|
+
unless validator.valid?(translation_keys_sort_collation)
|
|
362
|
+
fail ArgumentError, "invalid value for \"translation_keys_sort_collation\", must be one of #{validator.allowable_values}."
|
|
363
|
+
end
|
|
364
|
+
@translation_keys_sort_collation = translation_keys_sort_collation
|
|
365
|
+
end
|
|
366
|
+
|
|
317
367
|
# Checks equality by comparing each attribute.
|
|
318
368
|
# @param [Object] Object to be compared
|
|
319
369
|
def ==(o)
|
|
@@ -345,9 +395,11 @@ module Phrase
|
|
|
345
395
|
autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
|
|
346
396
|
autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
|
|
347
397
|
autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
|
|
398
|
+
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
348
399
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
349
400
|
default_encoding == o.default_encoding &&
|
|
350
401
|
cldr_version == o.cldr_version &&
|
|
402
|
+
translation_keys_sort_collation == o.translation_keys_sort_collation &&
|
|
351
403
|
job_locking_enabled == o.job_locking_enabled &&
|
|
352
404
|
placeholder_styles == o.placeholder_styles &&
|
|
353
405
|
branch == o.branch
|
|
@@ -362,7 +414,7 @@ module Phrase
|
|
|
362
414
|
# Calculates hash code according to all attributes.
|
|
363
415
|
# @return [Integer] Hash code
|
|
364
416
|
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
|
|
417
|
+
[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, translation_keys_sort_collation, job_locking_enabled, placeholder_styles, branch].hash
|
|
366
418
|
end
|
|
367
419
|
|
|
368
420
|
# 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
|
|
|
@@ -95,7 +104,7 @@ module Phrase
|
|
|
95
104
|
# (Optional) Collation used when sorting translation keys alphabetically.
|
|
96
105
|
attr_accessor :translation_keys_sort_collation
|
|
97
106
|
|
|
98
|
-
# (Optional) CLDR plural-rule version used by the project.
|
|
107
|
+
# (Optional) CLDR plural-rule version used by the project. Pass `legacy` for pre-CLDR pluralization behaviour, or a CLDR version string such as `cldr48`. Also used as the default version for the ICU skeleton endpoint (`POST /icu/skeleton`) when its own `cldr_version` parameter is omitted.
|
|
99
108
|
attr_accessor :cldr_version
|
|
100
109
|
|
|
101
110
|
class EnumAttributeValidator
|
|
@@ -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
|
|
@@ -360,6 +391,8 @@ module Phrase
|
|
|
360
391
|
def valid?
|
|
361
392
|
default_encoding_validator = EnumAttributeValidator.new('String', ["UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "ISO-8859-1"])
|
|
362
393
|
return false unless default_encoding_validator.valid?(@default_encoding)
|
|
394
|
+
translation_keys_sort_collation_validator = EnumAttributeValidator.new('String', ["general_ci", "unicode_ci"])
|
|
395
|
+
return false unless translation_keys_sort_collation_validator.valid?(@translation_keys_sort_collation)
|
|
363
396
|
true
|
|
364
397
|
end
|
|
365
398
|
|
|
@@ -373,6 +406,16 @@ module Phrase
|
|
|
373
406
|
@default_encoding = default_encoding
|
|
374
407
|
end
|
|
375
408
|
|
|
409
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
410
|
+
# @param [Object] translation_keys_sort_collation Object to be assigned
|
|
411
|
+
def translation_keys_sort_collation=(translation_keys_sort_collation)
|
|
412
|
+
validator = EnumAttributeValidator.new('String', ["general_ci", "unicode_ci"])
|
|
413
|
+
unless validator.valid?(translation_keys_sort_collation)
|
|
414
|
+
fail ArgumentError, "invalid value for \"translation_keys_sort_collation\", must be one of #{validator.allowable_values}."
|
|
415
|
+
end
|
|
416
|
+
@translation_keys_sort_collation = translation_keys_sort_collation
|
|
417
|
+
end
|
|
418
|
+
|
|
376
419
|
# Checks equality by comparing each attribute.
|
|
377
420
|
# @param [Object] Object to be compared
|
|
378
421
|
def ==(o)
|
|
@@ -384,6 +427,8 @@ module Phrase
|
|
|
384
427
|
main_format == o.main_format &&
|
|
385
428
|
media == o.media &&
|
|
386
429
|
shares_translation_memory == o.shares_translation_memory &&
|
|
430
|
+
tm_ids == o.tm_ids &&
|
|
431
|
+
term_base_ids == o.term_base_ids &&
|
|
387
432
|
project_image == o.project_image &&
|
|
388
433
|
remove_project_image == o.remove_project_image &&
|
|
389
434
|
workflow == o.workflow &&
|
|
@@ -401,6 +446,7 @@ module Phrase
|
|
|
401
446
|
autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
|
|
402
447
|
autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
|
|
403
448
|
autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
|
|
449
|
+
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
404
450
|
default_encoding == o.default_encoding &&
|
|
405
451
|
placeholder_styles == o.placeholder_styles &&
|
|
406
452
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
@@ -421,7 +467,7 @@ module Phrase
|
|
|
421
467
|
# Calculates hash code according to all attributes.
|
|
422
468
|
# @return [Integer] Hash code
|
|
423
469
|
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
|
|
470
|
+
[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
471
|
end
|
|
426
472
|
|
|
427
473
|
# Builds the object from hash
|