sentdm 0.34.0 → 0.36.0
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/CHANGELOG.md +16 -0
- data/README.md +11 -9
- data/lib/sentdm/client.rb +30 -0
- data/lib/sentdm/internal/calls_page.rb +115 -0
- data/lib/sentdm/models/api_response_of_call.rb +43 -0
- data/lib/sentdm/models/api_response_of_call_recordings.rb +43 -0
- data/lib/sentdm/models/api_response_of_calls_list.rb +42 -0
- data/lib/sentdm/models/call.rb +134 -0
- data/lib/sentdm/models/call_event.rb +72 -0
- data/lib/sentdm/models/call_event_payload.rb +102 -0
- data/lib/sentdm/models/call_hangup_params.rb +32 -0
- data/lib/sentdm/models/call_list_params.rb +83 -0
- data/lib/sentdm/models/call_list_recordings_params.rb +26 -0
- data/lib/sentdm/models/call_party.rb +31 -0
- data/lib/sentdm/models/call_record_params.rb +55 -0
- data/lib/sentdm/models/call_recording.rb +38 -0
- data/lib/sentdm/models/call_recordings.rb +24 -0
- data/lib/sentdm/models/call_retrieve_params.rb +26 -0
- data/lib/sentdm/models/call_timeline_entry.rb +26 -0
- data/lib/sentdm/models/calls/api_response_of_list_of_call_participant.rb +45 -0
- data/lib/sentdm/models/calls/call_participant.rb +60 -0
- data/lib/sentdm/models/calls/call_participant_target.rb +30 -0
- data/lib/sentdm/models/calls/participant_add_params.rb +66 -0
- data/lib/sentdm/models/calls/participant_list_params.rb +28 -0
- data/lib/sentdm/models/calls/participant_remove_all_params.rb +28 -0
- data/lib/sentdm/models/calls/participant_remove_params.rb +34 -0
- data/lib/sentdm/models/calls/participant_update_params.rb +64 -0
- data/lib/sentdm/models/calls_list.rb +26 -0
- data/lib/sentdm/models/channels/api_response_of_list_of_voice_number.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_callback_test.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_number.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_number_created.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_secret.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_token.rb +45 -0
- data/lib/sentdm/models/channels/voice_callback_test.rb +65 -0
- data/lib/sentdm/models/channels/voice_callback_test_error_info.rb +41 -0
- data/lib/sentdm/models/channels/voice_callback_test_request_info.rb +40 -0
- data/lib/sentdm/models/channels/voice_callback_test_response_info.rb +28 -0
- data/lib/sentdm/models/channels/voice_create_params.rb +86 -0
- data/lib/sentdm/models/channels/voice_create_token_params.rb +69 -0
- data/lib/sentdm/models/channels/voice_list_params.rb +22 -0
- data/lib/sentdm/models/channels/voice_number.rb +68 -0
- data/lib/sentdm/models/channels/voice_number_created.rb +26 -0
- data/lib/sentdm/models/channels/voice_retrieve_params.rb +28 -0
- data/lib/sentdm/models/channels/voice_rotate_secret_params.rb +34 -0
- data/lib/sentdm/models/channels/voice_secret.rb +25 -0
- data/lib/sentdm/models/channels/voice_test_params.rb +34 -0
- data/lib/sentdm/models/channels/voice_token.rb +44 -0
- data/lib/sentdm/models/channels/voice_update_params.rb +95 -0
- data/lib/sentdm/models/message_event_payload.rb +9 -4
- data/lib/sentdm/models/message_retrieve_activities_response.rb +7 -5
- data/lib/sentdm/models/webhook_list_events_response.rb +4 -173
- data/lib/sentdm/models.rb +36 -0
- data/lib/sentdm/resources/calls/participants.rb +231 -0
- data/lib/sentdm/resources/calls.rb +236 -0
- data/lib/sentdm/resources/channels/voice.rb +381 -0
- data/lib/sentdm/resources/channels.rb +45 -0
- data/lib/sentdm/resources/messages.rb +10 -4
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +50 -0
- data/rbi/sentdm/client.rbi +28 -0
- data/rbi/sentdm/internal/calls_page.rbi +71 -0
- data/rbi/sentdm/models/api_response_of_call.rbi +74 -0
- data/rbi/sentdm/models/api_response_of_call_recordings.rbi +74 -0
- data/rbi/sentdm/models/api_response_of_calls_list.rbi +74 -0
- data/rbi/sentdm/models/call.rbi +179 -0
- data/rbi/sentdm/models/call_event.rbi +114 -0
- data/rbi/sentdm/models/call_event_payload.rbi +135 -0
- data/rbi/sentdm/models/call_hangup_params.rbi +59 -0
- data/rbi/sentdm/models/call_list_params.rbi +112 -0
- data/rbi/sentdm/models/call_list_recordings_params.rbi +46 -0
- data/rbi/sentdm/models/call_party.rbi +41 -0
- data/rbi/sentdm/models/call_record_params.rbi +83 -0
- data/rbi/sentdm/models/call_recording.rbi +59 -0
- data/rbi/sentdm/models/call_recordings.rbi +39 -0
- data/rbi/sentdm/models/call_retrieve_params.rbi +46 -0
- data/rbi/sentdm/models/call_timeline_entry.rbi +40 -0
- data/rbi/sentdm/models/calls/api_response_of_list_of_call_participant.rbi +76 -0
- data/rbi/sentdm/models/calls/call_participant.rbi +92 -0
- data/rbi/sentdm/models/calls/call_participant_target.rbi +47 -0
- data/rbi/sentdm/models/calls/participant_add_params.rbi +98 -0
- data/rbi/sentdm/models/calls/participant_list_params.rbi +51 -0
- data/rbi/sentdm/models/calls/participant_remove_all_params.rbi +51 -0
- data/rbi/sentdm/models/calls/participant_remove_params.rbi +61 -0
- data/rbi/sentdm/models/calls/participant_update_params.rbi +94 -0
- data/rbi/sentdm/models/calls_list.rbi +47 -0
- data/rbi/sentdm/models/channels/api_response_of_list_of_voice_number.rbi +76 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_callback_test.rbi +83 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_number.rbi +81 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_number_created.rbi +83 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_secret.rbi +81 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_token.rbi +81 -0
- data/rbi/sentdm/models/channels/voice_callback_test.rbi +126 -0
- data/rbi/sentdm/models/channels/voice_callback_test_error_info.rbi +65 -0
- data/rbi/sentdm/models/channels/voice_callback_test_request_info.rbi +66 -0
- data/rbi/sentdm/models/channels/voice_callback_test_response_info.rbi +48 -0
- data/rbi/sentdm/models/channels/voice_create_params.rbi +127 -0
- data/rbi/sentdm/models/channels/voice_create_token_params.rbi +104 -0
- data/rbi/sentdm/models/channels/voice_list_params.rbi +40 -0
- data/rbi/sentdm/models/channels/voice_number.rbi +105 -0
- data/rbi/sentdm/models/channels/voice_number_created.rbi +42 -0
- data/rbi/sentdm/models/channels/voice_retrieve_params.rbi +51 -0
- data/rbi/sentdm/models/channels/voice_rotate_secret_params.rbi +64 -0
- data/rbi/sentdm/models/channels/voice_secret.rbi +35 -0
- data/rbi/sentdm/models/channels/voice_test_params.rbi +61 -0
- data/rbi/sentdm/models/channels/voice_token.rbi +76 -0
- data/rbi/sentdm/models/channels/voice_update_params.rbi +158 -0
- data/rbi/sentdm/models/message_event_payload.rbi +16 -6
- data/rbi/sentdm/models/message_retrieve_activities_response.rbi +12 -8
- data/rbi/sentdm/models/webhook_list_events_response.rbi +3 -269
- data/rbi/sentdm/models.rbi +36 -0
- data/rbi/sentdm/resources/calls/participants.rbi +199 -0
- data/rbi/sentdm/resources/calls.rbi +207 -0
- data/rbi/sentdm/resources/channels/voice.rbi +371 -0
- data/rbi/sentdm/resources/channels.rbi +42 -0
- data/rbi/sentdm/resources/messages.rbi +10 -4
- data/sig/sentdm/client.rbs +4 -0
- data/sig/sentdm/internal/calls_page.rbs +41 -0
- data/sig/sentdm/models/api_response_of_call.rbs +39 -0
- data/sig/sentdm/models/api_response_of_call_recordings.rbs +39 -0
- data/sig/sentdm/models/api_response_of_calls_list.rbs +39 -0
- data/sig/sentdm/models/call.rbs +101 -0
- data/sig/sentdm/models/call_event.rbs +44 -0
- data/sig/sentdm/models/call_event_payload.rbs +68 -0
- data/sig/sentdm/models/call_hangup_params.rbs +38 -0
- data/sig/sentdm/models/call_list_params.rbs +67 -0
- data/sig/sentdm/models/call_list_recordings_params.rbs +30 -0
- data/sig/sentdm/models/call_party.rbs +17 -0
- data/sig/sentdm/models/call_record_params.rbs +54 -0
- data/sig/sentdm/models/call_recording.rbs +32 -0
- data/sig/sentdm/models/call_recordings.rbs +17 -0
- data/sig/sentdm/models/call_retrieve_params.rbs +30 -0
- data/sig/sentdm/models/call_timeline_entry.rbs +19 -0
- data/sig/sentdm/models/calls/api_response_of_list_of_call_participant.rbs +41 -0
- data/sig/sentdm/models/calls/call_participant.rbs +52 -0
- data/sig/sentdm/models/calls/call_participant_target.rbs +23 -0
- data/sig/sentdm/models/calls/participant_add_params.rbs +63 -0
- data/sig/sentdm/models/calls/participant_list_params.rbs +32 -0
- data/sig/sentdm/models/calls/participant_remove_all_params.rbs +34 -0
- data/sig/sentdm/models/calls/participant_remove_params.rbs +40 -0
- data/sig/sentdm/models/calls/participant_update_params.rbs +61 -0
- data/sig/sentdm/models/calls_list.rbs +26 -0
- data/sig/sentdm/models/channels/api_response_of_list_of_voice_number.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_callback_test.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_number.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_number_created.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_secret.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_token.rbs +41 -0
- data/sig/sentdm/models/channels/voice_callback_test.rbs +51 -0
- data/sig/sentdm/models/channels/voice_callback_test_error_info.rbs +28 -0
- data/sig/sentdm/models/channels/voice_callback_test_request_info.rbs +34 -0
- data/sig/sentdm/models/channels/voice_callback_test_response_info.rbs +20 -0
- data/sig/sentdm/models/channels/voice_create_params.rbs +64 -0
- data/sig/sentdm/models/channels/voice_create_token_params.rbs +61 -0
- data/sig/sentdm/models/channels/voice_list_params.rbs +27 -0
- data/sig/sentdm/models/channels/voice_number.rbs +57 -0
- data/sig/sentdm/models/channels/voice_number_created.rbs +17 -0
- data/sig/sentdm/models/channels/voice_retrieve_params.rbs +32 -0
- data/sig/sentdm/models/channels/voice_rotate_secret_params.rbs +40 -0
- data/sig/sentdm/models/channels/voice_secret.rbs +17 -0
- data/sig/sentdm/models/channels/voice_test_params.rbs +40 -0
- data/sig/sentdm/models/channels/voice_token.rbs +40 -0
- data/sig/sentdm/models/channels/voice_update_params.rbs +78 -0
- data/sig/sentdm/models/webhook_list_events_response.rbs +1 -107
- data/sig/sentdm/models.rbs +36 -0
- data/sig/sentdm/resources/calls/participants.rbs +50 -0
- data/sig/sentdm/resources/calls.rbs +50 -0
- data/sig/sentdm/resources/channels/voice.rbs +68 -0
- data/sig/sentdm/resources/channels.rbs +9 -0
- metadata +152 -2
|
@@ -48,7 +48,7 @@ module Sentdm
|
|
|
48
48
|
# handler that rejects an envelope it does not recognise will break on the next
|
|
49
49
|
# addition rather than ignore it.
|
|
50
50
|
#
|
|
51
|
-
# @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, Sentdm::Models::
|
|
51
|
+
# @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, Sentdm::Models::CallEvent, nil]
|
|
52
52
|
optional :event_data, union: -> { Sentdm::Models::WebhookListEventsResponse::EventData }
|
|
53
53
|
|
|
54
54
|
# @!attribute event_type
|
|
@@ -90,7 +90,7 @@ module Sentdm
|
|
|
90
90
|
#
|
|
91
91
|
# @param error_message [String, nil]
|
|
92
92
|
#
|
|
93
|
-
# @param event_data [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, Sentdm::Models::
|
|
93
|
+
# @param event_data [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, Sentdm::Models::CallEvent] The exact event body that was delivered, or attempted, for this record. One of t
|
|
94
94
|
#
|
|
95
95
|
# @param event_type [String]
|
|
96
96
|
#
|
|
@@ -150,7 +150,7 @@ module Sentdm
|
|
|
150
150
|
|
|
151
151
|
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
152
152
|
# varies only in Payload.
|
|
153
|
-
variant -> { Sentdm::
|
|
153
|
+
variant -> { Sentdm::CallEvent }
|
|
154
154
|
|
|
155
155
|
class SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload < Sentdm::Internal::Type::BaseModel
|
|
156
156
|
# @!attribute event
|
|
@@ -437,177 +437,8 @@ module Sentdm
|
|
|
437
437
|
end
|
|
438
438
|
end
|
|
439
439
|
|
|
440
|
-
class SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload < Sentdm::Internal::Type::BaseModel
|
|
441
|
-
# @!attribute event
|
|
442
|
-
# The specific event within the family, for example message.delivered,
|
|
443
|
-
# message.received or contact.opt_out. Absent on events that have no subtype, so
|
|
444
|
-
# treat it as optional.
|
|
445
|
-
#
|
|
446
|
-
# @return [String, nil]
|
|
447
|
-
optional :event, String, nil?: true
|
|
448
|
-
|
|
449
|
-
# @!attribute field
|
|
450
|
-
# The event family, for example message, templates or contact. Route on this
|
|
451
|
-
# first, then on event for the specific change.
|
|
452
|
-
#
|
|
453
|
-
# @return [String, nil]
|
|
454
|
-
optional :field, String
|
|
455
|
-
|
|
456
|
-
# @!attribute payload
|
|
457
|
-
# Body of a call.initiated, call.answered, call.completed, call.failed or
|
|
458
|
-
# call.recording_ready event. Which of them occurred is the envelope's event.
|
|
459
|
-
#
|
|
460
|
-
# Shaped like the message, inbound, template and channel payloads: account_id
|
|
461
|
-
# names the account the event is about, channel names the channel, and updated_at
|
|
462
|
-
# is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
|
|
463
|
-
# duration_seconds and price are added on call.completed, reason on call.failed
|
|
464
|
-
# and recording_id on call.recording_ready; each is omitted rather than sent as
|
|
465
|
-
# null when it does not apply.
|
|
466
|
-
#
|
|
467
|
-
# Casing is snake_case because these ride the same webhook stream customers
|
|
468
|
-
# already parse message_id from; the question/answer contract is a separate
|
|
469
|
-
# surface and stays camelCase. Nothing here is provider-shaped: no provider call
|
|
470
|
-
# id, no namespaced identity.
|
|
471
|
-
#
|
|
472
|
-
# @return [Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload, nil]
|
|
473
|
-
optional :payload,
|
|
474
|
-
-> { Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload },
|
|
475
|
-
nil?: true
|
|
476
|
-
|
|
477
|
-
# @!attribute request_id
|
|
478
|
-
# The event-specific body.
|
|
479
|
-
#
|
|
480
|
-
# @return [String, nil]
|
|
481
|
-
optional :request_id, String, nil?: true
|
|
482
|
-
|
|
483
|
-
# @!attribute timestamp
|
|
484
|
-
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
485
|
-
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
486
|
-
# payload for the latter.
|
|
487
|
-
#
|
|
488
|
-
# @return [String, nil]
|
|
489
|
-
optional :timestamp, String
|
|
490
|
-
|
|
491
|
-
# @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
|
|
492
|
-
# Some parameter documentations has been truncated, see
|
|
493
|
-
# {Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload}
|
|
494
|
-
# for more details.
|
|
495
|
-
#
|
|
496
|
-
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
497
|
-
# this shape and varies only in Payload.
|
|
498
|
-
#
|
|
499
|
-
# @param event [String, nil] The specific event within the family, for example message.delivered,
|
|
500
|
-
#
|
|
501
|
-
# @param field [String] The event family, for example message, templates or contact. Route on
|
|
502
|
-
#
|
|
503
|
-
# @param payload [Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload, nil] Body of a call.initiated, call.answered, call.completed, call.failed
|
|
504
|
-
#
|
|
505
|
-
# @param request_id [String, nil] The event-specific body.
|
|
506
|
-
#
|
|
507
|
-
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
508
|
-
|
|
509
|
-
# @see Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload#payload
|
|
510
|
-
class Payload < Sentdm::Internal::Type::BaseModel
|
|
511
|
-
# @!attribute call_id
|
|
512
|
-
# Sent's call id, the same one the customer saw on the first question.
|
|
513
|
-
#
|
|
514
|
-
# @return [String]
|
|
515
|
-
required :call_id, String
|
|
516
|
-
|
|
517
|
-
# @!attribute account_id
|
|
518
|
-
# The account the call belongs to: the key's own customer, or the sender profile
|
|
519
|
-
# it acted as.
|
|
520
|
-
#
|
|
521
|
-
# @return [String, nil]
|
|
522
|
-
optional :account_id, String
|
|
523
|
-
|
|
524
|
-
# @!attribute channel
|
|
525
|
-
# Always voice.
|
|
526
|
-
#
|
|
527
|
-
# @return [String, nil]
|
|
528
|
-
optional :channel, String
|
|
529
|
-
|
|
530
|
-
# @!attribute duration_seconds
|
|
531
|
-
# How long the call lasted. Only on call.completed.
|
|
532
|
-
#
|
|
533
|
-
# @return [Integer, nil]
|
|
534
|
-
optional :duration_seconds, Integer, nil?: true
|
|
535
|
-
|
|
536
|
-
# @!attribute number
|
|
537
|
-
# The customer number that owns the call, in E.164 format.
|
|
538
|
-
#
|
|
539
|
-
# @return [String, nil]
|
|
540
|
-
optional :number, String
|
|
541
|
-
|
|
542
|
-
# @!attribute price
|
|
543
|
-
# What the call was charged. Only on call.completed, and omitted there until
|
|
544
|
-
# billing has recorded the charge.
|
|
545
|
-
#
|
|
546
|
-
# @return [Float, nil]
|
|
547
|
-
optional :price, Float, nil?: true
|
|
548
|
-
|
|
549
|
-
# @!attribute reason
|
|
550
|
-
# The machine-readable reason the call did not complete. Only on call.failed, and
|
|
551
|
-
# omitted when no reason was recorded.
|
|
552
|
-
#
|
|
553
|
-
# @return [String, nil]
|
|
554
|
-
optional :reason, String, nil?: true
|
|
555
|
-
|
|
556
|
-
# @!attribute recording_id
|
|
557
|
-
# The recording that became available, the same id GET /v3/calls/{id}/recordings
|
|
558
|
-
# lists it under. Only on call.recording_ready, which is sent once per recording.
|
|
559
|
-
#
|
|
560
|
-
# @return [String, nil]
|
|
561
|
-
optional :recording_id, String, nil?: true
|
|
562
|
-
|
|
563
|
-
# @!attribute updated_at
|
|
564
|
-
# When the change happened on the call, as opposed to when the event was emitted.
|
|
565
|
-
#
|
|
566
|
-
# @return [String, nil]
|
|
567
|
-
optional :updated_at, String
|
|
568
|
-
|
|
569
|
-
# @!method initialize(call_id:, account_id: nil, channel: nil, duration_seconds: nil, number: nil, price: nil, reason: nil, recording_id: nil, updated_at: nil)
|
|
570
|
-
# Some parameter documentations has been truncated, see
|
|
571
|
-
# {Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload}
|
|
572
|
-
# for more details.
|
|
573
|
-
#
|
|
574
|
-
# Body of a call.initiated, call.answered, call.completed, call.failed or
|
|
575
|
-
# call.recording_ready event. Which of them occurred is the envelope's event.
|
|
576
|
-
#
|
|
577
|
-
# Shaped like the message, inbound, template and channel payloads: account_id
|
|
578
|
-
# names the account the event is about, channel names the channel, and updated_at
|
|
579
|
-
# is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
|
|
580
|
-
# duration_seconds and price are added on call.completed, reason on call.failed
|
|
581
|
-
# and recording_id on call.recording_ready; each is omitted rather than sent as
|
|
582
|
-
# null when it does not apply.
|
|
583
|
-
#
|
|
584
|
-
# Casing is snake_case because these ride the same webhook stream customers
|
|
585
|
-
# already parse message_id from; the question/answer contract is a separate
|
|
586
|
-
# surface and stays camelCase. Nothing here is provider-shaped: no provider call
|
|
587
|
-
# id, no namespaced identity.
|
|
588
|
-
#
|
|
589
|
-
# @param call_id [String] Sent's call id, the same one the customer saw on the first question.
|
|
590
|
-
#
|
|
591
|
-
# @param account_id [String] The account the call belongs to: the key's own customer, or the sender profile i
|
|
592
|
-
#
|
|
593
|
-
# @param channel [String] Always voice.
|
|
594
|
-
#
|
|
595
|
-
# @param duration_seconds [Integer, nil] How long the call lasted. Only on call.completed.
|
|
596
|
-
#
|
|
597
|
-
# @param number [String] The customer number that owns the call, in E.164 format.
|
|
598
|
-
#
|
|
599
|
-
# @param price [Float, nil] What the call was charged. Only on call.completed, and omitted there until billi
|
|
600
|
-
#
|
|
601
|
-
# @param reason [String, nil] The machine-readable reason the call did not complete. Only on call.failed, and
|
|
602
|
-
#
|
|
603
|
-
# @param recording_id [String, nil] The recording that became available, the same id GET /v3/calls/{id}/recordings l
|
|
604
|
-
#
|
|
605
|
-
# @param updated_at [String] When the change happened on the call, as opposed to when the event was emitted.
|
|
606
|
-
end
|
|
607
|
-
end
|
|
608
|
-
|
|
609
440
|
# @!method self.variants
|
|
610
|
-
# @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, Sentdm::Models::
|
|
441
|
+
# @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, Sentdm::Models::CallEvent)]
|
|
611
442
|
end
|
|
612
443
|
end
|
|
613
444
|
end
|
data/lib/sentdm/models.rb
CHANGED
|
@@ -41,6 +41,12 @@ module Sentdm
|
|
|
41
41
|
|
|
42
42
|
APIMeta = Sentdm::Models::APIMeta
|
|
43
43
|
|
|
44
|
+
APIResponseOfCall = Sentdm::Models::APIResponseOfCall
|
|
45
|
+
|
|
46
|
+
APIResponseOfCallRecordings = Sentdm::Models::APIResponseOfCallRecordings
|
|
47
|
+
|
|
48
|
+
APIResponseOfCallsList = Sentdm::Models::APIResponseOfCallsList
|
|
49
|
+
|
|
44
50
|
APIResponseOfContact = Sentdm::Models::APIResponseOfContact
|
|
45
51
|
|
|
46
52
|
APIResponseOfContactMessageSummary = Sentdm::Models::APIResponseOfContactMessageSummary
|
|
@@ -67,10 +73,40 @@ module Sentdm
|
|
|
67
73
|
|
|
68
74
|
BrandsBrandData = Sentdm::Models::BrandsBrandData
|
|
69
75
|
|
|
76
|
+
Call = Sentdm::Models::Call
|
|
77
|
+
|
|
78
|
+
CallEvent = Sentdm::Models::CallEvent
|
|
79
|
+
|
|
80
|
+
CallEventPayload = Sentdm::Models::CallEventPayload
|
|
81
|
+
|
|
82
|
+
CallHangupParams = Sentdm::Models::CallHangupParams
|
|
83
|
+
|
|
84
|
+
CallListParams = Sentdm::Models::CallListParams
|
|
85
|
+
|
|
86
|
+
CallListRecordingsParams = Sentdm::Models::CallListRecordingsParams
|
|
87
|
+
|
|
88
|
+
CallParty = Sentdm::Models::CallParty
|
|
89
|
+
|
|
90
|
+
CallRecording = Sentdm::Models::CallRecording
|
|
91
|
+
|
|
92
|
+
CallRecordings = Sentdm::Models::CallRecordings
|
|
93
|
+
|
|
94
|
+
CallRecordParams = Sentdm::Models::CallRecordParams
|
|
95
|
+
|
|
96
|
+
CallRetrieveParams = Sentdm::Models::CallRetrieveParams
|
|
97
|
+
|
|
98
|
+
Calls = Sentdm::Models::Calls
|
|
99
|
+
|
|
100
|
+
CallsList = Sentdm::Models::CallsList
|
|
101
|
+
|
|
102
|
+
CallTimelineEntry = Sentdm::Models::CallTimelineEntry
|
|
103
|
+
|
|
70
104
|
ChannelEvent = Sentdm::Models::ChannelEvent
|
|
71
105
|
|
|
72
106
|
ChannelEventPayload = Sentdm::Models::ChannelEventPayload
|
|
73
107
|
|
|
108
|
+
Channels = Sentdm::Models::Channels
|
|
109
|
+
|
|
74
110
|
ContactCreateParams = Sentdm::Models::ContactCreateParams
|
|
75
111
|
|
|
76
112
|
ContactDeleteParams = Sentdm::Models::ContactDeleteParams
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Calls
|
|
6
|
+
# Phone calls from the numbers you hold, driven by your own callback URL.
|
|
7
|
+
#
|
|
8
|
+
# `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
|
|
9
|
+
# asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints
|
|
10
|
+
# a short-lived token that lets a user of your app place and receive calls as that
|
|
11
|
+
# number. When a call arrives or a caller presses a key, a signed question is
|
|
12
|
+
# POSTed to the callback URL and the answer decides the call;
|
|
13
|
+
# `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
|
|
14
|
+
# before a real call reaches it, and
|
|
15
|
+
# `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
|
|
16
|
+
# The call events themselves (`call.completed` and the rest) arrive through your
|
|
17
|
+
# webhooks.
|
|
18
|
+
#
|
|
19
|
+
# Every call is a record under `/v3/calls`: read it, list its recordings once one
|
|
20
|
+
# is ready, hang it up, start or stop recording, and add, mute or remove
|
|
21
|
+
# conference participants while it is live. A leg to a phone number runs for at
|
|
22
|
+
# most what your balance affords at the destination's rate.
|
|
23
|
+
class Participants
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {Sentdm::Models::Calls::ParticipantUpdateParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# Mutes or unmutes one participant of the conference room a live call is in, named
|
|
28
|
+
# by the participant's own call id from the participants list: send muted true to
|
|
29
|
+
# silence them, muted false to let them be heard again. Muting a participant who
|
|
30
|
+
# is already muted succeeds, as does unmuting one who is not. A participant who is
|
|
31
|
+
# not in this call's room answers 404. A call that has ended answers 409, as does
|
|
32
|
+
# a call that is not in a conference.
|
|
33
|
+
#
|
|
34
|
+
# @overload update(participant_id, id:, muted: nil, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
35
|
+
#
|
|
36
|
+
# @param participant_id [String] Path param: The participant's own call id from the route, as listed by the parti
|
|
37
|
+
#
|
|
38
|
+
# @param id [String] Path param: The call id from the route, as carried by call webhooks and the call
|
|
39
|
+
#
|
|
40
|
+
# @param muted [Boolean] Body param: true to mute the participant, false to unmute them
|
|
41
|
+
#
|
|
42
|
+
# @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
|
|
43
|
+
#
|
|
44
|
+
# @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
45
|
+
#
|
|
46
|
+
# @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
|
|
47
|
+
#
|
|
48
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
49
|
+
#
|
|
50
|
+
# @return [nil]
|
|
51
|
+
#
|
|
52
|
+
# @see Sentdm::Models::Calls::ParticipantUpdateParams
|
|
53
|
+
def update(participant_id, params)
|
|
54
|
+
parsed, options = Sentdm::Calls::ParticipantUpdateParams.dump_request(params)
|
|
55
|
+
id =
|
|
56
|
+
parsed.delete(:id) do
|
|
57
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
58
|
+
end
|
|
59
|
+
header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
|
|
60
|
+
@client.request(
|
|
61
|
+
method: :patch,
|
|
62
|
+
path: ["v3/calls/%1$s/participants/%2$s", id, participant_id],
|
|
63
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
64
|
+
body: parsed.except(*header_params.keys),
|
|
65
|
+
model: NilClass,
|
|
66
|
+
options: options
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Some parameter documentations has been truncated, see
|
|
71
|
+
# {Sentdm::Models::Calls::ParticipantListParams} for more details.
|
|
72
|
+
#
|
|
73
|
+
# Lists who is in the conference room one of your live calls is in: each
|
|
74
|
+
# participant's own call id, who they are, whether the room mutes them, and how
|
|
75
|
+
# long they have been connected. The call itself is one of the participants. Use a
|
|
76
|
+
# participant's id to mute or remove them; it is also a call id, so GET
|
|
77
|
+
# /v3/calls/{id} accepts it. A call that has ended answers 409, as does a call
|
|
78
|
+
# that is not in a conference.
|
|
79
|
+
#
|
|
80
|
+
# @overload list(id, x_profile_id: nil, request_options: {})
|
|
81
|
+
#
|
|
82
|
+
# @param id [String] The call id from the route, as carried by call webhooks and the calls list, for
|
|
83
|
+
#
|
|
84
|
+
# @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
|
|
85
|
+
#
|
|
86
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
87
|
+
#
|
|
88
|
+
# @return [Sentdm::Models::Calls::APIResponseOfListOfCallParticipant]
|
|
89
|
+
#
|
|
90
|
+
# @see Sentdm::Models::Calls::ParticipantListParams
|
|
91
|
+
def list(id, params = {})
|
|
92
|
+
parsed, options = Sentdm::Calls::ParticipantListParams.dump_request(params)
|
|
93
|
+
@client.request(
|
|
94
|
+
method: :get,
|
|
95
|
+
path: ["v3/calls/%1$s/participants", id],
|
|
96
|
+
headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
|
|
97
|
+
model: Sentdm::Calls::APIResponseOfListOfCallParticipant,
|
|
98
|
+
options: options
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Some parameter documentations has been truncated, see
|
|
103
|
+
# {Sentdm::Models::Calls::ParticipantAddParams} for more details.
|
|
104
|
+
#
|
|
105
|
+
# Dials one of your app users or a phone number into a call that is in a
|
|
106
|
+
# conference room, and answers with the participant's own call record. The
|
|
107
|
+
# participant is a call of their own: it has its own id, can be looked up and hung
|
|
108
|
+
# up, and is billed and reported through call.completed and call.failed like any
|
|
109
|
+
# other call. Every participant needs a positive balance. A phone participant is
|
|
110
|
+
# called from caller_id, which must be one of your numbers, or from the call's
|
|
111
|
+
# owning number when omitted, and needs a destination you may call. Only a call
|
|
112
|
+
# your answer connected to a conference can take participants: a call connected to
|
|
113
|
+
# a user or a number answers 409.
|
|
114
|
+
#
|
|
115
|
+
# @overload add(id, caller_id: nil, sandbox: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
116
|
+
#
|
|
117
|
+
# @param id [String] Path param: The call id from the route, as carried by call webhooks and the call
|
|
118
|
+
#
|
|
119
|
+
# @param caller_id [String, nil] Body param: The number shown to a phone participant as the caller, in E.164 form
|
|
120
|
+
#
|
|
121
|
+
# @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
|
|
122
|
+
#
|
|
123
|
+
# @param to [Sentdm::Models::Calls::CallParticipantTarget] Body param: A participant to add to a call
|
|
124
|
+
#
|
|
125
|
+
# @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
126
|
+
#
|
|
127
|
+
# @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
|
|
128
|
+
#
|
|
129
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
130
|
+
#
|
|
131
|
+
# @return [Sentdm::Models::APIResponseOfCall]
|
|
132
|
+
#
|
|
133
|
+
# @see Sentdm::Models::Calls::ParticipantAddParams
|
|
134
|
+
def add(id, params = {})
|
|
135
|
+
parsed, options = Sentdm::Calls::ParticipantAddParams.dump_request(params)
|
|
136
|
+
header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
|
|
137
|
+
@client.request(
|
|
138
|
+
method: :post,
|
|
139
|
+
path: ["v3/calls/%1$s/participants", id],
|
|
140
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
141
|
+
body: parsed.except(*header_params.keys),
|
|
142
|
+
model: Sentdm::APIResponseOfCall,
|
|
143
|
+
options: options
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Some parameter documentations has been truncated, see
|
|
148
|
+
# {Sentdm::Models::Calls::ParticipantRemoveParams} for more details.
|
|
149
|
+
#
|
|
150
|
+
# Removes one participant from the conference room a live call is in, named by the
|
|
151
|
+
# participant's own call id from the participants list. Their leg ends and is
|
|
152
|
+
# reported through call.completed like any other call; everyone else stays
|
|
153
|
+
# connected. A participant who is not in this call's room answers 404. A call that
|
|
154
|
+
# has ended answers 409, as does a call that is not in a conference.
|
|
155
|
+
#
|
|
156
|
+
# @overload remove(participant_id, id:, sandbox: nil, x_profile_id: nil, request_options: {})
|
|
157
|
+
#
|
|
158
|
+
# @param participant_id [String] Path param: The participant's own call id from the route, as listed by the parti
|
|
159
|
+
#
|
|
160
|
+
# @param id [String] Path param: The call id from the route, as carried by call webhooks and the call
|
|
161
|
+
#
|
|
162
|
+
# @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
|
|
163
|
+
#
|
|
164
|
+
# @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
|
|
165
|
+
#
|
|
166
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
167
|
+
#
|
|
168
|
+
# @return [nil]
|
|
169
|
+
#
|
|
170
|
+
# @see Sentdm::Models::Calls::ParticipantRemoveParams
|
|
171
|
+
def remove(participant_id, params)
|
|
172
|
+
parsed, options = Sentdm::Calls::ParticipantRemoveParams.dump_request(params)
|
|
173
|
+
id =
|
|
174
|
+
parsed.delete(:id) do
|
|
175
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
176
|
+
end
|
|
177
|
+
header_params = {x_profile_id: "x-profile-id"}
|
|
178
|
+
@client.request(
|
|
179
|
+
method: :delete,
|
|
180
|
+
path: ["v3/calls/%1$s/participants/%2$s", id, participant_id],
|
|
181
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
182
|
+
body: parsed.except(*header_params.keys),
|
|
183
|
+
model: NilClass,
|
|
184
|
+
options: options
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Some parameter documentations has been truncated, see
|
|
189
|
+
# {Sentdm::Models::Calls::ParticipantRemoveAllParams} for more details.
|
|
190
|
+
#
|
|
191
|
+
# Removes every participant from the conference room a live call is in, the call
|
|
192
|
+
# itself included. Every leg ends and is reported through call.completed like any
|
|
193
|
+
# other call. A room that is already empty answers 204 as well. A call that has
|
|
194
|
+
# ended answers 409, as does a call that is not in a conference.
|
|
195
|
+
#
|
|
196
|
+
# @overload remove_all(id, sandbox: nil, x_profile_id: nil, request_options: {})
|
|
197
|
+
#
|
|
198
|
+
# @param id [String] Path param: The call id from the route, as carried by call webhooks and the call
|
|
199
|
+
#
|
|
200
|
+
# @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
|
|
201
|
+
#
|
|
202
|
+
# @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
|
|
203
|
+
#
|
|
204
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
205
|
+
#
|
|
206
|
+
# @return [nil]
|
|
207
|
+
#
|
|
208
|
+
# @see Sentdm::Models::Calls::ParticipantRemoveAllParams
|
|
209
|
+
def remove_all(id, params = {})
|
|
210
|
+
parsed, options = Sentdm::Calls::ParticipantRemoveAllParams.dump_request(params)
|
|
211
|
+
header_params = {x_profile_id: "x-profile-id"}
|
|
212
|
+
@client.request(
|
|
213
|
+
method: :delete,
|
|
214
|
+
path: ["v3/calls/%1$s/participants", id],
|
|
215
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
216
|
+
body: parsed.except(*header_params.keys),
|
|
217
|
+
model: NilClass,
|
|
218
|
+
options: options
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# @api private
|
|
223
|
+
#
|
|
224
|
+
# @param client [Sentdm::Client]
|
|
225
|
+
def initialize(client:)
|
|
226
|
+
@client = client
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|