phrase 2.3.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -3
  3. data/docs/Distribution.md +2 -0
  4. data/docs/DistributionCreateParameters.md +2 -0
  5. data/docs/DistributionUpdateParameters.md +2 -0
  6. data/docs/ICUApi.md +70 -0
  7. data/docs/Icu.md +17 -0
  8. data/docs/IcuSkeletonParameters.md +23 -0
  9. data/docs/Invitation.md +2 -0
  10. data/docs/InvitationCreateParameters.md +2 -0
  11. data/docs/InvitationUpdateParameters.md +2 -0
  12. data/docs/JobLocaleCompleteReviewParameters.md +17 -0
  13. data/docs/JobLocaleUpdateParameters.md +3 -1
  14. data/docs/JobLocalesApi.md +68 -0
  15. data/docs/JobLocalesCreateParameters.md +4 -2
  16. data/docs/Member.md +6 -0
  17. data/docs/Project.md +2 -0
  18. data/docs/ProjectDetails.md +2 -0
  19. data/docs/ProjectLocales.md +2 -0
  20. data/docs/ProjectMemberSpecific.md +27 -0
  21. data/docs/ReleaseCreateParameters.md +2 -0
  22. data/docs/Team1.md +23 -0
  23. data/docs/UserPreview.md +3 -1
  24. data/lib/phrase/api/icu_api.rb +78 -0
  25. data/lib/phrase/api/job_locales_api.rb +86 -0
  26. data/lib/phrase/models/distribution.rb +12 -1
  27. data/lib/phrase/models/distribution_create_parameters.rb +13 -1
  28. data/lib/phrase/models/distribution_update_parameters.rb +13 -1
  29. data/lib/phrase/models/icu.rb +195 -0
  30. data/lib/phrase/models/icu_skeleton_parameters.rb +227 -0
  31. data/lib/phrase/models/invitation.rb +12 -1
  32. data/lib/phrase/models/invitation_create_parameters.rb +13 -1
  33. data/lib/phrase/models/invitation_update_parameters.rb +13 -1
  34. data/lib/phrase/models/job_locale_complete_review_parameters.rb +195 -0
  35. data/lib/phrase/models/job_locale_update_parameters.rb +16 -4
  36. data/lib/phrase/models/job_locales_create_parameters.rb +17 -5
  37. data/lib/phrase/models/member.rb +30 -1
  38. data/lib/phrase/models/project.rb +10 -1
  39. data/lib/phrase/models/project_details.rb +10 -1
  40. data/lib/phrase/models/project_locales.rb +11 -2
  41. data/lib/phrase/models/project_member_specific.rb +239 -0
  42. data/lib/phrase/models/release_create_parameters.rb +13 -1
  43. data/lib/phrase/models/team1.rb +221 -0
  44. data/lib/phrase/models/user_preview.rb +13 -4
  45. data/lib/phrase/response.rb +1 -1
  46. data/lib/phrase/version.rb +1 -1
  47. data/lib/phrase.rb +6 -0
  48. data/phrase.gemspec +2 -2
  49. data/spec/api/icu_api_spec.rb +36 -0
  50. data/spec/api/job_locales_api_spec.rb +16 -0
  51. data/spec/models/distribution_create_parameters_spec.rb +6 -0
  52. data/spec/models/distribution_spec.rb +6 -0
  53. data/spec/models/distribution_update_parameters_spec.rb +6 -0
  54. data/spec/models/icu_skeleton_parameters_spec.rb +47 -0
  55. data/spec/models/icu_spec.rb +29 -0
  56. data/spec/models/invitation_create_parameters_spec.rb +6 -0
  57. data/spec/models/invitation_spec.rb +6 -0
  58. data/spec/models/invitation_update_parameters_spec.rb +6 -0
  59. data/spec/models/job_locale_complete_review_parameters_spec.rb +29 -0
  60. data/spec/models/job_locale_update_parameters_spec.rb +6 -0
  61. data/spec/models/job_locales_create_parameters_spec.rb +6 -0
  62. data/spec/models/member_spec.rb +18 -0
  63. data/spec/models/project_details_spec.rb +6 -0
  64. data/spec/models/project_locales_spec.rb +6 -0
  65. data/spec/models/project_member_specific_spec.rb +59 -0
  66. data/spec/models/project_spec.rb +6 -0
  67. data/spec/models/release_create_parameters_spec.rb +6 -0
  68. data/spec/models/team1_spec.rb +47 -0
  69. data/spec/models/user_preview_spec.rb +6 -0
  70. metadata +221 -197
@@ -0,0 +1,227 @@
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
+ # Keep the content and add missing plural forms for each locale
12
+ attr_accessor :keep_content
13
+
14
+ # Indicates whether the zero form should be included or excluded in the returned skeletons
15
+ attr_accessor :zero_form_enabled
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'content' => :'content',
21
+ :'locale_codes' => :'locale_codes',
22
+ :'keep_content' => :'keep_content',
23
+ :'zero_form_enabled' => :'zero_form_enabled'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'content' => :'String',
31
+ :'locale_codes' => :'Array<String>',
32
+ :'keep_content' => :'Boolean',
33
+ :'zero_form_enabled' => :'Boolean'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::IcuSkeletonParameters` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ 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
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'content')
59
+ self.content = attributes[:'content']
60
+ end
61
+
62
+ if attributes.key?(:'locale_codes')
63
+ if (value = attributes[:'locale_codes']).is_a?(Array)
64
+ self.locale_codes = value
65
+ end
66
+ end
67
+
68
+ if attributes.key?(:'keep_content')
69
+ self.keep_content = attributes[:'keep_content']
70
+ end
71
+
72
+ if attributes.key?(:'zero_form_enabled')
73
+ self.zero_form_enabled = attributes[:'zero_form_enabled']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ content == o.content &&
96
+ locale_codes == o.locale_codes &&
97
+ keep_content == o.keep_content &&
98
+ zero_form_enabled == o.zero_form_enabled
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [content, locale_codes, keep_content, zero_form_enabled].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ Phrase.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
@@ -28,6 +28,8 @@ module Phrase
28
28
 
29
29
  attr_accessor :spaces
30
30
 
31
+ attr_accessor :teams
32
+
31
33
  attr_accessor :project_role
32
34
 
33
35
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -46,6 +48,7 @@ module Phrase
46
48
  :'updated_at' => :'updated_at',
47
49
  :'accepted_at' => :'accepted_at',
48
50
  :'spaces' => :'spaces',
51
+ :'teams' => :'teams',
49
52
  :'project_role' => :'project_role'
50
53
  }
51
54
  end
@@ -66,6 +69,7 @@ module Phrase
66
69
  :'updated_at' => :'DateTime',
67
70
  :'accepted_at' => :'DateTime',
68
71
  :'spaces' => :'Array<MemberSpaces>',
72
+ :'teams' => :'Array<Items>',
69
73
  :'project_role' => :'Array<MemberProjectDetailProjectRoles>'
70
74
  }
71
75
  end
@@ -153,6 +157,12 @@ module Phrase
153
157
  end
154
158
  end
155
159
 
160
+ if attributes.key?(:'teams')
161
+ if (value = attributes[:'teams']).is_a?(Array)
162
+ self.teams = value
163
+ end
164
+ end
165
+
156
166
  if attributes.key?(:'project_role')
157
167
  if (value = attributes[:'project_role']).is_a?(Array)
158
168
  self.project_role = value
@@ -191,6 +201,7 @@ module Phrase
191
201
  updated_at == o.updated_at &&
192
202
  accepted_at == o.accepted_at &&
193
203
  spaces == o.spaces &&
204
+ teams == o.teams &&
194
205
  project_role == o.project_role
195
206
  end
196
207
 
@@ -203,7 +214,7 @@ module Phrase
203
214
  # Calculates hash code according to all attributes.
204
215
  # @return [Integer] Hash code
205
216
  def hash
206
- [id, email, role, state, projects, locales, default_locale_codes, permissions, locale_ids, created_at, updated_at, accepted_at, spaces, project_role].hash
217
+ [id, email, role, state, projects, locales, default_locale_codes, permissions, locale_ids, created_at, updated_at, accepted_at, spaces, teams, project_role].hash
207
218
  end
208
219
 
209
220
  # Builds the object from hash
@@ -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