late-sdk 0.0.84 → 0.0.85

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -0
  3. data/docs/AddWhatsAppGroupParticipantsRequest.md +18 -0
  4. data/docs/ApproveWhatsAppGroupJoinRequestsRequest.md +18 -0
  5. data/docs/CreateWhatsAppGroupChat201Response.md +20 -0
  6. data/docs/CreateWhatsAppGroupChat201ResponseGroup.md +20 -0
  7. data/docs/CreateWhatsAppGroupChatRequest.md +24 -0
  8. data/docs/CreateWhatsAppGroupInviteLink200Response.md +20 -0
  9. data/docs/GetWhatsAppGroupChat200Response.md +20 -0
  10. data/docs/GetWhatsAppGroupChat200ResponseGroup.md +32 -0
  11. data/docs/GetWhatsAppGroupChat200ResponseGroupParticipantsInner.md +20 -0
  12. data/docs/ListWhatsAppGroupChats200Response.md +20 -0
  13. data/docs/ListWhatsAppGroupChats200ResponseGroupsInner.md +22 -0
  14. data/docs/ListWhatsAppGroupChats200ResponsePaging.md +18 -0
  15. data/docs/ListWhatsAppGroupChats200ResponsePagingCursors.md +20 -0
  16. data/docs/ListWhatsAppGroupJoinRequests200Response.md +20 -0
  17. data/docs/ListWhatsAppGroupJoinRequests200ResponseJoinRequestsInner.md +20 -0
  18. data/docs/RejectWhatsAppGroupJoinRequestsRequest.md +18 -0
  19. data/docs/RemoveWhatsAppGroupParticipantsRequest.md +18 -0
  20. data/docs/UpdateWhatsAppGroupChatRequest.md +22 -0
  21. data/docs/WhatsAppApi.md +958 -154
  22. data/lib/late-sdk/api/whats_app_api.rb +945 -118
  23. data/lib/late-sdk/models/add_whats_app_group_participants_request.rb +176 -0
  24. data/lib/late-sdk/models/approve_whats_app_group_join_requests_request.rb +167 -0
  25. data/lib/late-sdk/models/create_whats_app_group_chat201_response.rb +156 -0
  26. data/lib/late-sdk/models/create_whats_app_group_chat201_response_group.rb +156 -0
  27. data/lib/late-sdk/models/create_whats_app_group_chat_request.rb +274 -0
  28. data/lib/late-sdk/models/create_whats_app_group_invite_link200_response.rb +156 -0
  29. data/lib/late-sdk/models/get_whats_app_group_chat200_response.rb +156 -0
  30. data/lib/late-sdk/models/get_whats_app_group_chat200_response_group.rb +213 -0
  31. data/lib/late-sdk/models/get_whats_app_group_chat200_response_group_participants_inner.rb +157 -0
  32. data/lib/late-sdk/models/list_whats_app_group_chats200_response.rb +158 -0
  33. data/lib/late-sdk/models/list_whats_app_group_chats200_response_groups_inner.rb +168 -0
  34. data/lib/late-sdk/models/list_whats_app_group_chats200_response_paging.rb +147 -0
  35. data/lib/late-sdk/models/list_whats_app_group_chats200_response_paging_cursors.rb +156 -0
  36. data/lib/late-sdk/models/list_whats_app_group_join_requests200_response.rb +158 -0
  37. data/lib/late-sdk/models/list_whats_app_group_join_requests200_response_join_requests_inner.rb +158 -0
  38. data/lib/late-sdk/models/reject_whats_app_group_join_requests_request.rb +167 -0
  39. data/lib/late-sdk/models/remove_whats_app_group_participants_request.rb +167 -0
  40. data/lib/late-sdk/models/update_whats_app_group_chat_request.rb +237 -0
  41. data/lib/late-sdk/version.rb +1 -1
  42. data/lib/late-sdk.rb +18 -0
  43. data/openapi.yaml +371 -0
  44. data/spec/api/whats_app_api_spec.rb +148 -0
  45. data/spec/models/add_whats_app_group_participants_request_spec.rb +36 -0
  46. data/spec/models/approve_whats_app_group_join_requests_request_spec.rb +36 -0
  47. data/spec/models/create_whats_app_group_chat201_response_group_spec.rb +42 -0
  48. data/spec/models/create_whats_app_group_chat201_response_spec.rb +42 -0
  49. data/spec/models/create_whats_app_group_chat_request_spec.rb +58 -0
  50. data/spec/models/create_whats_app_group_invite_link200_response_spec.rb +42 -0
  51. data/spec/models/get_whats_app_group_chat200_response_group_participants_inner_spec.rb +42 -0
  52. data/spec/models/get_whats_app_group_chat200_response_group_spec.rb +78 -0
  53. data/spec/models/get_whats_app_group_chat200_response_spec.rb +42 -0
  54. data/spec/models/list_whats_app_group_chats200_response_groups_inner_spec.rb +48 -0
  55. data/spec/models/list_whats_app_group_chats200_response_paging_cursors_spec.rb +42 -0
  56. data/spec/models/list_whats_app_group_chats200_response_paging_spec.rb +36 -0
  57. data/spec/models/list_whats_app_group_chats200_response_spec.rb +42 -0
  58. data/spec/models/list_whats_app_group_join_requests200_response_join_requests_inner_spec.rb +42 -0
  59. data/spec/models/list_whats_app_group_join_requests200_response_spec.rb +42 -0
  60. data/spec/models/reject_whats_app_group_join_requests_request_spec.rb +36 -0
  61. data/spec/models/remove_whats_app_group_participants_request_spec.rb +36 -0
  62. data/spec/models/update_whats_app_group_chat_request_spec.rb +52 -0
  63. data/zernio-sdk-0.0.85.gem +0 -0
  64. metadata +74 -2
  65. data/zernio-sdk-0.0.84.gem +0 -0
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class CreateWhatsAppGroupChatRequest < ApiModelBase
18
+ # WhatsApp social account ID
19
+ attr_accessor :account_id
20
+
21
+ # Group name (max 128 characters)
22
+ attr_accessor :subject
23
+
24
+ # Group description (max 2048 characters)
25
+ attr_accessor :description
26
+
27
+ # Whether users need approval to join via invite link
28
+ attr_accessor :join_approval_mode
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'account_id' => :'accountId',
56
+ :'subject' => :'subject',
57
+ :'description' => :'description',
58
+ :'join_approval_mode' => :'joinApprovalMode'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'account_id' => :'String',
76
+ :'subject' => :'String',
77
+ :'description' => :'String',
78
+ :'join_approval_mode' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateWhatsAppGroupChatRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateWhatsAppGroupChatRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'account_id')
105
+ self.account_id = attributes[:'account_id']
106
+ else
107
+ self.account_id = nil
108
+ end
109
+
110
+ if attributes.key?(:'subject')
111
+ self.subject = attributes[:'subject']
112
+ else
113
+ self.subject = nil
114
+ end
115
+
116
+ if attributes.key?(:'description')
117
+ self.description = attributes[:'description']
118
+ end
119
+
120
+ if attributes.key?(:'join_approval_mode')
121
+ self.join_approval_mode = attributes[:'join_approval_mode']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @account_id.nil?
131
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
132
+ end
133
+
134
+ if @subject.nil?
135
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
136
+ end
137
+
138
+ if @subject.to_s.length > 128
139
+ invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 128.')
140
+ end
141
+
142
+ if !@description.nil? && @description.to_s.length > 2048
143
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2048.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ return false if @account_id.nil?
154
+ return false if @subject.nil?
155
+ return false if @subject.to_s.length > 128
156
+ return false if !@description.nil? && @description.to_s.length > 2048
157
+ join_approval_mode_validator = EnumAttributeValidator.new('String', ["approval_required", "auto_approve"])
158
+ return false unless join_approval_mode_validator.valid?(@join_approval_mode)
159
+ true
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] account_id Value to be assigned
164
+ def account_id=(account_id)
165
+ if account_id.nil?
166
+ fail ArgumentError, 'account_id cannot be nil'
167
+ end
168
+
169
+ @account_id = account_id
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] subject Value to be assigned
174
+ def subject=(subject)
175
+ if subject.nil?
176
+ fail ArgumentError, 'subject cannot be nil'
177
+ end
178
+
179
+ if subject.to_s.length > 128
180
+ fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 128.'
181
+ end
182
+
183
+ @subject = subject
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] description Value to be assigned
188
+ def description=(description)
189
+ if description.nil?
190
+ fail ArgumentError, 'description cannot be nil'
191
+ end
192
+
193
+ if description.to_s.length > 2048
194
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2048.'
195
+ end
196
+
197
+ @description = description
198
+ end
199
+
200
+ # Custom attribute writer method checking allowed values (enum).
201
+ # @param [Object] join_approval_mode Object to be assigned
202
+ def join_approval_mode=(join_approval_mode)
203
+ validator = EnumAttributeValidator.new('String', ["approval_required", "auto_approve"])
204
+ unless validator.valid?(join_approval_mode)
205
+ fail ArgumentError, "invalid value for \"join_approval_mode\", must be one of #{validator.allowable_values}."
206
+ end
207
+ @join_approval_mode = join_approval_mode
208
+ end
209
+
210
+ # Checks equality by comparing each attribute.
211
+ # @param [Object] Object to be compared
212
+ def ==(o)
213
+ return true if self.equal?(o)
214
+ self.class == o.class &&
215
+ account_id == o.account_id &&
216
+ subject == o.subject &&
217
+ description == o.description &&
218
+ join_approval_mode == o.join_approval_mode
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Integer] Hash code
229
+ def hash
230
+ [account_id, subject, description, join_approval_mode].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def self.build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ attributes = attributes.transform_keys(&:to_sym)
239
+ transformed_hash = {}
240
+ openapi_types.each_pair do |key, type|
241
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = nil
243
+ elsif type =~ /\AArray<(.*)>/i
244
+ # check to ensure the input is an array given that the attribute
245
+ # is documented as an array but the input is not
246
+ if attributes[attribute_map[key]].is_a?(Array)
247
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
248
+ end
249
+ elsif !attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
251
+ end
252
+ end
253
+ new(transformed_hash)
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ end
273
+
274
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class CreateWhatsAppGroupInviteLink200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ attr_accessor :invite_link
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'success' => :'success',
26
+ :'invite_link' => :'inviteLink'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'success' => :'Boolean',
44
+ :'invite_link' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateWhatsAppGroupInviteLink200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateWhatsAppGroupInviteLink200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.key?(:'invite_link')
75
+ self.invite_link = attributes[:'invite_link']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ success == o.success &&
100
+ invite_link == o.invite_link
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [success, invite_link].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class GetWhatsAppGroupChat200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ attr_accessor :group
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'success' => :'success',
26
+ :'group' => :'group'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'success' => :'Boolean',
44
+ :'group' => :'GetWhatsAppGroupChat200ResponseGroup'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetWhatsAppGroupChat200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetWhatsAppGroupChat200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.key?(:'group')
75
+ self.group = attributes[:'group']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ success == o.success &&
100
+ group == o.group
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [success, group].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end