twilio-ruby 5.72.1 → 5.73.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +45 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +160 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +251 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +59 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +22 -16
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -1
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
- data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -2
- data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
- data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
- data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
- data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
- data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
- data/lib/twilio-ruby/rest/oauth/v1.rb +56 -0
- data/lib/twilio-ruby/rest/oauth.rb +62 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -14
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -46
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +240 -0
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
- data/lib/twilio-ruby/rest/supersim.rb +6 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +18 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +9 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/template.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
- data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
- data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
- data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
- data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
- data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
- data/lib/twilio-ruby/twiml/voice_response.rb +10 -6
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +11 -2
@@ -0,0 +1,157 @@
|
|
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 Oauth < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class TokenList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the TokenList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [TokenList] TokenList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/token"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Create the TokenInstance
|
28
|
+
# @param [String] grant_type Grant type is a credential representing resource
|
29
|
+
# owner's authorization which can be used by client to obtain access token.
|
30
|
+
# @param [String] client_sid A 34 character string that uniquely identifies this
|
31
|
+
# OAuth App.
|
32
|
+
# @param [String] client_secret The credential for confidential OAuth App.
|
33
|
+
# @param [String] code JWT token related to the authorization code grant type.
|
34
|
+
# @param [String] code_verifier A code which is generation cryptographically.
|
35
|
+
# @param [String] device_code JWT token related to the device code grant type.
|
36
|
+
# @param [String] refresh_token JWT token related to the refresh token grant type.
|
37
|
+
# @param [String] device_id The Id of the device associated with the token
|
38
|
+
# (refresh token).
|
39
|
+
# @return [TokenInstance] Created TokenInstance
|
40
|
+
def create(grant_type: nil, client_sid: nil, client_secret: :unset, code: :unset, code_verifier: :unset, device_code: :unset, refresh_token: :unset, device_id: :unset)
|
41
|
+
data = Twilio::Values.of({
|
42
|
+
'GrantType' => grant_type,
|
43
|
+
'ClientSid' => client_sid,
|
44
|
+
'ClientSecret' => client_secret,
|
45
|
+
'Code' => code,
|
46
|
+
'CodeVerifier' => code_verifier,
|
47
|
+
'DeviceCode' => device_code,
|
48
|
+
'RefreshToken' => refresh_token,
|
49
|
+
'DeviceId' => device_id,
|
50
|
+
})
|
51
|
+
|
52
|
+
payload = @version.create('POST', @uri, data: data)
|
53
|
+
|
54
|
+
TokenInstance.new(@version, payload, )
|
55
|
+
end
|
56
|
+
|
57
|
+
##
|
58
|
+
# Provide a user friendly representation
|
59
|
+
def to_s
|
60
|
+
'#<Twilio.Oauth.V1.TokenList>'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class TokenPage < Page
|
65
|
+
##
|
66
|
+
# Initialize the TokenPage
|
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 [TokenPage] TokenPage
|
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 TokenInstance
|
80
|
+
# @param [Hash] payload Payload response from the API
|
81
|
+
# @return [TokenInstance] TokenInstance
|
82
|
+
def get_instance(payload)
|
83
|
+
TokenInstance.new(@version, payload, )
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Provide a user friendly representation
|
88
|
+
def to_s
|
89
|
+
'<Twilio.Oauth.V1.TokenPage>'
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class TokenInstance < InstanceResource
|
94
|
+
##
|
95
|
+
# Initialize the TokenInstance
|
96
|
+
# @param [Version] version Version that contains the resource
|
97
|
+
# @param [Hash] payload payload that contains response from Twilio
|
98
|
+
# @return [TokenInstance] TokenInstance
|
99
|
+
def initialize(version, payload)
|
100
|
+
super(version)
|
101
|
+
|
102
|
+
# Marshaled Properties
|
103
|
+
@properties = {
|
104
|
+
'access_token' => payload['access_token'],
|
105
|
+
'refresh_token' => payload['refresh_token'],
|
106
|
+
'id_token' => payload['id_token'],
|
107
|
+
'refresh_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['refresh_token_expires_at']),
|
108
|
+
'access_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['access_token_expires_at']),
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# @return [String] Token which carries the necessary information to access a Twilio resource directly
|
114
|
+
def access_token
|
115
|
+
@properties['access_token']
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# @return [String] Token which carries the information necessary to get a new access token
|
120
|
+
def refresh_token
|
121
|
+
@properties['refresh_token']
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# @return [String] The id_token
|
126
|
+
def id_token
|
127
|
+
@properties['id_token']
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# @return [Time] The RFC 2822 date and time in GMT when the refresh token expires
|
132
|
+
def refresh_token_expires_at
|
133
|
+
@properties['refresh_token_expires_at']
|
134
|
+
end
|
135
|
+
|
136
|
+
##
|
137
|
+
# @return [Time] The RFC 2822 date and time in GMT when the access token expires
|
138
|
+
def access_token_expires_at
|
139
|
+
@properties['access_token_expires_at']
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# Provide a user friendly representation
|
144
|
+
def to_s
|
145
|
+
"<Twilio.Oauth.V1.TokenInstance>"
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Provide a detailed, user friendly representation
|
150
|
+
def inspect
|
151
|
+
"<Twilio.Oauth.V1.TokenInstance>"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
@@ -0,0 +1,193 @@
|
|
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 Oauth < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class UserInfoList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the UserInfoList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [UserInfoList] UserInfoList
|
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.Oauth.V1.UserInfoList>'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class UserInfoPage < Page
|
33
|
+
##
|
34
|
+
# Initialize the UserInfoPage
|
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 [UserInfoPage] UserInfoPage
|
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 UserInfoInstance
|
48
|
+
# @param [Hash] payload Payload response from the API
|
49
|
+
# @return [UserInfoInstance] UserInfoInstance
|
50
|
+
def get_instance(payload)
|
51
|
+
UserInfoInstance.new(@version, payload, )
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Provide a user friendly representation
|
56
|
+
def to_s
|
57
|
+
'<Twilio.Oauth.V1.UserInfoPage>'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class UserInfoContext < InstanceContext
|
62
|
+
##
|
63
|
+
# Initialize the UserInfoContext
|
64
|
+
# @param [Version] version Version that contains the resource
|
65
|
+
# @return [UserInfoContext] UserInfoContext
|
66
|
+
def initialize(version)
|
67
|
+
super(version)
|
68
|
+
|
69
|
+
# Path Solution
|
70
|
+
@solution = {}
|
71
|
+
@uri = "/userinfo"
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Fetch the UserInfoInstance
|
76
|
+
# @return [UserInfoInstance] Fetched UserInfoInstance
|
77
|
+
def fetch
|
78
|
+
payload = @version.fetch('GET', @uri)
|
79
|
+
|
80
|
+
UserInfoInstance.new(@version, payload, )
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Provide a user friendly representation
|
85
|
+
def to_s
|
86
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
87
|
+
"#<Twilio.Oauth.V1.UserInfoContext #{context}>"
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Provide a detailed, user friendly representation
|
92
|
+
def inspect
|
93
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
94
|
+
"#<Twilio.Oauth.V1.UserInfoContext #{context}>"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
class UserInfoInstance < InstanceResource
|
99
|
+
##
|
100
|
+
# Initialize the UserInfoInstance
|
101
|
+
# @param [Version] version Version that contains the resource
|
102
|
+
# @param [Hash] payload payload that contains response from Twilio
|
103
|
+
# @return [UserInfoInstance] UserInfoInstance
|
104
|
+
def initialize(version, payload)
|
105
|
+
super(version)
|
106
|
+
|
107
|
+
# Marshaled Properties
|
108
|
+
@properties = {
|
109
|
+
'user_sid' => payload['user_sid'],
|
110
|
+
'first_name' => payload['first_name'],
|
111
|
+
'last_name' => payload['last_name'],
|
112
|
+
'friendly_name' => payload['friendly_name'],
|
113
|
+
'email' => payload['email'],
|
114
|
+
'url' => payload['url'],
|
115
|
+
}
|
116
|
+
|
117
|
+
# Context
|
118
|
+
@instance_context = nil
|
119
|
+
@params = {}
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Generate an instance context for the instance, the context is capable of
|
124
|
+
# performing various actions. All instance actions are proxied to the context
|
125
|
+
# @return [UserInfoContext] UserInfoContext for this UserInfoInstance
|
126
|
+
def context
|
127
|
+
unless @instance_context
|
128
|
+
@instance_context = UserInfoContext.new(@version, )
|
129
|
+
end
|
130
|
+
@instance_context
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# @return [String] The user sid
|
135
|
+
def user_sid
|
136
|
+
@properties['user_sid']
|
137
|
+
end
|
138
|
+
|
139
|
+
##
|
140
|
+
# @return [String] The first name of the end-user
|
141
|
+
def first_name
|
142
|
+
@properties['first_name']
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# @return [String] The last name of the end-user
|
147
|
+
def last_name
|
148
|
+
@properties['last_name']
|
149
|
+
end
|
150
|
+
|
151
|
+
##
|
152
|
+
# @return [String] The friendly name of the end-user
|
153
|
+
def friendly_name
|
154
|
+
@properties['friendly_name']
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# @return [String] The end-user's preferred email address
|
159
|
+
def email
|
160
|
+
@properties['email']
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# @return [String] The url
|
165
|
+
def url
|
166
|
+
@properties['url']
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# Fetch the UserInfoInstance
|
171
|
+
# @return [UserInfoInstance] Fetched UserInfoInstance
|
172
|
+
def fetch
|
173
|
+
context.fetch
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# Provide a user friendly representation
|
178
|
+
def to_s
|
179
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
180
|
+
"<Twilio.Oauth.V1.UserInfoInstance #{values}>"
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# Provide a detailed, user friendly representation
|
185
|
+
def inspect
|
186
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
187
|
+
"<Twilio.Oauth.V1.UserInfoInstance #{values}>"
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
@@ -0,0 +1,56 @@
|
|
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 Oauth
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# Initialize the V1 version of Oauth
|
15
|
+
def initialize(domain)
|
16
|
+
super
|
17
|
+
@version = 'v1'
|
18
|
+
@oauth = nil
|
19
|
+
@openid_discovery = nil
|
20
|
+
@token = nil
|
21
|
+
@user_info = nil
|
22
|
+
end
|
23
|
+
|
24
|
+
##
|
25
|
+
# @return [Twilio::REST::Oauth::V1::OauthContext]
|
26
|
+
def oauth
|
27
|
+
@oauth ||= OauthContext.new self
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
# @return [Twilio::REST::Oauth::V1::OpenidDiscoveryContext]
|
32
|
+
def openid_discovery
|
33
|
+
@openid_discovery ||= OpenidDiscoveryContext.new self
|
34
|
+
end
|
35
|
+
|
36
|
+
##
|
37
|
+
# @return [Twilio::REST::Oauth::V1::TokenContext]
|
38
|
+
def token
|
39
|
+
@token ||= TokenList.new self
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# @return [Twilio::REST::Oauth::V1::UserInfoContext]
|
44
|
+
def user_info
|
45
|
+
@user_info ||= UserInfoContext.new self
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Provide a user friendly representation
|
50
|
+
def to_s
|
51
|
+
'<Twilio::REST::Oauth::V1>'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,62 @@
|
|
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 Oauth < Domain
|
12
|
+
##
|
13
|
+
# Initialize the Oauth Domain
|
14
|
+
def initialize(twilio)
|
15
|
+
super
|
16
|
+
|
17
|
+
@base_url = 'https://oauth.twilio.com'
|
18
|
+
@host = 'oauth.twilio.com'
|
19
|
+
@port = 443
|
20
|
+
|
21
|
+
# Versions
|
22
|
+
@v1 = nil
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Version v1 of oauth
|
27
|
+
def v1
|
28
|
+
@v1 ||= V1.new self
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# @return [Twilio::REST::Oauth::V1::OauthInstance]
|
33
|
+
def oauth
|
34
|
+
self.v1.oauth()
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# @return [Twilio::REST::Oauth::V1::OpenidDiscoveryInstance]
|
39
|
+
def openid_discovery
|
40
|
+
self.v1.openid_discovery()
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# @return [Twilio::REST::Oauth::V1::TokenInstance]
|
45
|
+
def token
|
46
|
+
self.v1.token()
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# @return [Twilio::REST::Oauth::V1::UserInfoInstance]
|
51
|
+
def user_info
|
52
|
+
self.v1.user_info()
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Provide a user friendly representation
|
57
|
+
def to_s
|
58
|
+
'#<Twilio::REST::Oauth>'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -240,13 +240,13 @@ module Twilio
|
|
240
240
|
'failure_reason' => payload['failure_reason'],
|
241
241
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
242
242
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
243
|
-
'verification_attempts' => payload['verification_attempts'].to_i,
|
243
|
+
'verification_attempts' => payload['verification_attempts'] == nil ? payload['verification_attempts'] : payload['verification_attempts'].to_i,
|
244
244
|
'email' => payload['email'],
|
245
245
|
'cc_emails' => payload['cc_emails'],
|
246
246
|
'verification_type' => payload['verification_type'],
|
247
247
|
'verification_document_sid' => payload['verification_document_sid'],
|
248
248
|
'extension' => payload['extension'],
|
249
|
-
'call_delay' => payload['call_delay'].to_i,
|
249
|
+
'call_delay' => payload['call_delay'] == nil ? payload['call_delay'] : payload['call_delay'].to_i,
|
250
250
|
'verification_code' => payload['verification_code'],
|
251
251
|
'verification_call_sids' => payload['verification_call_sids'],
|
252
252
|
}
|
@@ -394,14 +394,14 @@ module Twilio
|
|
394
394
|
'failure_reason' => payload['failure_reason'],
|
395
395
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
396
396
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
397
|
-
'verification_attempts' => payload['verification_attempts'].to_i,
|
397
|
+
'verification_attempts' => payload['verification_attempts'] == nil ? payload['verification_attempts'] : payload['verification_attempts'].to_i,
|
398
398
|
'email' => payload['email'],
|
399
399
|
'cc_emails' => payload['cc_emails'],
|
400
400
|
'url' => payload['url'],
|
401
401
|
'verification_type' => payload['verification_type'],
|
402
402
|
'verification_document_sid' => payload['verification_document_sid'],
|
403
403
|
'extension' => payload['extension'],
|
404
|
-
'call_delay' => payload['call_delay'].to_i,
|
404
|
+
'call_delay' => payload['call_delay'] == nil ? payload['call_delay'] : payload['call_delay'].to_i,
|
405
405
|
'verification_code' => payload['verification_code'],
|
406
406
|
'verification_call_sids' => payload['verification_call_sids'],
|
407
407
|
}
|
@@ -275,7 +275,7 @@ module Twilio
|
|
275
275
|
|
276
276
|
# Marshaled Properties
|
277
277
|
@properties = {
|
278
|
-
'index' => payload['index'].to_i,
|
278
|
+
'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
|
279
279
|
'account_sid' => payload['account_sid'],
|
280
280
|
'service_sid' => payload['service_sid'],
|
281
281
|
'list_sid' => payload['list_sid'],
|
@@ -135,8 +135,8 @@ module Twilio
|
|
135
135
|
'account_sid' => payload['account_sid'],
|
136
136
|
'assistant_sid' => payload['assistant_sid'],
|
137
137
|
'task_sid' => payload['task_sid'],
|
138
|
-
'samples_count' => payload['samples_count'].to_i,
|
139
|
-
'fields_count' => payload['fields_count'].to_i,
|
138
|
+
'samples_count' => payload['samples_count'] == nil ? payload['samples_count'] : payload['samples_count'].to_i,
|
139
|
+
'fields_count' => payload['fields_count'] == nil ? payload['fields_count'] : payload['fields_count'].to_i,
|
140
140
|
'url' => payload['url'],
|
141
141
|
}
|
142
142
|
|
@@ -255,7 +255,7 @@ module Twilio
|
|
255
255
|
'friendly_name' => payload['friendly_name'],
|
256
256
|
'data_enabled' => payload['data_enabled'],
|
257
257
|
'data_metering' => payload['data_metering'],
|
258
|
-
'data_limit' => payload['data_limit'].to_i,
|
258
|
+
'data_limit' => payload['data_limit'] == nil ? payload['data_limit'] : payload['data_limit'].to_i,
|
259
259
|
'messaging_enabled' => payload['messaging_enabled'],
|
260
260
|
'voice_enabled' => payload['voice_enabled'],
|
261
261
|
'national_roaming_enabled' => payload['national_roaming_enabled'],
|
@@ -273,7 +273,7 @@ module Twilio
|
|
273
273
|
'capabilities' => payload['capabilities'],
|
274
274
|
'url' => payload['url'],
|
275
275
|
'is_reserved' => payload['is_reserved'],
|
276
|
-
'in_use' => payload['in_use'].to_i,
|
276
|
+
'in_use' => payload['in_use'] == nil ? payload['in_use'] : payload['in_use'].to_i,
|
277
277
|
}
|
278
278
|
|
279
279
|
# Context
|
@@ -121,26 +121,13 @@ module Twilio
|
|
121
121
|
# Participant. If not specified, Proxy will select a number from the pool.
|
122
122
|
# @param [String] proxy_identifier_sid The SID of the Proxy Identifier to assign
|
123
123
|
# to the Participant.
|
124
|
-
# @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
|
125
|
-
# the ProxyAllowParticipantConflict account flag, setting to true enables
|
126
|
-
# per-request opt-in to allowing Proxy to reject a Participant create request that
|
127
|
-
# could cause the same Identifier/ProxyIdentifier pair to be active in multiple
|
128
|
-
# Sessions. Depending on the context, this could be a 409 error (Twilio error code
|
129
|
-
# 80623) or a 400 error (Twilio error code 80604). If not provided, requests will
|
130
|
-
# be allowed to succeed and a Debugger notification (80802) will be emitted.
|
131
|
-
# Having multiple, active Participants with the same Identifier/ProxyIdentifier
|
132
|
-
# pair causes calls and messages from affected Participants to be routed
|
133
|
-
# incorrectly. Please note, the default behavior for accounts without the
|
134
|
-
# ProxyAllowParticipantConflict flag is to reject the request as described. This
|
135
|
-
# will eventually be the default for all accounts.
|
136
124
|
# @return [ParticipantInstance] Created ParticipantInstance
|
137
|
-
def create(identifier: nil, friendly_name: :unset, proxy_identifier: :unset, proxy_identifier_sid: :unset
|
125
|
+
def create(identifier: nil, friendly_name: :unset, proxy_identifier: :unset, proxy_identifier_sid: :unset)
|
138
126
|
data = Twilio::Values.of({
|
139
127
|
'Identifier' => identifier,
|
140
128
|
'FriendlyName' => friendly_name,
|
141
129
|
'ProxyIdentifier' => proxy_identifier,
|
142
130
|
'ProxyIdentifierSid' => proxy_identifier_sid,
|
143
|
-
'FailOnParticipantConflict' => fail_on_participant_conflict,
|
144
131
|
})
|
145
132
|
|
146
133
|
payload = @version.create('POST', @uri, data: data)
|
@@ -127,20 +127,8 @@ module Twilio
|
|
127
127
|
# on create.
|
128
128
|
# @param [Array[Hash]] participants The Participant objects to include in the new
|
129
129
|
# session.
|
130
|
-
# @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
|
131
|
-
# the ProxyAllowParticipantConflict account flag, setting to true enables
|
132
|
-
# per-request opt-in to allowing Proxy to reject a Session create (with
|
133
|
-
# Participants) request that could cause the same Identifier/ProxyIdentifier pair
|
134
|
-
# to be active in multiple Sessions. Depending on the context, this could be a 409
|
135
|
-
# error (Twilio error code 80623) or a 400 error (Twilio error code 80604). If not
|
136
|
-
# provided, requests will be allowed to succeed and a Debugger notification
|
137
|
-
# (80802) will be emitted. Having multiple, active Participants with the same
|
138
|
-
# Identifier/ProxyIdentifier pair causes calls and messages from affected
|
139
|
-
# Participants to be routed incorrectly. Please note, the default behavior for
|
140
|
-
# accounts without the ProxyAllowParticipantConflict flag is to reject the request
|
141
|
-
# as described. This will eventually be the default for all accounts.
|
142
130
|
# @return [SessionInstance] Created SessionInstance
|
143
|
-
def create(unique_name: :unset, date_expiry: :unset, ttl: :unset, mode: :unset, status: :unset, participants: :unset
|
131
|
+
def create(unique_name: :unset, date_expiry: :unset, ttl: :unset, mode: :unset, status: :unset, participants: :unset)
|
144
132
|
data = Twilio::Values.of({
|
145
133
|
'UniqueName' => unique_name,
|
146
134
|
'DateExpiry' => Twilio.serialize_iso8601_datetime(date_expiry),
|
@@ -148,7 +136,6 @@ module Twilio
|
|
148
136
|
'Mode' => mode,
|
149
137
|
'Status' => status,
|
150
138
|
'Participants' => Twilio.serialize_list(participants) { |e| Twilio.serialize_object(e) },
|
151
|
-
'FailOnParticipantConflict' => fail_on_participant_conflict,
|
152
139
|
})
|
153
140
|
|
154
141
|
payload = @version.create('POST', @uri, data: data)
|
@@ -243,24 +230,12 @@ module Twilio
|
|
243
230
|
# is measured from the last Session create or the Session's last Interaction.
|
244
231
|
# @param [session.Status] status The new status of the resource. Can be:
|
245
232
|
# `in-progress` to re-open a session or `closed` to close a session.
|
246
|
-
# @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
|
247
|
-
# the ProxyAllowParticipantConflict account flag, setting to true enables
|
248
|
-
# per-request opt-in to allowing Proxy to return a 400 error (Twilio error code
|
249
|
-
# 80604) when a request to set a Session to in-progress would cause Participants
|
250
|
-
# with the same Identifier/ProxyIdentifier pair to be active in multiple Sessions.
|
251
|
-
# If not provided, requests will be allowed to succeed, and a Debugger
|
252
|
-
# notification (80801) will be emitted. Having multiple, active Participants with
|
253
|
-
# the same Identifier/ProxyIdentifier pair causes calls and messages from affected
|
254
|
-
# Participants to be routed incorrectly. Please note, the default behavior for
|
255
|
-
# accounts without the ProxyAllowParticipantConflict flag is to reject the request
|
256
|
-
# as described. This will eventually be the default for all accounts.
|
257
233
|
# @return [SessionInstance] Updated SessionInstance
|
258
|
-
def update(date_expiry: :unset, ttl: :unset, status: :unset
|
234
|
+
def update(date_expiry: :unset, ttl: :unset, status: :unset)
|
259
235
|
data = Twilio::Values.of({
|
260
236
|
'DateExpiry' => Twilio.serialize_iso8601_datetime(date_expiry),
|
261
237
|
'Ttl' => ttl,
|
262
238
|
'Status' => status,
|
263
|
-
'FailOnParticipantConflict' => fail_on_participant_conflict,
|
264
239
|
})
|
265
240
|
|
266
241
|
payload = @version.update('POST', @uri, data: data)
|
@@ -355,7 +330,7 @@ module Twilio
|
|
355
330
|
'unique_name' => payload['unique_name'],
|
356
331
|
'status' => payload['status'],
|
357
332
|
'closed_reason' => payload['closed_reason'],
|
358
|
-
'ttl' => payload['ttl'].to_i,
|
333
|
+
'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i,
|
359
334
|
'mode' => payload['mode'],
|
360
335
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
361
336
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
@@ -498,25 +473,9 @@ module Twilio
|
|
498
473
|
# is measured from the last Session create or the Session's last Interaction.
|
499
474
|
# @param [session.Status] status The new status of the resource. Can be:
|
500
475
|
# `in-progress` to re-open a session or `closed` to close a session.
|
501
|
-
# @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
|
502
|
-
# the ProxyAllowParticipantConflict account flag, setting to true enables
|
503
|
-
# per-request opt-in to allowing Proxy to return a 400 error (Twilio error code
|
504
|
-
# 80604) when a request to set a Session to in-progress would cause Participants
|
505
|
-
# with the same Identifier/ProxyIdentifier pair to be active in multiple Sessions.
|
506
|
-
# If not provided, requests will be allowed to succeed, and a Debugger
|
507
|
-
# notification (80801) will be emitted. Having multiple, active Participants with
|
508
|
-
# the same Identifier/ProxyIdentifier pair causes calls and messages from affected
|
509
|
-
# Participants to be routed incorrectly. Please note, the default behavior for
|
510
|
-
# accounts without the ProxyAllowParticipantConflict flag is to reject the request
|
511
|
-
# as described. This will eventually be the default for all accounts.
|
512
476
|
# @return [SessionInstance] Updated SessionInstance
|
513
|
-
def update(date_expiry: :unset, ttl: :unset, status: :unset
|
514
|
-
context.update(
|
515
|
-
date_expiry: date_expiry,
|
516
|
-
ttl: ttl,
|
517
|
-
status: status,
|
518
|
-
fail_on_participant_conflict: fail_on_participant_conflict,
|
519
|
-
)
|
477
|
+
def update(date_expiry: :unset, ttl: :unset, status: :unset)
|
478
|
+
context.update(date_expiry: date_expiry, ttl: ttl, status: status, )
|
520
479
|
end
|
521
480
|
|
522
481
|
##
|