late-sdk 0.0.877 → 0.0.879

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.
@@ -0,0 +1,166 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 Zernio
17
+ class ConnectWhatsAppEmbeddedSignup200Response < ApiModelBase
18
+ attr_accessor :message
19
+
20
+ attr_accessor :account
21
+
22
+ # Present only when `redirectUrl` was sent; also present on error responses.
23
+ attr_accessor :redirect_url
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'message' => :'message',
29
+ :'account' => :'account',
30
+ :'redirect_url' => :'redirectUrl'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'message' => :'String',
48
+ :'account' => :'ConnectWhatsAppEmbeddedSignup200ResponseAccount',
49
+ :'redirect_url' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ConnectWhatsAppEmbeddedSignup200Response` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ConnectWhatsAppEmbeddedSignup200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'message')
76
+ self.message = attributes[:'message']
77
+ end
78
+
79
+ if attributes.key?(:'account')
80
+ self.account = attributes[:'account']
81
+ end
82
+
83
+ if attributes.key?(:'redirect_url')
84
+ self.redirect_url = attributes[:'redirect_url']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ message == o.message &&
109
+ account == o.account &&
110
+ redirect_url == o.redirect_url
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [message, account, redirect_url].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end
@@ -0,0 +1,226 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 Zernio
17
+ class ConnectWhatsAppEmbeddedSignup200ResponseAccount < ApiModelBase
18
+ attr_accessor :account_id
19
+
20
+ attr_accessor :platform
21
+
22
+ attr_accessor :username
23
+
24
+ attr_accessor :display_name
25
+
26
+ attr_accessor :is_active
27
+
28
+ attr_accessor :selected_phone_number
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
+ :'platform' => :'platform',
57
+ :'username' => :'username',
58
+ :'display_name' => :'displayName',
59
+ :'is_active' => :'isActive',
60
+ :'selected_phone_number' => :'selectedPhoneNumber'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'account_id' => :'String',
78
+ :'platform' => :'String',
79
+ :'username' => :'String',
80
+ :'display_name' => :'String',
81
+ :'is_active' => :'Boolean',
82
+ :'selected_phone_number' => :'String'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ConnectWhatsAppEmbeddedSignup200ResponseAccount` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ConnectWhatsAppEmbeddedSignup200ResponseAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'account_id')
109
+ self.account_id = attributes[:'account_id']
110
+ end
111
+
112
+ if attributes.key?(:'platform')
113
+ self.platform = attributes[:'platform']
114
+ end
115
+
116
+ if attributes.key?(:'username')
117
+ self.username = attributes[:'username']
118
+ end
119
+
120
+ if attributes.key?(:'display_name')
121
+ self.display_name = attributes[:'display_name']
122
+ end
123
+
124
+ if attributes.key?(:'is_active')
125
+ self.is_active = attributes[:'is_active']
126
+ end
127
+
128
+ if attributes.key?(:'selected_phone_number')
129
+ self.selected_phone_number = attributes[:'selected_phone_number']
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ platform_validator = EnumAttributeValidator.new('String', ["whatsapp"])
146
+ return false unless platform_validator.valid?(@platform)
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] platform Object to be assigned
152
+ def platform=(platform)
153
+ validator = EnumAttributeValidator.new('String', ["whatsapp"])
154
+ unless validator.valid?(platform)
155
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @platform = platform
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ account_id == o.account_id &&
166
+ platform == o.platform &&
167
+ username == o.username &&
168
+ display_name == o.display_name &&
169
+ is_active == o.is_active &&
170
+ selected_phone_number == o.selected_phone_number
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [account_id, platform, username, display_name, is_active, selected_phone_number].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash)
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -31,6 +31,12 @@ module Zernio
31
31
  # Rejects the connect when Meta returns a different number
32
32
  attr_accessor :expected_phone_number
33
33
 
34
+ # Hosted signup page only. When present, the response also carries `redirectUrl`, the URL the user should land on, with the outcome mapped exactly like the redirect flow (success params, or `error` and `platform` with the same values). Must be an absolute http(s) URL or a custom app scheme.
35
+ attr_accessor :redirect_url
36
+
37
+ # Hosted signup page only. Append the connect token to the success redirect, as the redirect flow does for API-key callers.
38
+ attr_accessor :echo_connect_token
39
+
34
40
  # Attribute mapping from ruby-style variable name to JSON key.
35
41
  def self.attribute_map
36
42
  {
@@ -39,7 +45,9 @@ module Zernio
39
45
  :'waba_id' => :'wabaId',
40
46
  :'phone_number_id' => :'phoneNumberId',
41
47
  :'is_coexistence' => :'isCoexistence',
42
- :'expected_phone_number' => :'expectedPhoneNumber'
48
+ :'expected_phone_number' => :'expectedPhoneNumber',
49
+ :'redirect_url' => :'redirectUrl',
50
+ :'echo_connect_token' => :'echoConnectToken'
43
51
  }
44
52
  end
45
53
 
@@ -61,7 +69,9 @@ module Zernio
61
69
  :'waba_id' => :'String',
62
70
  :'phone_number_id' => :'String',
63
71
  :'is_coexistence' => :'Boolean',
64
- :'expected_phone_number' => :'String'
72
+ :'expected_phone_number' => :'String',
73
+ :'redirect_url' => :'String',
74
+ :'echo_connect_token' => :'Boolean'
65
75
  }
66
76
  end
67
77
 
@@ -114,6 +124,14 @@ module Zernio
114
124
  if attributes.key?(:'expected_phone_number')
115
125
  self.expected_phone_number = attributes[:'expected_phone_number']
116
126
  end
127
+
128
+ if attributes.key?(:'redirect_url')
129
+ self.redirect_url = attributes[:'redirect_url']
130
+ end
131
+
132
+ if attributes.key?(:'echo_connect_token')
133
+ self.echo_connect_token = attributes[:'echo_connect_token']
134
+ end
117
135
  end
118
136
 
119
137
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -171,7 +189,9 @@ module Zernio
171
189
  waba_id == o.waba_id &&
172
190
  phone_number_id == o.phone_number_id &&
173
191
  is_coexistence == o.is_coexistence &&
174
- expected_phone_number == o.expected_phone_number
192
+ expected_phone_number == o.expected_phone_number &&
193
+ redirect_url == o.redirect_url &&
194
+ echo_connect_token == o.echo_connect_token
175
195
  end
176
196
 
177
197
  # @see the `==` method
@@ -183,7 +203,7 @@ module Zernio
183
203
  # Calculates hash code according to all attributes.
184
204
  # @return [Integer] Hash code
185
205
  def hash
186
- [code, profile_id, waba_id, phone_number_id, is_coexistence, expected_phone_number].hash
206
+ [code, profile_id, waba_id, phone_number_id, is_coexistence, expected_phone_number, redirect_url, echo_connect_token].hash
187
207
  end
188
208
 
189
209
  # Builds the object from hash
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 Zernio
17
+ class GetWhatsAppSdkConfig200Response < ApiModelBase
18
+ # Meta app id
19
+ attr_accessor :app_id
20
+
21
+ # Embedded Signup configuration id
22
+ attr_accessor :config_id
23
+
24
+ attr_accessor :branding
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'app_id' => :'appId',
30
+ :'config_id' => :'configId',
31
+ :'branding' => :'branding'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'app_id' => :'String',
49
+ :'config_id' => :'String',
50
+ :'branding' => :'GetWhatsAppSdkConfig200ResponseBranding'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetWhatsAppSdkConfig200Response` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetWhatsAppSdkConfig200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'app_id')
77
+ self.app_id = attributes[:'app_id']
78
+ else
79
+ self.app_id = nil
80
+ end
81
+
82
+ if attributes.key?(:'config_id')
83
+ self.config_id = attributes[:'config_id']
84
+ else
85
+ self.config_id = nil
86
+ end
87
+
88
+ if attributes.key?(:'branding')
89
+ self.branding = attributes[:'branding']
90
+ else
91
+ self.branding = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @app_id.nil?
101
+ invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
102
+ end
103
+
104
+ if @config_id.nil?
105
+ invalid_properties.push('invalid value for "config_id", config_id cannot be nil.')
106
+ end
107
+
108
+ if @branding.nil?
109
+ invalid_properties.push('invalid value for "branding", branding cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @app_id.nil?
120
+ return false if @config_id.nil?
121
+ return false if @branding.nil?
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] app_id Value to be assigned
127
+ def app_id=(app_id)
128
+ if app_id.nil?
129
+ fail ArgumentError, 'app_id cannot be nil'
130
+ end
131
+
132
+ @app_id = app_id
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] config_id Value to be assigned
137
+ def config_id=(config_id)
138
+ if config_id.nil?
139
+ fail ArgumentError, 'config_id cannot be nil'
140
+ end
141
+
142
+ @config_id = config_id
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] branding Value to be assigned
147
+ def branding=(branding)
148
+ if branding.nil?
149
+ fail ArgumentError, 'branding cannot be nil'
150
+ end
151
+
152
+ @branding = branding
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ app_id == o.app_id &&
161
+ config_id == o.config_id &&
162
+ branding == o.branding
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [app_id, config_id, branding].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ end
217
+
218
+ end