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.
- checksums.yaml +7 -0
- data/README.md +160 -0
- data/lib/ddx_interactions_api/api/authentication_details_api.rb +85 -0
- data/lib/ddx_interactions_api/api/interactions_api.rb +386 -0
- data/lib/ddx_interactions_api/api_client.rb +437 -0
- data/lib/ddx_interactions_api/api_error.rb +58 -0
- data/lib/ddx_interactions_api/configuration.rb +396 -0
- data/lib/ddx_interactions_api/models/accepted_interaction_dto.rb +226 -0
- data/lib/ddx_interactions_api/models/accepted_interactions_dto.rb +228 -0
- data/lib/ddx_interactions_api/models/activist_code.rb +252 -0
- data/lib/ddx_interactions_api/models/activist_code_outcome_details.rb +276 -0
- data/lib/ddx_interactions_api/models/address.rb +284 -0
- data/lib/ddx_interactions_api/models/address_channel_details.rb +269 -0
- data/lib/ddx_interactions_api/models/canvasser_details.rb +278 -0
- data/lib/ddx_interactions_api/models/committee_details.rb +278 -0
- data/lib/ddx_interactions_api/models/communication_consent.rb +243 -0
- data/lib/ddx_interactions_api/models/communication_consent_outcome_details.rb +276 -0
- data/lib/ddx_interactions_api/models/communication_consent_status.rb +40 -0
- data/lib/ddx_interactions_api/models/contact_info.rb +291 -0
- data/lib/ddx_interactions_api/models/contact_method.rb +53 -0
- data/lib/ddx_interactions_api/models/dynamic_channel_details.rb +238 -0
- data/lib/ddx_interactions_api/models/dynamic_outcome_details.rb +258 -0
- data/lib/ddx_interactions_api/models/event_details.rb +278 -0
- data/lib/ddx_interactions_api/models/event_role.rb +217 -0
- data/lib/ddx_interactions_api/models/event_signup.rb +253 -0
- data/lib/ddx_interactions_api/models/event_signup_outcome_details.rb +276 -0
- data/lib/ddx_interactions_api/models/event_signup_status.rb +255 -0
- data/lib/ddx_interactions_api/models/event_signup_status_value.rb +47 -0
- data/lib/ddx_interactions_api/models/exchange_interaction_status.rb +43 -0
- data/lib/ddx_interactions_api/models/exchange_interaction_status_dto.rb +278 -0
- data/lib/ddx_interactions_api/models/exchange_interaction_status_dto_cursor_paginated_response_dto.rb +237 -0
- data/lib/ddx_interactions_api/models/external_api_key_status.rb +40 -0
- data/lib/ddx_interactions_api/models/external_api_key_type.rb +39 -0
- data/lib/ddx_interactions_api/models/external_transaction_status.rb +45 -0
- data/lib/ddx_interactions_api/models/initiative_dto.rb +239 -0
- data/lib/ddx_interactions_api/models/interaction_dto.rb +513 -0
- data/lib/ddx_interactions_api/models/interaction_dto_channel.rb +56 -0
- data/lib/ddx_interactions_api/models/interaction_dto_outcomes_detailed_inner.rb +61 -0
- data/lib/ddx_interactions_api/models/interaction_error_dto.rb +223 -0
- data/lib/ddx_interactions_api/models/interaction_van_fields_dto.rb +227 -0
- data/lib/ddx_interactions_api/models/interactions_batch_result_dto.rb +244 -0
- data/lib/ddx_interactions_api/models/interactions_dto.rb +216 -0
- data/lib/ddx_interactions_api/models/interactions_external_api_transaction_dto.rb +279 -0
- data/lib/ddx_interactions_api/models/interactions_external_api_transaction_dto_get_response_dto.rb +225 -0
- data/lib/ddx_interactions_api/models/interactions_external_api_transaction_log_dto.rb +238 -0
- data/lib/ddx_interactions_api/models/mercury_destination_van_api_key_dto.rb +246 -0
- data/lib/ddx_interactions_api/models/minerva_metadata_dto.rb +215 -0
- data/lib/ddx_interactions_api/models/outcome.rb +58 -0
- data/lib/ddx_interactions_api/models/outcome_detail_operation.rb +41 -0
- data/lib/ddx_interactions_api/models/person_identifier.rb +278 -0
- data/lib/ddx_interactions_api/models/problem_details.rb +255 -0
- data/lib/ddx_interactions_api/models/rejected_interaction_dto.rb +238 -0
- data/lib/ddx_interactions_api/models/rejected_interactions_dto.rb +228 -0
- data/lib/ddx_interactions_api/models/simple_destination_dto.rb +243 -0
- data/lib/ddx_interactions_api/models/simple_movement_app_dto.rb +237 -0
- data/lib/ddx_interactions_api/models/simple_workspace_dto.rb +277 -0
- data/lib/ddx_interactions_api/models/survey_response.rb +299 -0
- data/lib/ddx_interactions_api/models/survey_response_outcome_details.rb +276 -0
- data/lib/ddx_interactions_api/models/van_api_key_dto.rb +319 -0
- data/lib/ddx_interactions_api/models/van_database_mode.rb +40 -0
- data/lib/ddx_interactions_api/models/who_am_i_api_key_dto.rb +286 -0
- data/lib/ddx_interactions_api/models/workspace_type_dto.rb +40 -0
- data/lib/ddx_interactions_api/version.rb +15 -0
- data/lib/ddx_interactions_api.rb +96 -0
- metadata +175 -0
|
@@ -0,0 +1,513 @@
|
|
|
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 single interaction record containing voter outreach attempt data.
|
|
18
|
+
class InteractionDto
|
|
19
|
+
# Optional ID used to identify a specific interaction. This ID should only be provided in the initial request when re-sending data, and must use DDx-provided interactionId value. If an existing ID is not provided to mark the interaction as a retry, Interactions API will populate this ID field and include it in the response for future use if the interaction needs to be re-sent.
|
|
20
|
+
attr_accessor :interaction_id
|
|
21
|
+
|
|
22
|
+
# Optional array of person identifiers representing all IDs from any vendor system for the person interacted with. Each identifier can contain an ID and type of ID indicating source system. If contact information for a person involved in the interaction is not provided, at least one ID is required. A maximum of 100 IDs are allowed per interaction. An ID of type 'VAN' must be present if VAN is included as a destination, even if contact information is provided. Each person identifier type can appear at most once in the array (i.e. no duplicate types are allowed).
|
|
23
|
+
attr_accessor :person
|
|
24
|
+
|
|
25
|
+
attr_accessor :contact_info
|
|
26
|
+
|
|
27
|
+
attr_accessor :channel
|
|
28
|
+
|
|
29
|
+
# 2-character US state postal abbreviation (e.g., AL, WY). Use \"NA\" when the state is unknown. Must be a valid uppercase state code.
|
|
30
|
+
attr_accessor :state_code
|
|
31
|
+
|
|
32
|
+
# The date and time when the outreach attempt occurred, as reported by the vendor and normalized to Coordinated Universal Time (UTC).
|
|
33
|
+
attr_accessor :attempt_date_time
|
|
34
|
+
|
|
35
|
+
attr_accessor :method
|
|
36
|
+
|
|
37
|
+
# Array of entities (campaign, state party, etc.) that conducted or logged the outreach attempt. Committee objects consist of a type and an identifier, and at least one committee must be provided.
|
|
38
|
+
attr_accessor :committee
|
|
39
|
+
|
|
40
|
+
# Array of canvasser details for the individual who conducted the outreach attempt, as reported by the vendor. Optional object containing identifier and identifier type.
|
|
41
|
+
attr_accessor :canvasser
|
|
42
|
+
|
|
43
|
+
# Canonical name of the vendor or tool used to facilitate the outreach attempt. This field reflects the platform through which the contact was made, not necessarily where the data was ingested from.
|
|
44
|
+
attr_accessor :vendor_source
|
|
45
|
+
|
|
46
|
+
attr_accessor :outcome
|
|
47
|
+
|
|
48
|
+
# Optional array of objects that provide additional context around the results of an interaction, such as activist codes or survey responses. If the type is recognized as an Activist Code Outcome (type = \"activist_code\"), Communication Consent Outcome (type = \"communication_consent\"), Survey Response Outcome (type = \"survey_response\"), or Event Signup (type = \"event_signup\") it will be deserialized to that type. If the type is unrecognized, it will be deserialized to an unvalidated, loosely typed object for flexibility.
|
|
49
|
+
attr_accessor :outcomes_detailed
|
|
50
|
+
|
|
51
|
+
# Unique identifier for interactions that took place during the same conversation or set of conversations. Used to group related interactions together. Maximum length of 100 characters.
|
|
52
|
+
attr_accessor :thread_id
|
|
53
|
+
|
|
54
|
+
# Additional metadata in JSON format related to the interaction. Must be valid JSON when provided. Can contain arbitrary structured data relevant to the interaction.
|
|
55
|
+
attr_accessor :json_metadata
|
|
56
|
+
|
|
57
|
+
attr_accessor :van_fields
|
|
58
|
+
|
|
59
|
+
# Optional array of initiatives associated with the interaction, such as campaign IDs. Each initiative can contain a type and an identifier.
|
|
60
|
+
attr_accessor :initiative
|
|
61
|
+
|
|
62
|
+
class EnumAttributeValidator
|
|
63
|
+
attr_reader :datatype
|
|
64
|
+
attr_reader :allowable_values
|
|
65
|
+
|
|
66
|
+
def initialize(datatype, allowable_values)
|
|
67
|
+
@allowable_values = allowable_values.map do |value|
|
|
68
|
+
case datatype.to_s
|
|
69
|
+
when /Integer/i
|
|
70
|
+
value.to_i
|
|
71
|
+
when /Float/i
|
|
72
|
+
value.to_f
|
|
73
|
+
else
|
|
74
|
+
value
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def valid?(value)
|
|
80
|
+
!value || allowable_values.include?(value)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
85
|
+
def self.attribute_map
|
|
86
|
+
{
|
|
87
|
+
:'interaction_id' => :'interactionId',
|
|
88
|
+
:'person' => :'person',
|
|
89
|
+
:'contact_info' => :'contactInfo',
|
|
90
|
+
:'channel' => :'channel',
|
|
91
|
+
:'state_code' => :'stateCode',
|
|
92
|
+
:'attempt_date_time' => :'attemptDateTime',
|
|
93
|
+
:'method' => :'method',
|
|
94
|
+
:'committee' => :'committee',
|
|
95
|
+
:'canvasser' => :'canvasser',
|
|
96
|
+
:'vendor_source' => :'vendorSource',
|
|
97
|
+
:'outcome' => :'outcome',
|
|
98
|
+
:'outcomes_detailed' => :'outcomesDetailed',
|
|
99
|
+
:'thread_id' => :'threadId',
|
|
100
|
+
:'json_metadata' => :'jsonMetadata',
|
|
101
|
+
:'van_fields' => :'vanFields',
|
|
102
|
+
:'initiative' => :'initiative'
|
|
103
|
+
}
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Returns all the JSON keys this model knows about
|
|
107
|
+
def self.acceptable_attributes
|
|
108
|
+
attribute_map.values
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Attribute type mapping.
|
|
112
|
+
def self.openapi_types
|
|
113
|
+
{
|
|
114
|
+
:'interaction_id' => :'String',
|
|
115
|
+
:'person' => :'Array<PersonIdentifier>',
|
|
116
|
+
:'contact_info' => :'ContactInfo',
|
|
117
|
+
:'channel' => :'InteractionDtoChannel',
|
|
118
|
+
:'state_code' => :'String',
|
|
119
|
+
:'attempt_date_time' => :'Time',
|
|
120
|
+
:'method' => :'ContactMethod',
|
|
121
|
+
:'committee' => :'Array<CommitteeDetails>',
|
|
122
|
+
:'canvasser' => :'Array<CanvasserDetails>',
|
|
123
|
+
:'vendor_source' => :'String',
|
|
124
|
+
:'outcome' => :'Outcome',
|
|
125
|
+
:'outcomes_detailed' => :'Array<InteractionDtoOutcomesDetailedInner>',
|
|
126
|
+
:'thread_id' => :'String',
|
|
127
|
+
:'json_metadata' => :'String',
|
|
128
|
+
:'van_fields' => :'InteractionVanFieldsDto',
|
|
129
|
+
:'initiative' => :'Array<InitiativeDto>'
|
|
130
|
+
}
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# List of attributes with nullable: true
|
|
134
|
+
def self.openapi_nullable
|
|
135
|
+
Set.new([
|
|
136
|
+
:'person',
|
|
137
|
+
:'channel',
|
|
138
|
+
:'canvasser',
|
|
139
|
+
:'outcomes_detailed',
|
|
140
|
+
:'thread_id',
|
|
141
|
+
:'json_metadata',
|
|
142
|
+
:'initiative'
|
|
143
|
+
])
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Initializes the object
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
def initialize(attributes = {})
|
|
149
|
+
if (!attributes.is_a?(Hash))
|
|
150
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DdxInteractionsApi::InteractionDto` initialize method"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
154
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
155
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
156
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DdxInteractionsApi::InteractionDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
157
|
+
end
|
|
158
|
+
h[k.to_sym] = v
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'interaction_id')
|
|
162
|
+
self.interaction_id = attributes[:'interaction_id']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'person')
|
|
166
|
+
if (value = attributes[:'person']).is_a?(Array)
|
|
167
|
+
self.person = value
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'contact_info')
|
|
172
|
+
self.contact_info = attributes[:'contact_info']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'channel')
|
|
176
|
+
self.channel = attributes[:'channel']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'state_code')
|
|
180
|
+
self.state_code = attributes[:'state_code']
|
|
181
|
+
else
|
|
182
|
+
self.state_code = nil
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'attempt_date_time')
|
|
186
|
+
self.attempt_date_time = attributes[:'attempt_date_time']
|
|
187
|
+
else
|
|
188
|
+
self.attempt_date_time = nil
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'method')
|
|
192
|
+
self.method = attributes[:'method']
|
|
193
|
+
else
|
|
194
|
+
self.method = nil
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'committee')
|
|
198
|
+
if (value = attributes[:'committee']).is_a?(Array)
|
|
199
|
+
self.committee = value
|
|
200
|
+
end
|
|
201
|
+
else
|
|
202
|
+
self.committee = nil
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'canvasser')
|
|
206
|
+
if (value = attributes[:'canvasser']).is_a?(Array)
|
|
207
|
+
self.canvasser = value
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'vendor_source')
|
|
212
|
+
self.vendor_source = attributes[:'vendor_source']
|
|
213
|
+
else
|
|
214
|
+
self.vendor_source = nil
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'outcome')
|
|
218
|
+
self.outcome = attributes[:'outcome']
|
|
219
|
+
else
|
|
220
|
+
self.outcome = nil
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if attributes.key?(:'outcomes_detailed')
|
|
224
|
+
if (value = attributes[:'outcomes_detailed']).is_a?(Array)
|
|
225
|
+
self.outcomes_detailed = value
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'thread_id')
|
|
230
|
+
self.thread_id = attributes[:'thread_id']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'json_metadata')
|
|
234
|
+
self.json_metadata = attributes[:'json_metadata']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'van_fields')
|
|
238
|
+
self.van_fields = attributes[:'van_fields']
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if attributes.key?(:'initiative')
|
|
242
|
+
if (value = attributes[:'initiative']).is_a?(Array)
|
|
243
|
+
self.initiative = value
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
249
|
+
# @return Array for valid properties with the reasons
|
|
250
|
+
def list_invalid_properties
|
|
251
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
252
|
+
invalid_properties = Array.new
|
|
253
|
+
if @state_code.nil?
|
|
254
|
+
invalid_properties.push('invalid value for "state_code", state_code cannot be nil.')
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if @state_code.to_s.length > 2
|
|
258
|
+
invalid_properties.push('invalid value for "state_code", the character length must be smaller than or equal to 2.')
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if @state_code.to_s.length < 2
|
|
262
|
+
invalid_properties.push('invalid value for "state_code", the character length must be great than or equal to 2.')
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if @attempt_date_time.nil?
|
|
266
|
+
invalid_properties.push('invalid value for "attempt_date_time", attempt_date_time cannot be nil.')
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if @method.nil?
|
|
270
|
+
invalid_properties.push('invalid value for "method", method cannot be nil.')
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if @committee.nil?
|
|
274
|
+
invalid_properties.push('invalid value for "committee", committee cannot be nil.')
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if @vendor_source.nil?
|
|
278
|
+
invalid_properties.push('invalid value for "vendor_source", vendor_source cannot be nil.')
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if @vendor_source.to_s.length < 1
|
|
282
|
+
invalid_properties.push('invalid value for "vendor_source", the character length must be great than or equal to 1.')
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if @outcome.nil?
|
|
286
|
+
invalid_properties.push('invalid value for "outcome", outcome cannot be nil.')
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
if !@thread_id.nil? && @thread_id.to_s.length > 100
|
|
290
|
+
invalid_properties.push('invalid value for "thread_id", the character length must be smaller than or equal to 100.')
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
if !@thread_id.nil? && @thread_id.to_s.length < 0
|
|
294
|
+
invalid_properties.push('invalid value for "thread_id", the character length must be great than or equal to 0.')
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
invalid_properties
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Check to see if the all the properties in the model are valid
|
|
301
|
+
# @return true if the model is valid
|
|
302
|
+
def valid?
|
|
303
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
304
|
+
return false if @state_code.nil?
|
|
305
|
+
return false if @state_code.to_s.length > 2
|
|
306
|
+
return false if @state_code.to_s.length < 2
|
|
307
|
+
return false if @attempt_date_time.nil?
|
|
308
|
+
return false if @method.nil?
|
|
309
|
+
return false if @committee.nil?
|
|
310
|
+
return false if @vendor_source.nil?
|
|
311
|
+
return false if @vendor_source.to_s.length < 1
|
|
312
|
+
return false if @outcome.nil?
|
|
313
|
+
return false if !@thread_id.nil? && @thread_id.to_s.length > 100
|
|
314
|
+
return false if !@thread_id.nil? && @thread_id.to_s.length < 0
|
|
315
|
+
true
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Custom attribute writer method with validation
|
|
319
|
+
# @param [Object] state_code Value to be assigned
|
|
320
|
+
def state_code=(state_code)
|
|
321
|
+
if state_code.nil?
|
|
322
|
+
fail ArgumentError, 'state_code cannot be nil'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
if state_code.to_s.length > 2
|
|
326
|
+
fail ArgumentError, 'invalid value for "state_code", the character length must be smaller than or equal to 2.'
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
if state_code.to_s.length < 2
|
|
330
|
+
fail ArgumentError, 'invalid value for "state_code", the character length must be great than or equal to 2.'
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
@state_code = state_code
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Custom attribute writer method with validation
|
|
337
|
+
# @param [Object] vendor_source Value to be assigned
|
|
338
|
+
def vendor_source=(vendor_source)
|
|
339
|
+
if vendor_source.nil?
|
|
340
|
+
fail ArgumentError, 'vendor_source cannot be nil'
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
if vendor_source.to_s.length < 1
|
|
344
|
+
fail ArgumentError, 'invalid value for "vendor_source", the character length must be great than or equal to 1.'
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
@vendor_source = vendor_source
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
# Custom attribute writer method with validation
|
|
351
|
+
# @param [Object] thread_id Value to be assigned
|
|
352
|
+
def thread_id=(thread_id)
|
|
353
|
+
if !thread_id.nil? && thread_id.to_s.length > 100
|
|
354
|
+
fail ArgumentError, 'invalid value for "thread_id", the character length must be smaller than or equal to 100.'
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
if !thread_id.nil? && thread_id.to_s.length < 0
|
|
358
|
+
fail ArgumentError, 'invalid value for "thread_id", the character length must be great than or equal to 0.'
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
@thread_id = thread_id
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Checks equality by comparing each attribute.
|
|
365
|
+
# @param [Object] Object to be compared
|
|
366
|
+
def ==(o)
|
|
367
|
+
return true if self.equal?(o)
|
|
368
|
+
self.class == o.class &&
|
|
369
|
+
interaction_id == o.interaction_id &&
|
|
370
|
+
person == o.person &&
|
|
371
|
+
contact_info == o.contact_info &&
|
|
372
|
+
channel == o.channel &&
|
|
373
|
+
state_code == o.state_code &&
|
|
374
|
+
attempt_date_time == o.attempt_date_time &&
|
|
375
|
+
method == o.method &&
|
|
376
|
+
committee == o.committee &&
|
|
377
|
+
canvasser == o.canvasser &&
|
|
378
|
+
vendor_source == o.vendor_source &&
|
|
379
|
+
outcome == o.outcome &&
|
|
380
|
+
outcomes_detailed == o.outcomes_detailed &&
|
|
381
|
+
thread_id == o.thread_id &&
|
|
382
|
+
json_metadata == o.json_metadata &&
|
|
383
|
+
van_fields == o.van_fields &&
|
|
384
|
+
initiative == o.initiative
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# @see the `==` method
|
|
388
|
+
# @param [Object] Object to be compared
|
|
389
|
+
def eql?(o)
|
|
390
|
+
self == o
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Calculates hash code according to all attributes.
|
|
394
|
+
# @return [Integer] Hash code
|
|
395
|
+
def hash
|
|
396
|
+
[interaction_id, person, contact_info, channel, state_code, attempt_date_time, method, committee, canvasser, vendor_source, outcome, outcomes_detailed, thread_id, json_metadata, van_fields, initiative].hash
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# Builds the object from hash
|
|
400
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
401
|
+
# @return [Object] Returns the model itself
|
|
402
|
+
def self.build_from_hash(attributes)
|
|
403
|
+
return nil unless attributes.is_a?(Hash)
|
|
404
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
405
|
+
transformed_hash = {}
|
|
406
|
+
openapi_types.each_pair do |key, type|
|
|
407
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
408
|
+
transformed_hash["#{key}"] = nil
|
|
409
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
410
|
+
# check to ensure the input is an array given that the attribute
|
|
411
|
+
# is documented as an array but the input is not
|
|
412
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
413
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
414
|
+
end
|
|
415
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
416
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
417
|
+
end
|
|
418
|
+
end
|
|
419
|
+
new(transformed_hash)
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
# Deserializes the data based on type
|
|
423
|
+
# @param string type Data type
|
|
424
|
+
# @param string value Value to be deserialized
|
|
425
|
+
# @return [Object] Deserialized data
|
|
426
|
+
def self._deserialize(type, value)
|
|
427
|
+
case type.to_sym
|
|
428
|
+
when :Time
|
|
429
|
+
Time.parse(value)
|
|
430
|
+
when :Date
|
|
431
|
+
Date.parse(value)
|
|
432
|
+
when :String
|
|
433
|
+
value.to_s
|
|
434
|
+
when :Integer
|
|
435
|
+
value.to_i
|
|
436
|
+
when :Float
|
|
437
|
+
value.to_f
|
|
438
|
+
when :Boolean
|
|
439
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
440
|
+
true
|
|
441
|
+
else
|
|
442
|
+
false
|
|
443
|
+
end
|
|
444
|
+
when :Object
|
|
445
|
+
# generic object (usually a Hash), return directly
|
|
446
|
+
value
|
|
447
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
448
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
449
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
450
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
451
|
+
k_type = Regexp.last_match[:k_type]
|
|
452
|
+
v_type = Regexp.last_match[:v_type]
|
|
453
|
+
{}.tap do |hash|
|
|
454
|
+
value.each do |k, v|
|
|
455
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
456
|
+
end
|
|
457
|
+
end
|
|
458
|
+
else # model
|
|
459
|
+
# models (e.g. Pet) or oneOf
|
|
460
|
+
klass = DdxInteractionsApi.const_get(type)
|
|
461
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
462
|
+
end
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
# Returns the string representation of the object
|
|
466
|
+
# @return [String] String presentation of the object
|
|
467
|
+
def to_s
|
|
468
|
+
to_hash.to_s
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
472
|
+
# @return [Hash] Returns the object in the form of hash
|
|
473
|
+
def to_body
|
|
474
|
+
to_hash
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
# Returns the object in the form of hash
|
|
478
|
+
# @return [Hash] Returns the object in the form of hash
|
|
479
|
+
def to_hash
|
|
480
|
+
hash = {}
|
|
481
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
482
|
+
value = self.send(attr)
|
|
483
|
+
if value.nil?
|
|
484
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
485
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
hash[param] = _to_hash(value)
|
|
489
|
+
end
|
|
490
|
+
hash
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
# Outputs non-array value in the form of hash
|
|
494
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
495
|
+
# @param [Object] value Any valid value
|
|
496
|
+
# @return [Hash] Returns the value in the form of hash
|
|
497
|
+
def _to_hash(value)
|
|
498
|
+
if value.is_a?(Array)
|
|
499
|
+
value.compact.map { |v| _to_hash(v) }
|
|
500
|
+
elsif value.is_a?(Hash)
|
|
501
|
+
{}.tap do |hash|
|
|
502
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
503
|
+
end
|
|
504
|
+
elsif value.respond_to? :to_hash
|
|
505
|
+
value.to_hash
|
|
506
|
+
else
|
|
507
|
+
value
|
|
508
|
+
end
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
# Channel-of-contact details used during the outreach attempt. If the `type` is recognized as an Address Channel (type = \"address\"), the `value` will be deserialized to that object type. Other string-based types have specific validation documented in the \"Channel\" section below, like \"phone_number\". If the `type` is unrecognized, the payload will be deserialized to an unvalidated, loosely typed object for flexibility.
|
|
18
|
+
module InteractionDtoChannel
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
21
|
+
def openapi_one_of
|
|
22
|
+
[
|
|
23
|
+
:'AddressChannelDetails',
|
|
24
|
+
:'DynamicChannelDetails'
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Discriminator's property name (OpenAPI v3)
|
|
29
|
+
def openapi_discriminator_name
|
|
30
|
+
:'type'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Discriminator's mapping (OpenAPI v3)
|
|
34
|
+
def openapi_discriminator_mapping
|
|
35
|
+
{
|
|
36
|
+
:'address' => :'AddressChannelDetails',
|
|
37
|
+
:'example_type' => :'DynamicChannelDetails'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Builds the object
|
|
42
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
43
|
+
# @return [Object] Returns the model or the data itself
|
|
44
|
+
def build(data)
|
|
45
|
+
discriminator_value = data[openapi_discriminator_name]
|
|
46
|
+
return nil if discriminator_value.nil?
|
|
47
|
+
|
|
48
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
|
|
49
|
+
return nil unless klass
|
|
50
|
+
|
|
51
|
+
DdxInteractionsApi.const_get(klass).build_from_hash(data)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
module InteractionDtoOutcomesDetailedInner
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
20
|
+
def openapi_one_of
|
|
21
|
+
[
|
|
22
|
+
:'ActivistCodeOutcomeDetails',
|
|
23
|
+
:'CommunicationConsentOutcomeDetails',
|
|
24
|
+
:'DynamicOutcomeDetails',
|
|
25
|
+
:'EventSignupOutcomeDetails',
|
|
26
|
+
:'SurveyResponseOutcomeDetails'
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Discriminator's property name (OpenAPI v3)
|
|
31
|
+
def openapi_discriminator_name
|
|
32
|
+
:'type'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Discriminator's mapping (OpenAPI v3)
|
|
36
|
+
def openapi_discriminator_mapping
|
|
37
|
+
{
|
|
38
|
+
:'activist_code' => :'ActivistCodeOutcomeDetails',
|
|
39
|
+
:'communication_consent' => :'CommunicationConsentOutcomeDetails',
|
|
40
|
+
:'event_signup' => :'EventSignupOutcomeDetails',
|
|
41
|
+
:'example_type' => :'DynamicOutcomeDetails',
|
|
42
|
+
:'survey_response' => :'SurveyResponseOutcomeDetails'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Builds the object
|
|
47
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
48
|
+
# @return [Object] Returns the model or the data itself
|
|
49
|
+
def build(data)
|
|
50
|
+
discriminator_value = data[openapi_discriminator_name]
|
|
51
|
+
return nil if discriminator_value.nil?
|
|
52
|
+
|
|
53
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
|
|
54
|
+
return nil unless klass
|
|
55
|
+
|
|
56
|
+
DdxInteractionsApi.const_get(klass).build_from_hash(data)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|