twilio-ruby 5.72.1 → 5.73.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +25 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
  7. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
  8. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
  9. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
  11. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +22 -16
  15. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
  17. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
  18. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
  19. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
  20. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
  21. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
  22. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
  23. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
  25. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
  26. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
  27. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
  28. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
  29. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
  30. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
  31. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
  32. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
  33. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
  35. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
  36. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
  37. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
  38. data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
  39. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
  40. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
  41. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  42. data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
  43. data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
  44. data/lib/twilio-ruby/rest/client.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
  46. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
  47. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
  48. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
  49. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
  50. data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
  51. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
  52. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  53. data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
  54. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
  55. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
  56. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
  57. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
  58. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
  59. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
  60. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  61. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
  62. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  63. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -2
  64. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +1 -1
  65. data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
  66. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  67. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
  68. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
  69. data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
  70. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
  71. data/lib/twilio-ruby/rest/oauth/v1.rb +56 -0
  72. data/lib/twilio-ruby/rest/oauth.rb +62 -0
  73. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  74. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
  75. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
  76. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
  77. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
  78. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
  79. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
  80. data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
  81. data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
  82. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  83. data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
  84. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +1 -1
  85. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +1 -1
  86. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +240 -0
  87. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
  88. data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
  89. data/lib/twilio-ruby/rest/supersim.rb +6 -0
  90. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
  91. data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
  92. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
  93. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  94. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
  95. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
  96. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +1 -1
  97. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
  98. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  99. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  100. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
  101. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
  102. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
  103. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
  104. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
  105. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
  106. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
  107. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
  108. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
  109. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
  110. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
  111. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
  112. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
  113. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
  114. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  115. data/lib/twilio-ruby/rest/verify/v2/template.rb +7 -0
  116. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
  117. data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
  118. data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
  119. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
  120. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
  121. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
  122. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
  123. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
  124. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  125. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
  126. data/lib/twilio-ruby/twiml/voice_response.rb +6 -4
  127. data/lib/twilio-ruby/version.rb +1 -1
  128. metadata +9 -2
@@ -0,0 +1,242 @@
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 OpenidDiscoveryList < ListResource
14
+ ##
15
+ # Initialize the OpenidDiscoveryList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [OpenidDiscoveryList] OpenidDiscoveryList
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.OpenidDiscoveryList>'
29
+ end
30
+ end
31
+
32
+ class OpenidDiscoveryPage < Page
33
+ ##
34
+ # Initialize the OpenidDiscoveryPage
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 [OpenidDiscoveryPage] OpenidDiscoveryPage
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 OpenidDiscoveryInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [OpenidDiscoveryInstance] OpenidDiscoveryInstance
50
+ def get_instance(payload)
51
+ OpenidDiscoveryInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Oauth.V1.OpenidDiscoveryPage>'
58
+ end
59
+ end
60
+
61
+ class OpenidDiscoveryContext < InstanceContext
62
+ ##
63
+ # Initialize the OpenidDiscoveryContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @return [OpenidDiscoveryContext] OpenidDiscoveryContext
66
+ def initialize(version)
67
+ super(version)
68
+
69
+ # Path Solution
70
+ @solution = {}
71
+ @uri = "/well-known/openid-configuration"
72
+ end
73
+
74
+ ##
75
+ # Fetch the OpenidDiscoveryInstance
76
+ # @return [OpenidDiscoveryInstance] Fetched OpenidDiscoveryInstance
77
+ def fetch
78
+ payload = @version.fetch('GET', @uri)
79
+
80
+ OpenidDiscoveryInstance.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.OpenidDiscoveryContext #{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.OpenidDiscoveryContext #{context}>"
95
+ end
96
+ end
97
+
98
+ class OpenidDiscoveryInstance < InstanceResource
99
+ ##
100
+ # Initialize the OpenidDiscoveryInstance
101
+ # @param [Version] version Version that contains the resource
102
+ # @param [Hash] payload payload that contains response from Twilio
103
+ # @return [OpenidDiscoveryInstance] OpenidDiscoveryInstance
104
+ def initialize(version, payload)
105
+ super(version)
106
+
107
+ # Marshaled Properties
108
+ @properties = {
109
+ 'issuer' => payload['issuer'],
110
+ 'authorization_endpoint' => payload['authorization_endpoint'],
111
+ 'device_authorization_endpoint' => payload['device_authorization_endpoint'],
112
+ 'token_endpoint' => payload['token_endpoint'],
113
+ 'userinfo_endpoint' => payload['userinfo_endpoint'],
114
+ 'revocation_endpoint' => payload['revocation_endpoint'],
115
+ 'jwk_uri' => payload['jwk_uri'],
116
+ 'response_type_supported' => payload['response_type_supported'],
117
+ 'subject_type_supported' => payload['subject_type_supported'],
118
+ 'id_token_signing_alg_values_supported' => payload['id_token_signing_alg_values_supported'],
119
+ 'scopes_supported' => payload['scopes_supported'],
120
+ 'claims_supported' => payload['claims_supported'],
121
+ 'url' => payload['url'],
122
+ }
123
+
124
+ # Context
125
+ @instance_context = nil
126
+ @params = {}
127
+ end
128
+
129
+ ##
130
+ # Generate an instance context for the instance, the context is capable of
131
+ # performing various actions. All instance actions are proxied to the context
132
+ # @return [OpenidDiscoveryContext] OpenidDiscoveryContext for this OpenidDiscoveryInstance
133
+ def context
134
+ unless @instance_context
135
+ @instance_context = OpenidDiscoveryContext.new(@version, )
136
+ end
137
+ @instance_context
138
+ end
139
+
140
+ ##
141
+ # @return [String] The issuer URL
142
+ def issuer
143
+ @properties['issuer']
144
+ end
145
+
146
+ ##
147
+ # @return [String] The URL of authorization endpoint
148
+ def authorization_endpoint
149
+ @properties['authorization_endpoint']
150
+ end
151
+
152
+ ##
153
+ # @return [String] The URL of device code authorization endpoint
154
+ def device_authorization_endpoint
155
+ @properties['device_authorization_endpoint']
156
+ end
157
+
158
+ ##
159
+ # @return [String] The URL of token endpoint
160
+ def token_endpoint
161
+ @properties['token_endpoint']
162
+ end
163
+
164
+ ##
165
+ # @return [String] The URL of user info endpoint
166
+ def userinfo_endpoint
167
+ @properties['userinfo_endpoint']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The URL of revocation endpoint
172
+ def revocation_endpoint
173
+ @properties['revocation_endpoint']
174
+ end
175
+
176
+ ##
177
+ # @return [String] The URL of public JWK endpoint
178
+ def jwk_uri
179
+ @properties['jwk_uri']
180
+ end
181
+
182
+ ##
183
+ # @return [Array[String]] List of response type supported for identity token
184
+ def response_type_supported
185
+ @properties['response_type_supported']
186
+ end
187
+
188
+ ##
189
+ # @return [Array[String]] List of subject supported for identity token
190
+ def subject_type_supported
191
+ @properties['subject_type_supported']
192
+ end
193
+
194
+ ##
195
+ # @return [Array[String]] List of JWS signing algorithms supported for identity token
196
+ def id_token_signing_alg_values_supported
197
+ @properties['id_token_signing_alg_values_supported']
198
+ end
199
+
200
+ ##
201
+ # @return [Array[String]] List of scopes supported identity token
202
+ def scopes_supported
203
+ @properties['scopes_supported']
204
+ end
205
+
206
+ ##
207
+ # @return [Array[String]] List of claims supported for identity token
208
+ def claims_supported
209
+ @properties['claims_supported']
210
+ end
211
+
212
+ ##
213
+ # @return [String] The url
214
+ def url
215
+ @properties['url']
216
+ end
217
+
218
+ ##
219
+ # Fetch the OpenidDiscoveryInstance
220
+ # @return [OpenidDiscoveryInstance] Fetched OpenidDiscoveryInstance
221
+ def fetch
222
+ context.fetch
223
+ end
224
+
225
+ ##
226
+ # Provide a user friendly representation
227
+ def to_s
228
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
229
+ "<Twilio.Oauth.V1.OpenidDiscoveryInstance #{values}>"
230
+ end
231
+
232
+ ##
233
+ # Provide a detailed, user friendly representation
234
+ def inspect
235
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
236
+ "<Twilio.Oauth.V1.OpenidDiscoveryInstance #{values}>"
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end
242
+ end
@@ -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