phrase 2.2.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -3
- data/docs/AccountsApi.md +8 -2
- data/docs/AuthorizationsApi.md +20 -5
- data/docs/BitbucketSyncApi.md +12 -3
- data/docs/BlacklistedKeysApi.md +20 -5
- data/docs/BranchesApi.md +28 -7
- data/docs/CommentsApi.md +32 -8
- data/docs/Distribution.md +2 -0
- data/docs/DistributionCreateParameters.md +2 -0
- data/docs/DistributionUpdateParameters.md +2 -0
- data/docs/DistributionsApi.md +20 -5
- data/docs/DocumentsApi.md +8 -2
- data/docs/FormatsApi.md +4 -1
- data/docs/GitHubSyncApi.md +8 -2
- data/docs/GitLabSyncApi.md +28 -7
- data/docs/GlossariesApi.md +20 -5
- data/docs/GlossaryTermTranslationsApi.md +12 -3
- data/docs/GlossaryTermsApi.md +20 -5
- data/docs/ICUApi.md +73 -0
- data/docs/Icu.md +17 -0
- data/docs/IcuSkeletonParameters.md +21 -0
- data/docs/InvitationCreateParameters.md +2 -0
- data/docs/InvitationUpdateParameters.md +2 -0
- data/docs/InvitationsApi.md +28 -7
- data/docs/JobLocaleCompleteReviewParameters.md +17 -0
- data/docs/JobLocaleUpdateParameters.md +3 -1
- data/docs/JobLocalesApi.md +99 -7
- data/docs/JobLocalesCreateParameters.md +4 -2
- data/docs/JobTemplateLocalesApi.md +20 -5
- data/docs/JobTemplatesApi.md +20 -5
- data/docs/JobsApi.md +44 -11
- data/docs/KeysApi.md +44 -11
- data/docs/LocalesApi.md +35 -10
- data/docs/Member.md +6 -0
- data/docs/MembersApi.md +20 -5
- data/docs/NotificationGroupsApi.md +12 -3
- data/docs/NotificationsApi.md +12 -3
- data/docs/OrdersApi.md +20 -5
- data/docs/Project.md +2 -0
- data/docs/ProjectDetails.md +2 -0
- data/docs/ProjectsApi.md +20 -5
- data/docs/ReleaseCreateParameters.md +2 -0
- data/docs/ReleasesApi.md +24 -6
- data/docs/ScreenshotMarkersApi.md +20 -5
- data/docs/ScreenshotsApi.md +20 -5
- data/docs/SearchApi.md +4 -1
- data/docs/SpacesApi.md +32 -8
- data/docs/StyleGuidesApi.md +20 -5
- data/docs/TagsApi.md +16 -4
- data/docs/Team1.md +23 -0
- data/docs/TeamsApi.md +44 -11
- data/docs/TranslationsApi.md +68 -17
- data/docs/TranslationsVerifyParameters.md +3 -5
- data/docs/UploadsApi.md +12 -3
- data/docs/UserPreview.md +3 -1
- data/docs/UsersApi.md +4 -1
- data/docs/VariablesApi.md +20 -5
- data/docs/VersionsHistoryApi.md +8 -2
- data/docs/WebhooksApi.md +24 -6
- data/lib/phrase/api/accounts_api.rb +2 -2
- data/lib/phrase/api/authorizations_api.rb +5 -5
- data/lib/phrase/api/bitbucket_sync_api.rb +3 -3
- data/lib/phrase/api/blacklisted_keys_api.rb +5 -5
- data/lib/phrase/api/branches_api.rb +7 -7
- data/lib/phrase/api/comments_api.rb +8 -8
- data/lib/phrase/api/distributions_api.rb +5 -5
- data/lib/phrase/api/documents_api.rb +2 -2
- data/lib/phrase/api/formats_api.rb +1 -1
- data/lib/phrase/api/git_hub_sync_api.rb +2 -2
- data/lib/phrase/api/git_lab_sync_api.rb +7 -7
- data/lib/phrase/api/glossaries_api.rb +5 -5
- data/lib/phrase/api/glossary_term_translations_api.rb +3 -3
- data/lib/phrase/api/glossary_terms_api.rb +5 -5
- data/lib/phrase/api/icu_api.rb +78 -0
- data/lib/phrase/api/invitations_api.rb +7 -7
- data/lib/phrase/api/job_locales_api.rb +93 -7
- data/lib/phrase/api/job_template_locales_api.rb +5 -5
- data/lib/phrase/api/job_templates_api.rb +5 -5
- data/lib/phrase/api/jobs_api.rb +11 -11
- data/lib/phrase/api/keys_api.rb +11 -11
- data/lib/phrase/api/locales_api.rb +20 -11
- data/lib/phrase/api/members_api.rb +5 -5
- data/lib/phrase/api/notification_groups_api.rb +3 -3
- data/lib/phrase/api/notifications_api.rb +3 -3
- data/lib/phrase/api/orders_api.rb +5 -5
- data/lib/phrase/api/projects_api.rb +5 -5
- data/lib/phrase/api/releases_api.rb +6 -6
- data/lib/phrase/api/screenshot_markers_api.rb +5 -5
- data/lib/phrase/api/screenshots_api.rb +5 -5
- data/lib/phrase/api/search_api.rb +1 -1
- data/lib/phrase/api/spaces_api.rb +8 -8
- data/lib/phrase/api/style_guides_api.rb +5 -5
- data/lib/phrase/api/tags_api.rb +4 -4
- data/lib/phrase/api/teams_api.rb +11 -11
- data/lib/phrase/api/translations_api.rb +17 -17
- data/lib/phrase/api/uploads_api.rb +3 -3
- data/lib/phrase/api/users_api.rb +1 -1
- data/lib/phrase/api/variables_api.rb +5 -5
- data/lib/phrase/api/versions_history_api.rb +2 -2
- data/lib/phrase/api/webhooks_api.rb +6 -6
- data/lib/phrase/configuration.rb +8 -0
- data/lib/phrase/models/distribution.rb +12 -1
- data/lib/phrase/models/distribution_create_parameters.rb +13 -1
- data/lib/phrase/models/distribution_update_parameters.rb +13 -1
- data/lib/phrase/models/icu.rb +195 -0
- data/lib/phrase/models/icu_skeleton_parameters.rb +217 -0
- data/lib/phrase/models/invitation_create_parameters.rb +13 -1
- data/lib/phrase/models/invitation_update_parameters.rb +13 -1
- data/lib/phrase/models/job_locale_complete_review_parameters.rb +195 -0
- data/lib/phrase/models/job_locale_update_parameters.rb +16 -4
- data/lib/phrase/models/job_locales_create_parameters.rb +17 -5
- data/lib/phrase/models/member.rb +30 -1
- data/lib/phrase/models/project.rb +10 -1
- data/lib/phrase/models/project_details.rb +10 -1
- data/lib/phrase/models/release_create_parameters.rb +13 -1
- data/lib/phrase/models/team1.rb +221 -0
- data/lib/phrase/models/translations_verify_parameters.rb +14 -24
- data/lib/phrase/models/user_preview.rb +13 -4
- data/lib/phrase/response.rb +1 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -0
- data/phrase.gemspec +2 -2
- data/spec/api/icu_api_spec.rb +36 -0
- data/spec/api/job_locales_api_spec.rb +16 -0
- data/spec/api/locales_api_spec.rb +2 -0
- data/spec/models/distribution_create_parameters_spec.rb +6 -0
- data/spec/models/distribution_spec.rb +6 -0
- data/spec/models/distribution_update_parameters_spec.rb +6 -0
- data/spec/models/icu_skeleton_parameters_spec.rb +41 -0
- data/spec/models/icu_spec.rb +29 -0
- data/spec/models/invitation_create_parameters_spec.rb +6 -0
- data/spec/models/invitation_update_parameters_spec.rb +6 -0
- data/spec/models/job_locale_complete_review_parameters_spec.rb +29 -0
- data/spec/models/job_locale_update_parameters_spec.rb +6 -0
- data/spec/models/job_locales_create_parameters_spec.rb +6 -0
- data/spec/models/member_spec.rb +18 -0
- data/spec/models/project_details_spec.rb +6 -0
- data/spec/models/project_spec.rb +6 -0
- data/spec/models/release_create_parameters_spec.rb +6 -0
- data/spec/models/team1_spec.rb +47 -0
- data/spec/models/translations_verify_parameters_spec.rb +2 -8
- data/spec/models/user_preview_spec.rb +6 -0
- metadata +214 -194
@@ -0,0 +1,217 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class IcuSkeletonParameters
|
5
|
+
# Source content
|
6
|
+
attr_accessor :content
|
7
|
+
|
8
|
+
# Locale codes
|
9
|
+
attr_accessor :locale_codes
|
10
|
+
|
11
|
+
# Indicates whether the zero form should be included or excluded in the returned skeletons
|
12
|
+
attr_accessor :zero_form_enabled
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
:'content' => :'content',
|
18
|
+
:'locale_codes' => :'locale_codes',
|
19
|
+
:'zero_form_enabled' => :'zero_form_enabled'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.openapi_types
|
25
|
+
{
|
26
|
+
:'content' => :'String',
|
27
|
+
:'locale_codes' => :'Array<String>',
|
28
|
+
:'zero_form_enabled' => :'Boolean'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# List of attributes with nullable: true
|
33
|
+
def self.openapi_nullable
|
34
|
+
Set.new([
|
35
|
+
])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
if (!attributes.is_a?(Hash))
|
42
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::IcuSkeletonParameters` initialize method"
|
43
|
+
end
|
44
|
+
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
48
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::IcuSkeletonParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
49
|
+
end
|
50
|
+
h[k.to_sym] = v
|
51
|
+
}
|
52
|
+
|
53
|
+
if attributes.key?(:'content')
|
54
|
+
self.content = attributes[:'content']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.key?(:'locale_codes')
|
58
|
+
if (value = attributes[:'locale_codes']).is_a?(Array)
|
59
|
+
self.locale_codes = value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.key?(:'zero_form_enabled')
|
64
|
+
self.zero_form_enabled = attributes[:'zero_form_enabled']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
invalid_properties
|
73
|
+
end
|
74
|
+
|
75
|
+
# Check to see if the all the properties in the model are valid
|
76
|
+
# @return true if the model is valid
|
77
|
+
def valid?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
content == o.content &&
|
87
|
+
locale_codes == o.locale_codes &&
|
88
|
+
zero_form_enabled == o.zero_form_enabled
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(o)
|
94
|
+
self == o
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Integer] Hash code
|
99
|
+
def hash
|
100
|
+
[content, locale_codes, zero_form_enabled].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
self.class.openapi_types.each_pair do |key, type|
|
116
|
+
if type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :DateTime
|
137
|
+
DateTime.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
Phrase.const_get(type).build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
@@ -17,6 +17,9 @@ module Phrase
|
|
17
17
|
# List of spaces the user is assigned to.
|
18
18
|
attr_accessor :space_ids
|
19
19
|
|
20
|
+
# List of teams the user is assigned to.
|
21
|
+
attr_accessor :team_ids
|
22
|
+
|
20
23
|
# List of default locales for the user.
|
21
24
|
attr_accessor :default_locale_codes
|
22
25
|
|
@@ -31,6 +34,7 @@ module Phrase
|
|
31
34
|
:'project_ids' => :'project_ids',
|
32
35
|
:'locale_ids' => :'locale_ids',
|
33
36
|
:'space_ids' => :'space_ids',
|
37
|
+
:'team_ids' => :'team_ids',
|
34
38
|
:'default_locale_codes' => :'default_locale_codes',
|
35
39
|
:'permissions' => :'permissions'
|
36
40
|
}
|
@@ -44,6 +48,7 @@ module Phrase
|
|
44
48
|
:'project_ids' => :'String',
|
45
49
|
:'locale_ids' => :'String',
|
46
50
|
:'space_ids' => :'Array<String>',
|
51
|
+
:'team_ids' => :'Array<String>',
|
47
52
|
:'default_locale_codes' => :'Array<String>',
|
48
53
|
:'permissions' => :'Hash<String, String>'
|
49
54
|
}
|
@@ -92,6 +97,12 @@ module Phrase
|
|
92
97
|
end
|
93
98
|
end
|
94
99
|
|
100
|
+
if attributes.key?(:'team_ids')
|
101
|
+
if (value = attributes[:'team_ids']).is_a?(Array)
|
102
|
+
self.team_ids = value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
95
106
|
if attributes.key?(:'default_locale_codes')
|
96
107
|
if (value = attributes[:'default_locale_codes']).is_a?(Array)
|
97
108
|
self.default_locale_codes = value
|
@@ -128,6 +139,7 @@ module Phrase
|
|
128
139
|
project_ids == o.project_ids &&
|
129
140
|
locale_ids == o.locale_ids &&
|
130
141
|
space_ids == o.space_ids &&
|
142
|
+
team_ids == o.team_ids &&
|
131
143
|
default_locale_codes == o.default_locale_codes &&
|
132
144
|
permissions == o.permissions
|
133
145
|
end
|
@@ -141,7 +153,7 @@ module Phrase
|
|
141
153
|
# Calculates hash code according to all attributes.
|
142
154
|
# @return [Integer] Hash code
|
143
155
|
def hash
|
144
|
-
[email, role, project_ids, locale_ids, space_ids, default_locale_codes, permissions].hash
|
156
|
+
[email, role, project_ids, locale_ids, space_ids, team_ids, default_locale_codes, permissions].hash
|
145
157
|
end
|
146
158
|
|
147
159
|
# Builds the object from hash
|
@@ -14,6 +14,9 @@ module Phrase
|
|
14
14
|
# List of spaces the user is assigned to.
|
15
15
|
attr_accessor :space_ids
|
16
16
|
|
17
|
+
# List of teams the user is assigned to.
|
18
|
+
attr_accessor :team_ids
|
19
|
+
|
17
20
|
# List of default locales for the user.
|
18
21
|
attr_accessor :default_locale_codes
|
19
22
|
|
@@ -27,6 +30,7 @@ module Phrase
|
|
27
30
|
:'project_ids' => :'project_ids',
|
28
31
|
:'locale_ids' => :'locale_ids',
|
29
32
|
:'space_ids' => :'space_ids',
|
33
|
+
:'team_ids' => :'team_ids',
|
30
34
|
:'default_locale_codes' => :'default_locale_codes',
|
31
35
|
:'permissions' => :'permissions'
|
32
36
|
}
|
@@ -39,6 +43,7 @@ module Phrase
|
|
39
43
|
:'project_ids' => :'String',
|
40
44
|
:'locale_ids' => :'String',
|
41
45
|
:'space_ids' => :'Array<String>',
|
46
|
+
:'team_ids' => :'Array<String>',
|
42
47
|
:'default_locale_codes' => :'Array<String>',
|
43
48
|
:'permissions' => :'Hash<String, String>'
|
44
49
|
}
|
@@ -83,6 +88,12 @@ module Phrase
|
|
83
88
|
end
|
84
89
|
end
|
85
90
|
|
91
|
+
if attributes.key?(:'team_ids')
|
92
|
+
if (value = attributes[:'team_ids']).is_a?(Array)
|
93
|
+
self.team_ids = value
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
86
97
|
if attributes.key?(:'default_locale_codes')
|
87
98
|
if (value = attributes[:'default_locale_codes']).is_a?(Array)
|
88
99
|
self.default_locale_codes = value
|
@@ -118,6 +129,7 @@ module Phrase
|
|
118
129
|
project_ids == o.project_ids &&
|
119
130
|
locale_ids == o.locale_ids &&
|
120
131
|
space_ids == o.space_ids &&
|
132
|
+
team_ids == o.team_ids &&
|
121
133
|
default_locale_codes == o.default_locale_codes &&
|
122
134
|
permissions == o.permissions
|
123
135
|
end
|
@@ -131,7 +143,7 @@ module Phrase
|
|
131
143
|
# Calculates hash code according to all attributes.
|
132
144
|
# @return [Integer] Hash code
|
133
145
|
def hash
|
134
|
-
[role, project_ids, locale_ids, space_ids, default_locale_codes, permissions].hash
|
146
|
+
[role, project_ids, locale_ids, space_ids, team_ids, default_locale_codes, permissions].hash
|
135
147
|
end
|
136
148
|
|
137
149
|
# Builds the object from hash
|
@@ -0,0 +1,195 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class JobLocaleCompleteReviewParameters
|
5
|
+
# specify the branch to use
|
6
|
+
attr_accessor :branch
|
7
|
+
|
8
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
9
|
+
def self.attribute_map
|
10
|
+
{
|
11
|
+
:'branch' => :'branch'
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
# Attribute type mapping.
|
16
|
+
def self.openapi_types
|
17
|
+
{
|
18
|
+
:'branch' => :'String'
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
# List of attributes with nullable: true
|
23
|
+
def self.openapi_nullable
|
24
|
+
Set.new([
|
25
|
+
])
|
26
|
+
end
|
27
|
+
|
28
|
+
# Initializes the object
|
29
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
30
|
+
def initialize(attributes = {})
|
31
|
+
if (!attributes.is_a?(Hash))
|
32
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::JobLocaleCompleteReviewParameters` initialize method"
|
33
|
+
end
|
34
|
+
|
35
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
36
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
37
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
38
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::JobLocaleCompleteReviewParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
39
|
+
end
|
40
|
+
h[k.to_sym] = v
|
41
|
+
}
|
42
|
+
|
43
|
+
if attributes.key?(:'branch')
|
44
|
+
self.branch = attributes[:'branch']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
invalid_properties
|
53
|
+
end
|
54
|
+
|
55
|
+
# Check to see if the all the properties in the model are valid
|
56
|
+
# @return true if the model is valid
|
57
|
+
def valid?
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
# Checks equality by comparing each attribute.
|
62
|
+
# @param [Object] Object to be compared
|
63
|
+
def ==(o)
|
64
|
+
return true if self.equal?(o)
|
65
|
+
self.class == o.class &&
|
66
|
+
branch == o.branch
|
67
|
+
end
|
68
|
+
|
69
|
+
# @see the `==` method
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def eql?(o)
|
72
|
+
self == o
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Integer] Hash code
|
77
|
+
def hash
|
78
|
+
[branch].hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def self.build_from_hash(attributes)
|
85
|
+
new.build_from_hash(attributes)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Builds the object from hash
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
# @return [Object] Returns the model itself
|
91
|
+
def build_from_hash(attributes)
|
92
|
+
return nil unless attributes.is_a?(Hash)
|
93
|
+
self.class.openapi_types.each_pair do |key, type|
|
94
|
+
if type =~ /\AArray<(.*)>/i
|
95
|
+
# check to ensure the input is an array given that the attribute
|
96
|
+
# is documented as an array but the input is not
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
+
end
|
100
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
+
end
|
104
|
+
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param string type Data type
|
110
|
+
# @param string value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :Boolean
|
125
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
Phrase.const_get(type).build_from_hash(value)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# Returns the string representation of the object
|
150
|
+
# @return [String] String presentation of the object
|
151
|
+
def to_s
|
152
|
+
to_hash.to_s
|
153
|
+
end
|
154
|
+
|
155
|
+
# to_body is an alias to to_hash (backward compatibility)
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_body
|
158
|
+
to_hash
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the object in the form of hash
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
163
|
+
def to_hash
|
164
|
+
hash = {}
|
165
|
+
self.class.attribute_map.each_pair do |attr, param|
|
166
|
+
value = self.send(attr)
|
167
|
+
if value.nil?
|
168
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
169
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
170
|
+
end
|
171
|
+
|
172
|
+
hash[param] = _to_hash(value)
|
173
|
+
end
|
174
|
+
hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -11,12 +11,16 @@ module Phrase
|
|
11
11
|
# Array of user ids to be assigned to the job locale
|
12
12
|
attr_accessor :user_ids
|
13
13
|
|
14
|
+
# Array of reviewer ids to be assigned to the job locale as reviewers
|
15
|
+
attr_accessor :reviewer_ids
|
16
|
+
|
14
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
15
18
|
def self.attribute_map
|
16
19
|
{
|
17
20
|
:'branch' => :'branch',
|
18
21
|
:'locale_id' => :'locale_id',
|
19
|
-
:'user_ids' => :'user_ids'
|
22
|
+
:'user_ids' => :'user_ids',
|
23
|
+
:'reviewer_ids' => :'reviewer_ids'
|
20
24
|
}
|
21
25
|
end
|
22
26
|
|
@@ -25,7 +29,8 @@ module Phrase
|
|
25
29
|
{
|
26
30
|
:'branch' => :'String',
|
27
31
|
:'locale_id' => :'String',
|
28
|
-
:'user_ids' => :'Array<String>'
|
32
|
+
:'user_ids' => :'Array<String>',
|
33
|
+
:'reviewer_ids' => :'Array<String>'
|
29
34
|
}
|
30
35
|
end
|
31
36
|
|
@@ -63,6 +68,12 @@ module Phrase
|
|
63
68
|
self.user_ids = value
|
64
69
|
end
|
65
70
|
end
|
71
|
+
|
72
|
+
if attributes.key?(:'reviewer_ids')
|
73
|
+
if (value = attributes[:'reviewer_ids']).is_a?(Array)
|
74
|
+
self.reviewer_ids = value
|
75
|
+
end
|
76
|
+
end
|
66
77
|
end
|
67
78
|
|
68
79
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -85,7 +96,8 @@ module Phrase
|
|
85
96
|
self.class == o.class &&
|
86
97
|
branch == o.branch &&
|
87
98
|
locale_id == o.locale_id &&
|
88
|
-
user_ids == o.user_ids
|
99
|
+
user_ids == o.user_ids &&
|
100
|
+
reviewer_ids == o.reviewer_ids
|
89
101
|
end
|
90
102
|
|
91
103
|
# @see the `==` method
|
@@ -97,7 +109,7 @@ module Phrase
|
|
97
109
|
# Calculates hash code according to all attributes.
|
98
110
|
# @return [Integer] Hash code
|
99
111
|
def hash
|
100
|
-
[branch, locale_id, user_ids].hash
|
112
|
+
[branch, locale_id, user_ids, reviewer_ids].hash
|
101
113
|
end
|
102
114
|
|
103
115
|
# Builds the object from hash
|
@@ -8,15 +8,19 @@ module Phrase
|
|
8
8
|
# locale id
|
9
9
|
attr_accessor :locale_id
|
10
10
|
|
11
|
-
# Array of user ids to be assigned to the job locale
|
11
|
+
# Array of user ids to be assigned to the job locale as translators
|
12
12
|
attr_accessor :user_ids
|
13
13
|
|
14
|
+
# Array of reviewer ids to be assigned to the job locale as reviewers
|
15
|
+
attr_accessor :reviewer_ids
|
16
|
+
|
14
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
15
18
|
def self.attribute_map
|
16
19
|
{
|
17
20
|
:'branch' => :'branch',
|
18
21
|
:'locale_id' => :'locale_id',
|
19
|
-
:'user_ids' => :'user_ids'
|
22
|
+
:'user_ids' => :'user_ids',
|
23
|
+
:'reviewer_ids' => :'reviewer_ids'
|
20
24
|
}
|
21
25
|
end
|
22
26
|
|
@@ -25,7 +29,8 @@ module Phrase
|
|
25
29
|
{
|
26
30
|
:'branch' => :'String',
|
27
31
|
:'locale_id' => :'String',
|
28
|
-
:'user_ids' => :'Array<String>'
|
32
|
+
:'user_ids' => :'Array<String>',
|
33
|
+
:'reviewer_ids' => :'Array<String>'
|
29
34
|
}
|
30
35
|
end
|
31
36
|
|
@@ -63,6 +68,12 @@ module Phrase
|
|
63
68
|
self.user_ids = value
|
64
69
|
end
|
65
70
|
end
|
71
|
+
|
72
|
+
if attributes.key?(:'reviewer_ids')
|
73
|
+
if (value = attributes[:'reviewer_ids']).is_a?(Array)
|
74
|
+
self.reviewer_ids = value
|
75
|
+
end
|
76
|
+
end
|
66
77
|
end
|
67
78
|
|
68
79
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -85,7 +96,8 @@ module Phrase
|
|
85
96
|
self.class == o.class &&
|
86
97
|
branch == o.branch &&
|
87
98
|
locale_id == o.locale_id &&
|
88
|
-
user_ids == o.user_ids
|
99
|
+
user_ids == o.user_ids &&
|
100
|
+
reviewer_ids == o.reviewer_ids
|
89
101
|
end
|
90
102
|
|
91
103
|
# @see the `==` method
|
@@ -97,7 +109,7 @@ module Phrase
|
|
97
109
|
# Calculates hash code according to all attributes.
|
98
110
|
# @return [Integer] Hash code
|
99
111
|
def hash
|
100
|
-
[branch, locale_id, user_ids].hash
|
112
|
+
[branch, locale_id, user_ids, reviewer_ids].hash
|
101
113
|
end
|
102
114
|
|
103
115
|
# Builds the object from hash
|