twilio-ruby 5.52.0 → 5.67.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 +5 -5
- data/.github/workflows/pr-lint.yml +15 -0
- data/.github/workflows/test-and-deploy.yml +129 -0
- data/.gitignore +5 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +91 -28
- data/CHANGES.md +563 -0
- data/Gemfile +1 -0
- data/Makefile +8 -11
- data/README.md +13 -6
- data/examples/examples.rb +1 -1
- data/lib/rack/twilio_webhook_authentication.rb +25 -1
- data/lib/twilio-ruby/http/http_client.rb +20 -4
- data/lib/twilio-ruby/http.rb +5 -0
- data/lib/twilio-ruby/jwt/access_token.rb +13 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
- data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
- data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
- data/lib/twilio-ruby/rest/chat.rb +16 -0
- data/lib/twilio-ruby/rest/client.rb +21 -12
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
- data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
- data/lib/twilio-ruby/rest/conversations.rb +15 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
- data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
- data/lib/twilio-ruby/rest/flex_api.rb +9 -0
- data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
- data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
- data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
- data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
- data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
- data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
- data/lib/twilio-ruby/rest/insights.rb +28 -0
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
- data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
- data/lib/twilio-ruby/rest/lookups.rb +7 -0
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
- data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
- data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
- data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
- data/lib/twilio-ruby/rest/media/v1.rb +76 -0
- data/lib/twilio-ruby/rest/media.rb +65 -0
- data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
- data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
- data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
- data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
- data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
- data/lib/twilio-ruby/rest/pricing.rb +19 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
- data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
- data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
- data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
- data/lib/twilio-ruby/rest/supersim.rb +15 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
- data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
- data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
- data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
- data/lib/twilio-ruby/rest/verify.rb +14 -2
- data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
- data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
- data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
- data/lib/twilio-ruby/rest/voice.rb +8 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
- data/lib/twilio-ruby/rest.rb +13 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
- data/lib/twilio-ruby/version.rb +1 -1
- data/lib/twilio-ruby.rb +6 -16
- data/sonar-project.properties +13 -0
- data/twilio-ruby.gemspec +1 -2
- metadata +59 -32
- data/.travis.yml +0 -45
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
- /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
- /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
- /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
- /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
- /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
- /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
- /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -0,0 +1,258 @@
|
|
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 FrontlineApi < 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 UserList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the UserList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [UserList] UserList
|
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.FrontlineApi.V1.UserList>'
|
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 UserPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the UserPage
|
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 [UserPage] UserPage
|
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 UserInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [UserInstance] UserInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
UserInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.FrontlineApi.V1.UserPage>'
|
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 UserContext < InstanceContext
|
68
|
+
##
|
69
|
+
# Initialize the UserContext
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @param [String] sid The SID of the User resource to fetch. This value can be
|
72
|
+
# either the `sid` or the `identity` of the User resource to fetch.
|
73
|
+
# @return [UserContext] UserContext
|
74
|
+
def initialize(version, sid)
|
75
|
+
super(version)
|
76
|
+
|
77
|
+
# Path Solution
|
78
|
+
@solution = {sid: sid, }
|
79
|
+
@uri = "/Users/#{@solution[:sid]}"
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Fetch the UserInstance
|
84
|
+
# @return [UserInstance] Fetched UserInstance
|
85
|
+
def fetch
|
86
|
+
payload = @version.fetch('GET', @uri)
|
87
|
+
|
88
|
+
UserInstance.new(@version, payload, sid: @solution[:sid], )
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Update the UserInstance
|
93
|
+
# @param [String] friendly_name The string that you assigned to describe the User.
|
94
|
+
# @param [String] avatar The avatar URL which will be shown in Frontline
|
95
|
+
# application.
|
96
|
+
# @param [user.StateType] state Current state of this user. Can be either `active`
|
97
|
+
# or `deactivated`.
|
98
|
+
# @param [Boolean] is_available Whether the User is available for new
|
99
|
+
# conversations. Set to `false` to prevent User from receiving new inbound
|
100
|
+
# conversations if you are using {Pool
|
101
|
+
# Routing}[https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing].
|
102
|
+
# @return [UserInstance] Updated UserInstance
|
103
|
+
def update(friendly_name: :unset, avatar: :unset, state: :unset, is_available: :unset)
|
104
|
+
data = Twilio::Values.of({
|
105
|
+
'FriendlyName' => friendly_name,
|
106
|
+
'Avatar' => avatar,
|
107
|
+
'State' => state,
|
108
|
+
'IsAvailable' => is_available,
|
109
|
+
})
|
110
|
+
|
111
|
+
payload = @version.update('POST', @uri, data: data)
|
112
|
+
|
113
|
+
UserInstance.new(@version, payload, sid: @solution[:sid], )
|
114
|
+
end
|
115
|
+
|
116
|
+
##
|
117
|
+
# Provide a user friendly representation
|
118
|
+
def to_s
|
119
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
120
|
+
"#<Twilio.FrontlineApi.V1.UserContext #{context}>"
|
121
|
+
end
|
122
|
+
|
123
|
+
##
|
124
|
+
# Provide a detailed, user friendly representation
|
125
|
+
def inspect
|
126
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
127
|
+
"#<Twilio.FrontlineApi.V1.UserContext #{context}>"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
133
|
+
class UserInstance < InstanceResource
|
134
|
+
##
|
135
|
+
# Initialize the UserInstance
|
136
|
+
# @param [Version] version Version that contains the resource
|
137
|
+
# @param [Hash] payload payload that contains response from Twilio
|
138
|
+
# @param [String] sid The SID of the User resource to fetch. This value can be
|
139
|
+
# either the `sid` or the `identity` of the User resource to fetch.
|
140
|
+
# @return [UserInstance] UserInstance
|
141
|
+
def initialize(version, payload, sid: nil)
|
142
|
+
super(version)
|
143
|
+
|
144
|
+
# Marshaled Properties
|
145
|
+
@properties = {
|
146
|
+
'sid' => payload['sid'],
|
147
|
+
'identity' => payload['identity'],
|
148
|
+
'friendly_name' => payload['friendly_name'],
|
149
|
+
'avatar' => payload['avatar'],
|
150
|
+
'state' => payload['state'],
|
151
|
+
'is_available' => payload['is_available'],
|
152
|
+
'url' => payload['url'],
|
153
|
+
}
|
154
|
+
|
155
|
+
# Context
|
156
|
+
@instance_context = nil
|
157
|
+
@params = {'sid' => sid || @properties['sid'], }
|
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 [UserContext] UserContext for this UserInstance
|
164
|
+
def context
|
165
|
+
unless @instance_context
|
166
|
+
@instance_context = UserContext.new(@version, @params['sid'], )
|
167
|
+
end
|
168
|
+
@instance_context
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# @return [String] The unique string that identifies the resource
|
173
|
+
def sid
|
174
|
+
@properties['sid']
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# @return [String] The string that identifies the resource's User
|
179
|
+
def identity
|
180
|
+
@properties['identity']
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# @return [String] The string that you assigned to describe the User
|
185
|
+
def friendly_name
|
186
|
+
@properties['friendly_name']
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] The avatar URL which will be shown in Frontline application
|
191
|
+
def avatar
|
192
|
+
@properties['avatar']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @return [user.StateType] Current state of this user
|
197
|
+
def state
|
198
|
+
@properties['state']
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# @return [Boolean] Whether the User is available for new conversations
|
203
|
+
def is_available
|
204
|
+
@properties['is_available']
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# @return [String] An absolute URL for this user.
|
209
|
+
def url
|
210
|
+
@properties['url']
|
211
|
+
end
|
212
|
+
|
213
|
+
##
|
214
|
+
# Fetch the UserInstance
|
215
|
+
# @return [UserInstance] Fetched UserInstance
|
216
|
+
def fetch
|
217
|
+
context.fetch
|
218
|
+
end
|
219
|
+
|
220
|
+
##
|
221
|
+
# Update the UserInstance
|
222
|
+
# @param [String] friendly_name The string that you assigned to describe the User.
|
223
|
+
# @param [String] avatar The avatar URL which will be shown in Frontline
|
224
|
+
# application.
|
225
|
+
# @param [user.StateType] state Current state of this user. Can be either `active`
|
226
|
+
# or `deactivated`.
|
227
|
+
# @param [Boolean] is_available Whether the User is available for new
|
228
|
+
# conversations. Set to `false` to prevent User from receiving new inbound
|
229
|
+
# conversations if you are using {Pool
|
230
|
+
# Routing}[https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing].
|
231
|
+
# @return [UserInstance] Updated UserInstance
|
232
|
+
def update(friendly_name: :unset, avatar: :unset, state: :unset, is_available: :unset)
|
233
|
+
context.update(
|
234
|
+
friendly_name: friendly_name,
|
235
|
+
avatar: avatar,
|
236
|
+
state: state,
|
237
|
+
is_available: is_available,
|
238
|
+
)
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# Provide a user friendly representation
|
243
|
+
def to_s
|
244
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
245
|
+
"<Twilio.FrontlineApi.V1.UserInstance #{values}>"
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# Provide a detailed, user friendly representation
|
250
|
+
def inspect
|
251
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
252
|
+
"<Twilio.FrontlineApi.V1.UserInstance #{values}>"
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
@@ -8,36 +8,36 @@
|
|
8
8
|
|
9
9
|
module Twilio
|
10
10
|
module REST
|
11
|
-
class
|
11
|
+
class FrontlineApi
|
12
12
|
class V1 < Version
|
13
13
|
##
|
14
|
-
# Initialize the V1 version of
|
14
|
+
# Initialize the V1 version of FrontlineApi
|
15
15
|
def initialize(domain)
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
|
-
@
|
18
|
+
@users = nil
|
19
19
|
end
|
20
20
|
|
21
21
|
##
|
22
|
-
# @param [String] sid The
|
23
|
-
# resource to fetch.
|
24
|
-
# @return [Twilio::REST::
|
25
|
-
# @return [Twilio::REST::
|
26
|
-
def
|
22
|
+
# @param [String] sid The SID of the User resource to fetch. This value can be
|
23
|
+
# either the `sid` or the `identity` of the User resource to fetch.
|
24
|
+
# @return [Twilio::REST::Frontline_api::V1::UserContext] if sid was passed.
|
25
|
+
# @return [Twilio::REST::Frontline_api::V1::UserList]
|
26
|
+
def users(sid=:unset)
|
27
27
|
if sid.nil?
|
28
28
|
raise ArgumentError, 'sid cannot be nil'
|
29
29
|
end
|
30
30
|
if sid == :unset
|
31
|
-
@
|
31
|
+
@users ||= UserList.new self
|
32
32
|
else
|
33
|
-
|
33
|
+
UserContext.new(self, sid)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
##
|
38
38
|
# Provide a user friendly representation
|
39
39
|
def to_s
|
40
|
-
'<Twilio::REST::
|
40
|
+
'<Twilio::REST::FrontlineApi::V1>'
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -8,14 +8,14 @@
|
|
8
8
|
|
9
9
|
module Twilio
|
10
10
|
module REST
|
11
|
-
class
|
11
|
+
class FrontlineApi < Domain
|
12
12
|
##
|
13
|
-
# Initialize the
|
13
|
+
# Initialize the FrontlineApi Domain
|
14
14
|
def initialize(twilio)
|
15
15
|
super
|
16
16
|
|
17
|
-
@base_url = 'https://
|
18
|
-
@host = '
|
17
|
+
@base_url = 'https://frontline-api.twilio.com'
|
18
|
+
@host = 'frontline-api.twilio.com'
|
19
19
|
@port = 443
|
20
20
|
|
21
21
|
# Versions
|
@@ -23,24 +23,24 @@ module Twilio
|
|
23
23
|
end
|
24
24
|
|
25
25
|
##
|
26
|
-
# Version v1 of
|
26
|
+
# Version v1 of frontline_api
|
27
27
|
def v1
|
28
28
|
@v1 ||= V1.new self
|
29
29
|
end
|
30
30
|
|
31
31
|
##
|
32
|
-
# @param [String] sid The unique string that we created to identify the
|
32
|
+
# @param [String] sid The unique string that we created to identify the User
|
33
33
|
# resource.
|
34
|
-
# @return [Twilio::REST::
|
35
|
-
# @return [Twilio::REST::
|
36
|
-
def
|
37
|
-
self.v1.
|
34
|
+
# @return [Twilio::REST::Frontline_api::V1::UserInstance] if sid was passed.
|
35
|
+
# @return [Twilio::REST::Frontline_api::V1::UserList]
|
36
|
+
def users(sid=:unset)
|
37
|
+
self.v1.users(sid)
|
38
38
|
end
|
39
39
|
|
40
40
|
##
|
41
41
|
# Provide a user friendly representation
|
42
42
|
def to_s
|
43
|
-
'#<Twilio::REST::
|
43
|
+
'#<Twilio::REST::FrontlineApi>'
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -0,0 +1,271 @@
|
|
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 Insights < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class AnnotationList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the AnnotationList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [AnnotationList] AnnotationList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Provide a user friendly representation
|
27
|
+
def to_s
|
28
|
+
'#<Twilio.Insights.V1.AnnotationList>'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class AnnotationPage < Page
|
33
|
+
##
|
34
|
+
# Initialize the AnnotationPage
|
35
|
+
# @param [Version] version Version that contains the resource
|
36
|
+
# @param [Response] response Response from the API
|
37
|
+
# @param [Hash] solution Path solution for the resource
|
38
|
+
# @return [AnnotationPage] AnnotationPage
|
39
|
+
def initialize(version, response, solution)
|
40
|
+
super(version, response)
|
41
|
+
|
42
|
+
# Path Solution
|
43
|
+
@solution = solution
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Build an instance of AnnotationInstance
|
48
|
+
# @param [Hash] payload Payload response from the API
|
49
|
+
# @return [AnnotationInstance] AnnotationInstance
|
50
|
+
def get_instance(payload)
|
51
|
+
AnnotationInstance.new(@version, payload, )
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Provide a user friendly representation
|
56
|
+
def to_s
|
57
|
+
'<Twilio.Insights.V1.AnnotationPage>'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class AnnotationContext < InstanceContext
|
62
|
+
##
|
63
|
+
# Initialize the AnnotationContext
|
64
|
+
# @param [Version] version Version that contains the resource
|
65
|
+
# @param [String] call_sid The call_sid
|
66
|
+
# @return [AnnotationContext] AnnotationContext
|
67
|
+
def initialize(version, call_sid)
|
68
|
+
super(version)
|
69
|
+
|
70
|
+
# Path Solution
|
71
|
+
@solution = {call_sid: call_sid, }
|
72
|
+
@uri = "/Voice/#{@solution[:call_sid]}/Annotation"
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Update the AnnotationInstance
|
77
|
+
# @param [annotation.AnsweredBy] answered_by The answered_by
|
78
|
+
# @param [annotation.ConnectivityIssue] connectivity_issue The connectivity_issue
|
79
|
+
# @param [String] quality_issues The quality_issues
|
80
|
+
# @param [Boolean] spam The spam
|
81
|
+
# @param [String] call_score The call_score
|
82
|
+
# @param [String] comment The comment
|
83
|
+
# @param [String] incident The incident
|
84
|
+
# @return [AnnotationInstance] Updated AnnotationInstance
|
85
|
+
def update(answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset)
|
86
|
+
data = Twilio::Values.of({
|
87
|
+
'AnsweredBy' => answered_by,
|
88
|
+
'ConnectivityIssue' => connectivity_issue,
|
89
|
+
'QualityIssues' => quality_issues,
|
90
|
+
'Spam' => spam,
|
91
|
+
'CallScore' => call_score,
|
92
|
+
'Comment' => comment,
|
93
|
+
'Incident' => incident,
|
94
|
+
})
|
95
|
+
|
96
|
+
payload = @version.update('POST', @uri, data: data)
|
97
|
+
|
98
|
+
AnnotationInstance.new(@version, payload, call_sid: @solution[:call_sid], )
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Fetch the AnnotationInstance
|
103
|
+
# @return [AnnotationInstance] Fetched AnnotationInstance
|
104
|
+
def fetch
|
105
|
+
payload = @version.fetch('GET', @uri)
|
106
|
+
|
107
|
+
AnnotationInstance.new(@version, payload, call_sid: @solution[:call_sid], )
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Provide a user friendly representation
|
112
|
+
def to_s
|
113
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
114
|
+
"#<Twilio.Insights.V1.AnnotationContext #{context}>"
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# Provide a detailed, user friendly representation
|
119
|
+
def inspect
|
120
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
121
|
+
"#<Twilio.Insights.V1.AnnotationContext #{context}>"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
class AnnotationInstance < InstanceResource
|
126
|
+
##
|
127
|
+
# Initialize the AnnotationInstance
|
128
|
+
# @param [Version] version Version that contains the resource
|
129
|
+
# @param [Hash] payload payload that contains response from Twilio
|
130
|
+
# @param [String] call_sid The call_sid
|
131
|
+
# @return [AnnotationInstance] AnnotationInstance
|
132
|
+
def initialize(version, payload, call_sid: nil)
|
133
|
+
super(version)
|
134
|
+
|
135
|
+
# Marshaled Properties
|
136
|
+
@properties = {
|
137
|
+
'call_sid' => payload['call_sid'],
|
138
|
+
'account_sid' => payload['account_sid'],
|
139
|
+
'answered_by' => payload['answered_by'],
|
140
|
+
'connectivity_issue' => payload['connectivity_issue'],
|
141
|
+
'quality_issues' => payload['quality_issues'],
|
142
|
+
'spam' => payload['spam'],
|
143
|
+
'call_score' => payload['call_score'] == nil ? payload['call_score'] : payload['call_score'].to_i,
|
144
|
+
'comment' => payload['comment'],
|
145
|
+
'incident' => payload['incident'],
|
146
|
+
'url' => payload['url'],
|
147
|
+
}
|
148
|
+
|
149
|
+
# Context
|
150
|
+
@instance_context = nil
|
151
|
+
@params = {'call_sid' => call_sid || @properties['call_sid'], }
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# Generate an instance context for the instance, the context is capable of
|
156
|
+
# performing various actions. All instance actions are proxied to the context
|
157
|
+
# @return [AnnotationContext] AnnotationContext for this AnnotationInstance
|
158
|
+
def context
|
159
|
+
unless @instance_context
|
160
|
+
@instance_context = AnnotationContext.new(@version, @params['call_sid'], )
|
161
|
+
end
|
162
|
+
@instance_context
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# @return [String] The call_sid
|
167
|
+
def call_sid
|
168
|
+
@properties['call_sid']
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# @return [String] The account_sid
|
173
|
+
def account_sid
|
174
|
+
@properties['account_sid']
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# @return [annotation.AnsweredBy] The answered_by
|
179
|
+
def answered_by
|
180
|
+
@properties['answered_by']
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# @return [annotation.ConnectivityIssue] The connectivity_issue
|
185
|
+
def connectivity_issue
|
186
|
+
@properties['connectivity_issue']
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [Array[String]] The quality_issues
|
191
|
+
def quality_issues
|
192
|
+
@properties['quality_issues']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @return [Boolean] The spam
|
197
|
+
def spam
|
198
|
+
@properties['spam']
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# @return [String] The call_score
|
203
|
+
def call_score
|
204
|
+
@properties['call_score']
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# @return [String] The comment
|
209
|
+
def comment
|
210
|
+
@properties['comment']
|
211
|
+
end
|
212
|
+
|
213
|
+
##
|
214
|
+
# @return [String] The incident
|
215
|
+
def incident
|
216
|
+
@properties['incident']
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# @return [String] The url
|
221
|
+
def url
|
222
|
+
@properties['url']
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# Update the AnnotationInstance
|
227
|
+
# @param [annotation.AnsweredBy] answered_by The answered_by
|
228
|
+
# @param [annotation.ConnectivityIssue] connectivity_issue The connectivity_issue
|
229
|
+
# @param [String] quality_issues The quality_issues
|
230
|
+
# @param [Boolean] spam The spam
|
231
|
+
# @param [String] call_score The call_score
|
232
|
+
# @param [String] comment The comment
|
233
|
+
# @param [String] incident The incident
|
234
|
+
# @return [AnnotationInstance] Updated AnnotationInstance
|
235
|
+
def update(answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset)
|
236
|
+
context.update(
|
237
|
+
answered_by: answered_by,
|
238
|
+
connectivity_issue: connectivity_issue,
|
239
|
+
quality_issues: quality_issues,
|
240
|
+
spam: spam,
|
241
|
+
call_score: call_score,
|
242
|
+
comment: comment,
|
243
|
+
incident: incident,
|
244
|
+
)
|
245
|
+
end
|
246
|
+
|
247
|
+
##
|
248
|
+
# Fetch the AnnotationInstance
|
249
|
+
# @return [AnnotationInstance] Fetched AnnotationInstance
|
250
|
+
def fetch
|
251
|
+
context.fetch
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# Provide a user friendly representation
|
256
|
+
def to_s
|
257
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
258
|
+
"<Twilio.Insights.V1.AnnotationInstance #{values}>"
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# Provide a detailed, user friendly representation
|
263
|
+
def inspect
|
264
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
265
|
+
"<Twilio.Insights.V1.AnnotationInstance #{values}>"
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|