twilio-ruby 5.39.2 → 5.40.3
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/.travis.yml +1 -1
- data/CHANGES.md +107 -1
- data/CONTRIBUTING.md +2 -2
- data/ISSUE_TEMPLATE.md +5 -1
- data/PULL_REQUEST_TEMPLATE.md +1 -1
- data/README.md +4 -3
- data/lib/twilio-ruby/framework/version.rb +4 -8
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +6 -4
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +85 -60
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/conversations.rb +39 -3
- data/lib/twilio-ruby/rest/conversations/v1.rb +68 -5
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +268 -0
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +21 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +34 -19
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +48 -32
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +374 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +388 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +271 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +549 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +394 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +519 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +457 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +395 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
- data/lib/twilio-ruby/rest/events.rb +72 -0
- data/lib/twilio-ruby/rest/events/v1.rb +90 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
- data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
- data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
- data/lib/twilio-ruby/rest/events/v1/sink.rb +380 -0
- data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +115 -0
- data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +119 -0
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +383 -0
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +216 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
- data/lib/twilio-ruby/rest/messaging.rb +6 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +164 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +3 -3
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +16 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +45 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +14 -1
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +12 -11
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +17 -7
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +75 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +38 -23
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +21 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +10 -2
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -2
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
- data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +5 -19
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +53 -0
- data/spec/holodeck/holodeck.rb +3 -3
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +35 -36
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +39 -40
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +35 -36
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +25 -23
- data/spec/integration/api/v2010/account/message_spec.rb +37 -0
- data/spec/integration/bulkexports/v1/export/day_spec.rb +5 -5
- data/spec/integration/bulkexports/v1/export_configuration_spec.rb +4 -4
- data/spec/integration/bulkexports/v1/export_spec.rb +3 -3
- data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
- data/spec/integration/conversations/v1/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
- data/spec/integration/conversations/v1/conversation/message_spec.rb +38 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +60 -4
- data/spec/integration/conversations/v1/conversation_spec.rb +35 -0
- data/spec/integration/conversations/v1/credential_spec.rb +219 -0
- data/spec/integration/conversations/v1/role_spec.rb +249 -0
- data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
- data/spec/integration/conversations/v1/service/configuration/notification_spec.rb +115 -0
- data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
- data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
- data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
- data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
- data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
- data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
- data/spec/integration/conversations/v1/service_spec.rb +174 -0
- data/spec/integration/conversations/v1/user_spec.rb +220 -0
- data/spec/integration/events/v1/event_type_spec.rb +133 -0
- data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
- data/spec/integration/events/v1/schema_spec.rb +46 -0
- data/spec/integration/events/v1/sink/sink_test_spec.rb +42 -0
- data/spec/integration/events/v1/sink/sink_validate_spec.rb +44 -0
- data/spec/integration/events/v1/sink_spec.rb +217 -0
- data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +91 -0
- data/spec/integration/events/v1/subscription_spec.rb +243 -0
- data/spec/integration/messaging/v1/deactivation_spec.rb +40 -0
- data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +27 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
- data/spec/integration/studio/v1/flow/execution/execution_step_spec.rb +1 -0
- data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +1 -0
- data/spec/integration/supersim/v1/sim_spec.rb +23 -0
- data/spec/integration/supersim/v1/usage_record_spec.rb +463 -18
- data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
- data/spec/integration/trunking/v1/trunk_spec.rb +4 -0
- data/spec/integration/verify/v2/service/access_token_spec.rb +1 -1
- data/spec/integration/verify/v2/service/entity/challenge_spec.rb +8 -8
- data/spec/integration/video/v1/room_spec.rb +37 -0
- data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +82 -5
- data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
#
|
|
7
|
+
# frozen_string_literal: true
|
|
8
|
+
|
|
9
|
+
require 'spec_helper.rb'
|
|
10
|
+
|
|
11
|
+
describe 'Recording' do
|
|
12
|
+
it "can fetch" do
|
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
|
14
|
+
|
|
15
|
+
expect {
|
|
16
|
+
@client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
17
|
+
.recordings().fetch()
|
|
18
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
|
19
|
+
|
|
20
|
+
expect(
|
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
22
|
+
method: 'get',
|
|
23
|
+
url: 'https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recording',
|
|
24
|
+
))).to eq(true)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "receives fetch responses" do
|
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
|
29
|
+
200,
|
|
30
|
+
%q[
|
|
31
|
+
{
|
|
32
|
+
"mode": "do-not-record",
|
|
33
|
+
"trim": "do-not-trim",
|
|
34
|
+
"url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recording",
|
|
35
|
+
"trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
))
|
|
39
|
+
|
|
40
|
+
actual = @client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
41
|
+
.recordings().fetch()
|
|
42
|
+
|
|
43
|
+
expect(actual).to_not eq(nil)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "can update" do
|
|
47
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
|
48
|
+
|
|
49
|
+
expect {
|
|
50
|
+
@client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
51
|
+
.recordings().update()
|
|
52
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
|
53
|
+
|
|
54
|
+
expect(
|
|
55
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
56
|
+
method: 'post',
|
|
57
|
+
url: 'https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recording',
|
|
58
|
+
))).to eq(true)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "receives update responses" do
|
|
62
|
+
@holodeck.mock(Twilio::Response.new(
|
|
63
|
+
200,
|
|
64
|
+
%q[
|
|
65
|
+
{
|
|
66
|
+
"mode": "do-not-record",
|
|
67
|
+
"trim": "do-not-trim",
|
|
68
|
+
"url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recording",
|
|
69
|
+
"trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
))
|
|
73
|
+
|
|
74
|
+
actual = @client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
|
75
|
+
.recordings().update()
|
|
76
|
+
|
|
77
|
+
expect(actual).to_not eq(nil)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -40,6 +40,7 @@ describe 'Trunk' do
|
|
|
40
40
|
"mode": "do-not-record",
|
|
41
41
|
"trim": "do-not-trim"
|
|
42
42
|
},
|
|
43
|
+
"transfer_mode": "disable-all",
|
|
43
44
|
"auth_type": "",
|
|
44
45
|
"auth_type_set": [],
|
|
45
46
|
"date_created": "2015-01-02T11:23:45Z",
|
|
@@ -116,6 +117,7 @@ describe 'Trunk' do
|
|
|
116
117
|
"mode": "do-not-record",
|
|
117
118
|
"trim": "do-not-trim"
|
|
118
119
|
},
|
|
120
|
+
"transfer_mode": "disable-all",
|
|
119
121
|
"auth_type": "",
|
|
120
122
|
"auth_type_set": [],
|
|
121
123
|
"date_created": "2015-01-02T11:23:45Z",
|
|
@@ -178,6 +180,7 @@ describe 'Trunk' do
|
|
|
178
180
|
"mode": "do-not-record",
|
|
179
181
|
"trim": "do-not-trim"
|
|
180
182
|
},
|
|
183
|
+
"transfer_mode": "disable-all",
|
|
181
184
|
"auth_type": "",
|
|
182
185
|
"auth_type_set": [],
|
|
183
186
|
"date_created": "2015-01-02T11:23:45Z",
|
|
@@ -255,6 +258,7 @@ describe 'Trunk' do
|
|
|
255
258
|
"mode": "do-not-record",
|
|
256
259
|
"trim": "do-not-trim"
|
|
257
260
|
},
|
|
261
|
+
"transfer_mode": "disable-all",
|
|
258
262
|
"auth_type": "",
|
|
259
263
|
"auth_type_set": [],
|
|
260
264
|
"date_created": "2015-01-02T11:23:45Z",
|
|
@@ -31,7 +31,7 @@ describe 'AccessToken' do
|
|
|
31
31
|
201,
|
|
32
32
|
%q[
|
|
33
33
|
{
|
|
34
|
-
"token": "
|
|
34
|
+
"token": "eyJ6aXAiOiJERUYiLCJraWQiOiJTQVNfUzNfX19LTVNfdjEiLCJjdHkiOiJ0d2lsaW8tZnBhO3Y9MSIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJkaXIifQ..qjltWfIgQaTwp2De.81Z_6W4kR-hdlAUvJQCbwS8CQ7QAoFRkOvNMoySEj8zEB4BAY3MXhPARfaK4Lnr4YceA2cXEmrzPKQ7bPm0XZMGYm1fqLYzAR8YAqUetI9WEdQLFytg1h4XnJnXhgd99eNXsLkpKHhsCnFkchV9eGpRrdrfB0STR5Xq0fdakomb98iuIFt1XtP0_iqxvxQZKe1O4035XhK_ELVwQBz_qdI77XRZBFM0REAzlnEOe61nOcQxkaIM9Qel9L7RPhcndcCPFAyYjxo6Ri5c4vOnszLDiHmeK9Ep9fRE5-Oz0px0ZEg_FgTUEPFPo2OHQj076H1plJnFr-qPINDJkUL_i7loqG1IlapOi1JSlflPH-Ebj4hhpBdMIcs-OX7jhqzmVqkIKWkpPyPEmfvY2-eA5Zpoo08YpqAJ3G1l_xEcHl28Ijkefj1mdb6E8POx41skAwXCpdfIbzWzV_VjFpmwhacS3JZNt9C4hVG4Yp-RGPEl1C7aJHRIUavAmoRHaXbfG20zzv5Zu0P5PcopDszzoqVfZpzc.GCt35DWTurtP-QaIL5aBSQ"
|
|
35
35
|
}
|
|
36
36
|
]
|
|
37
37
|
))
|
|
@@ -46,8 +46,8 @@ describe 'Challenge' do
|
|
|
46
46
|
"expiration_date": "2015-07-30T20:00:00Z",
|
|
47
47
|
"status": "pending",
|
|
48
48
|
"responded_reason": "none",
|
|
49
|
-
"details": "Hi! Mr. John Doe, would you like to sign up
|
|
50
|
-
"hidden_details": "
|
|
49
|
+
"details": "{\\"message\\": \\"Hi! Mr. John Doe, would you like to sign up?\\", \\"date\\":\\"2020-07-01T12:13:14Z\\", \\"fields\\": [{\\"label\\": \\"Action\\", \\"value\\": \\"Sign up in portal\\"}]}",
|
|
50
|
+
"hidden_details": "{\\"ip\\": \\"172.168.1.234\\"}",
|
|
51
51
|
"factor_type": "push",
|
|
52
52
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
53
53
|
}
|
|
@@ -96,8 +96,8 @@ describe 'Challenge' do
|
|
|
96
96
|
"expiration_date": "2015-07-30T20:00:00Z",
|
|
97
97
|
"status": "pending",
|
|
98
98
|
"responded_reason": "none",
|
|
99
|
-
"details": "
|
|
100
|
-
"hidden_details": "
|
|
99
|
+
"details": "{\\"message\\": \\"Hi! Mr. John Doe, would you like to sign up?\\", \\"fields\\": [{\\"label\\": \\"Action\\", \\"value\\": \\"Sign up in portal\\"}]}",
|
|
100
|
+
"hidden_details": "{\\"ip\\": \\"172.168.1.234\\"}",
|
|
101
101
|
"factor_type": "push",
|
|
102
102
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
103
103
|
}
|
|
@@ -174,8 +174,8 @@ describe 'Challenge' do
|
|
|
174
174
|
"expiration_date": "2015-07-30T20:00:00Z",
|
|
175
175
|
"status": "pending",
|
|
176
176
|
"responded_reason": "none",
|
|
177
|
-
"details": "
|
|
178
|
-
"hidden_details": "
|
|
177
|
+
"details": "{\\"message\\": \\"Hi! Mr. John Doe, would you like to sign up?\\", \\"fields\\": [{\\"label\\": \\"Action\\", \\"value\\": \\"Sign up in portal\\"}]}",
|
|
178
|
+
"hidden_details": "{\\"ip\\": \\"172.168.1.234\\"}",
|
|
179
179
|
"factor_type": "push",
|
|
180
180
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
181
181
|
}
|
|
@@ -235,8 +235,8 @@ describe 'Challenge' do
|
|
|
235
235
|
"expiration_date": "2015-07-30T20:00:00Z",
|
|
236
236
|
"status": "approved",
|
|
237
237
|
"responded_reason": "none",
|
|
238
|
-
"details": "Hi! Mr. John Doe, would you like to sign up
|
|
239
|
-
"hidden_details": "
|
|
238
|
+
"details": "{\\"message\\": \\"Hi! Mr. John Doe, would you like to sign up?\\", \\"fields\\": [{\\"label\\": \\"Action\\", \\"value\\": \\"Sign up in portal\\"}]}",
|
|
239
|
+
"hidden_details": "{\\"ip\\": \\"172.168.1.234\\"}",
|
|
240
240
|
"factor_type": "push",
|
|
241
241
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
242
242
|
}
|
|
@@ -111,6 +111,43 @@ describe 'Room' do
|
|
|
111
111
|
expect(actual).to_not eq(nil)
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
it "receives create_p2p_basic responses" do
|
|
115
|
+
@holodeck.mock(Twilio::Response.new(
|
|
116
|
+
201,
|
|
117
|
+
%q[
|
|
118
|
+
{
|
|
119
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
120
|
+
"date_created": "2015-07-30T20:00:00Z",
|
|
121
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
|
122
|
+
"status": "in-progress",
|
|
123
|
+
"type": "peer-to-peer-basic",
|
|
124
|
+
"sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
125
|
+
"enable_turn": true,
|
|
126
|
+
"unique_name": "room1",
|
|
127
|
+
"max_participants": 10,
|
|
128
|
+
"duration": 0,
|
|
129
|
+
"status_callback_method": "POST",
|
|
130
|
+
"status_callback": "",
|
|
131
|
+
"record_participants_on_connect": false,
|
|
132
|
+
"video_codecs": [
|
|
133
|
+
"VP8"
|
|
134
|
+
],
|
|
135
|
+
"media_region": "us1",
|
|
136
|
+
"end_time": "2015-07-30T20:00:00Z",
|
|
137
|
+
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
138
|
+
"links": {
|
|
139
|
+
"participants": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
|
|
140
|
+
"recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
))
|
|
145
|
+
|
|
146
|
+
actual = @client.video.v1.rooms.create()
|
|
147
|
+
|
|
148
|
+
expect(actual).to_not eq(nil)
|
|
149
|
+
end
|
|
150
|
+
|
|
114
151
|
it "can read" do
|
|
115
152
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
|
116
153
|
|
|
@@ -68,13 +68,13 @@ describe 'DataSession' do
|
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
70
|
"meta": {
|
|
71
|
-
"first_page_url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?
|
|
71
|
+
"first_page_url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?PageSize=50&Page=0",
|
|
72
72
|
"key": "data_sessions",
|
|
73
73
|
"next_page_url": null,
|
|
74
74
|
"page": 0,
|
|
75
75
|
"page_size": 50,
|
|
76
76
|
"previous_page_url": null,
|
|
77
|
-
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?
|
|
77
|
+
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?PageSize=50&Page=0"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
]
|
data/spec/spec_helper.rb
CHANGED
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
|
3
3
|
require 'bundler'
|
|
4
4
|
Bundler.setup
|
|
5
5
|
|
|
6
|
-
Dir.glob(File.expand_path('../support/**/*.rb', __FILE__)
|
|
6
|
+
Dir.glob(File.expand_path('../support/**/*.rb', __FILE__)).sort.each(&method(:require))
|
|
7
7
|
|
|
8
8
|
require_relative './holodeck/holodeck.rb'
|
|
9
9
|
require_relative './holodeck/hologram.rb'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twilio-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.40.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Twilio API Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jwt
|
|
@@ -371,12 +371,37 @@ files:
|
|
|
371
371
|
- lib/twilio-ruby/rest/client.rb
|
|
372
372
|
- lib/twilio-ruby/rest/conversations.rb
|
|
373
373
|
- lib/twilio-ruby/rest/conversations/v1.rb
|
|
374
|
+
- lib/twilio-ruby/rest/conversations/v1/configuration.rb
|
|
375
|
+
- lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
|
|
374
376
|
- lib/twilio-ruby/rest/conversations/v1/conversation.rb
|
|
375
377
|
- lib/twilio-ruby/rest/conversations/v1/conversation/message.rb
|
|
376
378
|
- lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
|
|
377
379
|
- lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb
|
|
378
380
|
- lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb
|
|
379
|
-
- lib/twilio-ruby/rest/conversations/v1/
|
|
381
|
+
- lib/twilio-ruby/rest/conversations/v1/credential.rb
|
|
382
|
+
- lib/twilio-ruby/rest/conversations/v1/role.rb
|
|
383
|
+
- lib/twilio-ruby/rest/conversations/v1/service.rb
|
|
384
|
+
- lib/twilio-ruby/rest/conversations/v1/service/binding.rb
|
|
385
|
+
- lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
|
|
386
|
+
- lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb
|
|
387
|
+
- lib/twilio-ruby/rest/conversations/v1/service/conversation.rb
|
|
388
|
+
- lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb
|
|
389
|
+
- lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
|
|
390
|
+
- lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb
|
|
391
|
+
- lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb
|
|
392
|
+
- lib/twilio-ruby/rest/conversations/v1/service/role.rb
|
|
393
|
+
- lib/twilio-ruby/rest/conversations/v1/service/user.rb
|
|
394
|
+
- lib/twilio-ruby/rest/conversations/v1/user.rb
|
|
395
|
+
- lib/twilio-ruby/rest/events.rb
|
|
396
|
+
- lib/twilio-ruby/rest/events/v1.rb
|
|
397
|
+
- lib/twilio-ruby/rest/events/v1/event_type.rb
|
|
398
|
+
- lib/twilio-ruby/rest/events/v1/schema.rb
|
|
399
|
+
- lib/twilio-ruby/rest/events/v1/schema/schema_version.rb
|
|
400
|
+
- lib/twilio-ruby/rest/events/v1/sink.rb
|
|
401
|
+
- lib/twilio-ruby/rest/events/v1/sink/sink_test.rb
|
|
402
|
+
- lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb
|
|
403
|
+
- lib/twilio-ruby/rest/events/v1/subscription.rb
|
|
404
|
+
- lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
|
|
380
405
|
- lib/twilio-ruby/rest/fax.rb
|
|
381
406
|
- lib/twilio-ruby/rest/fax/v1.rb
|
|
382
407
|
- lib/twilio-ruby/rest/fax/v1/fax.rb
|
|
@@ -422,6 +447,7 @@ files:
|
|
|
422
447
|
- lib/twilio-ruby/rest/lookups/v1/phone_number.rb
|
|
423
448
|
- lib/twilio-ruby/rest/messaging.rb
|
|
424
449
|
- lib/twilio-ruby/rest/messaging/v1.rb
|
|
450
|
+
- lib/twilio-ruby/rest/messaging/v1/deactivation.rb
|
|
425
451
|
- lib/twilio-ruby/rest/messaging/v1/service.rb
|
|
426
452
|
- lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb
|
|
427
453
|
- lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
|
|
@@ -622,6 +648,7 @@ files:
|
|
|
622
648
|
- lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb
|
|
623
649
|
- lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb
|
|
624
650
|
- lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb
|
|
651
|
+
- lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
|
|
625
652
|
- lib/twilio-ruby/rest/verify.rb
|
|
626
653
|
- lib/twilio-ruby/rest/verify/v2.rb
|
|
627
654
|
- lib/twilio-ruby/rest/verify/v2/form.rb
|
|
@@ -801,12 +828,35 @@ files:
|
|
|
801
828
|
- spec/integration/chat/v2/service/user/user_channel_spec.rb
|
|
802
829
|
- spec/integration/chat/v2/service/user_spec.rb
|
|
803
830
|
- spec/integration/chat/v2/service_spec.rb
|
|
831
|
+
- spec/integration/conversations/v1/configuration/webhook_spec.rb
|
|
832
|
+
- spec/integration/conversations/v1/configuration_spec.rb
|
|
804
833
|
- spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb
|
|
805
834
|
- spec/integration/conversations/v1/conversation/message_spec.rb
|
|
806
835
|
- spec/integration/conversations/v1/conversation/participant_spec.rb
|
|
807
836
|
- spec/integration/conversations/v1/conversation/webhook_spec.rb
|
|
808
837
|
- spec/integration/conversations/v1/conversation_spec.rb
|
|
809
|
-
- spec/integration/conversations/v1/
|
|
838
|
+
- spec/integration/conversations/v1/credential_spec.rb
|
|
839
|
+
- spec/integration/conversations/v1/role_spec.rb
|
|
840
|
+
- spec/integration/conversations/v1/service/binding_spec.rb
|
|
841
|
+
- spec/integration/conversations/v1/service/configuration/notification_spec.rb
|
|
842
|
+
- spec/integration/conversations/v1/service/configuration_spec.rb
|
|
843
|
+
- spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb
|
|
844
|
+
- spec/integration/conversations/v1/service/conversation/message_spec.rb
|
|
845
|
+
- spec/integration/conversations/v1/service/conversation/participant_spec.rb
|
|
846
|
+
- spec/integration/conversations/v1/service/conversation/webhook_spec.rb
|
|
847
|
+
- spec/integration/conversations/v1/service/conversation_spec.rb
|
|
848
|
+
- spec/integration/conversations/v1/service/role_spec.rb
|
|
849
|
+
- spec/integration/conversations/v1/service/user_spec.rb
|
|
850
|
+
- spec/integration/conversations/v1/service_spec.rb
|
|
851
|
+
- spec/integration/conversations/v1/user_spec.rb
|
|
852
|
+
- spec/integration/events/v1/event_type_spec.rb
|
|
853
|
+
- spec/integration/events/v1/schema/schema_version_spec.rb
|
|
854
|
+
- spec/integration/events/v1/schema_spec.rb
|
|
855
|
+
- spec/integration/events/v1/sink/sink_test_spec.rb
|
|
856
|
+
- spec/integration/events/v1/sink/sink_validate_spec.rb
|
|
857
|
+
- spec/integration/events/v1/sink_spec.rb
|
|
858
|
+
- spec/integration/events/v1/subscription/subscribed_event_spec.rb
|
|
859
|
+
- spec/integration/events/v1/subscription_spec.rb
|
|
810
860
|
- spec/integration/fax/v1/fax/fax_media_spec.rb
|
|
811
861
|
- spec/integration/fax/v1/fax_spec.rb
|
|
812
862
|
- spec/integration/flex_api/v1/channel_spec.rb
|
|
@@ -839,6 +889,7 @@ files:
|
|
|
839
889
|
- spec/integration/ip_messaging/v2/service/user_spec.rb
|
|
840
890
|
- spec/integration/ip_messaging/v2/service_spec.rb
|
|
841
891
|
- spec/integration/lookups/v1/phone_number_spec.rb
|
|
892
|
+
- spec/integration/messaging/v1/deactivation_spec.rb
|
|
842
893
|
- spec/integration/messaging/v1/service/alpha_sender_spec.rb
|
|
843
894
|
- spec/integration/messaging/v1/service/phone_number_spec.rb
|
|
844
895
|
- spec/integration/messaging/v1/service/short_code_spec.rb
|
|
@@ -1005,6 +1056,7 @@ files:
|
|
|
1005
1056
|
- spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb
|
|
1006
1057
|
- spec/integration/trunking/v1/trunk/origination_url_spec.rb
|
|
1007
1058
|
- spec/integration/trunking/v1/trunk/phone_number_spec.rb
|
|
1059
|
+
- spec/integration/trunking/v1/trunk/recording_spec.rb
|
|
1008
1060
|
- spec/integration/trunking/v1/trunk_spec.rb
|
|
1009
1061
|
- spec/integration/verify/v2/form_spec.rb
|
|
1010
1062
|
- spec/integration/verify/v2/service/access_token_spec.rb
|
|
@@ -1215,12 +1267,35 @@ test_files:
|
|
|
1215
1267
|
- spec/integration/chat/v2/service/user/user_channel_spec.rb
|
|
1216
1268
|
- spec/integration/chat/v2/service/user_spec.rb
|
|
1217
1269
|
- spec/integration/chat/v2/service_spec.rb
|
|
1270
|
+
- spec/integration/conversations/v1/configuration/webhook_spec.rb
|
|
1271
|
+
- spec/integration/conversations/v1/configuration_spec.rb
|
|
1218
1272
|
- spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb
|
|
1219
1273
|
- spec/integration/conversations/v1/conversation/message_spec.rb
|
|
1220
1274
|
- spec/integration/conversations/v1/conversation/participant_spec.rb
|
|
1221
1275
|
- spec/integration/conversations/v1/conversation/webhook_spec.rb
|
|
1222
1276
|
- spec/integration/conversations/v1/conversation_spec.rb
|
|
1223
|
-
- spec/integration/conversations/v1/
|
|
1277
|
+
- spec/integration/conversations/v1/credential_spec.rb
|
|
1278
|
+
- spec/integration/conversations/v1/role_spec.rb
|
|
1279
|
+
- spec/integration/conversations/v1/service/binding_spec.rb
|
|
1280
|
+
- spec/integration/conversations/v1/service/configuration/notification_spec.rb
|
|
1281
|
+
- spec/integration/conversations/v1/service/configuration_spec.rb
|
|
1282
|
+
- spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb
|
|
1283
|
+
- spec/integration/conversations/v1/service/conversation/message_spec.rb
|
|
1284
|
+
- spec/integration/conversations/v1/service/conversation/participant_spec.rb
|
|
1285
|
+
- spec/integration/conversations/v1/service/conversation/webhook_spec.rb
|
|
1286
|
+
- spec/integration/conversations/v1/service/conversation_spec.rb
|
|
1287
|
+
- spec/integration/conversations/v1/service/role_spec.rb
|
|
1288
|
+
- spec/integration/conversations/v1/service/user_spec.rb
|
|
1289
|
+
- spec/integration/conversations/v1/service_spec.rb
|
|
1290
|
+
- spec/integration/conversations/v1/user_spec.rb
|
|
1291
|
+
- spec/integration/events/v1/event_type_spec.rb
|
|
1292
|
+
- spec/integration/events/v1/schema/schema_version_spec.rb
|
|
1293
|
+
- spec/integration/events/v1/schema_spec.rb
|
|
1294
|
+
- spec/integration/events/v1/sink/sink_test_spec.rb
|
|
1295
|
+
- spec/integration/events/v1/sink/sink_validate_spec.rb
|
|
1296
|
+
- spec/integration/events/v1/sink_spec.rb
|
|
1297
|
+
- spec/integration/events/v1/subscription/subscribed_event_spec.rb
|
|
1298
|
+
- spec/integration/events/v1/subscription_spec.rb
|
|
1224
1299
|
- spec/integration/fax/v1/fax/fax_media_spec.rb
|
|
1225
1300
|
- spec/integration/fax/v1/fax_spec.rb
|
|
1226
1301
|
- spec/integration/flex_api/v1/channel_spec.rb
|
|
@@ -1253,6 +1328,7 @@ test_files:
|
|
|
1253
1328
|
- spec/integration/ip_messaging/v2/service/user_spec.rb
|
|
1254
1329
|
- spec/integration/ip_messaging/v2/service_spec.rb
|
|
1255
1330
|
- spec/integration/lookups/v1/phone_number_spec.rb
|
|
1331
|
+
- spec/integration/messaging/v1/deactivation_spec.rb
|
|
1256
1332
|
- spec/integration/messaging/v1/service/alpha_sender_spec.rb
|
|
1257
1333
|
- spec/integration/messaging/v1/service/phone_number_spec.rb
|
|
1258
1334
|
- spec/integration/messaging/v1/service/short_code_spec.rb
|
|
@@ -1419,6 +1495,7 @@ test_files:
|
|
|
1419
1495
|
- spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb
|
|
1420
1496
|
- spec/integration/trunking/v1/trunk/origination_url_spec.rb
|
|
1421
1497
|
- spec/integration/trunking/v1/trunk/phone_number_spec.rb
|
|
1498
|
+
- spec/integration/trunking/v1/trunk/recording_spec.rb
|
|
1422
1499
|
- spec/integration/trunking/v1/trunk_spec.rb
|
|
1423
1500
|
- spec/integration/verify/v2/form_spec.rb
|
|
1424
1501
|
- spec/integration/verify/v2/service/access_token_spec.rb
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
# This code was generated by
|
|
3
|
-
# \ / _ _ _| _ _
|
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
-
# / /
|
|
6
|
-
#
|
|
7
|
-
# frozen_string_literal: true
|
|
8
|
-
|
|
9
|
-
module Twilio
|
|
10
|
-
module REST
|
|
11
|
-
class Conversations < Domain
|
|
12
|
-
class V1 < Version
|
|
13
|
-
##
|
|
14
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
15
|
-
class WebhookList < ListResource
|
|
16
|
-
##
|
|
17
|
-
# Initialize the WebhookList
|
|
18
|
-
# @param [Version] version Version that contains the resource
|
|
19
|
-
# @return [WebhookList] WebhookList
|
|
20
|
-
def initialize(version)
|
|
21
|
-
super(version)
|
|
22
|
-
|
|
23
|
-
# Path Solution
|
|
24
|
-
@solution = {}
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
# Provide a user friendly representation
|
|
29
|
-
def to_s
|
|
30
|
-
'#<Twilio.Conversations.V1.WebhookList>'
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
##
|
|
35
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
36
|
-
class WebhookPage < Page
|
|
37
|
-
##
|
|
38
|
-
# Initialize the WebhookPage
|
|
39
|
-
# @param [Version] version Version that contains the resource
|
|
40
|
-
# @param [Response] response Response from the API
|
|
41
|
-
# @param [Hash] solution Path solution for the resource
|
|
42
|
-
# @return [WebhookPage] WebhookPage
|
|
43
|
-
def initialize(version, response, solution)
|
|
44
|
-
super(version, response)
|
|
45
|
-
|
|
46
|
-
# Path Solution
|
|
47
|
-
@solution = solution
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
##
|
|
51
|
-
# Build an instance of WebhookInstance
|
|
52
|
-
# @param [Hash] payload Payload response from the API
|
|
53
|
-
# @return [WebhookInstance] WebhookInstance
|
|
54
|
-
def get_instance(payload)
|
|
55
|
-
WebhookInstance.new(@version, payload, )
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
##
|
|
59
|
-
# Provide a user friendly representation
|
|
60
|
-
def to_s
|
|
61
|
-
'<Twilio.Conversations.V1.WebhookPage>'
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
##
|
|
66
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
67
|
-
class WebhookContext < InstanceContext
|
|
68
|
-
##
|
|
69
|
-
# Initialize the WebhookContext
|
|
70
|
-
# @param [Version] version Version that contains the resource
|
|
71
|
-
# @return [WebhookContext] WebhookContext
|
|
72
|
-
def initialize(version)
|
|
73
|
-
super(version)
|
|
74
|
-
|
|
75
|
-
# Path Solution
|
|
76
|
-
@solution = {}
|
|
77
|
-
@uri = "/Conversations/Webhooks"
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
##
|
|
81
|
-
# Fetch the WebhookInstance
|
|
82
|
-
# @return [WebhookInstance] Fetched WebhookInstance
|
|
83
|
-
def fetch
|
|
84
|
-
payload = @version.fetch('GET', @uri)
|
|
85
|
-
|
|
86
|
-
WebhookInstance.new(@version, payload, )
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
##
|
|
90
|
-
# Update the WebhookInstance
|
|
91
|
-
# @param [String] method The HTTP method to be used when sending a webhook
|
|
92
|
-
# request.
|
|
93
|
-
# @param [String] filters The list of webhook event triggers that are enabled for
|
|
94
|
-
# this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`,
|
|
95
|
-
# `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`,
|
|
96
|
-
# `onParticipantUpdated`, `onParticipantRemoved`
|
|
97
|
-
# @param [String] pre_webhook_url The absolute url the pre-event webhook request
|
|
98
|
-
# should be sent to.
|
|
99
|
-
# @param [String] post_webhook_url The absolute url the post-event webhook request
|
|
100
|
-
# should be sent to.
|
|
101
|
-
# @param [webhook.Target] target The routing target of the webhook. Can be
|
|
102
|
-
# ordinary or route internally to Flex
|
|
103
|
-
# @return [WebhookInstance] Updated WebhookInstance
|
|
104
|
-
def update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset)
|
|
105
|
-
data = Twilio::Values.of({
|
|
106
|
-
'Method' => method,
|
|
107
|
-
'Filters' => Twilio.serialize_list(filters) { |e| e },
|
|
108
|
-
'PreWebhookUrl' => pre_webhook_url,
|
|
109
|
-
'PostWebhookUrl' => post_webhook_url,
|
|
110
|
-
'Target' => target,
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
payload = @version.update('POST', @uri, data: data)
|
|
114
|
-
|
|
115
|
-
WebhookInstance.new(@version, payload, )
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
##
|
|
119
|
-
# Provide a user friendly representation
|
|
120
|
-
def to_s
|
|
121
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
122
|
-
"#<Twilio.Conversations.V1.WebhookContext #{context}>"
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
##
|
|
126
|
-
# Provide a detailed, user friendly representation
|
|
127
|
-
def inspect
|
|
128
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
129
|
-
"#<Twilio.Conversations.V1.WebhookContext #{context}>"
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
##
|
|
134
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
135
|
-
class WebhookInstance < InstanceResource
|
|
136
|
-
##
|
|
137
|
-
# Initialize the WebhookInstance
|
|
138
|
-
# @param [Version] version Version that contains the resource
|
|
139
|
-
# @param [Hash] payload payload that contains response from Twilio
|
|
140
|
-
# @return [WebhookInstance] WebhookInstance
|
|
141
|
-
def initialize(version, payload)
|
|
142
|
-
super(version)
|
|
143
|
-
|
|
144
|
-
# Marshaled Properties
|
|
145
|
-
@properties = {
|
|
146
|
-
'account_sid' => payload['account_sid'],
|
|
147
|
-
'method' => payload['method'],
|
|
148
|
-
'filters' => payload['filters'],
|
|
149
|
-
'pre_webhook_url' => payload['pre_webhook_url'],
|
|
150
|
-
'post_webhook_url' => payload['post_webhook_url'],
|
|
151
|
-
'target' => payload['target'],
|
|
152
|
-
'url' => payload['url'],
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
# Context
|
|
156
|
-
@instance_context = nil
|
|
157
|
-
@params = {}
|
|
158
|
-
end
|
|
159
|
-
|
|
160
|
-
##
|
|
161
|
-
# Generate an instance context for the instance, the context is capable of
|
|
162
|
-
# performing various actions. All instance actions are proxied to the context
|
|
163
|
-
# @return [WebhookContext] WebhookContext for this WebhookInstance
|
|
164
|
-
def context
|
|
165
|
-
unless @instance_context
|
|
166
|
-
@instance_context = WebhookContext.new(@version, )
|
|
167
|
-
end
|
|
168
|
-
@instance_context
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
##
|
|
172
|
-
# @return [String] The unique id of the Account responsible for this conversation.
|
|
173
|
-
def account_sid
|
|
174
|
-
@properties['account_sid']
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
##
|
|
178
|
-
# @return [webhook.Method] The HTTP method to be used when sending a webhook request.
|
|
179
|
-
def method
|
|
180
|
-
@properties['method']
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
##
|
|
184
|
-
# @return [String] The list of webhook event triggers that are enabled for this Service.
|
|
185
|
-
def filters
|
|
186
|
-
@properties['filters']
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
##
|
|
190
|
-
# @return [String] The absolute url the pre-event webhook request should be sent to.
|
|
191
|
-
def pre_webhook_url
|
|
192
|
-
@properties['pre_webhook_url']
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
##
|
|
196
|
-
# @return [String] The absolute url the post-event webhook request should be sent to.
|
|
197
|
-
def post_webhook_url
|
|
198
|
-
@properties['post_webhook_url']
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
##
|
|
202
|
-
# @return [webhook.Target] The routing target of the webhook.
|
|
203
|
-
def target
|
|
204
|
-
@properties['target']
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
##
|
|
208
|
-
# @return [String] An absolute URL for this webhook.
|
|
209
|
-
def url
|
|
210
|
-
@properties['url']
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
##
|
|
214
|
-
# Fetch the WebhookInstance
|
|
215
|
-
# @return [WebhookInstance] Fetched WebhookInstance
|
|
216
|
-
def fetch
|
|
217
|
-
context.fetch
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
##
|
|
221
|
-
# Update the WebhookInstance
|
|
222
|
-
# @param [String] method The HTTP method to be used when sending a webhook
|
|
223
|
-
# request.
|
|
224
|
-
# @param [String] filters The list of webhook event triggers that are enabled for
|
|
225
|
-
# this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`,
|
|
226
|
-
# `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`,
|
|
227
|
-
# `onParticipantUpdated`, `onParticipantRemoved`
|
|
228
|
-
# @param [String] pre_webhook_url The absolute url the pre-event webhook request
|
|
229
|
-
# should be sent to.
|
|
230
|
-
# @param [String] post_webhook_url The absolute url the post-event webhook request
|
|
231
|
-
# should be sent to.
|
|
232
|
-
# @param [webhook.Target] target The routing target of the webhook. Can be
|
|
233
|
-
# ordinary or route internally to Flex
|
|
234
|
-
# @return [WebhookInstance] Updated WebhookInstance
|
|
235
|
-
def update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset)
|
|
236
|
-
context.update(
|
|
237
|
-
method: method,
|
|
238
|
-
filters: filters,
|
|
239
|
-
pre_webhook_url: pre_webhook_url,
|
|
240
|
-
post_webhook_url: post_webhook_url,
|
|
241
|
-
target: target,
|
|
242
|
-
)
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
##
|
|
246
|
-
# Provide a user friendly representation
|
|
247
|
-
def to_s
|
|
248
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
249
|
-
"<Twilio.Conversations.V1.WebhookInstance #{values}>"
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
##
|
|
253
|
-
# Provide a detailed, user friendly representation
|
|
254
|
-
def inspect
|
|
255
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
256
|
-
"<Twilio.Conversations.V1.WebhookInstance #{values}>"
|
|
257
|
-
end
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
end
|