rainbow-submarine-test-3356 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +150 -0
  4. data/Rakefile +8 -0
  5. data/docs/AppUser.md +14 -0
  6. data/docs/AppUserApi.md +616 -0
  7. data/docs/AppUserLink.md +9 -0
  8. data/docs/AppUserPreCreate.md +14 -0
  9. data/docs/AppUserResponse.md +8 -0
  10. data/docs/AppUserUpdate.md +12 -0
  11. data/docs/Client.md +12 -0
  12. data/docs/ClientInfo.md +15 -0
  13. data/docs/ClientResponse.md +8 -0
  14. data/docs/Conversation.md +9 -0
  15. data/docs/ConversationApi.md +192 -0
  16. data/docs/DeviceUpdate.md +10 -0
  17. data/docs/Event.md +8 -0
  18. data/docs/GetMessagesResponse.md +10 -0
  19. data/docs/Menu.md +9 -0
  20. data/docs/MenuApi.md +163 -0
  21. data/docs/MenuItem.md +13 -0
  22. data/docs/MenuResponse.md +8 -0
  23. data/docs/Message.md +17 -0
  24. data/docs/MessageResponse.md +9 -0
  25. data/docs/Postback.md +11 -0
  26. data/docs/TrackEventResponse.md +8 -0
  27. data/docs/TypingActivityTrigger.md +11 -0
  28. data/git_push.sh +55 -0
  29. data/lib/rainbow-submarine-test-3356.rb +61 -0
  30. data/lib/rainbow-submarine-test-3356/api/app_user_api.rb +585 -0
  31. data/lib/rainbow-submarine-test-3356/api/conversation_api.rb +189 -0
  32. data/lib/rainbow-submarine-test-3356/api/menu_api.rb +173 -0
  33. data/lib/rainbow-submarine-test-3356/api_client.rb +376 -0
  34. data/lib/rainbow-submarine-test-3356/api_error.rb +37 -0
  35. data/lib/rainbow-submarine-test-3356/configuration.rb +209 -0
  36. data/lib/rainbow-submarine-test-3356/models/app_user.rb +258 -0
  37. data/lib/rainbow-submarine-test-3356/models/app_user_link.rb +201 -0
  38. data/lib/rainbow-submarine-test-3356/models/app_user_pre_create.rb +246 -0
  39. data/lib/rainbow-submarine-test-3356/models/app_user_response.rb +192 -0
  40. data/lib/rainbow-submarine-test-3356/models/app_user_update.rb +223 -0
  41. data/lib/rainbow-submarine-test-3356/models/client.rb +248 -0
  42. data/lib/rainbow-submarine-test-3356/models/client_info.rb +250 -0
  43. data/lib/rainbow-submarine-test-3356/models/client_response.rb +187 -0
  44. data/lib/rainbow-submarine-test-3356/models/conversation.rb +206 -0
  45. data/lib/rainbow-submarine-test-3356/models/device_update.rb +205 -0
  46. data/lib/rainbow-submarine-test-3356/models/event.rb +192 -0
  47. data/lib/rainbow-submarine-test-3356/models/get_messages_response.rb +207 -0
  48. data/lib/rainbow-submarine-test-3356/models/menu.rb +203 -0
  49. data/lib/rainbow-submarine-test-3356/models/menu_item.rb +242 -0
  50. data/lib/rainbow-submarine-test-3356/models/menu_response.rb +192 -0
  51. data/lib/rainbow-submarine-test-3356/models/message.rb +303 -0
  52. data/lib/rainbow-submarine-test-3356/models/message_response.rb +206 -0
  53. data/lib/rainbow-submarine-test-3356/models/postback.rb +229 -0
  54. data/lib/rainbow-submarine-test-3356/models/track_event_response.rb +187 -0
  55. data/lib/rainbow-submarine-test-3356/models/typing_activity_trigger.rb +224 -0
  56. data/lib/rainbow-submarine-test-3356/version.rb +14 -0
  57. data/lib/swagger_client.rb +61 -0
  58. data/lib/swagger_client/api/app_user_api.rb +585 -0
  59. data/lib/swagger_client/api/conversation_api.rb +189 -0
  60. data/lib/swagger_client/api/menu_api.rb +173 -0
  61. data/lib/swagger_client/api_client.rb +376 -0
  62. data/lib/swagger_client/api_error.rb +37 -0
  63. data/lib/swagger_client/configuration.rb +209 -0
  64. data/lib/swagger_client/models/app_user.rb +258 -0
  65. data/lib/swagger_client/models/app_user_link.rb +201 -0
  66. data/lib/swagger_client/models/app_user_pre_create.rb +246 -0
  67. data/lib/swagger_client/models/app_user_response.rb +192 -0
  68. data/lib/swagger_client/models/app_user_update.rb +223 -0
  69. data/lib/swagger_client/models/client.rb +248 -0
  70. data/lib/swagger_client/models/client_info.rb +250 -0
  71. data/lib/swagger_client/models/client_response.rb +187 -0
  72. data/lib/swagger_client/models/conversation.rb +206 -0
  73. data/lib/swagger_client/models/device_update.rb +205 -0
  74. data/lib/swagger_client/models/event.rb +192 -0
  75. data/lib/swagger_client/models/get_messages_response.rb +207 -0
  76. data/lib/swagger_client/models/menu.rb +203 -0
  77. data/lib/swagger_client/models/menu_item.rb +242 -0
  78. data/lib/swagger_client/models/menu_response.rb +192 -0
  79. data/lib/swagger_client/models/message.rb +303 -0
  80. data/lib/swagger_client/models/message_response.rb +206 -0
  81. data/lib/swagger_client/models/postback.rb +229 -0
  82. data/lib/swagger_client/models/track_event_response.rb +187 -0
  83. data/lib/swagger_client/models/typing_activity_trigger.rb +224 -0
  84. data/lib/swagger_client/version.rb +14 -0
  85. data/rainbow-submarine-test-3356.gemspec +44 -0
  86. data/spec/api/app_user_api_spec.rb +162 -0
  87. data/spec/api/conversation_api_spec.rb +73 -0
  88. data/spec/api/menu_api_spec.rb +68 -0
  89. data/spec/api_client_spec.rb +225 -0
  90. data/spec/configuration_spec.rb +41 -0
  91. data/spec/models/app_user_link_spec.rb +47 -0
  92. data/spec/models/app_user_pre_create_spec.rb +77 -0
  93. data/spec/models/app_user_response_spec.rb +41 -0
  94. data/spec/models/app_user_spec.rb +77 -0
  95. data/spec/models/app_user_update_spec.rb +65 -0
  96. data/spec/models/client_info_spec.rb +83 -0
  97. data/spec/models/client_response_spec.rb +41 -0
  98. data/spec/models/client_spec.rb +65 -0
  99. data/spec/models/conversation_spec.rb +47 -0
  100. data/spec/models/device_update_spec.rb +53 -0
  101. data/spec/models/event_spec.rb +41 -0
  102. data/spec/models/get_messages_response_spec.rb +53 -0
  103. data/spec/models/menu_item_spec.rb +71 -0
  104. data/spec/models/menu_response_spec.rb +41 -0
  105. data/spec/models/menu_spec.rb +47 -0
  106. data/spec/models/message_response_spec.rb +47 -0
  107. data/spec/models/message_spec.rb +95 -0
  108. data/spec/models/postback_spec.rb +59 -0
  109. data/spec/models/track_event_response_spec.rb +41 -0
  110. data/spec/models/typing_activity_trigger_spec.rb +59 -0
  111. data/spec/spec_helper.rb +110 -0
  112. data/swagger_client.gemspec +45 -0
  113. metadata +361 -0
@@ -0,0 +1,201 @@
1
+ =begin
2
+ #Smooch
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module RainbowSubmarineTest3356
15
+
16
+ class AppUserLink
17
+ attr_accessor :type
18
+
19
+ attr_accessor :skip_confirmation
20
+
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'type' => :'type',
26
+ :'skip_confirmation' => :'skipConfirmation'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'type' => :'String',
34
+ :'skip_confirmation' => :'BOOLEAN'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
45
+
46
+ if attributes.has_key?(:'type')
47
+ self.type = attributes[:'type']
48
+ end
49
+
50
+ if attributes.has_key?(:'skipConfirmation')
51
+ self.skip_confirmation = attributes[:'skipConfirmation']
52
+ end
53
+
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properies with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ if @type.nil?
61
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
62
+ end
63
+
64
+ return invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ return false if @type.nil?
71
+ return true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ type == o.type &&
80
+ skip_confirmation == o.skip_confirmation
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
91
+ def hash
92
+ [type, skip_confirmation].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.swagger_types.each_pair do |key, type|
101
+ if type =~ /\AArray<(.*)>/i
102
+ # check to ensure the input is an array given that the the attribute
103
+ # is documented as an array but the input is not
104
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
105
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
106
+ end
107
+ elsif !attributes[self.class.attribute_map[key]].nil?
108
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
110
+ end
111
+
112
+ self
113
+ end
114
+
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
119
+ def _deserialize(type, value)
120
+ case type.to_sym
121
+ when :DateTime
122
+ DateTime.parse(value)
123
+ when :Date
124
+ Date.parse(value)
125
+ when :String
126
+ value.to_s
127
+ when :Integer
128
+ value.to_i
129
+ when :Float
130
+ value.to_f
131
+ when :BOOLEAN
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
+ true
134
+ else
135
+ false
136
+ end
137
+ when :Object
138
+ # generic object (usually a Hash), return directly
139
+ value
140
+ when /\AArray<(?<inner_type>.+)>\z/
141
+ inner_type = Regexp.last_match[:inner_type]
142
+ value.map { |v| _deserialize(inner_type, v) }
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
+ k_type = Regexp.last_match[:k_type]
145
+ v_type = Regexp.last_match[:v_type]
146
+ {}.tap do |hash|
147
+ value.each do |k, v|
148
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
+ end
150
+ end
151
+ else # model
152
+ temp_model = RainbowSubmarineTest3356.const_get(type).new
153
+ temp_model.build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Outputs non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ # @param [Object] value Any valid value
184
+ # @return [Hash] Returns the value in the form of hash
185
+ def _to_hash(value)
186
+ if value.is_a?(Array)
187
+ value.compact.map{ |v| _to_hash(v) }
188
+ elsif value.is_a?(Hash)
189
+ {}.tap do |hash|
190
+ value.each { |k, v| hash[k] = _to_hash(v) }
191
+ end
192
+ elsif value.respond_to? :to_hash
193
+ value.to_hash
194
+ else
195
+ value
196
+ end
197
+ end
198
+
199
+ end
200
+
201
+ end
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Smooch
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module RainbowSubmarineTest3356
15
+
16
+ class AppUserPreCreate
17
+ attr_accessor :user_id
18
+
19
+ attr_accessor :credential_required
20
+
21
+ attr_accessor :given_name
22
+
23
+ attr_accessor :surname
24
+
25
+ attr_accessor :email
26
+
27
+ attr_accessor :signed_up_at
28
+
29
+ attr_accessor :properties
30
+
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'user_id' => :'userId',
36
+ :'credential_required' => :'credentialRequired',
37
+ :'given_name' => :'givenName',
38
+ :'surname' => :'surname',
39
+ :'email' => :'email',
40
+ :'signed_up_at' => :'signedUpAt',
41
+ :'properties' => :'properties'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'user_id' => :'String',
49
+ :'credential_required' => :'BOOLEAN',
50
+ :'given_name' => :'String',
51
+ :'surname' => :'String',
52
+ :'email' => :'String',
53
+ :'signed_up_at' => :'String',
54
+ :'properties' => :'Object'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
65
+
66
+ if attributes.has_key?(:'userId')
67
+ self.user_id = attributes[:'userId']
68
+ end
69
+
70
+ if attributes.has_key?(:'credentialRequired')
71
+ self.credential_required = attributes[:'credentialRequired']
72
+ end
73
+
74
+ if attributes.has_key?(:'givenName')
75
+ self.given_name = attributes[:'givenName']
76
+ end
77
+
78
+ if attributes.has_key?(:'surname')
79
+ self.surname = attributes[:'surname']
80
+ end
81
+
82
+ if attributes.has_key?(:'email')
83
+ self.email = attributes[:'email']
84
+ end
85
+
86
+ if attributes.has_key?(:'signedUpAt')
87
+ self.signed_up_at = attributes[:'signedUpAt']
88
+ end
89
+
90
+ if attributes.has_key?(:'properties')
91
+ self.properties = attributes[:'properties']
92
+ end
93
+
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properies with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ if @user_id.nil?
101
+ invalid_properties.push("invalid value for 'user_id', user_id cannot be nil.")
102
+ end
103
+
104
+ return invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @user_id.nil?
111
+ return true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ user_id == o.user_id &&
120
+ credential_required == o.credential_required &&
121
+ given_name == o.given_name &&
122
+ surname == o.surname &&
123
+ email == o.email &&
124
+ signed_up_at == o.signed_up_at &&
125
+ properties == o.properties
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [user_id, credential_required, given_name, surname, email, signed_up_at, properties].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.swagger_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :BOOLEAN
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ temp_model = RainbowSubmarineTest3356.const_get(type).new
198
+ temp_model.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map{ |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #Smooch
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module RainbowSubmarineTest3356
15
+
16
+ class AppUserResponse
17
+ attr_accessor :app_user
18
+
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'app_user' => :'appUser'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'app_user' => :'AppUser'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
41
+
42
+ if attributes.has_key?(:'appUser')
43
+ self.app_user = attributes[:'appUser']
44
+ end
45
+
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properies with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ if @app_user.nil?
53
+ invalid_properties.push("invalid value for 'app_user', app_user cannot be nil.")
54
+ end
55
+
56
+ return invalid_properties
57
+ end
58
+
59
+ # Check to see if the all the properties in the model are valid
60
+ # @return true if the model is valid
61
+ def valid?
62
+ return false if @app_user.nil?
63
+ return true
64
+ end
65
+
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(o)
69
+ return true if self.equal?(o)
70
+ self.class == o.class &&
71
+ app_user == o.app_user
72
+ end
73
+
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(o)
77
+ self == o
78
+ end
79
+
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Fixnum] Hash code
82
+ def hash
83
+ [app_user].hash
84
+ end
85
+
86
+ # Builds the object from hash
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ # @return [Object] Returns the model itself
89
+ def build_from_hash(attributes)
90
+ return nil unless attributes.is_a?(Hash)
91
+ self.class.swagger_types.each_pair do |key, type|
92
+ if type =~ /\AArray<(.*)>/i
93
+ # check to ensure the input is an array given that the the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
96
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
97
+ end
98
+ elsif !attributes[self.class.attribute_map[key]].nil?
99
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
100
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
101
+ end
102
+
103
+ self
104
+ end
105
+
106
+ # Deserializes the data based on type
107
+ # @param string type Data type
108
+ # @param string value Value to be deserialized
109
+ # @return [Object] Deserialized data
110
+ def _deserialize(type, value)
111
+ case type.to_sym
112
+ when :DateTime
113
+ DateTime.parse(value)
114
+ when :Date
115
+ Date.parse(value)
116
+ when :String
117
+ value.to_s
118
+ when :Integer
119
+ value.to_i
120
+ when :Float
121
+ value.to_f
122
+ when :BOOLEAN
123
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
124
+ true
125
+ else
126
+ false
127
+ end
128
+ when :Object
129
+ # generic object (usually a Hash), return directly
130
+ value
131
+ when /\AArray<(?<inner_type>.+)>\z/
132
+ inner_type = Regexp.last_match[:inner_type]
133
+ value.map { |v| _deserialize(inner_type, v) }
134
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
135
+ k_type = Regexp.last_match[:k_type]
136
+ v_type = Regexp.last_match[:v_type]
137
+ {}.tap do |hash|
138
+ value.each do |k, v|
139
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
140
+ end
141
+ end
142
+ else # model
143
+ temp_model = RainbowSubmarineTest3356.const_get(type).new
144
+ temp_model.build_from_hash(value)
145
+ end
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_hash (backward compatibility)
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_body
157
+ to_hash
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ next if value.nil?
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map{ |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+
190
+ end
191
+
192
+ end