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,276 @@
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 a survey question and response obtained from an interaction.
18
+ class SurveyResponseOutcomeDetails
19
+ # Describes whether this outcome detail is being created, deleted, or updated. Which operations are accepted varies by outcome type. Defaults to create.
20
+ attr_accessor :operation
21
+
22
+ # This field categorizes the type of detailed outcome information being provided.
23
+ attr_accessor :type
24
+
25
+ attr_accessor :value
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'operation' => :'operation',
53
+ :'type' => :'type',
54
+ :'value' => :'value'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'operation' => :'String',
67
+ :'type' => :'String',
68
+ :'value' => :'SurveyResponse'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DdxInteractionsApi::SurveyResponseOutcomeDetails` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DdxInteractionsApi::SurveyResponseOutcomeDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'operation')
94
+ self.operation = attributes[:'operation']
95
+ end
96
+
97
+ if attributes.key?(:'type')
98
+ self.type = attributes[:'type']
99
+ end
100
+
101
+ if attributes.key?(:'value')
102
+ self.value = attributes[:'value']
103
+ else
104
+ self.value = nil
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @value.nil?
114
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
115
+ end
116
+
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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ operation_validator = EnumAttributeValidator.new('String', ["create", "delete"])
125
+ return false unless operation_validator.valid?(@operation)
126
+ return false if @value.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method checking allowed values (enum).
131
+ # @param [Object] operation Object to be assigned
132
+ def operation=(operation)
133
+ validator = EnumAttributeValidator.new('String', ["create", "delete"])
134
+ unless validator.valid?(operation)
135
+ fail ArgumentError, "invalid value for \"operation\", must be one of #{validator.allowable_values}."
136
+ end
137
+ @operation = operation
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ operation == o.operation &&
146
+ type == o.type &&
147
+ value == o.value
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
+ [operation, type, value].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
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ transformed_hash = {}
169
+ openapi_types.each_pair do |key, type|
170
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = nil
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[attribute_map[key]].is_a?(Array)
176
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
177
+ end
178
+ elsif !attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
180
+ end
181
+ end
182
+ new(transformed_hash)
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def self._deserialize(type, value)
190
+ case type.to_sym
191
+ when :Time
192
+ Time.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :Boolean
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ # models (e.g. Pet) or oneOf
223
+ klass = DdxInteractionsApi.const_get(type)
224
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ if value.nil?
247
+ is_nullable = self.class.openapi_nullable.include?(attr)
248
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
+ end
250
+
251
+ hash[param] = _to_hash(value)
252
+ end
253
+ hash
254
+ end
255
+
256
+ # Outputs non-array value in the form of hash
257
+ # For object, use to_hash. Otherwise, just return the value
258
+ # @param [Object] value Any valid value
259
+ # @return [Hash] Returns the value in the form of hash
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map { |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+
274
+ end
275
+
276
+ end
@@ -0,0 +1,319 @@
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
+ # VAN-specific external key fields, for display and other front-end use
18
+ class VanApiKeyDto
19
+ attr_accessor :external_api_key_id
20
+
21
+ attr_accessor :type
22
+
23
+ attr_accessor :status
24
+
25
+ attr_accessor :name
26
+
27
+ attr_accessor :date_created
28
+
29
+ attr_accessor :connections
30
+
31
+ attr_accessor :committee_name
32
+
33
+ attr_accessor :has_my_voters
34
+
35
+ attr_accessor :has_my_campaign
36
+
37
+ attr_accessor :key_ref
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'external_api_key_id' => :'externalApiKeyId',
65
+ :'type' => :'type',
66
+ :'status' => :'status',
67
+ :'name' => :'name',
68
+ :'date_created' => :'dateCreated',
69
+ :'connections' => :'connections',
70
+ :'committee_name' => :'committeeName',
71
+ :'has_my_voters' => :'hasMyVoters',
72
+ :'has_my_campaign' => :'hasMyCampaign',
73
+ :'key_ref' => :'keyRef'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'external_api_key_id' => :'Integer',
86
+ :'type' => :'ExternalApiKeyType',
87
+ :'status' => :'ExternalApiKeyStatus',
88
+ :'name' => :'String',
89
+ :'date_created' => :'Time',
90
+ :'connections' => :'Integer',
91
+ :'committee_name' => :'String',
92
+ :'has_my_voters' => :'Boolean',
93
+ :'has_my_campaign' => :'Boolean',
94
+ :'key_ref' => :'String'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ :'name',
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DdxInteractionsApi::VanApiKeyDto` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!self.class.attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DdxInteractionsApi::VanApiKeyDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'external_api_key_id')
121
+ self.external_api_key_id = attributes[:'external_api_key_id']
122
+ end
123
+
124
+ if attributes.key?(:'type')
125
+ self.type = attributes[:'type']
126
+ end
127
+
128
+ if attributes.key?(:'status')
129
+ self.status = attributes[:'status']
130
+ end
131
+
132
+ if attributes.key?(:'name')
133
+ self.name = attributes[:'name']
134
+ end
135
+
136
+ if attributes.key?(:'date_created')
137
+ self.date_created = attributes[:'date_created']
138
+ end
139
+
140
+ if attributes.key?(:'connections')
141
+ self.connections = attributes[:'connections']
142
+ end
143
+
144
+ if attributes.key?(:'committee_name')
145
+ self.committee_name = attributes[:'committee_name']
146
+ end
147
+
148
+ if attributes.key?(:'has_my_voters')
149
+ self.has_my_voters = attributes[:'has_my_voters']
150
+ end
151
+
152
+ if attributes.key?(:'has_my_campaign')
153
+ self.has_my_campaign = attributes[:'has_my_campaign']
154
+ end
155
+
156
+ if attributes.key?(:'key_ref')
157
+ self.key_ref = attributes[:'key_ref']
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
165
+ invalid_properties = Array.new
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+ warn '[DEPRECATED] the `valid?` method is obsolete'
173
+ true
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ external_api_key_id == o.external_api_key_id &&
182
+ type == o.type &&
183
+ status == o.status &&
184
+ name == o.name &&
185
+ date_created == o.date_created &&
186
+ connections == o.connections &&
187
+ committee_name == o.committee_name &&
188
+ has_my_voters == o.has_my_voters &&
189
+ has_my_campaign == o.has_my_campaign &&
190
+ key_ref == o.key_ref
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(o)
196
+ self == o
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ def hash
202
+ [external_api_key_id, type, status, name, date_created, connections, committee_name, has_my_voters, has_my_campaign, key_ref].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def self.build_from_hash(attributes)
209
+ return nil unless attributes.is_a?(Hash)
210
+ attributes = attributes.transform_keys(&:to_sym)
211
+ transformed_hash = {}
212
+ openapi_types.each_pair do |key, type|
213
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = nil
215
+ elsif type =~ /\AArray<(.*)>/i
216
+ # check to ensure the input is an array given that the attribute
217
+ # is documented as an array but the input is not
218
+ if attributes[attribute_map[key]].is_a?(Array)
219
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
220
+ end
221
+ elsif !attributes[attribute_map[key]].nil?
222
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
223
+ end
224
+ end
225
+ new(transformed_hash)
226
+ end
227
+
228
+ # Deserializes the data based on type
229
+ # @param string type Data type
230
+ # @param string value Value to be deserialized
231
+ # @return [Object] Deserialized data
232
+ def self._deserialize(type, value)
233
+ case type.to_sym
234
+ when :Time
235
+ Time.parse(value)
236
+ when :Date
237
+ Date.parse(value)
238
+ when :String
239
+ value.to_s
240
+ when :Integer
241
+ value.to_i
242
+ when :Float
243
+ value.to_f
244
+ when :Boolean
245
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
246
+ true
247
+ else
248
+ false
249
+ end
250
+ when :Object
251
+ # generic object (usually a Hash), return directly
252
+ value
253
+ when /\AArray<(?<inner_type>.+)>\z/
254
+ inner_type = Regexp.last_match[:inner_type]
255
+ value.map { |v| _deserialize(inner_type, v) }
256
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
257
+ k_type = Regexp.last_match[:k_type]
258
+ v_type = Regexp.last_match[:v_type]
259
+ {}.tap do |hash|
260
+ value.each do |k, v|
261
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
262
+ end
263
+ end
264
+ else # model
265
+ # models (e.g. Pet) or oneOf
266
+ klass = DdxInteractionsApi.const_get(type)
267
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
268
+ end
269
+ end
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # to_body is an alias to to_hash (backward compatibility)
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_body
280
+ to_hash
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+
317
+ end
318
+
319
+ 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 VanDatabaseMode
18
+ MY_VOTERS = "MyVoters".freeze
19
+ MY_CAMPAIGN = "MyCampaign".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [MY_VOTERS, MY_CAMPAIGN].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 VanDatabaseMode.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #VanDatabaseMode"
38
+ end
39
+ end
40
+ end