pingram 1.0.7 → 1.0.9
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/pingram/api/components_api.rb +2 -0
- data/lib/pingram/api/email_api.rb +88 -0
- data/lib/pingram/api/numbers_api.rb +4 -4
- data/lib/pingram/api/push_settings_api.rb +4 -0
- data/lib/pingram/api/sms_api.rb +88 -0
- data/lib/pingram/api/templates_api.rb +2 -0
- data/lib/pingram/api/types_api.rb +2 -0
- data/lib/pingram/api/user_api.rb +4 -0
- data/lib/pingram/api/webhooks_api.rb +2 -0
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/api_error.rb +40 -4
- data/lib/pingram/client_wrapper.rb +20 -0
- data/lib/pingram/models/api_error_body.rb +223 -0
- data/lib/pingram/models/api_error_response.rb +192 -0
- data/lib/pingram/models/change_phone_request.rb +164 -0
- data/lib/pingram/models/get_logs_response_messages_inner.rb +13 -1
- data/lib/pingram/models/get_logs_response_messages_inner_media_inner.rb +173 -0
- data/lib/pingram/models/get_templates_list_response_inner.rb +2 -1
- data/lib/pingram/models/get_templates_list_response_inner_any_of2.rb +16 -4
- data/lib/pingram/models/get_templates_list_response_inner_any_of3.rb +16 -42
- data/lib/pingram/models/get_templates_list_response_inner_any_of4.rb +4 -22
- data/lib/pingram/models/get_templates_list_response_inner_any_of5.rb +42 -111
- data/lib/pingram/models/get_templates_list_response_inner_any_of6.rb +440 -0
- data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata.rb → get_templates_list_response_inner_any_of6_metadata.rb} +4 -4
- data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata_entities_inner.rb → get_templates_list_response_inner_any_of6_metadata_entities_inner.rb} +4 -4
- data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata_entities_inner_external_ref.rb → get_templates_list_response_inner_any_of6_metadata_entities_inner_external_ref.rb} +3 -3
- data/lib/pingram/models/logs_get_response_logs_inner.rb +52 -21
- data/lib/pingram/models/send_email_api_response.rb +104 -0
- data/lib/pingram/models/send_email_api_response_any_of.rb +193 -0
- data/lib/pingram/models/send_email_api_response_any_of1.rb +191 -0
- data/lib/pingram/models/send_email_api_response_any_of1_error.rb +223 -0
- data/lib/pingram/models/send_email_request.rb +335 -0
- data/lib/pingram/models/{sender_post_body_options_email_attachments_inner_any_of1.rb → send_email_request_attachments_inner.rb} +19 -28
- data/lib/pingram/models/send_sms_request.rb +249 -0
- data/lib/pingram/models/send_sms_response.rb +104 -0
- data/lib/pingram/models/send_sms_response_any_of.rb +193 -0
- data/lib/pingram/models/send_sms_response_any_of1.rb +191 -0
- data/lib/pingram/models/send_sms_response_any_of1_error.rb +223 -0
- data/lib/pingram/models/sender_post_body_options_email_attachments_inner.rb +2 -2
- data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of.rb +25 -16
- data/lib/pingram/models/sender_post_body_slack.rb +1 -1
- data/lib/pingram/models/sender_post_body_sms.rb +16 -4
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +21 -4
- data/vendor/bundle/ruby/3.2.0/cache/psych-5.4.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/gem_make.out +10 -10
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/README.md +2 -2
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_parser.c +14 -3
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/versions.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{psych-5.3.1.gemspec → psych-5.4.0.gemspec} +2 -2
- metadata +83 -66
- data/vendor/bundle/ruby/3.2.0/cache/psych-5.3.1.gem +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/mkmf.log +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/Makefile +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/depend +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/extconf.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_emitter.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_emitter.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_parser.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_to_ruby.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_to_ruby.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_yaml_tree.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_yaml_tree.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/class_loader.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/coder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/core_ext.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/exception.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handler.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handlers/document_stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handlers/recorder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/ruby_events.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/tree_builder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/yaml_events.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/alias.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/document.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/mapping.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/node.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/scalar.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/sequence.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/omap.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/parser.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/scalar_scanner.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/set.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/streaming.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/syntax_error.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/tree_builder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/depth_first.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/emitter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/json_tree.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/to_ruby.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/visitor.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/yaml_tree.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/y.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych.rb +0 -0
|
@@ -79,6 +79,9 @@ module Pingram
|
|
|
79
79
|
|
|
80
80
|
attr_accessor :email_sent_after
|
|
81
81
|
|
|
82
|
+
# Bare `POST /email` may set this on the `email_sent` row so Logs Insights `latest(email_preview)` still resolves after delivered/opened rows. Sender / SQS consumer paths omit this field (unchanged behavior).
|
|
83
|
+
attr_accessor :email_preview
|
|
84
|
+
|
|
82
85
|
attr_accessor :email_delivered_at
|
|
83
86
|
|
|
84
87
|
attr_accessor :email_delivered_recipients
|
|
@@ -161,12 +164,18 @@ module Pingram
|
|
|
161
164
|
|
|
162
165
|
attr_accessor :sms_inbound_from
|
|
163
166
|
|
|
167
|
+
# Pingram number that received the inbound message.
|
|
168
|
+
attr_accessor :sms_inbound_to
|
|
169
|
+
|
|
164
170
|
attr_accessor :sms_inbound_text
|
|
165
171
|
|
|
166
172
|
attr_accessor :sms_inbound_webhook_delivered
|
|
167
173
|
|
|
168
174
|
attr_accessor :sms_inbound_webhook_res
|
|
169
175
|
|
|
176
|
+
# Truncated JSON string of inbound MMS metadata when present.
|
|
177
|
+
attr_accessor :sms_inbound_media
|
|
178
|
+
|
|
170
179
|
attr_accessor :sms_replied_at
|
|
171
180
|
|
|
172
181
|
attr_accessor :sms_replied_to
|
|
@@ -239,8 +248,6 @@ module Pingram
|
|
|
239
248
|
|
|
240
249
|
attr_accessor :slack_routing_reason
|
|
241
250
|
|
|
242
|
-
attr_accessor :email_preview
|
|
243
|
-
|
|
244
251
|
attr_accessor :sms_preview
|
|
245
252
|
|
|
246
253
|
attr_accessor :call_preview
|
|
@@ -318,10 +325,13 @@ module Pingram
|
|
|
318
325
|
|
|
319
326
|
attr_accessor :sms_sent_country
|
|
320
327
|
|
|
321
|
-
# Unique message ID from
|
|
328
|
+
# Unique message ID from the SMS provider
|
|
322
329
|
attr_accessor :sms_sent_message_id
|
|
323
330
|
|
|
324
|
-
#
|
|
331
|
+
# True when the send included MMS (`mediaUrls`).
|
|
332
|
+
attr_accessor :sms_sent_mms
|
|
333
|
+
|
|
334
|
+
# Actual carrier cost (internal)
|
|
325
335
|
attr_accessor :sms_carrier_cost_internal
|
|
326
336
|
|
|
327
337
|
attr_accessor :sms_carrier_fee_internal
|
|
@@ -332,7 +342,7 @@ module Pingram
|
|
|
332
342
|
|
|
333
343
|
attr_accessor :sms_delivered_after
|
|
334
344
|
|
|
335
|
-
# Actual cost from
|
|
345
|
+
# Actual delivery cost from carrier webhook (USD), for internal logging
|
|
336
346
|
attr_accessor :sms_delivered_cost_internal
|
|
337
347
|
|
|
338
348
|
attr_accessor :schedule_updated_at
|
|
@@ -398,6 +408,7 @@ module Pingram
|
|
|
398
408
|
:'email_sent_at' => :'email_sent_at',
|
|
399
409
|
:'email_sent_message_id' => :'email_sent_message_id',
|
|
400
410
|
:'email_sent_after' => :'email_sent_after',
|
|
411
|
+
:'email_preview' => :'email_preview',
|
|
401
412
|
:'email_delivered_at' => :'email_delivered_at',
|
|
402
413
|
:'email_delivered_recipients' => :'email_delivered_recipients',
|
|
403
414
|
:'email_delivered_after' => :'email_delivered_after',
|
|
@@ -439,9 +450,11 @@ module Pingram
|
|
|
439
450
|
:'email_inbound_resolution_type' => :'email_inbound_resolution_type',
|
|
440
451
|
:'sms_inbound_at' => :'sms_inbound_at',
|
|
441
452
|
:'sms_inbound_from' => :'sms_inbound_from',
|
|
453
|
+
:'sms_inbound_to' => :'sms_inbound_to',
|
|
442
454
|
:'sms_inbound_text' => :'sms_inbound_text',
|
|
443
455
|
:'sms_inbound_webhook_delivered' => :'sms_inbound_webhook_delivered',
|
|
444
456
|
:'sms_inbound_webhook_res' => :'sms_inbound_webhook_res',
|
|
457
|
+
:'sms_inbound_media' => :'sms_inbound_media',
|
|
445
458
|
:'sms_replied_at' => :'sms_replied_at',
|
|
446
459
|
:'sms_replied_to' => :'sms_replied_to',
|
|
447
460
|
:'sms_replied_text' => :'sms_replied_text',
|
|
@@ -478,7 +491,6 @@ module Pingram
|
|
|
478
491
|
:'inapp_routing_reason' => :'inapp_routing_reason',
|
|
479
492
|
:'slack_routing' => :'slack_routing',
|
|
480
493
|
:'slack_routing_reason' => :'slack_routing_reason',
|
|
481
|
-
:'email_preview' => :'email_preview',
|
|
482
494
|
:'sms_preview' => :'sms_preview',
|
|
483
495
|
:'call_preview' => :'call_preview',
|
|
484
496
|
:'web_push_preview' => :'web_push_preview',
|
|
@@ -518,6 +530,7 @@ module Pingram
|
|
|
518
530
|
:'sms_sent_cost' => :'sms_sent_cost',
|
|
519
531
|
:'sms_sent_country' => :'sms_sent_country',
|
|
520
532
|
:'sms_sent_message_id' => :'sms_sent_messageId',
|
|
533
|
+
:'sms_sent_mms' => :'sms_sent_mms',
|
|
521
534
|
:'sms_carrier_cost_internal' => :'sms_carrier_cost_internal',
|
|
522
535
|
:'sms_carrier_fee_internal' => :'sms_carrier_fee_internal',
|
|
523
536
|
:'sms_rate_internal' => :'sms_rate_internal',
|
|
@@ -575,6 +588,7 @@ module Pingram
|
|
|
575
588
|
:'email_sent_at' => :'String',
|
|
576
589
|
:'email_sent_message_id' => :'String',
|
|
577
590
|
:'email_sent_after' => :'Float',
|
|
591
|
+
:'email_preview' => :'String',
|
|
578
592
|
:'email_delivered_at' => :'String',
|
|
579
593
|
:'email_delivered_recipients' => :'String',
|
|
580
594
|
:'email_delivered_after' => :'Float',
|
|
@@ -616,9 +630,11 @@ module Pingram
|
|
|
616
630
|
:'email_inbound_resolution_type' => :'String',
|
|
617
631
|
:'sms_inbound_at' => :'String',
|
|
618
632
|
:'sms_inbound_from' => :'String',
|
|
633
|
+
:'sms_inbound_to' => :'String',
|
|
619
634
|
:'sms_inbound_text' => :'String',
|
|
620
635
|
:'sms_inbound_webhook_delivered' => :'Boolean',
|
|
621
636
|
:'sms_inbound_webhook_res' => :'String',
|
|
637
|
+
:'sms_inbound_media' => :'String',
|
|
622
638
|
:'sms_replied_at' => :'String',
|
|
623
639
|
:'sms_replied_to' => :'String',
|
|
624
640
|
:'sms_replied_text' => :'String',
|
|
@@ -655,7 +671,6 @@ module Pingram
|
|
|
655
671
|
:'inapp_routing_reason' => :'String',
|
|
656
672
|
:'slack_routing' => :'String',
|
|
657
673
|
:'slack_routing_reason' => :'String',
|
|
658
|
-
:'email_preview' => :'String',
|
|
659
674
|
:'sms_preview' => :'String',
|
|
660
675
|
:'call_preview' => :'String',
|
|
661
676
|
:'web_push_preview' => :'String',
|
|
@@ -695,6 +710,7 @@ module Pingram
|
|
|
695
710
|
:'sms_sent_cost' => :'Float',
|
|
696
711
|
:'sms_sent_country' => :'String',
|
|
697
712
|
:'sms_sent_message_id' => :'String',
|
|
713
|
+
:'sms_sent_mms' => :'Boolean',
|
|
698
714
|
:'sms_carrier_cost_internal' => :'Float',
|
|
699
715
|
:'sms_carrier_fee_internal' => :'Float',
|
|
700
716
|
:'sms_rate_internal' => :'Float',
|
|
@@ -861,6 +877,10 @@ module Pingram
|
|
|
861
877
|
self.email_sent_after = attributes[:'email_sent_after']
|
|
862
878
|
end
|
|
863
879
|
|
|
880
|
+
if attributes.key?(:'email_preview')
|
|
881
|
+
self.email_preview = attributes[:'email_preview']
|
|
882
|
+
end
|
|
883
|
+
|
|
864
884
|
if attributes.key?(:'email_delivered_at')
|
|
865
885
|
self.email_delivered_at = attributes[:'email_delivered_at']
|
|
866
886
|
end
|
|
@@ -1025,6 +1045,10 @@ module Pingram
|
|
|
1025
1045
|
self.sms_inbound_from = attributes[:'sms_inbound_from']
|
|
1026
1046
|
end
|
|
1027
1047
|
|
|
1048
|
+
if attributes.key?(:'sms_inbound_to')
|
|
1049
|
+
self.sms_inbound_to = attributes[:'sms_inbound_to']
|
|
1050
|
+
end
|
|
1051
|
+
|
|
1028
1052
|
if attributes.key?(:'sms_inbound_text')
|
|
1029
1053
|
self.sms_inbound_text = attributes[:'sms_inbound_text']
|
|
1030
1054
|
end
|
|
@@ -1037,6 +1061,10 @@ module Pingram
|
|
|
1037
1061
|
self.sms_inbound_webhook_res = attributes[:'sms_inbound_webhook_res']
|
|
1038
1062
|
end
|
|
1039
1063
|
|
|
1064
|
+
if attributes.key?(:'sms_inbound_media')
|
|
1065
|
+
self.sms_inbound_media = attributes[:'sms_inbound_media']
|
|
1066
|
+
end
|
|
1067
|
+
|
|
1040
1068
|
if attributes.key?(:'sms_replied_at')
|
|
1041
1069
|
self.sms_replied_at = attributes[:'sms_replied_at']
|
|
1042
1070
|
end
|
|
@@ -1181,10 +1209,6 @@ module Pingram
|
|
|
1181
1209
|
self.slack_routing_reason = attributes[:'slack_routing_reason']
|
|
1182
1210
|
end
|
|
1183
1211
|
|
|
1184
|
-
if attributes.key?(:'email_preview')
|
|
1185
|
-
self.email_preview = attributes[:'email_preview']
|
|
1186
|
-
end
|
|
1187
|
-
|
|
1188
1212
|
if attributes.key?(:'sms_preview')
|
|
1189
1213
|
self.sms_preview = attributes[:'sms_preview']
|
|
1190
1214
|
end
|
|
@@ -1341,6 +1365,10 @@ module Pingram
|
|
|
1341
1365
|
self.sms_sent_message_id = attributes[:'sms_sent_message_id']
|
|
1342
1366
|
end
|
|
1343
1367
|
|
|
1368
|
+
if attributes.key?(:'sms_sent_mms')
|
|
1369
|
+
self.sms_sent_mms = attributes[:'sms_sent_mms']
|
|
1370
|
+
end
|
|
1371
|
+
|
|
1344
1372
|
if attributes.key?(:'sms_carrier_cost_internal')
|
|
1345
1373
|
self.sms_carrier_cost_internal = attributes[:'sms_carrier_cost_internal']
|
|
1346
1374
|
end
|
|
@@ -1400,13 +1428,13 @@ module Pingram
|
|
|
1400
1428
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
1401
1429
|
return false if @tracking_id.nil?
|
|
1402
1430
|
return false if @account_id.nil?
|
|
1403
|
-
failed_code_validator = EnumAttributeValidator.new('String', ["SPAM_CONTENT", "INVALID_SCHEDULE_FORMAT", "SCHEDULE_RESOURCE_NOT_FOUND", "UNKNOWN"])
|
|
1431
|
+
failed_code_validator = EnumAttributeValidator.new('String', ["SPAM_CONTENT", "INVALID_SCHEDULE_FORMAT", "SCHEDULE_RESOURCE_NOT_FOUND", "MISSING_NOTIFICATION_TYPE", "UNKNOWN"])
|
|
1404
1432
|
return false unless failed_code_validator.valid?(@failed_code)
|
|
1405
1433
|
inapp_failed_code_validator = EnumAttributeValidator.new('String', ["IN_APP_WEB_FAILED", "UNKNOWN"])
|
|
1406
1434
|
return false unless inapp_failed_code_validator.valid?(@inapp_failed_code)
|
|
1407
1435
|
mobile_push_failed_code_validator = EnumAttributeValidator.new('String', ["NO_APN_CONFIG", "NO_FCM_CONFIG", "INVALID_APN_TOKEN", "INVALID_FCM_TOKEN", "UNKNOWN"])
|
|
1408
1436
|
return false unless mobile_push_failed_code_validator.valid?(@mobile_push_failed_code)
|
|
1409
|
-
email_failed_code_validator = EnumAttributeValidator.new('String', ["UNVERIFIED_SENDER", "PERMANENT_GENERAL_BOUNCE", "PERMANENT_NO_EMAIL_BOUNCE", "PERMANENT_SUPPRESSED_BOUNCE", "TRANSIENT_GENERAL_BOUNCE", "TRANSIENT_MAILBOX_FULL_BOUNCE", "TRANSIENT_MESSAGE_TOO_LARGE_BOUNCE", "TRANSIENT_CONTENT_REJECTED_BOUNCE", "TRANSIENT_ATTACHMENT_REJECTED_BOUNCE", "UNDETERMINED_BOUNCE", "COMPLAINT_ABUSE", "COMPLAINT_AUTH", "COMPLAINT_FRAUD", "COMPLAINT_NOT_SPAM", "COMPLAINT_OTHER", "COMPLAINT_VIRUS", "SUPPRESSED_COMPLAINT", "SUPPRESSED_BOUNCE", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1437
|
+
email_failed_code_validator = EnumAttributeValidator.new('String', ["UNVERIFIED_SENDER", "PERMANENT_GENERAL_BOUNCE", "PERMANENT_NO_EMAIL_BOUNCE", "PERMANENT_SUPPRESSED_BOUNCE", "TRANSIENT_GENERAL_BOUNCE", "TRANSIENT_MAILBOX_FULL_BOUNCE", "TRANSIENT_MESSAGE_TOO_LARGE_BOUNCE", "TRANSIENT_CONTENT_REJECTED_BOUNCE", "TRANSIENT_ATTACHMENT_REJECTED_BOUNCE", "UNDETERMINED_BOUNCE", "COMPLAINT_ABUSE", "COMPLAINT_AUTH", "COMPLAINT_FRAUD", "COMPLAINT_NOT_SPAM", "COMPLAINT_OTHER", "COMPLAINT_VIRUS", "SUPPRESSED_COMPLAINT", "SUPPRESSED_BOUNCE", "MISSING_EMAIL_RECIPIENT", "MISSING_EMAIL_SUBJECT", "MISSING_EMAIL_HTML", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1410
1438
|
return false unless email_failed_code_validator.valid?(@email_failed_code)
|
|
1411
1439
|
email_inbound_resolution_type_validator = EnumAttributeValidator.new('String', ["reply", "builtin", "custom"])
|
|
1412
1440
|
return false unless email_inbound_resolution_type_validator.valid?(@email_inbound_resolution_type)
|
|
@@ -1446,9 +1474,9 @@ module Pingram
|
|
|
1446
1474
|
return false unless slack_failed_code_validator.valid?(@slack_failed_code)
|
|
1447
1475
|
call_delivered_code_validator = EnumAttributeValidator.new('String', ["COMPLETED", "BUSY", "NO_ANSWER", "UNKNOWN"])
|
|
1448
1476
|
return false unless call_delivered_code_validator.valid?(@call_delivered_code)
|
|
1449
|
-
call_failed_code_validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1477
|
+
call_failed_code_validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "MISSING_SMS_RECIPIENT", "MISSING_SMS_MESSAGE", "INVALID_PHONE_NUMBER", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1450
1478
|
return false unless call_failed_code_validator.valid?(@call_failed_code)
|
|
1451
|
-
sms_failed_code_validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1479
|
+
sms_failed_code_validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "MISSING_SMS_RECIPIENT", "MISSING_SMS_MESSAGE", "INVALID_PHONE_NUMBER", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1452
1480
|
return false unless sms_failed_code_validator.valid?(@sms_failed_code)
|
|
1453
1481
|
true
|
|
1454
1482
|
end
|
|
@@ -1476,7 +1504,7 @@ module Pingram
|
|
|
1476
1504
|
# Custom attribute writer method checking allowed values (enum).
|
|
1477
1505
|
# @param [Object] failed_code Object to be assigned
|
|
1478
1506
|
def failed_code=(failed_code)
|
|
1479
|
-
validator = EnumAttributeValidator.new('String', ["SPAM_CONTENT", "INVALID_SCHEDULE_FORMAT", "SCHEDULE_RESOURCE_NOT_FOUND", "UNKNOWN"])
|
|
1507
|
+
validator = EnumAttributeValidator.new('String', ["SPAM_CONTENT", "INVALID_SCHEDULE_FORMAT", "SCHEDULE_RESOURCE_NOT_FOUND", "MISSING_NOTIFICATION_TYPE", "UNKNOWN"])
|
|
1480
1508
|
unless validator.valid?(failed_code)
|
|
1481
1509
|
fail ArgumentError, "invalid value for \"failed_code\", must be one of #{validator.allowable_values}."
|
|
1482
1510
|
end
|
|
@@ -1506,7 +1534,7 @@ module Pingram
|
|
|
1506
1534
|
# Custom attribute writer method checking allowed values (enum).
|
|
1507
1535
|
# @param [Object] email_failed_code Object to be assigned
|
|
1508
1536
|
def email_failed_code=(email_failed_code)
|
|
1509
|
-
validator = EnumAttributeValidator.new('String', ["UNVERIFIED_SENDER", "PERMANENT_GENERAL_BOUNCE", "PERMANENT_NO_EMAIL_BOUNCE", "PERMANENT_SUPPRESSED_BOUNCE", "TRANSIENT_GENERAL_BOUNCE", "TRANSIENT_MAILBOX_FULL_BOUNCE", "TRANSIENT_MESSAGE_TOO_LARGE_BOUNCE", "TRANSIENT_CONTENT_REJECTED_BOUNCE", "TRANSIENT_ATTACHMENT_REJECTED_BOUNCE", "UNDETERMINED_BOUNCE", "COMPLAINT_ABUSE", "COMPLAINT_AUTH", "COMPLAINT_FRAUD", "COMPLAINT_NOT_SPAM", "COMPLAINT_OTHER", "COMPLAINT_VIRUS", "SUPPRESSED_COMPLAINT", "SUPPRESSED_BOUNCE", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1537
|
+
validator = EnumAttributeValidator.new('String', ["UNVERIFIED_SENDER", "PERMANENT_GENERAL_BOUNCE", "PERMANENT_NO_EMAIL_BOUNCE", "PERMANENT_SUPPRESSED_BOUNCE", "TRANSIENT_GENERAL_BOUNCE", "TRANSIENT_MAILBOX_FULL_BOUNCE", "TRANSIENT_MESSAGE_TOO_LARGE_BOUNCE", "TRANSIENT_CONTENT_REJECTED_BOUNCE", "TRANSIENT_ATTACHMENT_REJECTED_BOUNCE", "UNDETERMINED_BOUNCE", "COMPLAINT_ABUSE", "COMPLAINT_AUTH", "COMPLAINT_FRAUD", "COMPLAINT_NOT_SPAM", "COMPLAINT_OTHER", "COMPLAINT_VIRUS", "SUPPRESSED_COMPLAINT", "SUPPRESSED_BOUNCE", "MISSING_EMAIL_RECIPIENT", "MISSING_EMAIL_SUBJECT", "MISSING_EMAIL_HTML", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1510
1538
|
unless validator.valid?(email_failed_code)
|
|
1511
1539
|
fail ArgumentError, "invalid value for \"email_failed_code\", must be one of #{validator.allowable_values}."
|
|
1512
1540
|
end
|
|
@@ -1706,7 +1734,7 @@ module Pingram
|
|
|
1706
1734
|
# Custom attribute writer method checking allowed values (enum).
|
|
1707
1735
|
# @param [Object] call_failed_code Object to be assigned
|
|
1708
1736
|
def call_failed_code=(call_failed_code)
|
|
1709
|
-
validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1737
|
+
validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "MISSING_SMS_RECIPIENT", "MISSING_SMS_MESSAGE", "INVALID_PHONE_NUMBER", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1710
1738
|
unless validator.valid?(call_failed_code)
|
|
1711
1739
|
fail ArgumentError, "invalid value for \"call_failed_code\", must be one of #{validator.allowable_values}."
|
|
1712
1740
|
end
|
|
@@ -1716,7 +1744,7 @@ module Pingram
|
|
|
1716
1744
|
# Custom attribute writer method checking allowed values (enum).
|
|
1717
1745
|
# @param [Object] sms_failed_code Object to be assigned
|
|
1718
1746
|
def sms_failed_code=(sms_failed_code)
|
|
1719
|
-
validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1747
|
+
validator = EnumAttributeValidator.new('String', ["13224", "21211", "21215", "21265", "21610", "21614", "21612", "30005", "30006", "30007", "30008", "30453", "40001", "40002", "40300", "Unknown", "MISSING_SMS_RECIPIENT", "MISSING_SMS_MESSAGE", "INVALID_PHONE_NUMBER", "NO_ADDRESS", "USAGE_LIMIT", "VERIFICATION_LIMIT", "TEMPLATE_NOT_FOUND", "NO_DEFAULT_TEMPLATE", "SPAM_CONTENT"])
|
|
1720
1748
|
unless validator.valid?(sms_failed_code)
|
|
1721
1749
|
fail ArgumentError, "invalid value for \"sms_failed_code\", must be one of #{validator.allowable_values}."
|
|
1722
1750
|
end
|
|
@@ -1760,6 +1788,7 @@ module Pingram
|
|
|
1760
1788
|
email_sent_at == o.email_sent_at &&
|
|
1761
1789
|
email_sent_message_id == o.email_sent_message_id &&
|
|
1762
1790
|
email_sent_after == o.email_sent_after &&
|
|
1791
|
+
email_preview == o.email_preview &&
|
|
1763
1792
|
email_delivered_at == o.email_delivered_at &&
|
|
1764
1793
|
email_delivered_recipients == o.email_delivered_recipients &&
|
|
1765
1794
|
email_delivered_after == o.email_delivered_after &&
|
|
@@ -1801,9 +1830,11 @@ module Pingram
|
|
|
1801
1830
|
email_inbound_resolution_type == o.email_inbound_resolution_type &&
|
|
1802
1831
|
sms_inbound_at == o.sms_inbound_at &&
|
|
1803
1832
|
sms_inbound_from == o.sms_inbound_from &&
|
|
1833
|
+
sms_inbound_to == o.sms_inbound_to &&
|
|
1804
1834
|
sms_inbound_text == o.sms_inbound_text &&
|
|
1805
1835
|
sms_inbound_webhook_delivered == o.sms_inbound_webhook_delivered &&
|
|
1806
1836
|
sms_inbound_webhook_res == o.sms_inbound_webhook_res &&
|
|
1837
|
+
sms_inbound_media == o.sms_inbound_media &&
|
|
1807
1838
|
sms_replied_at == o.sms_replied_at &&
|
|
1808
1839
|
sms_replied_to == o.sms_replied_to &&
|
|
1809
1840
|
sms_replied_text == o.sms_replied_text &&
|
|
@@ -1840,7 +1871,6 @@ module Pingram
|
|
|
1840
1871
|
inapp_routing_reason == o.inapp_routing_reason &&
|
|
1841
1872
|
slack_routing == o.slack_routing &&
|
|
1842
1873
|
slack_routing_reason == o.slack_routing_reason &&
|
|
1843
|
-
email_preview == o.email_preview &&
|
|
1844
1874
|
sms_preview == o.sms_preview &&
|
|
1845
1875
|
call_preview == o.call_preview &&
|
|
1846
1876
|
web_push_preview == o.web_push_preview &&
|
|
@@ -1880,6 +1910,7 @@ module Pingram
|
|
|
1880
1910
|
sms_sent_cost == o.sms_sent_cost &&
|
|
1881
1911
|
sms_sent_country == o.sms_sent_country &&
|
|
1882
1912
|
sms_sent_message_id == o.sms_sent_message_id &&
|
|
1913
|
+
sms_sent_mms == o.sms_sent_mms &&
|
|
1883
1914
|
sms_carrier_cost_internal == o.sms_carrier_cost_internal &&
|
|
1884
1915
|
sms_carrier_fee_internal == o.sms_carrier_fee_internal &&
|
|
1885
1916
|
sms_rate_internal == o.sms_rate_internal &&
|
|
@@ -1900,7 +1931,7 @@ module Pingram
|
|
|
1900
1931
|
# Calculates hash code according to all attributes.
|
|
1901
1932
|
# @return [Integer] Hash code
|
|
1902
1933
|
def hash
|
|
1903
|
-
[received_at, type, env_id, client_id, agent, ip, request, test, tracking_id, account_id, failed_at, failed_code, failed_internal, inapp_sent_at, inapp_sent_after, inapp_delivered_at, inapp_delivered_after, inapp_failed_at, inapp_failed_code, inapp_failed_internal, mobile_push_failed_at, mobile_push_failed_code, mobile_push_failed_token, mobile_push_failed_internal, mobile_push_sent_at, mobile_push_sent_after, mobile_push_sent_token, mobile_push_delivered_at, mobile_push_delivered_after, email_sent_at, email_sent_message_id, email_sent_after, email_delivered_at, email_delivered_recipients, email_delivered_after, email_delivered_webhook_res, email_failed_at, email_failed_code, email_failed_recipient, email_failed_diagnostic_code, email_failed_internal, email_failed_webhook_res, email_opened_at, email_opened_user_agent, email_opened_ip, email_opened_webhook_res, email_clicked_at, email_clicked_user_agent, email_clicked_ip, email_clicked_link, email_clicked_link_tags, email_clicked_webhook_res, email_inbound_at, email_inbound_from, email_inbound_from_name, email_inbound_to, email_inbound_cc, email_inbound_bcc, email_inbound_reply_to, email_inbound_inbox, email_inbound_subject, email_inbound_body_text, email_inbound_body_html, email_inbound_has_attachments, email_inbound_attachment_count, email_inbound_message_id, email_inbound_in_reply_to, email_inbound_references, email_inbound_webhook_delivered, email_inbound_webhook_res, email_inbound_resolution_type, sms_inbound_at, sms_inbound_from, sms_inbound_text, sms_inbound_webhook_delivered, sms_inbound_webhook_res, sms_replied_at, sms_replied_to, sms_replied_text, sms_replied_segments, sms_replied_encoding, web_push_sent_token, web_push_sent_at, web_push_sent_after, web_push_delivered_at, web_push_delivered_after, web_push_delivered_token, web_push_delivered_internal, web_push_failed_at, web_push_failed_token, web_push_failed_code, web_push_failed_internal, processed_at, ignored, scheduled_for, user_id, user_email, user_number, email_routing, email_routing_reason, sms_routing, sms_routing_reason, web_push_routing, web_push_routing_reason, mobile_push_routing, mobile_push_routing_reason, call_routing, call_routing_reason, inapp_routing, inapp_routing_reason, slack_routing, slack_routing_reason,
|
|
1934
|
+
[received_at, type, env_id, client_id, agent, ip, request, test, tracking_id, account_id, failed_at, failed_code, failed_internal, inapp_sent_at, inapp_sent_after, inapp_delivered_at, inapp_delivered_after, inapp_failed_at, inapp_failed_code, inapp_failed_internal, mobile_push_failed_at, mobile_push_failed_code, mobile_push_failed_token, mobile_push_failed_internal, mobile_push_sent_at, mobile_push_sent_after, mobile_push_sent_token, mobile_push_delivered_at, mobile_push_delivered_after, email_sent_at, email_sent_message_id, email_sent_after, email_preview, email_delivered_at, email_delivered_recipients, email_delivered_after, email_delivered_webhook_res, email_failed_at, email_failed_code, email_failed_recipient, email_failed_diagnostic_code, email_failed_internal, email_failed_webhook_res, email_opened_at, email_opened_user_agent, email_opened_ip, email_opened_webhook_res, email_clicked_at, email_clicked_user_agent, email_clicked_ip, email_clicked_link, email_clicked_link_tags, email_clicked_webhook_res, email_inbound_at, email_inbound_from, email_inbound_from_name, email_inbound_to, email_inbound_cc, email_inbound_bcc, email_inbound_reply_to, email_inbound_inbox, email_inbound_subject, email_inbound_body_text, email_inbound_body_html, email_inbound_has_attachments, email_inbound_attachment_count, email_inbound_message_id, email_inbound_in_reply_to, email_inbound_references, email_inbound_webhook_delivered, email_inbound_webhook_res, email_inbound_resolution_type, sms_inbound_at, sms_inbound_from, sms_inbound_to, sms_inbound_text, sms_inbound_webhook_delivered, sms_inbound_webhook_res, sms_inbound_media, sms_replied_at, sms_replied_to, sms_replied_text, sms_replied_segments, sms_replied_encoding, web_push_sent_token, web_push_sent_at, web_push_sent_after, web_push_delivered_at, web_push_delivered_after, web_push_delivered_token, web_push_delivered_internal, web_push_failed_at, web_push_failed_token, web_push_failed_code, web_push_failed_internal, processed_at, ignored, scheduled_for, user_id, user_email, user_number, email_routing, email_routing_reason, sms_routing, sms_routing_reason, web_push_routing, web_push_routing_reason, mobile_push_routing, mobile_push_routing_reason, call_routing, call_routing_reason, inapp_routing, inapp_routing_reason, slack_routing, slack_routing_reason, sms_preview, call_preview, web_push_preview, mobile_push_preview, slack_preview, inapp_preview, slack_sent_at, slack_sent_after, slack_delivered_at, slack_delivered_after, slack_delivered_internal, slack_failed_at, slack_failed_code, slack_failed_internal, call_sent_at, call_sent_after, call_sent_from, call_delivered_at, call_delivered_after, call_delivered_code, call_delivered_cost_internal, call_delivered_cost, call_failed_at, call_failed_code, call_failed_internal, sms_failed_at, sms_failed_code, sms_failed_internal, sms_sent_at, sms_sent_after, sms_sent_from, sms_sent_carrier, sms_sent_line_type, sms_sent_encoding, sms_sent_segments, sms_sent_parts, sms_sent_cost, sms_sent_country, sms_sent_message_id, sms_sent_mms, sms_carrier_cost_internal, sms_carrier_fee_internal, sms_rate_internal, sms_delivered_at, sms_delivered_after, sms_delivered_cost_internal, schedule_updated_at, schedule_updated_to, schedule_deleted_at].hash
|
|
1904
1935
|
end
|
|
1905
1936
|
|
|
1906
1937
|
# Builds the object from hash
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Pingram
|
|
17
|
+
# Response for `POST /email` - either success or error.
|
|
18
|
+
module SendEmailApiResponse
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
21
|
+
def openapi_any_of
|
|
22
|
+
[
|
|
23
|
+
:'SendEmailApiResponseAnyOf',
|
|
24
|
+
:'SendEmailApiResponseAnyOf1'
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the object
|
|
29
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
30
|
+
# @return [Object] Returns the model or the data itself
|
|
31
|
+
def build(data)
|
|
32
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
33
|
+
# Note:
|
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
+
# - TODO: logging when debugging is set.
|
|
38
|
+
openapi_any_of.each do |klass|
|
|
39
|
+
begin
|
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
|
41
|
+
return find_and_cast_into_type(klass, data)
|
|
42
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
52
|
+
|
|
53
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
54
|
+
def find_and_cast_into_type(klass, data)
|
|
55
|
+
return if data.nil?
|
|
56
|
+
|
|
57
|
+
case klass.to_s
|
|
58
|
+
when 'Boolean'
|
|
59
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
60
|
+
when 'Float'
|
|
61
|
+
return data if data.instance_of?(Float)
|
|
62
|
+
when 'Integer'
|
|
63
|
+
return data if data.instance_of?(Integer)
|
|
64
|
+
when 'Time'
|
|
65
|
+
return Time.parse(data)
|
|
66
|
+
when 'Date'
|
|
67
|
+
return Date.iso8601(data)
|
|
68
|
+
when 'String'
|
|
69
|
+
return data if data.instance_of?(String)
|
|
70
|
+
when 'Object' # "type: object"
|
|
71
|
+
return data if data.instance_of?(Hash)
|
|
72
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
73
|
+
if data.instance_of?(Array)
|
|
74
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
75
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
76
|
+
end
|
|
77
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
78
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
79
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
80
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
81
|
+
end
|
|
82
|
+
else # model
|
|
83
|
+
const = Pingram.const_get(klass)
|
|
84
|
+
if const
|
|
85
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
86
|
+
model = const.build(data)
|
|
87
|
+
return model if model
|
|
88
|
+
else
|
|
89
|
+
# raise if data contains keys that are not known to the model
|
|
90
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
91
|
+
model = const.build_from_hash(data)
|
|
92
|
+
return model if model
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
raise # if no match by now, raise
|
|
98
|
+
rescue
|
|
99
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Pingram
|
|
17
|
+
# Success response for `POST /email`.
|
|
18
|
+
class SendEmailApiResponseAnyOf < ApiModelBase
|
|
19
|
+
attr_accessor :tracking_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :messages
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'tracking_id' => :'trackingId',
|
|
27
|
+
:'messages' => :'messages'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'tracking_id' => :'String',
|
|
45
|
+
:'messages' => :'Array<String>'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SendEmailApiResponseAnyOf` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SendEmailApiResponseAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'tracking_id')
|
|
72
|
+
self.tracking_id = attributes[:'tracking_id']
|
|
73
|
+
else
|
|
74
|
+
self.tracking_id = nil
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'messages')
|
|
78
|
+
if (value = attributes[:'messages']).is_a?(Array)
|
|
79
|
+
self.messages = value
|
|
80
|
+
end
|
|
81
|
+
else
|
|
82
|
+
self.messages = nil
|
|
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
|
+
if @tracking_id.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "tracking_id", tracking_id cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @messages.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "messages", messages cannot be nil.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
invalid_properties
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Check to see if the all the properties in the model are valid
|
|
103
|
+
# @return true if the model is valid
|
|
104
|
+
def valid?
|
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
+
return false if @tracking_id.nil?
|
|
107
|
+
return false if @messages.nil?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] tracking_id Value to be assigned
|
|
113
|
+
def tracking_id=(tracking_id)
|
|
114
|
+
if tracking_id.nil?
|
|
115
|
+
fail ArgumentError, 'tracking_id cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@tracking_id = tracking_id
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] messages Value to be assigned
|
|
123
|
+
def messages=(messages)
|
|
124
|
+
if messages.nil?
|
|
125
|
+
fail ArgumentError, 'messages cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@messages = messages
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
tracking_id == o.tracking_id &&
|
|
137
|
+
messages == o.messages
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[tracking_id, messages].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|