cybersource_rest_client 0.0.70 → 0.0.71

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/batches_api.rb +9 -9
  3. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +3 -149
  4. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +20 -261
  5. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +75 -0
  6. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +1 -1
  7. data/lib/cybersource_rest_client/models/inline_response_200_2.rb +64 -26
  8. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded.rb → inline_response_200_2__embedded.rb} +2 -2
  9. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded__links.rb → inline_response_200_2__embedded__links.rb} +2 -2
  10. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded__links_reports.rb → inline_response_200_2__embedded__links_reports.rb} +1 -1
  11. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded_batches.rb → inline_response_200_2__embedded_batches.rb} +3 -3
  12. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded_totals.rb → inline_response_200_2__embedded_totals.rb} +1 -1
  13. data/lib/cybersource_rest_client/models/{inline_response_200_5__links.rb → inline_response_200_2__links.rb} +1 -1
  14. data/lib/cybersource_rest_client/models/inline_response_200_3.rb +75 -120
  15. data/lib/cybersource_rest_client/models/{inline_response_200_6__links.rb → inline_response_200_3__links.rb} +2 -2
  16. data/lib/cybersource_rest_client/models/{inline_response_200_6__links_report.rb → inline_response_200_3__links_report.rb} +1 -1
  17. data/lib/cybersource_rest_client/models/{inline_response_200_6_billing.rb → inline_response_200_3_billing.rb} +1 -1
  18. data/lib/cybersource_rest_client/models/inline_response_200_4.rb +83 -126
  19. data/lib/cybersource_rest_client/models/{inline_response_200_7_records.rb → inline_response_200_4_records.rb} +3 -3
  20. data/lib/cybersource_rest_client/models/{inline_response_200_7_response_record.rb → inline_response_200_4_response_record.rb} +2 -2
  21. data/lib/cybersource_rest_client/models/{inline_response_200_7_response_record_additional_updates.rb → inline_response_200_4_response_record_additional_updates.rb} +1 -1
  22. data/lib/cybersource_rest_client/models/{inline_response_200_7_source_record.rb → inline_response_200_4_source_record.rb} +1 -1
  23. data/lib/cybersource_rest_client/models/inline_response_201_4.rb +64 -134
  24. data/lib/cybersource_rest_client/models/inline_response_201_4_payloads.rb +189 -0
  25. data/lib/cybersource_rest_client/models/inline_response_201_4_payloads_test_payload.rb +190 -0
  26. data/lib/cybersource_rest_client/models/inline_response_201_5.rb +5 -25
  27. data/lib/cybersource_rest_client/models/model_400_upload_batch_file_response.rb +199 -0
  28. data/lib/cybersource_rest_client/models/payments_strong_auth_issuer_information.rb +22 -5
  29. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1.rb +25 -5
  30. data/lib/cybersource_rest_client/models/{inline_response_404_2.rb → pts_v2_payments_post201_response_1_error_information.rb} +4 -2
  31. data/lib/cybersource_rest_client/models/{inline_response_404_2_details.rb → pts_v2_payments_post201_response_1_error_information_details.rb} +3 -12
  32. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_issuer_information.rb +213 -0
  33. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information.rb +15 -5
  34. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_amount_details.rb +196 -0
  35. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information.rb +11 -1
  36. data/lib/cybersource_rest_client/models/{notificationsubscriptionsv1webhooks_security_policy_1.rb → pts_v2_payments_post201_response_1_payment_information_e_wallet.rb} +30 -29
  37. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information.rb +41 -1
  38. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +11 -1
  39. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +1 -1
  40. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +1 -1
  41. data/lib/cybersource_rest_client/models/ptsv2payouts_recipient_information.rb +7 -7
  42. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information.rb +3 -3
  43. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information_account.rb +1 -1
  44. data/lib/cybersource_rest_client/models/save_asym_egress_key.rb +0 -10
  45. data/lib/cybersource_rest_client/models/save_sym_egress_key.rb +0 -10
  46. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_issuer_information.rb +22 -5
  47. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processor_information.rb +12 -1
  48. data/lib/cybersource_rest_client.rb +21 -32
  49. metadata +23 -34
  50. data/lib/cybersource_rest_client/api/replay_webhooks_api.rb +0 -98
  51. data/lib/cybersource_rest_client/models/create_webhook_request.rb +0 -289
  52. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +0 -251
  53. data/lib/cybersource_rest_client/models/inline_response_200_6.rb +0 -290
  54. data/lib/cybersource_rest_client/models/inline_response_200_7.rb +0 -292
  55. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1productsorganization_id_event_types.rb +0 -233
  56. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_notification_scope.rb +0 -205
  57. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_products.rb +0 -202
  58. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_retry_policy.rb +0 -270
  59. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy.rb +0 -201
  60. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy_1_config.rb +0 -223
  61. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy_1_config_additional_config.rb +0 -220
  62. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy_config.rb +0 -213
  63. data/lib/cybersource_rest_client/models/nrtfv1webhookswebhook_idreplays_by_delivery_status.rb +0 -243
  64. data/lib/cybersource_rest_client/models/replay_webhooks_request.rb +0 -201
  65. data/lib/cybersource_rest_client/models/update_webhook_request.rb +0 -314
@@ -1,289 +0,0 @@
1
- =begin
2
- #CyberSource Merged Spec
3
-
4
- #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
-
6
- OpenAPI spec version: 0.0.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.38
10
- =end
11
-
12
- require 'date'
13
-
14
- module CyberSource
15
- class CreateWebhookRequest
16
- # Client friendly webhook name.
17
- attr_accessor :name
18
-
19
- # Client friendly webhook description.
20
- attr_accessor :description
21
-
22
- # Organization Identifier (OrgId) or Merchant Identifier (MID).
23
- attr_accessor :organization_id
24
-
25
- # To see the valid productId and eventTypes, call the \"Create and Manage Webhooks - Retrieve a list of event types\" endpoint.
26
- attr_accessor :product_id
27
-
28
- # Array of the different events for a given product id.
29
- attr_accessor :event_types
30
-
31
- # The client's endpoint (URL) to receive webhooks.
32
- attr_accessor :webhook_url
33
-
34
- # The client's health check endpoint (URL). This should be as close as possible to the actual webhookUrl. If the user does not provide the health check URL, it is the user's responsibility to re-activate the webhook if it is deactivated by calling the test endpoint.
35
- attr_accessor :health_check_url
36
-
37
- # The webhook scope. 1. SELF The Webhook is used to deliver webhooks for only this Organization (or Merchant). 2. DESCENDANTS The Webhook is used to deliver webhooks for this Organization and its children. 3. CUSTOM The Webhook is used to deliver webhooks for the OrgIds (or MiDs) explicitly listed in scopeData field.
38
- attr_accessor :notification_scope
39
-
40
- attr_accessor :retry_policy
41
-
42
- attr_accessor :security_policy
43
-
44
- # Attribute mapping from ruby-style variable name to JSON key.
45
- def self.attribute_map
46
- {
47
- :'name' => :'name',
48
- :'description' => :'description',
49
- :'organization_id' => :'organizationId',
50
- :'product_id' => :'productId',
51
- :'event_types' => :'eventTypes',
52
- :'webhook_url' => :'webhookUrl',
53
- :'health_check_url' => :'healthCheckUrl',
54
- :'notification_scope' => :'notificationScope',
55
- :'retry_policy' => :'retryPolicy',
56
- :'security_policy' => :'securityPolicy'
57
- }
58
- end
59
-
60
- # Attribute mapping from JSON key to ruby-style variable name.
61
- def self.json_map
62
- {
63
- :'name' => :'name',
64
- :'description' => :'description',
65
- :'organization_id' => :'organization_id',
66
- :'product_id' => :'product_id',
67
- :'event_types' => :'event_types',
68
- :'webhook_url' => :'webhook_url',
69
- :'health_check_url' => :'health_check_url',
70
- :'notification_scope' => :'notification_scope',
71
- :'retry_policy' => :'retry_policy',
72
- :'security_policy' => :'security_policy'
73
- }
74
- end
75
-
76
- # Attribute type mapping.
77
- def self.swagger_types
78
- {
79
- :'name' => :'String',
80
- :'description' => :'String',
81
- :'organization_id' => :'String',
82
- :'product_id' => :'String',
83
- :'event_types' => :'Array<String>',
84
- :'webhook_url' => :'String',
85
- :'health_check_url' => :'String',
86
- :'notification_scope' => :'String',
87
- :'retry_policy' => :'Notificationsubscriptionsv1webhooksRetryPolicy',
88
- :'security_policy' => :'Notificationsubscriptionsv1webhooksSecurityPolicy1'
89
- }
90
- end
91
-
92
- # Initializes the object
93
- # @param [Hash] attributes Model attributes in the form of hash
94
- def initialize(attributes = {})
95
- return unless attributes.is_a?(Hash)
96
-
97
- # convert string to symbol for hash key
98
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
-
100
- if attributes.has_key?(:'name')
101
- self.name = attributes[:'name']
102
- end
103
-
104
- if attributes.has_key?(:'description')
105
- self.description = attributes[:'description']
106
- end
107
-
108
- if attributes.has_key?(:'organizationId')
109
- self.organization_id = attributes[:'organizationId']
110
- end
111
-
112
- if attributes.has_key?(:'productId')
113
- self.product_id = attributes[:'productId']
114
- end
115
-
116
- if attributes.has_key?(:'eventTypes')
117
- if (value = attributes[:'eventTypes']).is_a?(Array)
118
- self.event_types = value
119
- end
120
- end
121
-
122
- if attributes.has_key?(:'webhookUrl')
123
- self.webhook_url = attributes[:'webhookUrl']
124
- end
125
-
126
- if attributes.has_key?(:'healthCheckUrl')
127
- self.health_check_url = attributes[:'healthCheckUrl']
128
- end
129
-
130
- if attributes.has_key?(:'notificationScope')
131
- self.notification_scope = attributes[:'notificationScope']
132
- end
133
-
134
- if attributes.has_key?(:'retryPolicy')
135
- self.retry_policy = attributes[:'retryPolicy']
136
- end
137
-
138
- if attributes.has_key?(:'securityPolicy')
139
- self.security_policy = attributes[:'securityPolicy']
140
- end
141
- end
142
-
143
- # Show invalid properties with the reasons. Usually used together with valid?
144
- # @return Array for valid properties with the reasons
145
- def list_invalid_properties
146
- invalid_properties = Array.new
147
- invalid_properties
148
- end
149
-
150
- # Check to see if the all the properties in the model are valid
151
- # @return true if the model is valid
152
- def valid?
153
- true
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
- name == o.name &&
162
- description == o.description &&
163
- organization_id == o.organization_id &&
164
- product_id == o.product_id &&
165
- event_types == o.event_types &&
166
- webhook_url == o.webhook_url &&
167
- health_check_url == o.health_check_url &&
168
- notification_scope == o.notification_scope &&
169
- retry_policy == o.retry_policy &&
170
- security_policy == o.security_policy
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 [Fixnum] Hash code
181
- def hash
182
- [name, description, organization_id, product_id, event_types, webhook_url, health_check_url, notification_scope, retry_policy, security_policy].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 build_from_hash(attributes)
189
- return nil unless attributes.is_a?(Hash)
190
- self.class.swagger_types.each_pair do |key, type|
191
- if type =~ /\AArray<(.*)>/i
192
- # check to ensure the input is an array given that the the attribute
193
- # is documented as an array but the input is not
194
- if attributes[self.class.attribute_map[key]].is_a?(Array)
195
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
- end
197
- elsif !attributes[self.class.attribute_map[key]].nil?
198
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
- end # or else data not found in attributes(hash), not an issue as the data can be optional
200
- end
201
-
202
- self
203
- end
204
-
205
- # Deserializes the data based on type
206
- # @param string type Data type
207
- # @param string value Value to be deserialized
208
- # @return [Object] Deserialized data
209
- def _deserialize(type, value)
210
- case type.to_sym
211
- when :DateTime
212
- DateTime.parse(value)
213
- when :Date
214
- Date.parse(value)
215
- when :String
216
- value.to_s
217
- when :Integer
218
- value.to_i
219
- when :Float
220
- value.to_f
221
- when :BOOLEAN
222
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
- true
224
- else
225
- false
226
- end
227
- when :Object
228
- # generic object (usually a Hash), return directly
229
- value
230
- when /\AArray<(?<inner_type>.+)>\z/
231
- inner_type = Regexp.last_match[:inner_type]
232
- value.map { |v| _deserialize(inner_type, v) }
233
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
- k_type = Regexp.last_match[:k_type]
235
- v_type = Regexp.last_match[:v_type]
236
- {}.tap do |hash|
237
- value.each do |k, v|
238
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
- end
240
- end
241
- else # model
242
- temp_model = CyberSource.const_get(type).new
243
- temp_model.build_from_hash(value)
244
- end
245
- end
246
-
247
- # Returns the string representation of the object
248
- # @return [String] String presentation of the object
249
- def to_s
250
- to_hash.to_s
251
- end
252
-
253
- # to_body is an alias to to_hash (backward compatibility)
254
- # @return [Hash] Returns the object in the form of hash
255
- def to_body
256
- to_hash
257
- end
258
-
259
- # Returns the object in the form of hash
260
- # @return [Hash] Returns the object in the form of hash
261
- def to_hash
262
- hash = {}
263
- self.class.attribute_map.each_pair do |attr, param|
264
- value = self.send(attr)
265
- next if value.nil?
266
- hash[param] = _to_hash(value)
267
- end
268
- hash
269
- end
270
-
271
- # Outputs non-array value in the form of hash
272
- # For object, use to_hash. Otherwise, just return the value
273
- # @param [Object] value Any valid value
274
- # @return [Hash] Returns the value in the form of hash
275
- def _to_hash(value)
276
- if value.is_a?(Array)
277
- value.compact.map { |v| _to_hash(v) }
278
- elsif value.is_a?(Hash)
279
- {}.tap do |hash|
280
- value.each { |k, v| hash[k] = _to_hash(v) }
281
- end
282
- elsif value.respond_to? :to_hash
283
- value.to_hash
284
- else
285
- value
286
- end
287
- end
288
- end
289
- end
@@ -1,251 +0,0 @@
1
- =begin
2
- #CyberSource Merged Spec
3
-
4
- #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
-
6
- OpenAPI spec version: 0.0.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.38
10
- =end
11
-
12
- require 'date'
13
-
14
- module CyberSource
15
- class InlineResponse2005
16
- attr_accessor :_links
17
-
18
- attr_accessor :object
19
-
20
- attr_accessor :offset
21
-
22
- attr_accessor :limit
23
-
24
- attr_accessor :count
25
-
26
- attr_accessor :total
27
-
28
- attr_accessor :_embedded
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- :'_links' => :'_links',
34
- :'object' => :'object',
35
- :'offset' => :'offset',
36
- :'limit' => :'limit',
37
- :'count' => :'count',
38
- :'total' => :'total',
39
- :'_embedded' => :'_embedded'
40
- }
41
- end
42
-
43
- # Attribute mapping from JSON key to ruby-style variable name.
44
- def self.json_map
45
- {
46
- :'_links' => :'_links',
47
- :'object' => :'object',
48
- :'offset' => :'offset',
49
- :'limit' => :'limit',
50
- :'count' => :'count',
51
- :'total' => :'total',
52
- :'_embedded' => :'_embedded'
53
- }
54
- end
55
-
56
- # Attribute type mapping.
57
- def self.swagger_types
58
- {
59
- :'_links' => :'Array<InlineResponse2005Links>',
60
- :'object' => :'String',
61
- :'offset' => :'Integer',
62
- :'limit' => :'Integer',
63
- :'count' => :'Integer',
64
- :'total' => :'Integer',
65
- :'_embedded' => :'InlineResponse2005Embedded'
66
- }
67
- end
68
-
69
- # Initializes the object
70
- # @param [Hash] attributes Model attributes in the form of hash
71
- def initialize(attributes = {})
72
- return unless attributes.is_a?(Hash)
73
-
74
- # convert string to symbol for hash key
75
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
76
-
77
- if attributes.has_key?(:'_links')
78
- if (value = attributes[:'_links']).is_a?(Array)
79
- self._links = value
80
- end
81
- end
82
-
83
- if attributes.has_key?(:'object')
84
- self.object = attributes[:'object']
85
- end
86
-
87
- if attributes.has_key?(:'offset')
88
- self.offset = attributes[:'offset']
89
- end
90
-
91
- if attributes.has_key?(:'limit')
92
- self.limit = attributes[:'limit']
93
- end
94
-
95
- if attributes.has_key?(:'count')
96
- self.count = attributes[:'count']
97
- end
98
-
99
- if attributes.has_key?(:'total')
100
- self.total = attributes[:'total']
101
- end
102
-
103
- if attributes.has_key?(:'_embedded')
104
- self._embedded = attributes[:'_embedded']
105
- end
106
- end
107
-
108
- # Show invalid properties with the reasons. Usually used together with valid?
109
- # @return Array for valid properties with the reasons
110
- def list_invalid_properties
111
- invalid_properties = Array.new
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
- true
119
- end
120
-
121
- # Checks equality by comparing each attribute.
122
- # @param [Object] Object to be compared
123
- def ==(o)
124
- return true if self.equal?(o)
125
- self.class == o.class &&
126
- _links == o._links &&
127
- object == o.object &&
128
- offset == o.offset &&
129
- limit == o.limit &&
130
- count == o.count &&
131
- total == o.total &&
132
- _embedded == o._embedded
133
- end
134
-
135
- # @see the `==` method
136
- # @param [Object] Object to be compared
137
- def eql?(o)
138
- self == o
139
- end
140
-
141
- # Calculates hash code according to all attributes.
142
- # @return [Fixnum] Hash code
143
- def hash
144
- [_links, object, offset, limit, count, total, _embedded].hash
145
- end
146
-
147
- # Builds the object from hash
148
- # @param [Hash] attributes Model attributes in the form of hash
149
- # @return [Object] Returns the model itself
150
- def build_from_hash(attributes)
151
- return nil unless attributes.is_a?(Hash)
152
- self.class.swagger_types.each_pair do |key, type|
153
- if type =~ /\AArray<(.*)>/i
154
- # check to ensure the input is an array given that the the attribute
155
- # is documented as an array but the input is not
156
- if attributes[self.class.attribute_map[key]].is_a?(Array)
157
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
- end
159
- elsif !attributes[self.class.attribute_map[key]].nil?
160
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
161
- end # or else data not found in attributes(hash), not an issue as the data can be optional
162
- end
163
-
164
- self
165
- end
166
-
167
- # Deserializes the data based on type
168
- # @param string type Data type
169
- # @param string value Value to be deserialized
170
- # @return [Object] Deserialized data
171
- def _deserialize(type, value)
172
- case type.to_sym
173
- when :DateTime
174
- DateTime.parse(value)
175
- when :Date
176
- Date.parse(value)
177
- when :String
178
- value.to_s
179
- when :Integer
180
- value.to_i
181
- when :Float
182
- value.to_f
183
- when :BOOLEAN
184
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
- true
186
- else
187
- false
188
- end
189
- when :Object
190
- # generic object (usually a Hash), return directly
191
- value
192
- when /\AArray<(?<inner_type>.+)>\z/
193
- inner_type = Regexp.last_match[:inner_type]
194
- value.map { |v| _deserialize(inner_type, v) }
195
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
- k_type = Regexp.last_match[:k_type]
197
- v_type = Regexp.last_match[:v_type]
198
- {}.tap do |hash|
199
- value.each do |k, v|
200
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
- end
202
- end
203
- else # model
204
- temp_model = CyberSource.const_get(type).new
205
- temp_model.build_from_hash(value)
206
- end
207
- end
208
-
209
- # Returns the string representation of the object
210
- # @return [String] String presentation of the object
211
- def to_s
212
- to_hash.to_s
213
- end
214
-
215
- # to_body is an alias to to_hash (backward compatibility)
216
- # @return [Hash] Returns the object in the form of hash
217
- def to_body
218
- to_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
- next if value.nil?
228
- hash[param] = _to_hash(value)
229
- end
230
- hash
231
- end
232
-
233
- # Outputs non-array value in the form of hash
234
- # For object, use to_hash. Otherwise, just return the value
235
- # @param [Object] value Any valid value
236
- # @return [Hash] Returns the value in the form of hash
237
- def _to_hash(value)
238
- if value.is_a?(Array)
239
- value.compact.map { |v| _to_hash(v) }
240
- elsif value.is_a?(Hash)
241
- {}.tap do |hash|
242
- value.each { |k, v| hash[k] = _to_hash(v) }
243
- end
244
- elsif value.respond_to? :to_hash
245
- value.to_hash
246
- else
247
- value
248
- end
249
- end
250
- end
251
- end