ultracart_api 4.1.230 → 4.1.232

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +62 -2
  3. data/docs/ItemAutoOrder.md +1 -1
  4. data/docs/ItemContentMultimedia.md +2 -0
  5. data/docs/SfvbApi.md +1011 -0
  6. data/docs/SfvbApprovalCreateRequest.md +9 -1
  7. data/docs/SfvbCampaign.md +2 -0
  8. data/docs/SfvbCommsBranchStat.md +20 -0
  9. data/docs/SfvbCommsChange.md +22 -0
  10. data/docs/SfvbCommsClick.md +20 -0
  11. data/docs/SfvbCommsClicksResponse.md +26 -0
  12. data/docs/SfvbCommsDailyStat.md +30 -0
  13. data/docs/SfvbCommsDashboardResponse.md +24 -0
  14. data/docs/SfvbCommsDashboardRow.md +28 -0
  15. data/docs/SfvbCommsMember.md +22 -0
  16. data/docs/SfvbCommsMembersResponse.md +36 -0
  17. data/docs/SfvbCommsPlan.md +66 -0
  18. data/docs/SfvbCommsPlanResponse.md +20 -0
  19. data/docs/SfvbCommsProvider.md +28 -0
  20. data/docs/SfvbCommsProviderImportRequest.md +22 -0
  21. data/docs/SfvbCommsProviderImportResponse.md +26 -0
  22. data/docs/SfvbCommsProviderList.md +20 -0
  23. data/docs/SfvbCommsProvidersResponse.md +22 -0
  24. data/docs/SfvbCommsSender.md +24 -0
  25. data/docs/SfvbCommsSenderUpdate.md +22 -0
  26. data/docs/SfvbCommsSequenceStatsResponse.md +26 -0
  27. data/docs/SfvbCommsSettings.md +34 -0
  28. data/docs/SfvbCommsSettingsResponse.md +24 -0
  29. data/docs/SfvbCommsSettingsUpdateRequest.md +26 -0
  30. data/docs/SfvbCommsStat.md +54 -0
  31. data/docs/SfvbCommsStepStat.md +34 -0
  32. data/docs/SfvbCommsTemplate.md +30 -0
  33. data/docs/SfvbCommsTemplateResponse.md +24 -0
  34. data/docs/SfvbCommsTemplatesResponse.md +20 -0
  35. data/docs/SfvbCommsTestEmailRequest.md +24 -0
  36. data/docs/SfvbCommsTestPostcardRequest.md +36 -0
  37. data/docs/SfvbCommsTestSendResponse.md +32 -0
  38. data/docs/SfvbCommsTestSmsRequest.md +18 -0
  39. data/docs/SfvbFlow.md +2 -0
  40. data/docs/SfvbPostcardAddress.md +28 -0
  41. data/docs/SfvbPostcardCard.md +40 -0
  42. data/docs/SfvbPostcardTrackingResponse.md +34 -0
  43. data/docs/SfvbTransactionalChange.md +24 -0
  44. data/docs/SfvbTransactionalDeliveryOption.md +22 -0
  45. data/docs/SfvbTransactionalEmailDetail.md +30 -0
  46. data/docs/SfvbTransactionalEmailResponse.md +24 -0
  47. data/docs/SfvbTransactionalEmailUpdateRequest.md +28 -0
  48. data/docs/SfvbTransactionalSender.md +24 -0
  49. data/lib/ultracart_api/api/sfvb_api.rb +1553 -183
  50. data/lib/ultracart_api/models/item_auto_order.rb +1 -1
  51. data/lib/ultracart_api/models/item_content_multimedia.rb +11 -1
  52. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +42 -6
  53. data/lib/ultracart_api/models/sfvb_campaign.rb +11 -1
  54. data/lib/ultracart_api/models/sfvb_comms_branch_stat.rb +229 -0
  55. data/lib/ultracart_api/models/sfvb_comms_change.rb +240 -0
  56. data/lib/ultracart_api/models/sfvb_comms_click.rb +230 -0
  57. data/lib/ultracart_api/models/sfvb_comms_clicks_response.rb +264 -0
  58. data/lib/ultracart_api/models/sfvb_comms_daily_stat.rb +280 -0
  59. data/lib/ultracart_api/models/sfvb_comms_dashboard_response.rb +256 -0
  60. data/lib/ultracart_api/models/sfvb_comms_dashboard_row.rb +269 -0
  61. data/lib/ultracart_api/models/sfvb_comms_member.rb +240 -0
  62. data/lib/ultracart_api/models/sfvb_comms_members_response.rb +314 -0
  63. data/lib/ultracart_api/models/sfvb_comms_plan.rb +460 -0
  64. data/lib/ultracart_api/models/sfvb_comms_plan_response.rb +231 -0
  65. data/lib/ultracart_api/models/sfvb_comms_provider.rb +272 -0
  66. data/lib/ultracart_api/models/sfvb_comms_provider_import_request.rb +242 -0
  67. data/lib/ultracart_api/models/sfvb_comms_provider_import_response.rb +264 -0
  68. data/lib/ultracart_api/models/sfvb_comms_provider_list.rb +230 -0
  69. data/lib/ultracart_api/models/sfvb_comms_providers_response.rb +244 -0
  70. data/lib/ultracart_api/models/sfvb_comms_sender.rb +250 -0
  71. data/lib/ultracart_api/models/sfvb_comms_sender_update.rb +240 -0
  72. data/lib/ultracart_api/models/sfvb_comms_sequence_stats_response.rb +263 -0
  73. data/lib/ultracart_api/models/sfvb_comms_settings.rb +297 -0
  74. data/lib/ultracart_api/models/sfvb_comms_settings_response.rb +253 -0
  75. data/lib/ultracart_api/models/sfvb_comms_settings_update_request.rb +257 -0
  76. data/lib/ultracart_api/models/sfvb_comms_stat.rb +402 -0
  77. data/lib/ultracart_api/models/sfvb_comms_step_stat.rb +301 -0
  78. data/lib/ultracart_api/models/sfvb_comms_template.rb +280 -0
  79. data/lib/ultracart_api/models/sfvb_comms_template_response.rb +251 -0
  80. data/lib/ultracart_api/models/sfvb_comms_templates_response.rb +234 -0
  81. data/lib/ultracart_api/models/sfvb_comms_test_email_request.rb +252 -0
  82. data/lib/ultracart_api/models/sfvb_comms_test_postcard_request.rb +312 -0
  83. data/lib/ultracart_api/models/sfvb_comms_test_send_response.rb +292 -0
  84. data/lib/ultracart_api/models/sfvb_comms_test_sms_request.rb +220 -0
  85. data/lib/ultracart_api/models/sfvb_flow.rb +11 -1
  86. data/lib/ultracart_api/models/sfvb_postcard_address.rb +270 -0
  87. data/lib/ultracart_api/models/sfvb_postcard_card.rb +328 -0
  88. data/lib/ultracart_api/models/sfvb_postcard_tracking_response.rb +304 -0
  89. data/lib/ultracart_api/models/sfvb_transactional_change.rb +250 -0
  90. data/lib/ultracart_api/models/sfvb_transactional_delivery_option.rb +240 -0
  91. data/lib/ultracart_api/models/sfvb_transactional_email_detail.rb +283 -0
  92. data/lib/ultracart_api/models/sfvb_transactional_email_response.rb +253 -0
  93. data/lib/ultracart_api/models/sfvb_transactional_email_update_request.rb +272 -0
  94. data/lib/ultracart_api/models/sfvb_transactional_sender.rb +250 -0
  95. data/lib/ultracart_api/version.rb +1 -1
  96. data/lib/ultracart_api.rb +40 -0
  97. metadata +81 -1
@@ -0,0 +1,272 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbCommsProvider
18
+ # True when the account has connected this provider. One that isn't connected has no lists and is connected in the admin.
19
+ attr_accessor :connected
20
+
21
+ # The provider's lists.
22
+ attr_accessor :lists
23
+
24
+ # The provider's logo.
25
+ attr_accessor :logo_url
26
+
27
+ # The provider, such as Mailchimp.
28
+ attr_accessor :name
29
+
30
+ # True when the provider supports unsubscribing.
31
+ attr_accessor :supports_list_unsubscribe
32
+
33
+ # True when the provider supports contact tags.
34
+ attr_accessor :supports_tags
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'connected' => :'connected',
40
+ :'lists' => :'lists',
41
+ :'logo_url' => :'logo_url',
42
+ :'name' => :'name',
43
+ :'supports_list_unsubscribe' => :'supports_list_unsubscribe',
44
+ :'supports_tags' => :'supports_tags'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'connected' => :'Boolean',
57
+ :'lists' => :'Array<SfvbCommsProviderList>',
58
+ :'logo_url' => :'String',
59
+ :'name' => :'String',
60
+ :'supports_list_unsubscribe' => :'Boolean',
61
+ :'supports_tags' => :'Boolean'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsProvider` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsProvider`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'connected')
87
+ self.connected = attributes[:'connected']
88
+ end
89
+
90
+ if attributes.key?(:'lists')
91
+ if (value = attributes[:'lists']).is_a?(Array)
92
+ self.lists = value
93
+ end
94
+ end
95
+
96
+ if attributes.key?(:'logo_url')
97
+ self.logo_url = attributes[:'logo_url']
98
+ end
99
+
100
+ if attributes.key?(:'name')
101
+ self.name = attributes[:'name']
102
+ end
103
+
104
+ if attributes.key?(:'supports_list_unsubscribe')
105
+ self.supports_list_unsubscribe = attributes[:'supports_list_unsubscribe']
106
+ end
107
+
108
+ if attributes.key?(:'supports_tags')
109
+ self.supports_tags = attributes[:'supports_tags']
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ invalid_properties = Array.new
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ connected == o.connected &&
132
+ lists == o.lists &&
133
+ logo_url == o.logo_url &&
134
+ name == o.name &&
135
+ supports_list_unsubscribe == o.supports_list_unsubscribe &&
136
+ supports_tags == o.supports_tags
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [connected, lists, logo_url, name, supports_list_unsubscribe, supports_tags].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ new.build_from_hash(attributes)
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ self.class.openapi_types.each_pair do |key, type|
165
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
+ self.send("#{key}=", nil)
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ end
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :Time
188
+ Time.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ # models (e.g. Pet) or oneOf
219
+ klass = UltracartClient.const_get(type)
220
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+
270
+ end
271
+
272
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbCommsProviderImportRequest
18
+ # Check the import and name what it would create, without importing or using an approval.
19
+ attr_accessor :dry_run
20
+
21
+ # The provider's list ids to import.
22
+ attr_accessor :list_ids
23
+
24
+ # The provider's name, from the providers list.
25
+ attr_accessor :provider
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'dry_run' => :'dry_run',
31
+ :'list_ids' => :'list_ids',
32
+ :'provider' => :'provider'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'dry_run' => :'Boolean',
45
+ :'list_ids' => :'Array<String>',
46
+ :'provider' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsProviderImportRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsProviderImportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'dry_run')
72
+ self.dry_run = attributes[:'dry_run']
73
+ end
74
+
75
+ if attributes.key?(:'list_ids')
76
+ if (value = attributes[:'list_ids']).is_a?(Array)
77
+ self.list_ids = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'provider')
82
+ self.provider = attributes[:'provider']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ dry_run == o.dry_run &&
105
+ list_ids == o.list_ids &&
106
+ provider == o.provider
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [dry_run, list_ids, provider].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ new.build_from_hash(attributes)
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ self.class.openapi_types.each_pair do |key, type|
135
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
136
+ self.send("#{key}=", nil)
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ end
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :Time
158
+ Time.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ # models (e.g. Pet) or oneOf
189
+ klass = UltracartClient.const_get(type)
190
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end