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,240 @@
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 SfvbTransactionalDeliveryOption
18
+ # What the option does.
19
+ attr_accessor :description
20
+
21
+ # The option's name. An update names options by it.
22
+ attr_accessor :name
23
+
24
+ # True when the option is on.
25
+ attr_accessor :selected
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'description' => :'description',
31
+ :'name' => :'name',
32
+ :'selected' => :'selected'
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
+ :'description' => :'String',
45
+ :'name' => :'String',
46
+ :'selected' => :'Boolean'
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::SfvbTransactionalDeliveryOption` 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::SfvbTransactionalDeliveryOption`. 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?(:'description')
72
+ self.description = attributes[:'description']
73
+ end
74
+
75
+ if attributes.key?(:'name')
76
+ self.name = attributes[:'name']
77
+ end
78
+
79
+ if attributes.key?(:'selected')
80
+ self.selected = attributes[:'selected']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ description == o.description &&
103
+ name == o.name &&
104
+ selected == o.selected
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [description, name, selected].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = UltracartClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -0,0 +1,283 @@
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 SfvbTransactionalEmailDetail
18
+ # Its delivery options. Empty for an email that has none.
19
+ attr_accessor :delivery_options
20
+
21
+ # The HTML template file, such as receipt_html.vm.
22
+ attr_accessor :file_name
23
+
24
+ # The hash of the subject, the options and the sender. Send it as If-Match to change them.
25
+ attr_accessor :hash_sha256
26
+
27
+ # The display name, such as Order - Receipt.
28
+ attr_accessor :name
29
+
30
+ attr_accessor :sender
31
+
32
+ # Every storefront on this account that shares the sender, this one included.
33
+ attr_accessor :sender_shared_with
34
+
35
+ # The subject line.
36
+ attr_accessor :subject
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'delivery_options' => :'delivery_options',
42
+ :'file_name' => :'file_name',
43
+ :'hash_sha256' => :'hash_sha256',
44
+ :'name' => :'name',
45
+ :'sender' => :'sender',
46
+ :'sender_shared_with' => :'sender_shared_with',
47
+ :'subject' => :'subject'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'delivery_options' => :'Array<SfvbTransactionalDeliveryOption>',
60
+ :'file_name' => :'String',
61
+ :'hash_sha256' => :'String',
62
+ :'name' => :'String',
63
+ :'sender' => :'SfvbTransactionalSender',
64
+ :'sender_shared_with' => :'Array<String>',
65
+ :'subject' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTransactionalEmailDetail` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTransactionalEmailDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'delivery_options')
91
+ if (value = attributes[:'delivery_options']).is_a?(Array)
92
+ self.delivery_options = value
93
+ end
94
+ end
95
+
96
+ if attributes.key?(:'file_name')
97
+ self.file_name = attributes[:'file_name']
98
+ end
99
+
100
+ if attributes.key?(:'hash_sha256')
101
+ self.hash_sha256 = attributes[:'hash_sha256']
102
+ end
103
+
104
+ if attributes.key?(:'name')
105
+ self.name = attributes[:'name']
106
+ end
107
+
108
+ if attributes.key?(:'sender')
109
+ self.sender = attributes[:'sender']
110
+ end
111
+
112
+ if attributes.key?(:'sender_shared_with')
113
+ if (value = attributes[:'sender_shared_with']).is_a?(Array)
114
+ self.sender_shared_with = value
115
+ end
116
+ end
117
+
118
+ if attributes.key?(:'subject')
119
+ self.subject = attributes[:'subject']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ delivery_options == o.delivery_options &&
142
+ file_name == o.file_name &&
143
+ hash_sha256 == o.hash_sha256 &&
144
+ name == o.name &&
145
+ sender == o.sender &&
146
+ sender_shared_with == o.sender_shared_with &&
147
+ subject == o.subject
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [delivery_options, file_name, hash_sha256, name, sender, sender_shared_with, subject].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ self.class.openapi_types.each_pair do |key, type|
176
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
177
+ self.send("#{key}=", nil)
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :Time
199
+ Time.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ # models (e.g. Pet) or oneOf
230
+ klass = UltracartClient.const_get(type)
231
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end