twilio-ruby 5.73.3 → 5.74.0
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 +49 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +19 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +4 -4
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
- data/lib/twilio-ruby/rest/content/v1/content.rb +18 -9
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +156 -0
- data/lib/twilio-ruby/rest/flex_api/v1/good_data.rb +6 -6
- data/lib/twilio-ruby/rest/flex_api/v1/user_roles.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +133 -0
- data/lib/twilio-ruby/rest/flex_api/v2.rb +35 -0
- data/lib/twilio-ruby/rest/flex_api.rb +19 -0
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +81 -6
- data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +267 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +43 -18
- data/lib/twilio-ruby/rest/messaging/v1.rb +34 -0
- data/lib/twilio-ruby/rest/messaging.rb +18 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device.rb +7 -0
- data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +153 -0
- data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +1 -1
- data/lib/twilio-ruby/rest/oauth/v1.rb +7 -0
- data/lib/twilio-ruby/rest/oauth.rb +6 -0
- data/lib/twilio-ruby/rest/preview.rb +0 -33
- data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +12 -5
- data/lib/twilio-ruby/twiml/voice_response.rb +21 -21
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +9 -8
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
- data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +0 -195
- data/lib/twilio-ruby/rest/preview/trusted_comms/cps.rb +0 -186
- data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -0,0 +1,133 @@
|
|
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 FlexApi < Domain
|
12
|
+
class V2 < Version
|
13
|
+
class WebChannelsList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the WebChannelsList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [WebChannelsList] WebChannelsList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/WebChats"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Create the WebChannelsInstance
|
28
|
+
# @param [String] address_sid The SID of the Conversations Address. See {Address
|
29
|
+
# Configuration
|
30
|
+
# Resource}[https://www.twilio.com/docs/conversations/api/address-configuration-resource]
|
31
|
+
# for configuration details. When a conversation is created on the Flex backend,
|
32
|
+
# the callback URL will be set to the corresponding Studio Flow SID or webhook URL
|
33
|
+
# in your address configuration.
|
34
|
+
# @param [String] chat_friendly_name The Conversation's friendly name. See the
|
35
|
+
# {Conversation
|
36
|
+
# resource}[https://www.twilio.com/docs/conversations/api/conversation-resource]
|
37
|
+
# for an example.
|
38
|
+
# @param [String] customer_friendly_name The Conversation participant's friendly
|
39
|
+
# name. See the {Conversation Participant
|
40
|
+
# Resource}[https://www.twilio.com/docs/conversations/api/conversation-participant-resource]
|
41
|
+
# for an example.
|
42
|
+
# @param [String] pre_engagement_data The pre-engagement data.
|
43
|
+
# @return [WebChannelsInstance] Created WebChannelsInstance
|
44
|
+
def create(address_sid: nil, chat_friendly_name: :unset, customer_friendly_name: :unset, pre_engagement_data: :unset)
|
45
|
+
data = Twilio::Values.of({
|
46
|
+
'AddressSid' => address_sid,
|
47
|
+
'ChatFriendlyName' => chat_friendly_name,
|
48
|
+
'CustomerFriendlyName' => customer_friendly_name,
|
49
|
+
'PreEngagementData' => pre_engagement_data,
|
50
|
+
})
|
51
|
+
|
52
|
+
payload = @version.create('POST', @uri, data: data)
|
53
|
+
|
54
|
+
WebChannelsInstance.new(@version, payload, )
|
55
|
+
end
|
56
|
+
|
57
|
+
##
|
58
|
+
# Provide a user friendly representation
|
59
|
+
def to_s
|
60
|
+
'#<Twilio.FlexApi.V2.WebChannelsList>'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class WebChannelsPage < Page
|
65
|
+
##
|
66
|
+
# Initialize the WebChannelsPage
|
67
|
+
# @param [Version] version Version that contains the resource
|
68
|
+
# @param [Response] response Response from the API
|
69
|
+
# @param [Hash] solution Path solution for the resource
|
70
|
+
# @return [WebChannelsPage] WebChannelsPage
|
71
|
+
def initialize(version, response, solution)
|
72
|
+
super(version, response)
|
73
|
+
|
74
|
+
# Path Solution
|
75
|
+
@solution = solution
|
76
|
+
end
|
77
|
+
|
78
|
+
##
|
79
|
+
# Build an instance of WebChannelsInstance
|
80
|
+
# @param [Hash] payload Payload response from the API
|
81
|
+
# @return [WebChannelsInstance] WebChannelsInstance
|
82
|
+
def get_instance(payload)
|
83
|
+
WebChannelsInstance.new(@version, payload, )
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Provide a user friendly representation
|
88
|
+
def to_s
|
89
|
+
'<Twilio.FlexApi.V2.WebChannelsPage>'
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class WebChannelsInstance < InstanceResource
|
94
|
+
##
|
95
|
+
# Initialize the WebChannelsInstance
|
96
|
+
# @param [Version] version Version that contains the resource
|
97
|
+
# @param [Hash] payload payload that contains response from Twilio
|
98
|
+
# @return [WebChannelsInstance] WebChannelsInstance
|
99
|
+
def initialize(version, payload)
|
100
|
+
super(version)
|
101
|
+
|
102
|
+
# Marshaled Properties
|
103
|
+
@properties = {'conversation_sid' => payload['conversation_sid'], 'identity' => payload['identity'], }
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# @return [String] The unique string representing the Conversation resource created
|
108
|
+
def conversation_sid
|
109
|
+
@properties['conversation_sid']
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# @return [String] The unique string representing the User created
|
114
|
+
def identity
|
115
|
+
@properties['identity']
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Provide a user friendly representation
|
120
|
+
def to_s
|
121
|
+
"<Twilio.FlexApi.V2.WebChannelsInstance>"
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Provide a detailed, user friendly representation
|
126
|
+
def inspect
|
127
|
+
"<Twilio.FlexApi.V2.WebChannelsInstance>"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
@@ -0,0 +1,35 @@
|
|
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 FlexApi
|
12
|
+
class V2 < Version
|
13
|
+
##
|
14
|
+
# Initialize the V2 version of FlexApi
|
15
|
+
def initialize(domain)
|
16
|
+
super
|
17
|
+
@version = 'v2'
|
18
|
+
@web_channels = nil
|
19
|
+
end
|
20
|
+
|
21
|
+
##
|
22
|
+
# @return [Twilio::REST::Flex_api::V2::WebChannelsContext]
|
23
|
+
def web_channels
|
24
|
+
@web_channels ||= WebChannelsList.new self
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'<Twilio::REST::FlexApi::V2>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -20,6 +20,7 @@ module Twilio
|
|
20
20
|
|
21
21
|
# Versions
|
22
22
|
@v1 = nil
|
23
|
+
@v2 = nil
|
23
24
|
end
|
24
25
|
|
25
26
|
##
|
@@ -28,6 +29,18 @@ module Twilio
|
|
28
29
|
@v1 ||= V1.new self
|
29
30
|
end
|
30
31
|
|
32
|
+
##
|
33
|
+
# Version v2 of flex_api
|
34
|
+
def v2
|
35
|
+
@v2 ||= V2.new self
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# @return [Twilio::REST::Flex_api::V1::AssessmentsInstance]
|
40
|
+
def assessments
|
41
|
+
self.v1.assessments()
|
42
|
+
end
|
43
|
+
|
31
44
|
##
|
32
45
|
# @param [String] sid The unique string that we created to identify the Channel
|
33
46
|
# resource.
|
@@ -82,6 +95,12 @@ module Twilio
|
|
82
95
|
self.v1.web_channel(sid)
|
83
96
|
end
|
84
97
|
|
98
|
+
##
|
99
|
+
# @return [Twilio::REST::Flex_api::V2::WebChannelsInstance]
|
100
|
+
def web_channels
|
101
|
+
self.v2.web_channels()
|
102
|
+
end
|
103
|
+
|
85
104
|
##
|
86
105
|
# Provide a user friendly representation
|
87
106
|
def to_s
|
@@ -83,13 +83,47 @@ module Twilio
|
|
83
83
|
# Fetch the PhoneNumberInstance
|
84
84
|
# @param [String] fields A comma-separated list of fields to return. Possible
|
85
85
|
# values are caller_name, sim_swap, call_forwarding, live_activity,
|
86
|
-
# line_type_intelligence.
|
86
|
+
# line_type_intelligence, identity_match.
|
87
87
|
# @param [String] country_code The {country
|
88
88
|
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] used if the phone number
|
89
89
|
# provided is in national format.
|
90
|
+
# @param [String] first_name User’s first name. This query parameter is only used
|
91
|
+
# (optionally) for identity_match package requests.
|
92
|
+
# @param [String] last_name User’s last name. This query parameter is only used
|
93
|
+
# (optionally) for identity_match package requests.
|
94
|
+
# @param [String] address_line_1 User’s first address line. This query parameter
|
95
|
+
# is only used (optionally) for identity_match package requests.
|
96
|
+
# @param [String] address_line_2 User’s second address line. This query parameter
|
97
|
+
# is only used (optionally) for identity_match package requests.
|
98
|
+
# @param [String] city User’s city. This query parameter is only used (optionally)
|
99
|
+
# for identity_match package requests.
|
100
|
+
# @param [String] state User’s country subdivision, such as state, province, or
|
101
|
+
# locality. This query parameter is only used (optionally) for identity_match
|
102
|
+
# package requests.
|
103
|
+
# @param [String] postal_code User’s postal zip code. This query parameter is only
|
104
|
+
# used (optionally) for identity_match package requests.
|
105
|
+
# @param [String] address_country_code User’s country, up to two characters. This
|
106
|
+
# query parameter is only used (optionally) for identity_match package requests.
|
107
|
+
# @param [String] national_id User’s national ID, such as SSN or Passport ID. This
|
108
|
+
# query parameter is only used (optionally) for identity_match package requests.
|
109
|
+
# @param [String] date_of_birth User’s date of birth, in YYYYMMDD format. This
|
110
|
+
# query parameter is only used (optionally) for identity_match package requests.
|
90
111
|
# @return [PhoneNumberInstance] Fetched PhoneNumberInstance
|
91
|
-
def fetch(fields: :unset, country_code: :unset)
|
92
|
-
params = Twilio::Values.of({
|
112
|
+
def fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line_1: :unset, address_line_2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset)
|
113
|
+
params = Twilio::Values.of({
|
114
|
+
'Fields' => fields,
|
115
|
+
'CountryCode' => country_code,
|
116
|
+
'FirstName' => first_name,
|
117
|
+
'LastName' => last_name,
|
118
|
+
'AddressLine1' => address_line_1,
|
119
|
+
'AddressLine2' => address_line_2,
|
120
|
+
'City' => city,
|
121
|
+
'State' => state,
|
122
|
+
'PostalCode' => postal_code,
|
123
|
+
'AddressCountryCode' => address_country_code,
|
124
|
+
'NationalId' => national_id,
|
125
|
+
'DateOfBirth' => date_of_birth,
|
126
|
+
})
|
93
127
|
|
94
128
|
payload = @version.fetch('GET', @uri, params: params)
|
95
129
|
|
@@ -137,6 +171,7 @@ module Twilio
|
|
137
171
|
'call_forwarding' => payload['call_forwarding'],
|
138
172
|
'live_activity' => payload['live_activity'],
|
139
173
|
'line_type_intelligence' => payload['line_type_intelligence'],
|
174
|
+
'identity_match' => payload['identity_match'],
|
140
175
|
'url' => payload['url'],
|
141
176
|
}
|
142
177
|
|
@@ -222,6 +257,12 @@ module Twilio
|
|
222
257
|
@properties['line_type_intelligence']
|
223
258
|
end
|
224
259
|
|
260
|
+
##
|
261
|
+
# @return [Hash] An object that contains identity match information
|
262
|
+
def identity_match
|
263
|
+
@properties['identity_match']
|
264
|
+
end
|
265
|
+
|
225
266
|
##
|
226
267
|
# @return [String] The absolute URL of the resource
|
227
268
|
def url
|
@@ -232,13 +273,47 @@ module Twilio
|
|
232
273
|
# Fetch the PhoneNumberInstance
|
233
274
|
# @param [String] fields A comma-separated list of fields to return. Possible
|
234
275
|
# values are caller_name, sim_swap, call_forwarding, live_activity,
|
235
|
-
# line_type_intelligence.
|
276
|
+
# line_type_intelligence, identity_match.
|
236
277
|
# @param [String] country_code The {country
|
237
278
|
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] used if the phone number
|
238
279
|
# provided is in national format.
|
280
|
+
# @param [String] first_name User’s first name. This query parameter is only used
|
281
|
+
# (optionally) for identity_match package requests.
|
282
|
+
# @param [String] last_name User’s last name. This query parameter is only used
|
283
|
+
# (optionally) for identity_match package requests.
|
284
|
+
# @param [String] address_line_1 User’s first address line. This query parameter
|
285
|
+
# is only used (optionally) for identity_match package requests.
|
286
|
+
# @param [String] address_line_2 User’s second address line. This query parameter
|
287
|
+
# is only used (optionally) for identity_match package requests.
|
288
|
+
# @param [String] city User’s city. This query parameter is only used (optionally)
|
289
|
+
# for identity_match package requests.
|
290
|
+
# @param [String] state User’s country subdivision, such as state, province, or
|
291
|
+
# locality. This query parameter is only used (optionally) for identity_match
|
292
|
+
# package requests.
|
293
|
+
# @param [String] postal_code User’s postal zip code. This query parameter is only
|
294
|
+
# used (optionally) for identity_match package requests.
|
295
|
+
# @param [String] address_country_code User’s country, up to two characters. This
|
296
|
+
# query parameter is only used (optionally) for identity_match package requests.
|
297
|
+
# @param [String] national_id User’s national ID, such as SSN or Passport ID. This
|
298
|
+
# query parameter is only used (optionally) for identity_match package requests.
|
299
|
+
# @param [String] date_of_birth User’s date of birth, in YYYYMMDD format. This
|
300
|
+
# query parameter is only used (optionally) for identity_match package requests.
|
239
301
|
# @return [PhoneNumberInstance] Fetched PhoneNumberInstance
|
240
|
-
def fetch(fields: :unset, country_code: :unset)
|
241
|
-
context.fetch(
|
302
|
+
def fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line_1: :unset, address_line_2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset)
|
303
|
+
context.fetch(
|
304
|
+
fields: fields,
|
305
|
+
country_code: country_code,
|
306
|
+
first_name: first_name,
|
307
|
+
last_name: last_name,
|
308
|
+
address_line_1: address_line_1,
|
309
|
+
address_line_2: address_line_2,
|
310
|
+
city: city,
|
311
|
+
state: state,
|
312
|
+
postal_code: postal_code,
|
313
|
+
address_country_code: address_country_code,
|
314
|
+
national_id: national_id,
|
315
|
+
date_of_birth: date_of_birth,
|
316
|
+
)
|
242
317
|
end
|
243
318
|
|
244
319
|
##
|
@@ -0,0 +1,257 @@
|
|
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 Messaging < 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 DomainCertsList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the DomainCertsList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [DomainCertsList] DomainCertsList
|
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.Messaging.V1.DomainCertsList>'
|
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 DomainCertsPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the DomainCertsPage
|
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 [DomainCertsPage] DomainCertsPage
|
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 DomainCertsInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [DomainCertsInstance] DomainCertsInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
DomainCertsInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.Messaging.V1.DomainCertsPage>'
|
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 DomainCertsContext < InstanceContext
|
68
|
+
##
|
69
|
+
# Initialize the DomainCertsContext
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @param [String] domain_sid Unique string used to identify the domain that this
|
72
|
+
# certificate should be associated with.
|
73
|
+
# @return [DomainCertsContext] DomainCertsContext
|
74
|
+
def initialize(version, domain_sid)
|
75
|
+
super(version)
|
76
|
+
|
77
|
+
# Path Solution
|
78
|
+
@solution = {domain_sid: domain_sid, }
|
79
|
+
@uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Certificate"
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Update the DomainCertsInstance
|
84
|
+
# @param [String] tls_cert Contains the full TLS certificate and private for this
|
85
|
+
# domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail.
|
86
|
+
# Twilio uses this information to process HTTPS traffic sent to your domain.
|
87
|
+
# @return [DomainCertsInstance] Updated DomainCertsInstance
|
88
|
+
def update(tls_cert: nil)
|
89
|
+
data = Twilio::Values.of({'TlsCert' => tls_cert, })
|
90
|
+
|
91
|
+
payload = @version.update('POST', @uri, data: data)
|
92
|
+
|
93
|
+
DomainCertsInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Fetch the DomainCertsInstance
|
98
|
+
# @return [DomainCertsInstance] Fetched DomainCertsInstance
|
99
|
+
def fetch
|
100
|
+
payload = @version.fetch('GET', @uri)
|
101
|
+
|
102
|
+
DomainCertsInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
|
103
|
+
end
|
104
|
+
|
105
|
+
##
|
106
|
+
# Delete the DomainCertsInstance
|
107
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
108
|
+
def delete
|
109
|
+
@version.delete('DELETE', @uri)
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Provide a user friendly representation
|
114
|
+
def to_s
|
115
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
116
|
+
"#<Twilio.Messaging.V1.DomainCertsContext #{context}>"
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Provide a detailed, user friendly representation
|
121
|
+
def inspect
|
122
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
123
|
+
"#<Twilio.Messaging.V1.DomainCertsContext #{context}>"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
129
|
+
class DomainCertsInstance < InstanceResource
|
130
|
+
##
|
131
|
+
# Initialize the DomainCertsInstance
|
132
|
+
# @param [Version] version Version that contains the resource
|
133
|
+
# @param [Hash] payload payload that contains response from Twilio
|
134
|
+
# @param [String] domain_sid Unique string used to identify the domain that this
|
135
|
+
# certificate should be associated with.
|
136
|
+
# @return [DomainCertsInstance] DomainCertsInstance
|
137
|
+
def initialize(version, payload, domain_sid: nil)
|
138
|
+
super(version)
|
139
|
+
|
140
|
+
# Marshaled Properties
|
141
|
+
@properties = {
|
142
|
+
'domain_sid' => payload['domain_sid'],
|
143
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
144
|
+
'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
|
145
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
146
|
+
'domain_name' => payload['domain_name'],
|
147
|
+
'certificate_sid' => payload['certificate_sid'],
|
148
|
+
'url' => payload['url'],
|
149
|
+
'validated' => payload['validated'],
|
150
|
+
}
|
151
|
+
|
152
|
+
# Context
|
153
|
+
@instance_context = nil
|
154
|
+
@params = {'domain_sid' => domain_sid || @properties['domain_sid'], }
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Generate an instance context for the instance, the context is capable of
|
159
|
+
# performing various actions. All instance actions are proxied to the context
|
160
|
+
# @return [DomainCertsContext] DomainCertsContext for this DomainCertsInstance
|
161
|
+
def context
|
162
|
+
unless @instance_context
|
163
|
+
@instance_context = DomainCertsContext.new(@version, @params['domain_sid'], )
|
164
|
+
end
|
165
|
+
@instance_context
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# @return [String] The unique string that we created to identify the Domain resource.
|
170
|
+
def domain_sid
|
171
|
+
@properties['domain_sid']
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# @return [Time] Date that this Domain was last updated.
|
176
|
+
def date_updated
|
177
|
+
@properties['date_updated']
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# @return [Time] Expiration date for your private certificate.
|
182
|
+
def date_expires
|
183
|
+
@properties['date_expires']
|
184
|
+
end
|
185
|
+
|
186
|
+
##
|
187
|
+
# @return [Time] Date this Domain SID was created.
|
188
|
+
def date_created
|
189
|
+
@properties['date_created']
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @return [String] Full url path for this domain.
|
194
|
+
def domain_name
|
195
|
+
@properties['domain_name']
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# @return [String] The unique string that we created to identify this Certificate resource.
|
200
|
+
def certificate_sid
|
201
|
+
@properties['certificate_sid']
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# @return [String] The url
|
206
|
+
def url
|
207
|
+
@properties['url']
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# @return [Boolean] Certificate validation field
|
212
|
+
def validated
|
213
|
+
@properties['validated']
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Update the DomainCertsInstance
|
218
|
+
# @param [String] tls_cert Contains the full TLS certificate and private for this
|
219
|
+
# domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail.
|
220
|
+
# Twilio uses this information to process HTTPS traffic sent to your domain.
|
221
|
+
# @return [DomainCertsInstance] Updated DomainCertsInstance
|
222
|
+
def update(tls_cert: nil)
|
223
|
+
context.update(tls_cert: tls_cert, )
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# Fetch the DomainCertsInstance
|
228
|
+
# @return [DomainCertsInstance] Fetched DomainCertsInstance
|
229
|
+
def fetch
|
230
|
+
context.fetch
|
231
|
+
end
|
232
|
+
|
233
|
+
##
|
234
|
+
# Delete the DomainCertsInstance
|
235
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
236
|
+
def delete
|
237
|
+
context.delete
|
238
|
+
end
|
239
|
+
|
240
|
+
##
|
241
|
+
# Provide a user friendly representation
|
242
|
+
def to_s
|
243
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
244
|
+
"<Twilio.Messaging.V1.DomainCertsInstance #{values}>"
|
245
|
+
end
|
246
|
+
|
247
|
+
##
|
248
|
+
# Provide a detailed, user friendly representation
|
249
|
+
def inspect
|
250
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
251
|
+
"<Twilio.Messaging.V1.DomainCertsInstance #{values}>"
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|