ddx_interactions_api 0.1.0.pre.1

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 +7 -0
  2. data/README.md +160 -0
  3. data/lib/ddx_interactions_api/api/authentication_details_api.rb +85 -0
  4. data/lib/ddx_interactions_api/api/interactions_api.rb +386 -0
  5. data/lib/ddx_interactions_api/api_client.rb +437 -0
  6. data/lib/ddx_interactions_api/api_error.rb +58 -0
  7. data/lib/ddx_interactions_api/configuration.rb +396 -0
  8. data/lib/ddx_interactions_api/models/accepted_interaction_dto.rb +226 -0
  9. data/lib/ddx_interactions_api/models/accepted_interactions_dto.rb +228 -0
  10. data/lib/ddx_interactions_api/models/activist_code.rb +252 -0
  11. data/lib/ddx_interactions_api/models/activist_code_outcome_details.rb +276 -0
  12. data/lib/ddx_interactions_api/models/address.rb +284 -0
  13. data/lib/ddx_interactions_api/models/address_channel_details.rb +269 -0
  14. data/lib/ddx_interactions_api/models/canvasser_details.rb +278 -0
  15. data/lib/ddx_interactions_api/models/committee_details.rb +278 -0
  16. data/lib/ddx_interactions_api/models/communication_consent.rb +243 -0
  17. data/lib/ddx_interactions_api/models/communication_consent_outcome_details.rb +276 -0
  18. data/lib/ddx_interactions_api/models/communication_consent_status.rb +40 -0
  19. data/lib/ddx_interactions_api/models/contact_info.rb +291 -0
  20. data/lib/ddx_interactions_api/models/contact_method.rb +53 -0
  21. data/lib/ddx_interactions_api/models/dynamic_channel_details.rb +238 -0
  22. data/lib/ddx_interactions_api/models/dynamic_outcome_details.rb +258 -0
  23. data/lib/ddx_interactions_api/models/event_details.rb +278 -0
  24. data/lib/ddx_interactions_api/models/event_role.rb +217 -0
  25. data/lib/ddx_interactions_api/models/event_signup.rb +253 -0
  26. data/lib/ddx_interactions_api/models/event_signup_outcome_details.rb +276 -0
  27. data/lib/ddx_interactions_api/models/event_signup_status.rb +255 -0
  28. data/lib/ddx_interactions_api/models/event_signup_status_value.rb +47 -0
  29. data/lib/ddx_interactions_api/models/exchange_interaction_status.rb +43 -0
  30. data/lib/ddx_interactions_api/models/exchange_interaction_status_dto.rb +278 -0
  31. data/lib/ddx_interactions_api/models/exchange_interaction_status_dto_cursor_paginated_response_dto.rb +237 -0
  32. data/lib/ddx_interactions_api/models/external_api_key_status.rb +40 -0
  33. data/lib/ddx_interactions_api/models/external_api_key_type.rb +39 -0
  34. data/lib/ddx_interactions_api/models/external_transaction_status.rb +45 -0
  35. data/lib/ddx_interactions_api/models/initiative_dto.rb +239 -0
  36. data/lib/ddx_interactions_api/models/interaction_dto.rb +513 -0
  37. data/lib/ddx_interactions_api/models/interaction_dto_channel.rb +56 -0
  38. data/lib/ddx_interactions_api/models/interaction_dto_outcomes_detailed_inner.rb +61 -0
  39. data/lib/ddx_interactions_api/models/interaction_error_dto.rb +223 -0
  40. data/lib/ddx_interactions_api/models/interaction_van_fields_dto.rb +227 -0
  41. data/lib/ddx_interactions_api/models/interactions_batch_result_dto.rb +244 -0
  42. data/lib/ddx_interactions_api/models/interactions_dto.rb +216 -0
  43. data/lib/ddx_interactions_api/models/interactions_external_api_transaction_dto.rb +279 -0
  44. data/lib/ddx_interactions_api/models/interactions_external_api_transaction_dto_get_response_dto.rb +225 -0
  45. data/lib/ddx_interactions_api/models/interactions_external_api_transaction_log_dto.rb +238 -0
  46. data/lib/ddx_interactions_api/models/mercury_destination_van_api_key_dto.rb +246 -0
  47. data/lib/ddx_interactions_api/models/minerva_metadata_dto.rb +215 -0
  48. data/lib/ddx_interactions_api/models/outcome.rb +58 -0
  49. data/lib/ddx_interactions_api/models/outcome_detail_operation.rb +41 -0
  50. data/lib/ddx_interactions_api/models/person_identifier.rb +278 -0
  51. data/lib/ddx_interactions_api/models/problem_details.rb +255 -0
  52. data/lib/ddx_interactions_api/models/rejected_interaction_dto.rb +238 -0
  53. data/lib/ddx_interactions_api/models/rejected_interactions_dto.rb +228 -0
  54. data/lib/ddx_interactions_api/models/simple_destination_dto.rb +243 -0
  55. data/lib/ddx_interactions_api/models/simple_movement_app_dto.rb +237 -0
  56. data/lib/ddx_interactions_api/models/simple_workspace_dto.rb +277 -0
  57. data/lib/ddx_interactions_api/models/survey_response.rb +299 -0
  58. data/lib/ddx_interactions_api/models/survey_response_outcome_details.rb +276 -0
  59. data/lib/ddx_interactions_api/models/van_api_key_dto.rb +319 -0
  60. data/lib/ddx_interactions_api/models/van_database_mode.rb +40 -0
  61. data/lib/ddx_interactions_api/models/who_am_i_api_key_dto.rb +286 -0
  62. data/lib/ddx_interactions_api/models/workspace_type_dto.rb +40 -0
  63. data/lib/ddx_interactions_api/version.rb +15 -0
  64. data/lib/ddx_interactions_api.rb +96 -0
  65. metadata +175 -0
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Interactions API
3
+
4
+ #Interactions API documentation
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: api@demexchange.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DdxInteractionsApi
17
+ # Extends Minerva.Dto.Api.GetResponseDto`1 with cursor-based pagination support.
18
+ class ExchangeInteractionStatusDtoCursorPaginatedResponseDto
19
+ attr_accessor :metadata
20
+
21
+ attr_accessor :data
22
+
23
+ # Opaque cursor token for fetching the next page. Null if there are no more results.
24
+ attr_accessor :next_cursor
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'metadata' => :'metadata',
30
+ :'data' => :'data',
31
+ :'next_cursor' => :'nextCursor'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'metadata' => :'MinervaMetadataDto',
44
+ :'data' => :'Array<ExchangeInteractionStatusDto>',
45
+ :'next_cursor' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'next_cursor'
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 `DdxInteractionsApi::ExchangeInteractionStatusDtoCursorPaginatedResponseDto` 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 `DdxInteractionsApi::ExchangeInteractionStatusDtoCursorPaginatedResponseDto`. 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?(:'metadata')
72
+ self.metadata = attributes[:'metadata']
73
+ end
74
+
75
+ if attributes.key?(:'data')
76
+ if (value = attributes[:'data']).is_a?(Array)
77
+ self.data = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'next_cursor')
82
+ self.next_cursor = attributes[:'next_cursor']
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ warn '[DEPRECATED] the `valid?` method is obsolete'
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ metadata == o.metadata &&
107
+ data == o.data &&
108
+ next_cursor == o.next_cursor
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
+ [metadata, data, next_cursor].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
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def self._deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = DdxInteractionsApi.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -0,0 +1,40 @@
1
+ =begin
2
+ #Interactions API
3
+
4
+ #Interactions API documentation
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: api@demexchange.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DdxInteractionsApi
17
+ class ExternalApiKeyStatus
18
+ UNKNOWN = "Unknown".freeze
19
+ ACTIVE = "Active".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [UNKNOWN, ACTIVE].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if ExternalApiKeyStatus.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #ExternalApiKeyStatus"
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,39 @@
1
+ =begin
2
+ #Interactions API
3
+
4
+ #Interactions API documentation
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: api@demexchange.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DdxInteractionsApi
17
+ class ExternalApiKeyType
18
+ VAN = "Van".freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [VAN].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if ExternalApiKeyType.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #ExternalApiKeyType"
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,45 @@
1
+ =begin
2
+ #Interactions API
3
+
4
+ #Interactions API documentation
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: api@demexchange.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DdxInteractionsApi
17
+ class ExternalTransactionStatus
18
+ RECEIVED = "Received".freeze
19
+ PROCESSING = "Processing".freeze
20
+ SUCCESS = "Success".freeze
21
+ FAILED = "Failed".freeze
22
+ INVALID = "Invalid".freeze
23
+ DUPLICATE = "Duplicate".freeze
24
+ INTERNAL_ERROR = "InternalError".freeze
25
+
26
+ def self.all_vars
27
+ @all_vars ||= [RECEIVED, PROCESSING, SUCCESS, FAILED, INVALID, DUPLICATE, INTERNAL_ERROR].freeze
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def self.build_from_hash(value)
34
+ new.build_from_hash(value)
35
+ end
36
+
37
+ # Builds the enum from string
38
+ # @param [String] The enum value in the form of the string
39
+ # @return [String] The enum value
40
+ def build_from_hash(value)
41
+ return value if ExternalTransactionStatus.all_vars.include?(value)
42
+ raise "Invalid ENUM value #{value} for class #ExternalTransactionStatus"
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #Interactions API
3
+
4
+ #Interactions API documentation
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: api@demexchange.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DdxInteractionsApi
17
+ # Represents an initiative associated with an interaction, such as a campaign identifier.
18
+ class InitiativeDto
19
+ # Type of the initiative identifier specified in 'id'.
20
+ attr_accessor :type
21
+
22
+ # The actual initiative identifier, such as a campaign ID.
23
+ attr_accessor :id
24
+
25
+ # Descriptive name or title for the initiative.
26
+ attr_accessor :name
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'type' => :'type',
32
+ :'id' => :'id',
33
+ :'name' => :'name'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'type' => :'String',
46
+ :'id' => :'String',
47
+ :'name' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'type',
55
+ :'id',
56
+ :'name'
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 `DdxInteractionsApi::InitiativeDto` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DdxInteractionsApi::InitiativeDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'type')
76
+ self.type = attributes[:'type']
77
+ end
78
+
79
+ if attributes.key?(:'id')
80
+ self.id = attributes[:'id']
81
+ end
82
+
83
+ if attributes.key?(:'name')
84
+ self.name = attributes[:'name']
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
+ type == o.type &&
109
+ id == o.id &&
110
+ name == o.name
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
+ [type, id, name].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
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = DdxInteractionsApi.const_get(type)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end