twilio-ruby 5.54.1 → 5.55.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGES.md +10 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/frontline_api.rb +47 -0
- data/lib/twilio-ruby/rest/frontline_api/v1.rb +45 -0
- data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +233 -0
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c72bbd9cbefca5721d0511533669f45267080d0d5fa0737782fd92fc70d6751
|
4
|
+
data.tar.gz: 8b3365ed643f116a3ee5f1ca74d6e0e52e5c02cd0d51213a899fac3045f92773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c3731c318a3e0638f05f4670c59e5f4f6bd395c8ca317d5f60ef80d541cd6938c24b925d984255a648575736f087578731d0495590c526eb260aaa0c6b3f74c
|
7
|
+
data.tar.gz: aa0b3121b2df4f92be392302dbf60272ec3fce6e3b1e346f5c6d51c1bc1263706368a75d162d434f1058646ee0e43e4e73e6f76ab735bf55c1a9549f48332308
|
data/.travis.yml
CHANGED
@@ -36,4 +36,4 @@ notifications:
|
|
36
36
|
on_success: never
|
37
37
|
on_failure: change
|
38
38
|
rooms:
|
39
|
-
secure:
|
39
|
+
secure: HG7rC5VSDOZiLCkpTsC4ZImh1k59OPi6YEjYKhdGXItybLHa6Yh5C42WvSx3kVW3SeyLOm1CiaMv+pbBZUXStXYsl8eH69MbEZimhDWsPs/m+bh+gEISov22WNUs3ZfUqIXMIb6v18oXPp2Qa1gX5LUEAGoSxHWNmCAcHayWl7M=
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2021-06-16] Version 5.55.0
|
5
|
+
---------------------------
|
6
|
+
**Api**
|
7
|
+
- Update `status` enum for Messages to include 'canceled'
|
8
|
+
- Update `update_status` enum for Messages to include 'canceled'
|
9
|
+
|
10
|
+
**Trusthub**
|
11
|
+
- Corrected the sid for policy sid in customer_profile_evaluation.json and trust_product_evaluation.json **(breaking change)**
|
12
|
+
|
13
|
+
|
4
14
|
[2021-06-02] Version 5.54.1
|
5
15
|
---------------------------
|
6
16
|
**Events**
|
data/README.md
CHANGED
@@ -35,13 +35,13 @@ This library supports the following Ruby implementations:
|
|
35
35
|
To install using [Bundler][bundler] grab the latest stable version:
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
gem 'twilio-ruby', '~> 5.
|
38
|
+
gem 'twilio-ruby', '~> 5.55.0'
|
39
39
|
```
|
40
40
|
|
41
41
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
42
42
|
|
43
43
|
```bash
|
44
|
-
gem install twilio-ruby -v 5.
|
44
|
+
gem install twilio-ruby -v 5.55.0
|
45
45
|
```
|
46
46
|
|
47
47
|
To build and install the development branch yourself from the latest source:
|
@@ -37,6 +37,7 @@ module Twilio
|
|
37
37
|
@events = nil
|
38
38
|
@fax = nil
|
39
39
|
@flex_api = nil
|
40
|
+
@frontline_api = nil
|
40
41
|
@insights = nil
|
41
42
|
@ip_messaging = nil
|
42
43
|
@lookups = nil
|
@@ -206,6 +207,12 @@ module Twilio
|
|
206
207
|
@flex_api ||= FlexApi.new self
|
207
208
|
end
|
208
209
|
|
210
|
+
##
|
211
|
+
# Access the FrontlineApi Twilio Domain
|
212
|
+
def frontline_api
|
213
|
+
@frontline_api ||= FrontlineApi.new self
|
214
|
+
end
|
215
|
+
|
209
216
|
##
|
210
217
|
# Access the Insights Twilio Domain
|
211
218
|
def insights
|
@@ -0,0 +1,47 @@
|
|
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
|
+
##
|
13
|
+
# Initialize the FrontlineApi Domain
|
14
|
+
def initialize(twilio)
|
15
|
+
super
|
16
|
+
|
17
|
+
@base_url = 'https://frontline-api.twilio.com'
|
18
|
+
@host = 'frontline-api.twilio.com'
|
19
|
+
@port = 443
|
20
|
+
|
21
|
+
# Versions
|
22
|
+
@v1 = nil
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Version v1 of frontline_api
|
27
|
+
def v1
|
28
|
+
@v1 ||= V1.new self
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# @param [String] sid The unique string that we created to identify the User
|
33
|
+
# resource.
|
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
|
+
end
|
39
|
+
|
40
|
+
##
|
41
|
+
# Provide a user friendly representation
|
42
|
+
def to_s
|
43
|
+
'#<Twilio::REST::FrontlineApi>'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,45 @@
|
|
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
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# Initialize the V1 version of FrontlineApi
|
15
|
+
def initialize(domain)
|
16
|
+
super
|
17
|
+
@version = 'v1'
|
18
|
+
@users = nil
|
19
|
+
end
|
20
|
+
|
21
|
+
##
|
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
|
+
if sid.nil?
|
28
|
+
raise ArgumentError, 'sid cannot be nil'
|
29
|
+
end
|
30
|
+
if sid == :unset
|
31
|
+
@users ||= UserList.new self
|
32
|
+
else
|
33
|
+
UserContext.new(self, sid)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Provide a user friendly representation
|
39
|
+
def to_s
|
40
|
+
'<Twilio::REST::FrontlineApi::V1>'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,233 @@
|
|
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` and defaults to `active`
|
98
|
+
# @return [UserInstance] Updated UserInstance
|
99
|
+
def update(friendly_name: :unset, avatar: :unset, state: :unset)
|
100
|
+
data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Avatar' => avatar, 'State' => state, })
|
101
|
+
|
102
|
+
payload = @version.update('POST', @uri, data: data)
|
103
|
+
|
104
|
+
UserInstance.new(@version, payload, sid: @solution[:sid], )
|
105
|
+
end
|
106
|
+
|
107
|
+
##
|
108
|
+
# Provide a user friendly representation
|
109
|
+
def to_s
|
110
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
111
|
+
"#<Twilio.FrontlineApi.V1.UserContext #{context}>"
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Provide a detailed, user friendly representation
|
116
|
+
def inspect
|
117
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
118
|
+
"#<Twilio.FrontlineApi.V1.UserContext #{context}>"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
124
|
+
class UserInstance < InstanceResource
|
125
|
+
##
|
126
|
+
# Initialize the UserInstance
|
127
|
+
# @param [Version] version Version that contains the resource
|
128
|
+
# @param [Hash] payload payload that contains response from Twilio
|
129
|
+
# @param [String] sid The SID of the User resource to fetch. This value can be
|
130
|
+
# either the `sid` or the `identity` of the User resource to fetch.
|
131
|
+
# @return [UserInstance] UserInstance
|
132
|
+
def initialize(version, payload, sid: nil)
|
133
|
+
super(version)
|
134
|
+
|
135
|
+
# Marshaled Properties
|
136
|
+
@properties = {
|
137
|
+
'sid' => payload['sid'],
|
138
|
+
'identity' => payload['identity'],
|
139
|
+
'friendly_name' => payload['friendly_name'],
|
140
|
+
'avatar' => payload['avatar'],
|
141
|
+
'state' => payload['state'],
|
142
|
+
'url' => payload['url'],
|
143
|
+
}
|
144
|
+
|
145
|
+
# Context
|
146
|
+
@instance_context = nil
|
147
|
+
@params = {'sid' => sid || @properties['sid'], }
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Generate an instance context for the instance, the context is capable of
|
152
|
+
# performing various actions. All instance actions are proxied to the context
|
153
|
+
# @return [UserContext] UserContext for this UserInstance
|
154
|
+
def context
|
155
|
+
unless @instance_context
|
156
|
+
@instance_context = UserContext.new(@version, @params['sid'], )
|
157
|
+
end
|
158
|
+
@instance_context
|
159
|
+
end
|
160
|
+
|
161
|
+
##
|
162
|
+
# @return [String] The unique string that identifies the resource
|
163
|
+
def sid
|
164
|
+
@properties['sid']
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# @return [String] The string that identifies the resource's User
|
169
|
+
def identity
|
170
|
+
@properties['identity']
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# @return [String] The string that you assigned to describe the User
|
175
|
+
def friendly_name
|
176
|
+
@properties['friendly_name']
|
177
|
+
end
|
178
|
+
|
179
|
+
##
|
180
|
+
# @return [String] The avatar URL which will be shown in Frontline application
|
181
|
+
def avatar
|
182
|
+
@properties['avatar']
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# @return [user.StateType] Current state of this user
|
187
|
+
def state
|
188
|
+
@properties['state']
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# @return [String] An absolute URL for this user.
|
193
|
+
def url
|
194
|
+
@properties['url']
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# Fetch the UserInstance
|
199
|
+
# @return [UserInstance] Fetched UserInstance
|
200
|
+
def fetch
|
201
|
+
context.fetch
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# Update the UserInstance
|
206
|
+
# @param [String] friendly_name The string that you assigned to describe the User.
|
207
|
+
# @param [String] avatar The avatar URL which will be shown in Frontline
|
208
|
+
# application.
|
209
|
+
# @param [user.StateType] state Current state of this user. Can be either `active`
|
210
|
+
# or `deactivated` and defaults to `active`
|
211
|
+
# @return [UserInstance] Updated UserInstance
|
212
|
+
def update(friendly_name: :unset, avatar: :unset, state: :unset)
|
213
|
+
context.update(friendly_name: friendly_name, avatar: avatar, state: state, )
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Provide a user friendly representation
|
218
|
+
def to_s
|
219
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
220
|
+
"<Twilio.FrontlineApi.V1.UserInstance #{values}>"
|
221
|
+
end
|
222
|
+
|
223
|
+
##
|
224
|
+
# Provide a detailed, user friendly representation
|
225
|
+
def inspect
|
226
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
227
|
+
"<Twilio.FrontlineApi.V1.UserInstance #{values}>"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
data/lib/twilio-ruby/version.rb
CHANGED
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.55.0
|
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: 2021-06-
|
11
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -429,6 +429,9 @@ files:
|
|
429
429
|
- lib/twilio-ruby/rest/flex_api/v1/configuration.rb
|
430
430
|
- lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
|
431
431
|
- lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
|
432
|
+
- lib/twilio-ruby/rest/frontline_api.rb
|
433
|
+
- lib/twilio-ruby/rest/frontline_api/v1.rb
|
434
|
+
- lib/twilio-ruby/rest/frontline_api/v1/user.rb
|
432
435
|
- lib/twilio-ruby/rest/insights.rb
|
433
436
|
- lib/twilio-ruby/rest/insights/v1.rb
|
434
437
|
- lib/twilio-ruby/rest/insights/v1/call.rb
|