late-sdk 0.0.108 → 0.0.110

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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -0
  3. data/docs/AnalyticsApi.md +78 -0
  4. data/docs/CreateWhatsAppFlow200Response.md +20 -0
  5. data/docs/CreateWhatsAppFlow200ResponseFlow.md +24 -0
  6. data/docs/CreateWhatsAppFlowRequest.md +24 -0
  7. data/docs/GetWhatsAppFlow200Response.md +20 -0
  8. data/docs/GetWhatsAppFlow200ResponseFlow.md +30 -0
  9. data/docs/GetWhatsAppFlow200ResponseFlowPreview.md +20 -0
  10. data/docs/GetWhatsAppFlowJson200Response.md +20 -0
  11. data/docs/GetWhatsAppFlowJson200ResponseAssetsInner.md +22 -0
  12. data/docs/GetYouTubeDemographics412Response.md +24 -0
  13. data/docs/GetYouTubeDemographics412ResponseScopeStatus.md +22 -0
  14. data/docs/ListWhatsAppFlows200Response.md +20 -0
  15. data/docs/ListWhatsAppFlows200ResponseFlowsInner.md +26 -0
  16. data/docs/PublishWhatsAppFlowRequest.md +18 -0
  17. data/docs/SendWhatsAppFlowMessage200Response.md +20 -0
  18. data/docs/SendWhatsAppFlowMessageRequest.md +38 -0
  19. data/docs/SendWhatsAppFlowMessageRequestFlowActionPayload.md +20 -0
  20. data/docs/SendWhatsAppFlowMessageRequestHeader.md +20 -0
  21. data/docs/UpdateWhatsAppFlowRequest.md +22 -0
  22. data/docs/UploadWhatsAppFlowJson200Response.md +20 -0
  23. data/docs/UploadWhatsAppFlowJson200ResponseValidationErrorsInner.md +30 -0
  24. data/docs/UploadWhatsAppFlowJsonRequest.md +20 -0
  25. data/docs/UploadWhatsAppFlowJsonRequestFlowJson.md +49 -0
  26. data/docs/WhatsAppFlowsApi.md +725 -0
  27. data/docs/YouTubeDemographicsResponse.md +28 -0
  28. data/docs/YouTubeDemographicsResponseDateRange.md +20 -0
  29. data/docs/YouTubeDemographicsResponseDemographicsValueInner.md +20 -0
  30. data/lib/late-sdk/api/analytics_api.rb +73 -0
  31. data/lib/late-sdk/api/whats_app_flows_api.rb +731 -0
  32. data/lib/late-sdk/models/create_whats_app_flow200_response.rb +156 -0
  33. data/lib/late-sdk/models/create_whats_app_flow200_response_flow.rb +176 -0
  34. data/lib/late-sdk/models/create_whats_app_flow_request.rb +257 -0
  35. data/lib/late-sdk/models/get_whats_app_flow200_response.rb +156 -0
  36. data/lib/late-sdk/models/get_whats_app_flow200_response_flow.rb +205 -0
  37. data/lib/late-sdk/models/get_whats_app_flow200_response_flow_preview.rb +156 -0
  38. data/lib/late-sdk/models/get_whats_app_flow_json200_response.rb +158 -0
  39. data/lib/late-sdk/models/get_whats_app_flow_json200_response_assets_inner.rb +166 -0
  40. data/lib/late-sdk/models/get_you_tube_demographics412_response.rb +174 -0
  41. data/lib/late-sdk/models/get_you_tube_demographics412_response_scope_status.rb +165 -0
  42. data/lib/late-sdk/models/list_whats_app_flows200_response.rb +158 -0
  43. data/lib/late-sdk/models/list_whats_app_flows200_response_flows_inner.rb +221 -0
  44. data/lib/late-sdk/models/publish_whats_app_flow_request.rb +165 -0
  45. data/lib/late-sdk/models/send_whats_app_flow_message200_response.rb +157 -0
  46. data/lib/late-sdk/models/send_whats_app_flow_message_request.rb +395 -0
  47. data/lib/late-sdk/models/send_whats_app_flow_message_request_flow_action_payload.rb +158 -0
  48. data/lib/late-sdk/models/send_whats_app_flow_message_request_header.rb +190 -0
  49. data/lib/late-sdk/models/update_whats_app_flow_request.rb +232 -0
  50. data/lib/late-sdk/models/upload_whats_app_flow_json200_response.rb +159 -0
  51. data/lib/late-sdk/models/upload_whats_app_flow_json200_response_validation_errors_inner.rb +201 -0
  52. data/lib/late-sdk/models/upload_whats_app_flow_json_request.rb +191 -0
  53. data/lib/late-sdk/models/upload_whats_app_flow_json_request_flow_json.rb +105 -0
  54. data/lib/late-sdk/models/you_tube_demographics_response.rb +196 -0
  55. data/lib/late-sdk/models/you_tube_demographics_response_date_range.rb +156 -0
  56. data/lib/late-sdk/models/you_tube_demographics_response_demographics_value_inner.rb +158 -0
  57. data/lib/late-sdk/version.rb +1 -1
  58. data/lib/late-sdk.rb +26 -0
  59. data/openapi.yaml +616 -1
  60. data/spec/api/analytics_api_spec.rb +15 -0
  61. data/spec/api/whats_app_flows_api_spec.rb +163 -0
  62. data/spec/models/create_whats_app_flow200_response_flow_spec.rb +54 -0
  63. data/spec/models/create_whats_app_flow200_response_spec.rb +42 -0
  64. data/spec/models/create_whats_app_flow_request_spec.rb +58 -0
  65. data/spec/models/get_whats_app_flow200_response_flow_preview_spec.rb +42 -0
  66. data/spec/models/get_whats_app_flow200_response_flow_spec.rb +72 -0
  67. data/spec/models/get_whats_app_flow200_response_spec.rb +42 -0
  68. data/spec/models/get_whats_app_flow_json200_response_assets_inner_spec.rb +48 -0
  69. data/spec/models/get_whats_app_flow_json200_response_spec.rb +42 -0
  70. data/spec/models/get_you_tube_demographics412_response_scope_status_spec.rb +48 -0
  71. data/spec/models/get_you_tube_demographics412_response_spec.rb +54 -0
  72. data/spec/models/list_whats_app_flows200_response_flows_inner_spec.rb +64 -0
  73. data/spec/models/list_whats_app_flows200_response_spec.rb +42 -0
  74. data/spec/models/publish_whats_app_flow_request_spec.rb +36 -0
  75. data/spec/models/send_whats_app_flow_message200_response_spec.rb +42 -0
  76. data/spec/models/send_whats_app_flow_message_request_flow_action_payload_spec.rb +42 -0
  77. data/spec/models/send_whats_app_flow_message_request_header_spec.rb +46 -0
  78. data/spec/models/send_whats_app_flow_message_request_spec.rb +100 -0
  79. data/spec/models/update_whats_app_flow_request_spec.rb +52 -0
  80. data/spec/models/upload_whats_app_flow_json200_response_spec.rb +42 -0
  81. data/spec/models/upload_whats_app_flow_json200_response_validation_errors_inner_spec.rb +72 -0
  82. data/spec/models/upload_whats_app_flow_json_request_flow_json_spec.rb +32 -0
  83. data/spec/models/upload_whats_app_flow_json_request_spec.rb +42 -0
  84. data/spec/models/you_tube_demographics_response_date_range_spec.rb +42 -0
  85. data/spec/models/you_tube_demographics_response_demographics_value_inner_spec.rb +42 -0
  86. data/spec/models/you_tube_demographics_response_spec.rb +66 -0
  87. data/zernio-sdk-0.0.110.gem +0 -0
  88. metadata +107 -3
  89. data/zernio-sdk-0.0.108.gem +0 -0
@@ -0,0 +1,221 @@
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 ListWhatsAppFlows200ResponseFlowsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :status
23
+
24
+ attr_accessor :categories
25
+
26
+ attr_accessor :validation_errors
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'id' => :'id',
54
+ :'name' => :'name',
55
+ :'status' => :'status',
56
+ :'categories' => :'categories',
57
+ :'validation_errors' => :'validation_errors'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'id' => :'String',
75
+ :'name' => :'String',
76
+ :'status' => :'String',
77
+ :'categories' => :'Array<String>',
78
+ :'validation_errors' => :'Array<Object>'
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::ListWhatsAppFlows200ResponseFlowsInner` 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::ListWhatsAppFlows200ResponseFlowsInner`. 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?(:'id')
105
+ self.id = attributes[:'id']
106
+ end
107
+
108
+ if attributes.key?(:'name')
109
+ self.name = attributes[:'name']
110
+ end
111
+
112
+ if attributes.key?(:'status')
113
+ self.status = attributes[:'status']
114
+ end
115
+
116
+ if attributes.key?(:'categories')
117
+ if (value = attributes[:'categories']).is_a?(Array)
118
+ self.categories = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'validation_errors')
123
+ if (value = attributes[:'validation_errors']).is_a?(Array)
124
+ self.validation_errors = value
125
+ end
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ status_validator = EnumAttributeValidator.new('String', ["DRAFT", "PUBLISHED", "DEPRECATED", "BLOCKED", "THROTTLED"])
142
+ return false unless status_validator.valid?(@status)
143
+ true
144
+ end
145
+
146
+ # Custom attribute writer method checking allowed values (enum).
147
+ # @param [Object] status Object to be assigned
148
+ def status=(status)
149
+ validator = EnumAttributeValidator.new('String', ["DRAFT", "PUBLISHED", "DEPRECATED", "BLOCKED", "THROTTLED"])
150
+ unless validator.valid?(status)
151
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
152
+ end
153
+ @status = status
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ id == o.id &&
162
+ name == o.name &&
163
+ status == o.status &&
164
+ categories == o.categories &&
165
+ validation_errors == o.validation_errors
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [id, name, status, categories, validation_errors].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,165 @@
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 PublishWhatsAppFlowRequest < ApiModelBase
18
+ # WhatsApp social account ID
19
+ attr_accessor :account_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'account_id' => :'accountId'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'account_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::PublishWhatsAppFlowRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::PublishWhatsAppFlowRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'account_id')
68
+ self.account_id = attributes[:'account_id']
69
+ else
70
+ self.account_id = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @account_id.nil?
80
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @account_id.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] account_id Value to be assigned
96
+ def account_id=(account_id)
97
+ if account_id.nil?
98
+ fail ArgumentError, 'account_id cannot be nil'
99
+ end
100
+
101
+ @account_id = account_id
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ account_id == o.account_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [account_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,157 @@
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 SendWhatsAppFlowMessage200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ # WhatsApp message ID (WAMID)
21
+ attr_accessor :message_id
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'success' => :'success',
27
+ :'message_id' => :'messageId'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'success' => :'Boolean',
45
+ :'message_id' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::SendWhatsAppFlowMessage200Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::SendWhatsAppFlowMessage200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'success')
72
+ self.success = attributes[:'success']
73
+ end
74
+
75
+ if attributes.key?(:'message_id')
76
+ self.message_id = attributes[:'message_id']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ success == o.success &&
101
+ message_id == o.message_id
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [success, message_id].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif 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[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end