twilio-ruby 7.8.0 → 7.8.2
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/CHANGES.md +27 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/local.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/national.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/shared_cost.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/toll_free.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/voip.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
- data/lib/twilio-ruby/rest/client.rb +5 -0
- data/lib/twilio-ruby/rest/content/v1/content.rb +38 -1
- data/lib/twilio-ruby/rest/intelligence/v2/service.rb +17 -1
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_operator_results.rb +217 -0
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_sentences.rb +217 -0
- data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +43 -0
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge/chunk.rb +232 -0
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +213 -0
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge.rb +623 -0
- data/lib/twilio-ruby/rest/knowledge/v1.rb +49 -0
- data/lib/twilio-ruby/rest/knowledge.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge_base.rb +38 -0
- data/lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb +140 -0
- data/lib/twilio-ruby/rest/messaging/v2.rb +6 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +96 -8
- data/lib/twilio-ruby/rest/numbers/v3/hosted_number_order.rb +339 -0
- data/lib/twilio-ruby/rest/numbers/v3.rb +40 -0
- data/lib/twilio-ruby/rest/numbers_base.rb +5 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +186 -0
- data/lib/twilio-ruby/rest/oauth/v2.rb +40 -0
- data/lib/twilio-ruby/rest/oauth_base.rb +6 -1
- data/lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb +312 -0
- data/lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb +340 -0
- data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +467 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +75 -0
- data/lib/twilio-ruby/rest/voice_base.rb +6 -1
- data/lib/twilio-ruby/twiml/voice_response.rb +20 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +20 -4
@@ -0,0 +1,38 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
8
|
+
# https://openapi-generator.tech
|
9
|
+
# Do not edit the class manually.
|
10
|
+
# frozen_string_literal: true
|
11
|
+
module Twilio
|
12
|
+
module REST
|
13
|
+
class KnowledgeBase < Domain
|
14
|
+
##
|
15
|
+
# Initialize knowledge domain
|
16
|
+
#
|
17
|
+
# @param twilio - The twilio client
|
18
|
+
#
|
19
|
+
def initialize(twilio)
|
20
|
+
super(twilio)
|
21
|
+
@base_url = "https://knowledge.twilio.com"
|
22
|
+
@host = "knowledge.twilio.com"
|
23
|
+
@port = 443
|
24
|
+
@v1 = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def v1
|
28
|
+
@v1 ||= Knowledge::V1.new self
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Provide a user friendly representation
|
33
|
+
def to_s
|
34
|
+
'<Twilio::REST::Knowledge::V1>';
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Messaging
|
8
|
+
# This is the public Twilio REST API.
|
9
|
+
#
|
10
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
11
|
+
# https://openapi-generator.tech
|
12
|
+
# Do not edit the class manually.
|
13
|
+
#
|
14
|
+
|
15
|
+
|
16
|
+
module Twilio
|
17
|
+
module REST
|
18
|
+
class Messaging < MessagingBase
|
19
|
+
class V2 < Version
|
20
|
+
class TypingIndicatorList < ListResource
|
21
|
+
|
22
|
+
##
|
23
|
+
# Initialize the TypingIndicatorList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [TypingIndicatorList] TypingIndicatorList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
@uri = "/Indicators/Typing.json"
|
31
|
+
|
32
|
+
end
|
33
|
+
##
|
34
|
+
# Create the TypingIndicatorInstance
|
35
|
+
# @param [String] channel Shared channel identifier
|
36
|
+
# @param [String] message_id Message SID that identifies the conversation thread for the typing indicator. Must be a valid Twilio Message SID (SM*) or Media SID (MM*) from an existing WhatsApp conversation.
|
37
|
+
# @return [TypingIndicatorInstance] Created TypingIndicatorInstance
|
38
|
+
def create(
|
39
|
+
channel: nil,
|
40
|
+
message_id: nil
|
41
|
+
)
|
42
|
+
|
43
|
+
data = Twilio::Values.of({
|
44
|
+
'channel' => channel,
|
45
|
+
'messageId' => message_id,
|
46
|
+
})
|
47
|
+
|
48
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
payload = @version.create('POST', @uri, data: data, headers: headers)
|
55
|
+
TypingIndicatorInstance.new(
|
56
|
+
@version,
|
57
|
+
payload,
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
# Provide a user friendly representation
|
65
|
+
def to_s
|
66
|
+
'#<Twilio.Messaging.V2.TypingIndicatorList>'
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class TypingIndicatorPage < Page
|
71
|
+
##
|
72
|
+
# Initialize the TypingIndicatorPage
|
73
|
+
# @param [Version] version Version that contains the resource
|
74
|
+
# @param [Response] response Response from the API
|
75
|
+
# @param [Hash] solution Path solution for the resource
|
76
|
+
# @return [TypingIndicatorPage] TypingIndicatorPage
|
77
|
+
def initialize(version, response, solution)
|
78
|
+
super(version, response)
|
79
|
+
|
80
|
+
# Path Solution
|
81
|
+
@solution = solution
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Build an instance of TypingIndicatorInstance
|
86
|
+
# @param [Hash] payload Payload response from the API
|
87
|
+
# @return [TypingIndicatorInstance] TypingIndicatorInstance
|
88
|
+
def get_instance(payload)
|
89
|
+
TypingIndicatorInstance.new(@version, payload)
|
90
|
+
end
|
91
|
+
|
92
|
+
##
|
93
|
+
# Provide a user friendly representation
|
94
|
+
def to_s
|
95
|
+
'<Twilio.Messaging.V2.TypingIndicatorPage>'
|
96
|
+
end
|
97
|
+
end
|
98
|
+
class TypingIndicatorInstance < InstanceResource
|
99
|
+
##
|
100
|
+
# Initialize the TypingIndicatorInstance
|
101
|
+
# @param [Version] version Version that contains the resource
|
102
|
+
# @param [Hash] payload payload that contains response from Twilio
|
103
|
+
# @param [String] account_sid The SID of the
|
104
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this TypingIndicator
|
105
|
+
# resource.
|
106
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
107
|
+
# @return [TypingIndicatorInstance] TypingIndicatorInstance
|
108
|
+
def initialize(version, payload )
|
109
|
+
super(version)
|
110
|
+
|
111
|
+
# Marshaled Properties
|
112
|
+
@properties = {
|
113
|
+
'success' => payload['success'],
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
##
|
119
|
+
# @return [Boolean] Indicates if the typing indicator was sent successfully.
|
120
|
+
def success
|
121
|
+
@properties['success']
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Provide a user friendly representation
|
126
|
+
def to_s
|
127
|
+
"<Twilio.Messaging.V2.TypingIndicatorInstance>"
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# Provide a detailed, user friendly representation
|
132
|
+
def inspect
|
133
|
+
"<Twilio.Messaging.V2.TypingIndicatorInstance>"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -22,6 +22,7 @@ module Twilio
|
|
22
22
|
super
|
23
23
|
@version = 'v2'
|
24
24
|
@channels_senders = nil
|
25
|
+
@typing_indicator = nil
|
25
26
|
end
|
26
27
|
|
27
28
|
##
|
@@ -39,6 +40,11 @@ module Twilio
|
|
39
40
|
end
|
40
41
|
end
|
41
42
|
##
|
43
|
+
# @return [Twilio::REST::Messaging::V2::TypingIndicatorList]
|
44
|
+
def typing_indicator
|
45
|
+
@typing_indicator ||= TypingIndicatorList.new self
|
46
|
+
end
|
47
|
+
##
|
42
48
|
# Provide a user friendly representation
|
43
49
|
def to_s
|
44
50
|
'<Twilio::REST::Messaging::V2>';
|
@@ -19,6 +19,94 @@ module Twilio
|
|
19
19
|
class V1 < Version
|
20
20
|
class PortingPortInList < ListResource
|
21
21
|
|
22
|
+
class NumbersV1PortingAddress
|
23
|
+
# @param [street]: [String] The street address, ex: 101 Spear St
|
24
|
+
# @param [street_2]: [String] The building information, ex : 5th floor.
|
25
|
+
# @param [city]: [String] The city name, ex: San Francisco.
|
26
|
+
# @param [state]: [String] The state name, ex: CA or California. Note this should match the losing carrier’s information exactly. So if they spell out the entire state’s name instead of abbreviating it, please do so.
|
27
|
+
# @param [zip]: [String] The zip code, ex: 94105.
|
28
|
+
# @param [country]: [String] The country, ex: USA.
|
29
|
+
attr_accessor :street, :street_2, :city, :state, :zip, :country
|
30
|
+
def initialize(payload)
|
31
|
+
@street = payload["street"]
|
32
|
+
@street_2 = payload["street_2"]
|
33
|
+
@city = payload["city"]
|
34
|
+
@state = payload["state"]
|
35
|
+
@zip = payload["zip"]
|
36
|
+
@country = payload["country"]
|
37
|
+
end
|
38
|
+
def to_json(options = {})
|
39
|
+
{
|
40
|
+
"street": @street,
|
41
|
+
"street_2": @street_2,
|
42
|
+
"city": @city,
|
43
|
+
"state": @state,
|
44
|
+
"zip": @zip,
|
45
|
+
"country": @country,
|
46
|
+
}.to_json(options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class NumbersV1PortingPortInCreate
|
51
|
+
# @param [account_sid]: [String] Account Sid or subaccount where the phone number(s) will be Ported
|
52
|
+
# @param [documents]: [Array<String>] List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required.
|
53
|
+
# @param [phone_numbers]: [Array<PortingPortInList.NumbersV1PortingPortInCreatePhoneNumbers>] List of phone numbers to be ported. Maximum of 1,000 phone numbers per request.
|
54
|
+
# @param [losing_carrier_information]: [PortingPortInList.NumbersV1PortingLosingCarrierInformation]
|
55
|
+
# @param [notification_emails]: [Array<String>] Additional emails to send a copy of the signed LOA to.
|
56
|
+
# @param [target_port_in_date]: [Date] Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. We can't guarantee the exact date and time, as this depends on the losing carrier
|
57
|
+
# @param [target_port_in_time_range_start]: [String] The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
|
58
|
+
# @param [target_port_in_time_range_end]: [String] The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
|
59
|
+
# @param [bundle_sid]: [String] The bundle sid is an optional identifier to reference a group of regulatory documents for a port request.
|
60
|
+
# @param [portability_advance_carrier]: [String] A field only required for Japan port in requests. It is a unique identifier for the donor carrier service the line is being ported from.
|
61
|
+
# @param [auto_cancel_approval_numbers]: [String] Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.
|
62
|
+
attr_accessor :account_sid, :documents, :phone_numbers, :losing_carrier_information, :notification_emails, :target_port_in_date, :target_port_in_time_range_start, :target_port_in_time_range_end, :bundle_sid, :portability_advance_carrier, :auto_cancel_approval_numbers
|
63
|
+
def initialize(payload)
|
64
|
+
@account_sid = payload["account_sid"]
|
65
|
+
@documents = payload["documents"]
|
66
|
+
@phone_numbers = payload["phone_numbers"]
|
67
|
+
@losing_carrier_information = payload["losing_carrier_information"]
|
68
|
+
@notification_emails = payload["notification_emails"]
|
69
|
+
@target_port_in_date = payload["target_port_in_date"]
|
70
|
+
@target_port_in_time_range_start = payload["target_port_in_time_range_start"]
|
71
|
+
@target_port_in_time_range_end = payload["target_port_in_time_range_end"]
|
72
|
+
@bundle_sid = payload["bundle_sid"]
|
73
|
+
@portability_advance_carrier = payload["portability_advance_carrier"]
|
74
|
+
@auto_cancel_approval_numbers = payload["auto_cancel_approval_numbers"]
|
75
|
+
end
|
76
|
+
def to_json(options = {})
|
77
|
+
{
|
78
|
+
"account_sid": @account_sid,
|
79
|
+
"documents": @documents,
|
80
|
+
"phone_numbers": @phone_numbers,
|
81
|
+
"losing_carrier_information": @losing_carrier_information,
|
82
|
+
"notification_emails": @notification_emails,
|
83
|
+
"target_port_in_date": @target_port_in_date,
|
84
|
+
"target_port_in_time_range_start": @target_port_in_time_range_start,
|
85
|
+
"target_port_in_time_range_end": @target_port_in_time_range_end,
|
86
|
+
"bundle_sid": @bundle_sid,
|
87
|
+
"portability_advance_carrier": @portability_advance_carrier,
|
88
|
+
"auto_cancel_approval_numbers": @auto_cancel_approval_numbers,
|
89
|
+
}.to_json(options)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class NumbersV1PortingPortInCreatePhoneNumbers
|
94
|
+
# @param [phone_number]: [String] Phone number to be ported. This must be in the E164 Format.
|
95
|
+
# @param [pin]: [String] Some losing carriers require a PIN to authorize the port of a phone number. If the phone number is a US mobile phone number, the PIN is mandatory to process a porting request. Other carriers and number types may also require a PIN, you'll need to contact the losing carrier to determine what your phone number's PIN is.
|
96
|
+
attr_accessor :phone_number, :pin
|
97
|
+
def initialize(payload)
|
98
|
+
@phone_number = payload["phone_number"]
|
99
|
+
@pin = payload["pin"]
|
100
|
+
end
|
101
|
+
def to_json(options = {})
|
102
|
+
{
|
103
|
+
"phone_number": @phone_number,
|
104
|
+
"pin": @pin,
|
105
|
+
}.to_json(options)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
|
22
110
|
##
|
23
111
|
# Initialize the PortingPortInList
|
24
112
|
# @param [Version] version Version that contains the resource
|
@@ -32,9 +120,9 @@ module Twilio
|
|
32
120
|
end
|
33
121
|
##
|
34
122
|
# Create the PortingPortInInstance
|
35
|
-
# @param [
|
123
|
+
# @param [NumbersV1PortingPortInCreate] numbers_v1_porting_port_in_create
|
36
124
|
# @return [PortingPortInInstance] Created PortingPortInInstance
|
37
|
-
def create(
|
125
|
+
def create(numbers_v1_porting_port_in_create: nil
|
38
126
|
)
|
39
127
|
|
40
128
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
@@ -43,7 +131,7 @@ module Twilio
|
|
43
131
|
|
44
132
|
|
45
133
|
|
46
|
-
payload = @version.create('POST', @uri, headers: headers, data:
|
134
|
+
payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_porting_port_in_create.to_json)
|
47
135
|
PortingPortInInstance.new(
|
48
136
|
@version,
|
49
137
|
payload,
|
@@ -223,19 +311,19 @@ module Twilio
|
|
223
311
|
end
|
224
312
|
|
225
313
|
##
|
226
|
-
# @return [Date] Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. We can't guarantee the exact date and time, as this depends on the losing carrier
|
314
|
+
# @return [Date] Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. If a start and end range is provided, the date will be converted to its UTC equivalent with the ranges as reference and stored in UTC. We can't guarantee the exact date and time, as this depends on the losing carrier.
|
227
315
|
def target_port_in_date
|
228
316
|
@properties['target_port_in_date']
|
229
317
|
end
|
230
318
|
|
231
319
|
##
|
232
|
-
# @return [String] The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
|
320
|
+
# @return [String] The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.
|
233
321
|
def target_port_in_time_range_start
|
234
322
|
@properties['target_port_in_time_range_start']
|
235
323
|
end
|
236
324
|
|
237
325
|
##
|
238
|
-
# @return [String] The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
|
326
|
+
# @return [String] The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.
|
239
327
|
def target_port_in_time_range_end
|
240
328
|
@properties['target_port_in_time_range_end']
|
241
329
|
end
|
@@ -247,13 +335,13 @@ module Twilio
|
|
247
335
|
end
|
248
336
|
|
249
337
|
##
|
250
|
-
# @return [
|
338
|
+
# @return [NumbersV1PortingLosingCarrierInformation]
|
251
339
|
def losing_carrier_information
|
252
340
|
@properties['losing_carrier_information']
|
253
341
|
end
|
254
342
|
|
255
343
|
##
|
256
|
-
# @return [Array<
|
344
|
+
# @return [Array<NumbersV1PortingPortInPhoneNumberResult>]
|
257
345
|
def phone_numbers
|
258
346
|
@properties['phone_numbers']
|
259
347
|
end
|