late-sdk 0.0.111 → 0.0.113

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  3. data/docs/CreateInboxConversation201Response.md +20 -0
  4. data/docs/CreateInboxConversation201ResponseData.md +26 -0
  5. data/docs/CreateInboxConversation400Response.md +20 -0
  6. data/docs/CreateInboxConversation422Response.md +20 -0
  7. data/docs/CreateInboxConversationRequest.md +26 -0
  8. data/docs/CreatePostRequest.md +2 -0
  9. data/docs/EditPost200Response.md +24 -0
  10. data/docs/EditPostRequest.md +20 -0
  11. data/docs/FacebookPlatformData.md +3 -1
  12. data/docs/MessagesApi.md +70 -0
  13. data/docs/PostsApi.md +72 -0
  14. data/docs/TwitterPlatformData.md +3 -1
  15. data/docs/UpdatePostRequest.md +2 -0
  16. data/lib/late-sdk/api/messages_api.rb +68 -0
  17. data/lib/late-sdk/api/posts_api.rb +74 -0
  18. data/lib/late-sdk/models/create_inbox_conversation201_response.rb +156 -0
  19. data/lib/late-sdk/models/create_inbox_conversation201_response_data.rb +188 -0
  20. data/lib/late-sdk/models/create_inbox_conversation400_response.rb +190 -0
  21. data/lib/late-sdk/models/create_inbox_conversation422_response.rb +190 -0
  22. data/lib/late-sdk/models/create_inbox_conversation_request.rb +207 -0
  23. data/lib/late-sdk/models/create_post_request.rb +11 -1
  24. data/lib/late-sdk/models/edit_post200_response.rb +176 -0
  25. data/lib/late-sdk/models/edit_post_request.rb +216 -0
  26. data/lib/late-sdk/models/facebook_platform_data.rb +14 -2
  27. data/lib/late-sdk/models/twitter_platform_data.rb +16 -4
  28. data/lib/late-sdk/models/update_post_request.rb +11 -1
  29. data/lib/late-sdk/version.rb +1 -1
  30. data/lib/late-sdk.rb +7 -0
  31. data/openapi.yaml +207 -1
  32. data/spec/api/messages_api_spec.rb +12 -0
  33. data/spec/api/posts_api_spec.rb +13 -0
  34. data/spec/models/create_inbox_conversation201_response_data_spec.rb +60 -0
  35. data/spec/models/create_inbox_conversation201_response_spec.rb +42 -0
  36. data/spec/models/create_inbox_conversation400_response_spec.rb +46 -0
  37. data/spec/models/create_inbox_conversation422_response_spec.rb +46 -0
  38. data/spec/models/create_inbox_conversation_request_spec.rb +60 -0
  39. data/spec/models/create_post_request_spec.rb +6 -0
  40. data/spec/models/edit_post200_response_spec.rb +54 -0
  41. data/spec/models/edit_post_request_spec.rb +46 -0
  42. data/spec/models/facebook_platform_data_spec.rb +6 -0
  43. data/spec/models/twitter_platform_data_spec.rb +6 -0
  44. data/spec/models/update_post_request_spec.rb +6 -0
  45. data/zernio-sdk-0.0.113.gem +0 -0
  46. metadata +31 -3
  47. data/zernio-sdk-0.0.111.gem +0 -0
@@ -0,0 +1,190 @@
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 CreateInboxConversation422Response < ApiModelBase
18
+ attr_accessor :error
19
+
20
+ attr_accessor :code
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'error' => :'error',
48
+ :'code' => :'code'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'error' => :'String',
66
+ :'code' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateInboxConversation422Response` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateInboxConversation422Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'error')
93
+ self.error = attributes[:'error']
94
+ end
95
+
96
+ if attributes.key?(:'code')
97
+ self.code = attributes[:'code']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ code_validator = EnumAttributeValidator.new('String', ["DM_NOT_ALLOWED"])
114
+ return false unless code_validator.valid?(@code)
115
+ true
116
+ end
117
+
118
+ # Custom attribute writer method checking allowed values (enum).
119
+ # @param [Object] code Object to be assigned
120
+ def code=(code)
121
+ validator = EnumAttributeValidator.new('String', ["DM_NOT_ALLOWED"])
122
+ unless validator.valid?(code)
123
+ fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
124
+ end
125
+ @code = code
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ error == o.error &&
134
+ code == o.code
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [error, code].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -0,0 +1,207 @@
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 CreateInboxConversationRequest < ApiModelBase
18
+ # The social account ID to send from
19
+ attr_accessor :account_id
20
+
21
+ # Twitter numeric user ID of the recipient. Provide either this or `participantUsername`.
22
+ attr_accessor :participant_id
23
+
24
+ # Twitter username (with or without @) of the recipient. Resolved to a user ID via lookup. Provide either this or `participantId`.
25
+ attr_accessor :participant_username
26
+
27
+ # Text content of the message. At least one of `message` or attachment is required.
28
+ attr_accessor :message
29
+
30
+ # Skip the `receives_your_dm` eligibility check before sending. Use if you have already verified the recipient accepts DMs.
31
+ attr_accessor :skip_dm_check
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'account_id' => :'accountId',
37
+ :'participant_id' => :'participantId',
38
+ :'participant_username' => :'participantUsername',
39
+ :'message' => :'message',
40
+ :'skip_dm_check' => :'skipDmCheck'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'account_id' => :'String',
58
+ :'participant_id' => :'String',
59
+ :'participant_username' => :'String',
60
+ :'message' => :'String',
61
+ :'skip_dm_check' => :'Boolean'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateInboxConversationRequest` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateInboxConversationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'account_id')
88
+ self.account_id = attributes[:'account_id']
89
+ else
90
+ self.account_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'participant_id')
94
+ self.participant_id = attributes[:'participant_id']
95
+ end
96
+
97
+ if attributes.key?(:'participant_username')
98
+ self.participant_username = attributes[:'participant_username']
99
+ end
100
+
101
+ if attributes.key?(:'message')
102
+ self.message = attributes[:'message']
103
+ end
104
+
105
+ if attributes.key?(:'skip_dm_check')
106
+ self.skip_dm_check = attributes[:'skip_dm_check']
107
+ else
108
+ self.skip_dm_check = false
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @account_id.nil?
118
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ warn '[DEPRECATED] the `valid?` method is obsolete'
128
+ return false if @account_id.nil?
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] account_id Value to be assigned
134
+ def account_id=(account_id)
135
+ if account_id.nil?
136
+ fail ArgumentError, 'account_id cannot be nil'
137
+ end
138
+
139
+ @account_id = account_id
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ account_id == o.account_id &&
148
+ participant_id == o.participant_id &&
149
+ participant_username == o.participant_username &&
150
+ message == o.message &&
151
+ skip_dm_check == o.skip_dm_check
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Integer] Hash code
162
+ def hash
163
+ [account_id, participant_id, participant_username, message, skip_dm_check].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def self.build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ transformed_hash = {}
173
+ openapi_types.each_pair do |key, type|
174
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = nil
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[attribute_map[key]].is_a?(Array)
180
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
+ end
182
+ elsif !attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
+ end
185
+ end
186
+ new(transformed_hash)
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ end
206
+
207
+ end
@@ -49,6 +49,9 @@ module Late
49
49
  # Root-level TikTok settings applied to all TikTok platforms. Merged into each platform's platformSpecificData, with platform-specific settings taking precedence.
50
50
  attr_accessor :tiktok_settings
51
51
 
52
+ # Root-level Facebook settings applied to all Facebook platforms. Merged into each platform's platformSpecificData, with platform-specific settings taking precedence.
53
+ attr_accessor :facebook_settings
54
+
52
55
  attr_accessor :recycling
53
56
 
54
57
  # Profile ID to schedule via queue. When provided without scheduledFor, the post is auto-assigned to the next available slot. Do not call /v1/queue/next-slot and use that time in scheduledFor, as that bypasses queue locking.
@@ -74,6 +77,7 @@ module Late
74
77
  :'crossposting_enabled' => :'crosspostingEnabled',
75
78
  :'metadata' => :'metadata',
76
79
  :'tiktok_settings' => :'tiktokSettings',
80
+ :'facebook_settings' => :'facebookSettings',
77
81
  :'recycling' => :'recycling',
78
82
  :'queued_from_profile' => :'queuedFromProfile',
79
83
  :'queue_id' => :'queueId'
@@ -107,6 +111,7 @@ module Late
107
111
  :'crossposting_enabled' => :'Boolean',
108
112
  :'metadata' => :'Hash<String, Object>',
109
113
  :'tiktok_settings' => :'TikTokPlatformData',
114
+ :'facebook_settings' => :'FacebookPlatformData',
110
115
  :'recycling' => :'RecyclingConfig',
111
116
  :'queued_from_profile' => :'String',
112
117
  :'queue_id' => :'String'
@@ -211,6 +216,10 @@ module Late
211
216
  self.tiktok_settings = attributes[:'tiktok_settings']
212
217
  end
213
218
 
219
+ if attributes.key?(:'facebook_settings')
220
+ self.facebook_settings = attributes[:'facebook_settings']
221
+ end
222
+
214
223
  if attributes.key?(:'recycling')
215
224
  self.recycling = attributes[:'recycling']
216
225
  end
@@ -258,6 +267,7 @@ module Late
258
267
  crossposting_enabled == o.crossposting_enabled &&
259
268
  metadata == o.metadata &&
260
269
  tiktok_settings == o.tiktok_settings &&
270
+ facebook_settings == o.facebook_settings &&
261
271
  recycling == o.recycling &&
262
272
  queued_from_profile == o.queued_from_profile &&
263
273
  queue_id == o.queue_id
@@ -272,7 +282,7 @@ module Late
272
282
  # Calculates hash code according to all attributes.
273
283
  # @return [Integer] Hash code
274
284
  def hash
275
- [title, content, media_items, platforms, scheduled_for, publish_now, is_draft, timezone, tags, hashtags, mentions, crossposting_enabled, metadata, tiktok_settings, recycling, queued_from_profile, queue_id].hash
285
+ [title, content, media_items, platforms, scheduled_for, publish_now, is_draft, timezone, tags, hashtags, mentions, crossposting_enabled, metadata, tiktok_settings, facebook_settings, recycling, queued_from_profile, queue_id].hash
276
286
  end
277
287
 
278
288
  # Builds the object from hash
@@ -0,0 +1,176 @@
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 EditPost200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ # New tweet ID assigned by X after edit
21
+ attr_accessor :id
22
+
23
+ # URL of the edited tweet
24
+ attr_accessor :url
25
+
26
+ attr_accessor :message
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'success' => :'success',
32
+ :'id' => :'id',
33
+ :'url' => :'url',
34
+ :'message' => :'message'
35
+ }
36
+ end
37
+
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ acceptable_attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'success' => :'Boolean',
52
+ :'id' => :'String',
53
+ :'url' => :'String',
54
+ :'message' => :'String'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::EditPost200Response` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::EditPost200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'success')
81
+ self.success = attributes[:'success']
82
+ end
83
+
84
+ if attributes.key?(:'id')
85
+ self.id = attributes[:'id']
86
+ end
87
+
88
+ if attributes.key?(:'url')
89
+ self.url = attributes[:'url']
90
+ end
91
+
92
+ if attributes.key?(:'message')
93
+ self.message = attributes[:'message']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ success == o.success &&
118
+ id == o.id &&
119
+ url == o.url &&
120
+ message == o.message
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [success, id, url, message].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ if value.nil?
165
+ is_nullable = self.class.openapi_nullable.include?(attr)
166
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
167
+ end
168
+
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ end
175
+
176
+ end