twilio-ruby 5.40.2 → 5.40.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +15 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/version.rb +2 -1
- 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 +8 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
- 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/conversations.rb +0 -16
- data/lib/twilio-ruby/rest/conversations/v1.rb +0 -24
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +17 -7
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +6 -6
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +22 -16
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +42 -36
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +4 -2
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +28 -25
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +30 -18
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +23 -20
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +32 -26
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +52 -46
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +24 -21
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +13 -11
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +23 -23
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +14 -14
- data/lib/twilio-ruby/rest/events.rb +10 -1
- data/lib/twilio-ruby/rest/events/v1.rb +17 -1
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +8 -8
- 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/subscription.rb +28 -8
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +3 -109
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
- 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/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/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 +19 -26
- 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/verification.rb +3 -1
- 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/voice/v1/dialing_permissions.rb +1 -4
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +11 -0
- data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
- data/spec/integration/conversations/v1/configuration_spec.rb +4 -2
- data/spec/integration/conversations/v1/{notification_spec.rb → service/configuration/notification_spec.rb} +12 -4
- 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/subscription/subscribed_event_spec.rb +0 -121
- data/spec/integration/events/v1/subscription_spec.rb +38 -0
- data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
- metadata +17 -8
- data/lib/twilio-ruby/rest/conversations/v1/notification.rb +0 -310
- data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -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
|