smplkit 1.0.19 → 1.0.21

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/{default_api.rb → events_api.rb} +38 -102
  3. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +640 -0
  4. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/usage_api.rb +86 -0
  5. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +13 -1
  6. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb +353 -0
  7. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb +329 -0
  8. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_response.rb +202 -0
  9. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_resource.rb +201 -0
  10. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_response.rb +164 -0
  11. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_http.rb +239 -0
  12. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_links.rb +148 -0
  13. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_meta.rb +164 -0
  14. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_response.rb +202 -0
  15. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_resource.rb +201 -0
  16. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_response.rb +164 -0
  17. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/http_header.rb +218 -0
  18. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb +216 -0
  19. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/success_status.rb +103 -0
  20. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb +273 -0
  21. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb +220 -0
  22. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +19 -1
  23. data/lib/smplkit/_generated/audit/spec/api/{default_api_spec.rb → events_api_spec.rb} +13 -25
  24. data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +152 -0
  25. data/lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb +47 -0
  26. data/lib/smplkit/_generated/audit/spec/models/event_spec.rb +6 -0
  27. data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_response_spec.rb +48 -0
  28. data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_resource_spec.rb +48 -0
  29. data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_response_spec.rb +36 -0
  30. data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_spec.rb +94 -0
  31. data/lib/smplkit/_generated/audit/spec/models/forwarder_http_spec.rb +60 -0
  32. data/lib/smplkit/_generated/audit/spec/models/forwarder_list_links_spec.rb +36 -0
  33. data/lib/smplkit/_generated/audit/spec/models/forwarder_list_meta_spec.rb +36 -0
  34. data/lib/smplkit/_generated/audit/spec/models/forwarder_list_response_spec.rb +48 -0
  35. data/lib/smplkit/_generated/audit/spec/models/forwarder_resource_spec.rb +48 -0
  36. data/lib/smplkit/_generated/audit/spec/models/forwarder_response_spec.rb +36 -0
  37. data/lib/smplkit/_generated/audit/spec/models/forwarder_spec.rb +102 -0
  38. data/lib/smplkit/_generated/audit/spec/models/http_header_spec.rb +42 -0
  39. data/lib/smplkit/_generated/audit/spec/models/retry_failed_deliveries_summary_spec.rb +48 -0
  40. data/lib/smplkit/_generated/audit/spec/models/success_status_spec.rb +21 -0
  41. data/lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb +66 -0
  42. data/lib/smplkit/_generated/audit/spec/models/test_forwarder_response_spec.rb +66 -0
  43. data/lib/smplkit/audit/buffer.rb +15 -6
  44. data/lib/smplkit/audit/client.rb +1 -1
  45. data/lib/smplkit/audit/events.rb +1 -1
  46. metadata +39 -3
@@ -0,0 +1,201 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::Audit
17
+ class ForwarderDeliveryResource < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :type
21
+
22
+ attr_accessor :attributes
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'type' => :'type',
29
+ :'attributes' => :'attributes'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'id' => :'String',
47
+ :'type' => :'String',
48
+ :'attributes' => :'ForwarderDelivery'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::ForwarderDeliveryResource` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::ForwarderDeliveryResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'id')
75
+ self.id = attributes[:'id']
76
+ else
77
+ self.id = nil
78
+ end
79
+
80
+ if attributes.key?(:'type')
81
+ self.type = attributes[:'type']
82
+ else
83
+ self.type = 'forwarder_delivery'
84
+ end
85
+
86
+ if attributes.key?(:'attributes')
87
+ self.attributes = attributes[:'attributes']
88
+ else
89
+ self.attributes = nil
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @id.nil?
99
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
100
+ end
101
+
102
+ if @attributes.nil?
103
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
104
+ end
105
+
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
+ return false if @id.nil?
114
+ return false if @attributes.nil?
115
+ true
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] id Value to be assigned
120
+ def id=(id)
121
+ if id.nil?
122
+ fail ArgumentError, 'id cannot be nil'
123
+ end
124
+
125
+ @id = id
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] attributes Value to be assigned
130
+ def attributes=(attributes)
131
+ if attributes.nil?
132
+ fail ArgumentError, 'attributes cannot be nil'
133
+ end
134
+
135
+ @attributes = attributes
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ id == o.id &&
144
+ type == o.type &&
145
+ attributes == o.attributes
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [id, type, attributes].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ end
200
+
201
+ end
@@ -0,0 +1,164 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::Audit
17
+ class ForwarderDeliveryResponse < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'data' => :'ForwarderDeliveryResource'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::ForwarderDeliveryResponse` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::ForwarderDeliveryResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'data')
67
+ self.data = attributes[:'data']
68
+ else
69
+ self.data = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @data.nil?
79
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @data.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] data Value to be assigned
95
+ def data=(data)
96
+ if data.nil?
97
+ fail ArgumentError, 'data cannot be nil'
98
+ end
99
+
100
+ @data = data
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
+ data == o.data
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [data].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::Audit
17
+ # The destination HTTP request shape stored encrypted on a forwarder. ``success_status`` is either a single integer status (e.g. ``200``) or a class string like ``\"2xx\"``. Anything outside the matched set is treated as a delivery failure.
18
+ class ForwarderHttp < ApiModelBase
19
+ attr_accessor :method
20
+
21
+ attr_accessor :url
22
+
23
+ attr_accessor :headers
24
+
25
+ attr_accessor :body
26
+
27
+ attr_accessor :success_status
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'method' => :'method',
33
+ :'url' => :'url',
34
+ :'headers' => :'headers',
35
+ :'body' => :'body',
36
+ :'success_status' => :'success_status'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'method' => :'String',
54
+ :'url' => :'String',
55
+ :'headers' => :'Array<HttpHeader>',
56
+ :'body' => :'String',
57
+ :'success_status' => :'SuccessStatus'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'body',
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::ForwarderHttp` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::ForwarderHttp`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'method')
85
+ self.method = attributes[:'method']
86
+ else
87
+ self.method = 'POST'
88
+ end
89
+
90
+ if attributes.key?(:'url')
91
+ self.url = attributes[:'url']
92
+ else
93
+ self.url = nil
94
+ end
95
+
96
+ if attributes.key?(:'headers')
97
+ if (value = attributes[:'headers']).is_a?(Array)
98
+ self.headers = value
99
+ end
100
+ end
101
+
102
+ if attributes.key?(:'body')
103
+ self.body = attributes[:'body']
104
+ end
105
+
106
+ if attributes.key?(:'success_status')
107
+ self.success_status = attributes[:'success_status']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if @url.nil?
117
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
118
+ end
119
+
120
+ if @url.to_s.length > 2048
121
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 2048.')
122
+ end
123
+
124
+ if @url.to_s.length < 1
125
+ invalid_properties.push('invalid value for "url", the character length must be greater than or equal to 1.')
126
+ end
127
+
128
+ if !@body.nil? && @body.to_s.length > 65536
129
+ invalid_properties.push('invalid value for "body", the character length must be smaller than or equal to 65536.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ return false if @url.nil?
140
+ return false if @url.to_s.length > 2048
141
+ return false if @url.to_s.length < 1
142
+ return false if !@body.nil? && @body.to_s.length > 65536
143
+ true
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] url Value to be assigned
148
+ def url=(url)
149
+ if url.nil?
150
+ fail ArgumentError, 'url cannot be nil'
151
+ end
152
+
153
+ if url.to_s.length > 2048
154
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 2048.'
155
+ end
156
+
157
+ if url.to_s.length < 1
158
+ fail ArgumentError, 'invalid value for "url", the character length must be greater than or equal to 1.'
159
+ end
160
+
161
+ @url = url
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] body Value to be assigned
166
+ def body=(body)
167
+ if !body.nil? && body.to_s.length > 65536
168
+ fail ArgumentError, 'invalid value for "body", the character length must be smaller than or equal to 65536.'
169
+ end
170
+
171
+ @body = body
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ method == o.method &&
180
+ url == o.url &&
181
+ headers == o.headers &&
182
+ body == o.body &&
183
+ success_status == o.success_status
184
+ end
185
+
186
+ # @see the `==` method
187
+ # @param [Object] Object to be compared
188
+ def eql?(o)
189
+ self == o
190
+ end
191
+
192
+ # Calculates hash code according to all attributes.
193
+ # @return [Integer] Hash code
194
+ def hash
195
+ [method, url, headers, body, success_status].hash
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def self.build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ attributes = attributes.transform_keys(&:to_sym)
204
+ transformed_hash = {}
205
+ openapi_types.each_pair do |key, type|
206
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = nil
208
+ elsif type =~ /\AArray<(.*)>/i
209
+ # check to ensure the input is an array given that the attribute
210
+ # is documented as an array but the input is not
211
+ if attributes[attribute_map[key]].is_a?(Array)
212
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
213
+ end
214
+ elsif !attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
216
+ end
217
+ end
218
+ new(transformed_hash)
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ end
238
+
239
+ end