phrase 4.27.0 → 4.29.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 +6 -3
- data/docs/JobTemplateCreateParameters.md +3 -1
- data/docs/JobTemplateUpdateParameters.md +3 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/MachineTranslationSettingsUpdateParameters.md +1 -1
- data/docs/MemberUpdateParameters.md +2 -2
- data/docs/MembersApi.md +71 -1
- data/docs/OrganizationJobTemplateCreateParameters.md +3 -1
- data/docs/OrganizationJobTemplateUpdateParameters.md +3 -1
- data/docs/ProjectCreateParameters.md +2 -2
- data/docs/ProjectDetails.md +2 -0
- data/docs/ProjectMember.md +27 -0
- data/docs/ProjectUpdateParameters.md +2 -2
- data/docs/ProjectsApi.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/SpacesApi.md +3 -1
- data/docs/SupportedLanguagesApi.md +62 -0
- data/lib/phrase/api/members_api.rb +80 -2
- data/lib/phrase/api/projects_api.rb +2 -2
- data/lib/phrase/api/spaces_api.rb +3 -0
- data/lib/phrase/api/supported_languages_api.rb +67 -0
- data/lib/phrase/models/job_template_create_parameters.rb +14 -4
- data/lib/phrase/models/job_template_update_parameters.rb +14 -4
- data/lib/phrase/models/machine_translation_settings_update_parameters.rb +1 -1
- data/lib/phrase/models/member_update_parameters.rb +2 -2
- data/lib/phrase/models/organization_job_template_create_parameters.rb +14 -4
- data/lib/phrase/models/organization_job_template_update_parameters.rb +14 -4
- data/lib/phrase/models/project_create_parameters.rb +13 -1
- data/lib/phrase/models/project_details.rb +44 -1
- data/lib/phrase/models/project_member.rb +241 -0
- data/lib/phrase/models/project_update_parameters.rb +13 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +2 -0
- data/spec/api/members_api_spec.rb +18 -1
- data/spec/api/projects_api_spec.rb +1 -1
- data/spec/api/spaces_api_spec.rb +1 -0
- data/spec/api/supported_languages_api_spec.rb +34 -0
- data/spec/models/job_template_create_parameters_spec.rb +6 -0
- data/spec/models/job_template_update_parameters_spec.rb +6 -0
- data/spec/models/organization_job_template_create_parameters_spec.rb +6 -0
- data/spec/models/organization_job_template_update_parameters_spec.rb +6 -0
- data/spec/models/project_create_parameters_spec.rb +4 -0
- data/spec/models/project_details_spec.rb +10 -0
- data/spec/models/project_member_spec.rb +59 -0
- data/spec/models/project_update_parameters_spec.rb +4 -0
- metadata +10 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class SupportedLanguagesApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# List supported languages
|
|
11
|
+
# Returns all languages/locale codes that Phrase Strings recognizes, mapped to their human-readable display name. This endpoint does not require authentication.
|
|
12
|
+
# @param [Hash] opts the optional parameters
|
|
13
|
+
# @return [Hash<String, String>]
|
|
14
|
+
def languages_list(opts = {})
|
|
15
|
+
data, _status_code, _headers = languages_list_with_http_info(opts)
|
|
16
|
+
data
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# List supported languages
|
|
20
|
+
# Returns all languages/locale codes that Phrase Strings recognizes, mapped to their human-readable display name. This endpoint does not require authentication.
|
|
21
|
+
# @param [Hash] opts the optional parameters
|
|
22
|
+
# @return [Array<(Response<(Hash<String, String>)>, Integer, Hash)>] Response<(Hash<String, String>)> data, response status code and response headers
|
|
23
|
+
def languages_list_with_http_info(opts = {})
|
|
24
|
+
if @api_client.config.debugging
|
|
25
|
+
@api_client.config.logger.debug 'Calling API: SupportedLanguagesApi.languages_list ...'
|
|
26
|
+
end
|
|
27
|
+
# resource path
|
|
28
|
+
local_var_path = '/languages'
|
|
29
|
+
|
|
30
|
+
# query parameters
|
|
31
|
+
query_params = opts[:query_params] || {}
|
|
32
|
+
|
|
33
|
+
# header parameters
|
|
34
|
+
header_params = opts[:header_params] || {}
|
|
35
|
+
# HTTP header 'Accept' (if needed)
|
|
36
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
37
|
+
|
|
38
|
+
# form parameters
|
|
39
|
+
form_params = opts[:form_params] || {}
|
|
40
|
+
|
|
41
|
+
# http body (model)
|
|
42
|
+
post_body = opts[:body]
|
|
43
|
+
|
|
44
|
+
# return_type
|
|
45
|
+
return_type = opts[:return_type] || 'Hash<String, String>'
|
|
46
|
+
|
|
47
|
+
# auth_names
|
|
48
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
49
|
+
|
|
50
|
+
new_options = opts.merge(
|
|
51
|
+
:header_params => header_params,
|
|
52
|
+
:query_params => query_params,
|
|
53
|
+
:form_params => form_params,
|
|
54
|
+
:body => post_body,
|
|
55
|
+
:auth_names => auth_names,
|
|
56
|
+
:return_type => return_type
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
60
|
+
if @api_client.config.debugging
|
|
61
|
+
@api_client.config.logger.debug "API called: SupportedLanguagesApi#languages_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
62
|
+
end
|
|
63
|
+
response = ::Phrase::Response.new(data, headers)
|
|
64
|
+
return response, status_code, headers
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -17,6 +17,9 @@ module Phrase
|
|
|
17
17
|
# The API id of the source language. This locale will be set as source locale for the job template. If not provided, the project default locale will be used.
|
|
18
18
|
attr_accessor :source_locale_id
|
|
19
19
|
|
|
20
|
+
# Code of the account member to set as the job template owner. The referenced user must also be a member of the project; passing the code of an account member who is not a project member returns a 404. When omitted or blank, no owner is pre-set; the user who creates a job from this template is assigned as owner at job-creation time.
|
|
21
|
+
attr_accessor :owner_id
|
|
22
|
+
|
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
24
|
def self.attribute_map
|
|
22
25
|
{
|
|
@@ -24,7 +27,8 @@ module Phrase
|
|
|
24
27
|
:'name' => :'name',
|
|
25
28
|
:'briefing' => :'briefing',
|
|
26
29
|
:'autotranslate' => :'autotranslate',
|
|
27
|
-
:'source_locale_id' => :'source_locale_id'
|
|
30
|
+
:'source_locale_id' => :'source_locale_id',
|
|
31
|
+
:'owner_id' => :'owner_id'
|
|
28
32
|
}
|
|
29
33
|
end
|
|
30
34
|
|
|
@@ -35,7 +39,8 @@ module Phrase
|
|
|
35
39
|
:'name' => :'String',
|
|
36
40
|
:'briefing' => :'String',
|
|
37
41
|
:'autotranslate' => :'Boolean',
|
|
38
|
-
:'source_locale_id' => :'String'
|
|
42
|
+
:'source_locale_id' => :'String',
|
|
43
|
+
:'owner_id' => :'String'
|
|
39
44
|
}
|
|
40
45
|
end
|
|
41
46
|
|
|
@@ -79,6 +84,10 @@ module Phrase
|
|
|
79
84
|
if attributes.key?(:'source_locale_id')
|
|
80
85
|
self.source_locale_id = attributes[:'source_locale_id']
|
|
81
86
|
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'owner_id')
|
|
89
|
+
self.owner_id = attributes[:'owner_id']
|
|
90
|
+
end
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -108,7 +117,8 @@ module Phrase
|
|
|
108
117
|
name == o.name &&
|
|
109
118
|
briefing == o.briefing &&
|
|
110
119
|
autotranslate == o.autotranslate &&
|
|
111
|
-
source_locale_id == o.source_locale_id
|
|
120
|
+
source_locale_id == o.source_locale_id &&
|
|
121
|
+
owner_id == o.owner_id
|
|
112
122
|
end
|
|
113
123
|
|
|
114
124
|
# @see the `==` method
|
|
@@ -120,7 +130,7 @@ module Phrase
|
|
|
120
130
|
# Calculates hash code according to all attributes.
|
|
121
131
|
# @return [Integer] Hash code
|
|
122
132
|
def hash
|
|
123
|
-
[branch, name, briefing, autotranslate, source_locale_id].hash
|
|
133
|
+
[branch, name, briefing, autotranslate, source_locale_id, owner_id].hash
|
|
124
134
|
end
|
|
125
135
|
|
|
126
136
|
# Builds the object from hash
|
|
@@ -17,6 +17,9 @@ module Phrase
|
|
|
17
17
|
# The API id of the source language. This locale will be set as source locale for the job template. If not provided, the project default locale will be used.
|
|
18
18
|
attr_accessor :source_locale_id
|
|
19
19
|
|
|
20
|
+
# Code of the account member to set as the job template owner. The referenced user must also be a member of the project; passing the code of an account member who is not a project member returns a 404. Pass an empty string to clear a previously set owner; when blank, jobs created from this template will default to assigning the job creator as owner.
|
|
21
|
+
attr_accessor :owner_id
|
|
22
|
+
|
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
24
|
def self.attribute_map
|
|
22
25
|
{
|
|
@@ -24,7 +27,8 @@ module Phrase
|
|
|
24
27
|
:'name' => :'name',
|
|
25
28
|
:'briefing' => :'briefing',
|
|
26
29
|
:'autotranslate' => :'autotranslate',
|
|
27
|
-
:'source_locale_id' => :'source_locale_id'
|
|
30
|
+
:'source_locale_id' => :'source_locale_id',
|
|
31
|
+
:'owner_id' => :'owner_id'
|
|
28
32
|
}
|
|
29
33
|
end
|
|
30
34
|
|
|
@@ -35,7 +39,8 @@ module Phrase
|
|
|
35
39
|
:'name' => :'String',
|
|
36
40
|
:'briefing' => :'String',
|
|
37
41
|
:'autotranslate' => :'Boolean',
|
|
38
|
-
:'source_locale_id' => :'String'
|
|
42
|
+
:'source_locale_id' => :'String',
|
|
43
|
+
:'owner_id' => :'String'
|
|
39
44
|
}
|
|
40
45
|
end
|
|
41
46
|
|
|
@@ -79,6 +84,10 @@ module Phrase
|
|
|
79
84
|
if attributes.key?(:'source_locale_id')
|
|
80
85
|
self.source_locale_id = attributes[:'source_locale_id']
|
|
81
86
|
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'owner_id')
|
|
89
|
+
self.owner_id = attributes[:'owner_id']
|
|
90
|
+
end
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -108,7 +117,8 @@ module Phrase
|
|
|
108
117
|
name == o.name &&
|
|
109
118
|
briefing == o.briefing &&
|
|
110
119
|
autotranslate == o.autotranslate &&
|
|
111
|
-
source_locale_id == o.source_locale_id
|
|
120
|
+
source_locale_id == o.source_locale_id &&
|
|
121
|
+
owner_id == o.owner_id
|
|
112
122
|
end
|
|
113
123
|
|
|
114
124
|
# @see the `==` method
|
|
@@ -120,7 +130,7 @@ module Phrase
|
|
|
120
130
|
# Calculates hash code according to all attributes.
|
|
121
131
|
# @return [Integer] Hash code
|
|
122
132
|
def hash
|
|
123
|
-
[branch, name, briefing, autotranslate, source_locale_id].hash
|
|
133
|
+
[branch, name, briefing, autotranslate, source_locale_id, owner_id].hash
|
|
124
134
|
end
|
|
125
135
|
|
|
126
136
|
# Builds the object from hash
|
|
@@ -2,7 +2,7 @@ require 'date'
|
|
|
2
2
|
|
|
3
3
|
module Phrase
|
|
4
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
|
|
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
6
|
attr_accessor :default_service
|
|
7
7
|
|
|
8
8
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -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.
|
|
@@ -11,12 +11,16 @@ module Phrase
|
|
|
11
11
|
# Automatically translate the job using machine translation.
|
|
12
12
|
attr_accessor :autotranslate
|
|
13
13
|
|
|
14
|
+
# Code of the account member to set as the job template owner. When omitted or blank, no owner is pre-set; the user who creates a job from this template is assigned as its owner at job-creation time.
|
|
15
|
+
attr_accessor :owner_id
|
|
16
|
+
|
|
14
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
18
|
def self.attribute_map
|
|
16
19
|
{
|
|
17
20
|
:'name' => :'name',
|
|
18
21
|
:'briefing' => :'briefing',
|
|
19
|
-
:'autotranslate' => :'autotranslate'
|
|
22
|
+
:'autotranslate' => :'autotranslate',
|
|
23
|
+
:'owner_id' => :'owner_id'
|
|
20
24
|
}
|
|
21
25
|
end
|
|
22
26
|
|
|
@@ -25,7 +29,8 @@ module Phrase
|
|
|
25
29
|
{
|
|
26
30
|
:'name' => :'String',
|
|
27
31
|
:'briefing' => :'String',
|
|
28
|
-
:'autotranslate' => :'Boolean'
|
|
32
|
+
:'autotranslate' => :'Boolean',
|
|
33
|
+
:'owner_id' => :'String'
|
|
29
34
|
}
|
|
30
35
|
end
|
|
31
36
|
|
|
@@ -61,6 +66,10 @@ module Phrase
|
|
|
61
66
|
if attributes.key?(:'autotranslate')
|
|
62
67
|
self.autotranslate = attributes[:'autotranslate']
|
|
63
68
|
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'owner_id')
|
|
71
|
+
self.owner_id = attributes[:'owner_id']
|
|
72
|
+
end
|
|
64
73
|
end
|
|
65
74
|
|
|
66
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -88,7 +97,8 @@ module Phrase
|
|
|
88
97
|
self.class == o.class &&
|
|
89
98
|
name == o.name &&
|
|
90
99
|
briefing == o.briefing &&
|
|
91
|
-
autotranslate == o.autotranslate
|
|
100
|
+
autotranslate == o.autotranslate &&
|
|
101
|
+
owner_id == o.owner_id
|
|
92
102
|
end
|
|
93
103
|
|
|
94
104
|
# @see the `==` method
|
|
@@ -100,7 +110,7 @@ module Phrase
|
|
|
100
110
|
# Calculates hash code according to all attributes.
|
|
101
111
|
# @return [Integer] Hash code
|
|
102
112
|
def hash
|
|
103
|
-
[name, briefing, autotranslate].hash
|
|
113
|
+
[name, briefing, autotranslate, owner_id].hash
|
|
104
114
|
end
|
|
105
115
|
|
|
106
116
|
# Builds the object from hash
|
|
@@ -11,12 +11,16 @@ module Phrase
|
|
|
11
11
|
# Automatically translate the job using machine translation.
|
|
12
12
|
attr_accessor :autotranslate
|
|
13
13
|
|
|
14
|
+
# Code of the account member to set as the job template owner. Pass an empty string to clear a previously set owner; when blank, the owner is set to null and jobs created from this template will default to assigning the job creator as owner.
|
|
15
|
+
attr_accessor :owner_id
|
|
16
|
+
|
|
14
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
18
|
def self.attribute_map
|
|
16
19
|
{
|
|
17
20
|
:'name' => :'name',
|
|
18
21
|
:'briefing' => :'briefing',
|
|
19
|
-
:'autotranslate' => :'autotranslate'
|
|
22
|
+
:'autotranslate' => :'autotranslate',
|
|
23
|
+
:'owner_id' => :'owner_id'
|
|
20
24
|
}
|
|
21
25
|
end
|
|
22
26
|
|
|
@@ -25,7 +29,8 @@ module Phrase
|
|
|
25
29
|
{
|
|
26
30
|
:'name' => :'String',
|
|
27
31
|
:'briefing' => :'String',
|
|
28
|
-
:'autotranslate' => :'Boolean'
|
|
32
|
+
:'autotranslate' => :'Boolean',
|
|
33
|
+
:'owner_id' => :'String'
|
|
29
34
|
}
|
|
30
35
|
end
|
|
31
36
|
|
|
@@ -61,6 +66,10 @@ module Phrase
|
|
|
61
66
|
if attributes.key?(:'autotranslate')
|
|
62
67
|
self.autotranslate = attributes[:'autotranslate']
|
|
63
68
|
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'owner_id')
|
|
71
|
+
self.owner_id = attributes[:'owner_id']
|
|
72
|
+
end
|
|
64
73
|
end
|
|
65
74
|
|
|
66
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -88,7 +97,8 @@ module Phrase
|
|
|
88
97
|
self.class == o.class &&
|
|
89
98
|
name == o.name &&
|
|
90
99
|
briefing == o.briefing &&
|
|
91
|
-
autotranslate == o.autotranslate
|
|
100
|
+
autotranslate == o.autotranslate &&
|
|
101
|
+
owner_id == o.owner_id
|
|
92
102
|
end
|
|
93
103
|
|
|
94
104
|
# @see the `==` method
|
|
@@ -100,7 +110,7 @@ module Phrase
|
|
|
100
110
|
# Calculates hash code according to all attributes.
|
|
101
111
|
# @return [Integer] Hash code
|
|
102
112
|
def hash
|
|
103
|
-
[name, briefing, autotranslate].hash
|
|
113
|
+
[name, briefing, autotranslate, owner_id].hash
|
|
104
114
|
end
|
|
105
115
|
|
|
106
116
|
# Builds the object from hash
|
|
@@ -104,7 +104,7 @@ module Phrase
|
|
|
104
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.
|
|
105
105
|
attr_accessor :default_encoding
|
|
106
106
|
|
|
107
|
-
# (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.
|
|
108
108
|
attr_accessor :cldr_version
|
|
109
109
|
|
|
110
110
|
# (Optional) List of placeholder styles enabled for the project.
|
|
@@ -403,11 +403,23 @@ module Phrase
|
|
|
403
403
|
# @return true if the model is valid
|
|
404
404
|
def valid?
|
|
405
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)
|
|
406
408
|
default_encoding_validator = EnumAttributeValidator.new('String', ["UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "ISO-8859-1"])
|
|
407
409
|
return false unless default_encoding_validator.valid?(@default_encoding)
|
|
408
410
|
true
|
|
409
411
|
end
|
|
410
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
|
+
|
|
411
423
|
# Custom attribute writer method checking allowed values (enum).
|
|
412
424
|
# @param [Object] default_encoding Object to be assigned
|
|
413
425
|
def default_encoding=(default_encoding)
|
|
@@ -62,12 +62,36 @@ module Phrase
|
|
|
62
62
|
|
|
63
63
|
attr_accessor :cldr_version
|
|
64
64
|
|
|
65
|
+
attr_accessor :translation_keys_sort_collation
|
|
66
|
+
|
|
65
67
|
attr_accessor :job_locking_enabled
|
|
66
68
|
|
|
67
69
|
attr_accessor :placeholder_styles
|
|
68
70
|
|
|
69
71
|
attr_accessor :branch
|
|
70
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
|
+
|
|
71
95
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
72
96
|
def self.attribute_map
|
|
73
97
|
{
|
|
@@ -101,6 +125,7 @@ module Phrase
|
|
|
101
125
|
:'autocomplete_job_enabled' => :'autocomplete_job_enabled',
|
|
102
126
|
:'default_encoding' => :'default_encoding',
|
|
103
127
|
:'cldr_version' => :'cldr_version',
|
|
128
|
+
:'translation_keys_sort_collation' => :'translation_keys_sort_collation',
|
|
104
129
|
:'job_locking_enabled' => :'job_locking_enabled',
|
|
105
130
|
:'placeholder_styles' => :'placeholder_styles',
|
|
106
131
|
:'branch' => :'branch'
|
|
@@ -140,6 +165,7 @@ module Phrase
|
|
|
140
165
|
:'autocomplete_job_enabled' => :'Boolean',
|
|
141
166
|
:'default_encoding' => :'String',
|
|
142
167
|
:'cldr_version' => :'String',
|
|
168
|
+
:'translation_keys_sort_collation' => :'String',
|
|
143
169
|
:'job_locking_enabled' => :'Boolean',
|
|
144
170
|
:'placeholder_styles' => :'Array<String>',
|
|
145
171
|
:'branch' => :'Branch'
|
|
@@ -294,6 +320,10 @@ module Phrase
|
|
|
294
320
|
self.cldr_version = attributes[:'cldr_version']
|
|
295
321
|
end
|
|
296
322
|
|
|
323
|
+
if attributes.key?(:'translation_keys_sort_collation')
|
|
324
|
+
self.translation_keys_sort_collation = attributes[:'translation_keys_sort_collation']
|
|
325
|
+
end
|
|
326
|
+
|
|
297
327
|
if attributes.key?(:'job_locking_enabled')
|
|
298
328
|
self.job_locking_enabled = attributes[:'job_locking_enabled']
|
|
299
329
|
end
|
|
@@ -319,9 +349,21 @@ module Phrase
|
|
|
319
349
|
# Check to see if the all the properties in the model are valid
|
|
320
350
|
# @return true if the model is valid
|
|
321
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)
|
|
322
354
|
true
|
|
323
355
|
end
|
|
324
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
|
+
|
|
325
367
|
# Checks equality by comparing each attribute.
|
|
326
368
|
# @param [Object] Object to be compared
|
|
327
369
|
def ==(o)
|
|
@@ -357,6 +399,7 @@ module Phrase
|
|
|
357
399
|
autocomplete_job_enabled == o.autocomplete_job_enabled &&
|
|
358
400
|
default_encoding == o.default_encoding &&
|
|
359
401
|
cldr_version == o.cldr_version &&
|
|
402
|
+
translation_keys_sort_collation == o.translation_keys_sort_collation &&
|
|
360
403
|
job_locking_enabled == o.job_locking_enabled &&
|
|
361
404
|
placeholder_styles == o.placeholder_styles &&
|
|
362
405
|
branch == o.branch
|
|
@@ -371,7 +414,7 @@ module Phrase
|
|
|
371
414
|
# Calculates hash code according to all attributes.
|
|
372
415
|
# @return [Integer] Hash code
|
|
373
416
|
def 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
|
|
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
|
|
375
418
|
end
|
|
376
419
|
|
|
377
420
|
# Builds the object from hash
|