twilio-ruby 5.52.0 → 5.67.3

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.
Files changed (163) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/pr-lint.yml +15 -0
  3. data/.github/workflows/test-and-deploy.yml +129 -0
  4. data/.gitignore +5 -1
  5. data/.rubocop.yml +1 -1
  6. data/.rubocop_todo.yml +91 -28
  7. data/CHANGES.md +563 -0
  8. data/Gemfile +1 -0
  9. data/Makefile +8 -11
  10. data/README.md +13 -6
  11. data/examples/examples.rb +1 -1
  12. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  13. data/lib/twilio-ruby/http/http_client.rb +20 -4
  14. data/lib/twilio-ruby/http.rb +5 -0
  15. data/lib/twilio-ruby/jwt/access_token.rb +13 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
  22. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
  23. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
  28. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
  29. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  32. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
  33. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
  35. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
  36. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
  37. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  38. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  39. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  40. data/lib/twilio-ruby/rest/chat.rb +16 -0
  41. data/lib/twilio-ruby/rest/client.rb +21 -12
  42. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  44. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
  47. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  50. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  53. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  54. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  55. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  56. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  57. data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
  58. data/lib/twilio-ruby/rest/conversations.rb +15 -0
  59. data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
  60. data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
  61. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
  62. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
  63. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  64. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  65. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
  66. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  67. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  68. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  69. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
  70. data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
  71. data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
  72. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  73. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
  74. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  75. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  76. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  77. data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
  78. data/lib/twilio-ruby/rest/insights.rb +28 -0
  79. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
  80. data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
  81. data/lib/twilio-ruby/rest/lookups.rb +7 -0
  82. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
  83. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
  84. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
  85. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
  86. data/lib/twilio-ruby/rest/media/v1.rb +76 -0
  87. data/lib/twilio-ruby/rest/media.rb +65 -0
  88. data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
  89. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
  90. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
  91. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
  92. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  93. data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
  94. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
  95. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
  96. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
  97. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  98. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  99. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  100. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  101. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  102. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
  103. data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
  104. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  105. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
  106. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  107. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
  108. data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
  109. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
  110. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
  111. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  112. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
  113. data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
  114. data/lib/twilio-ruby/rest/supersim.rb +15 -6
  115. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  116. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
  117. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  118. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
  119. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
  120. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  121. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  122. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
  123. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
  124. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
  125. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
  126. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
  127. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
  128. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
  129. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
  130. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
  131. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  132. data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
  133. data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
  134. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  135. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
  136. data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
  137. data/lib/twilio-ruby/rest/verify.rb +14 -2
  138. data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
  139. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
  140. data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
  141. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  142. data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
  143. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  144. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  145. data/lib/twilio-ruby/rest/voice.rb +8 -0
  146. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  147. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
  148. data/lib/twilio-ruby/rest.rb +13 -0
  149. data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
  150. data/lib/twilio-ruby/version.rb +1 -1
  151. data/lib/twilio-ruby.rb +6 -16
  152. data/sonar-project.properties +13 -0
  153. data/twilio-ruby.gemspec +1 -2
  154. metadata +59 -32
  155. data/.travis.yml +0 -45
  156. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
  157. /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
  158. /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
  159. /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
  160. /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
  161. /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
  162. /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
  163. /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -0,0 +1,215 @@
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 Insights < Domain
12
+ class V1 < Version
13
+ class SettingList < ListResource
14
+ ##
15
+ # Initialize the SettingList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SettingList] SettingList
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.Insights.V1.SettingList>'
29
+ end
30
+ end
31
+
32
+ class SettingPage < Page
33
+ ##
34
+ # Initialize the SettingPage
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 [SettingPage] SettingPage
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 SettingInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [SettingInstance] SettingInstance
50
+ def get_instance(payload)
51
+ SettingInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Insights.V1.SettingPage>'
58
+ end
59
+ end
60
+
61
+ class SettingContext < InstanceContext
62
+ ##
63
+ # Initialize the SettingContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @return [SettingContext] SettingContext
66
+ def initialize(version)
67
+ super(version)
68
+
69
+ # Path Solution
70
+ @solution = {}
71
+ @uri = "/Voice/Settings"
72
+ end
73
+
74
+ ##
75
+ # Fetch the SettingInstance
76
+ # @param [String] subaccount_sid The subaccount_sid
77
+ # @return [SettingInstance] Fetched SettingInstance
78
+ def fetch(subaccount_sid: :unset)
79
+ params = Twilio::Values.of({'SubaccountSid' => subaccount_sid, })
80
+
81
+ payload = @version.fetch('GET', @uri, params: params)
82
+
83
+ SettingInstance.new(@version, payload, )
84
+ end
85
+
86
+ ##
87
+ # Update the SettingInstance
88
+ # @param [Boolean] advanced_features The advanced_features
89
+ # @param [Boolean] voice_trace The voice_trace
90
+ # @param [String] subaccount_sid The subaccount_sid
91
+ # @return [SettingInstance] Updated SettingInstance
92
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
93
+ data = Twilio::Values.of({
94
+ 'AdvancedFeatures' => advanced_features,
95
+ 'VoiceTrace' => voice_trace,
96
+ 'SubaccountSid' => subaccount_sid,
97
+ })
98
+
99
+ payload = @version.update('POST', @uri, data: data)
100
+
101
+ SettingInstance.new(@version, payload, )
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
109
+ end
110
+
111
+ ##
112
+ # Provide a detailed, user friendly representation
113
+ def inspect
114
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
116
+ end
117
+ end
118
+
119
+ class SettingInstance < InstanceResource
120
+ ##
121
+ # Initialize the SettingInstance
122
+ # @param [Version] version Version that contains the resource
123
+ # @param [Hash] payload payload that contains response from Twilio
124
+ # @return [SettingInstance] SettingInstance
125
+ def initialize(version, payload)
126
+ super(version)
127
+
128
+ # Marshaled Properties
129
+ @properties = {
130
+ 'account_sid' => payload['account_sid'],
131
+ 'advanced_features' => payload['advanced_features'],
132
+ 'voice_trace' => payload['voice_trace'],
133
+ 'url' => payload['url'],
134
+ }
135
+
136
+ # Context
137
+ @instance_context = nil
138
+ @params = {}
139
+ end
140
+
141
+ ##
142
+ # Generate an instance context for the instance, the context is capable of
143
+ # performing various actions. All instance actions are proxied to the context
144
+ # @return [SettingContext] SettingContext for this SettingInstance
145
+ def context
146
+ unless @instance_context
147
+ @instance_context = SettingContext.new(@version, )
148
+ end
149
+ @instance_context
150
+ end
151
+
152
+ ##
153
+ # @return [String] The account_sid
154
+ def account_sid
155
+ @properties['account_sid']
156
+ end
157
+
158
+ ##
159
+ # @return [Boolean] The advanced_features
160
+ def advanced_features
161
+ @properties['advanced_features']
162
+ end
163
+
164
+ ##
165
+ # @return [Boolean] The voice_trace
166
+ def voice_trace
167
+ @properties['voice_trace']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The url
172
+ def url
173
+ @properties['url']
174
+ end
175
+
176
+ ##
177
+ # Fetch the SettingInstance
178
+ # @param [String] subaccount_sid The subaccount_sid
179
+ # @return [SettingInstance] Fetched SettingInstance
180
+ def fetch(subaccount_sid: :unset)
181
+ context.fetch(subaccount_sid: subaccount_sid, )
182
+ end
183
+
184
+ ##
185
+ # Update the SettingInstance
186
+ # @param [Boolean] advanced_features The advanced_features
187
+ # @param [Boolean] voice_trace The voice_trace
188
+ # @param [String] subaccount_sid The subaccount_sid
189
+ # @return [SettingInstance] Updated SettingInstance
190
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
191
+ context.update(
192
+ advanced_features: advanced_features,
193
+ voice_trace: voice_trace,
194
+ subaccount_sid: subaccount_sid,
195
+ )
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
202
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
203
+ end
204
+
205
+ ##
206
+ # Provide a detailed, user friendly representation
207
+ def inspect
208
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
209
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -15,10 +15,35 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
+ @settings = nil
19
+ @annotation = nil
18
20
  @calls = nil
21
+ @call_summaries = nil
22
+ @conferences = nil
19
23
  @rooms = nil
20
24
  end
21
25
 
26
+ ##
27
+ # @return [Twilio::REST::Insights::V1::SettingContext]
28
+ def settings
29
+ @settings ||= SettingContext.new self
30
+ end
31
+
32
+ ##
33
+ # @param [String] call_sid The call_sid
34
+ # @return [Twilio::REST::Insights::V1::AnnotationContext] if call_sid was passed.
35
+ # @return [Twilio::REST::Insights::V1::AnnotationList]
36
+ def annotation(call_sid=:unset)
37
+ if call_sid.nil?
38
+ raise ArgumentError, 'call_sid cannot be nil'
39
+ end
40
+ if call_sid == :unset
41
+ @annotation ||= AnnotationList.new self
42
+ else
43
+ AnnotationContext.new(self, call_sid)
44
+ end
45
+ end
46
+
22
47
  ##
23
48
  # @param [String] sid The sid
24
49
  # @return [Twilio::REST::Insights::V1::CallContext] if sid was passed.
@@ -34,6 +59,27 @@ module Twilio
34
59
  end
35
60
  end
36
61
 
62
+ ##
63
+ # @return [Twilio::REST::Insights::V1::CallSummariesContext]
64
+ def call_summaries
65
+ @call_summaries ||= CallSummariesList.new self
66
+ end
67
+
68
+ ##
69
+ # @param [String] conference_sid The unique SID identifier of the Conference.
70
+ # @return [Twilio::REST::Insights::V1::ConferenceContext] if conference_sid was passed.
71
+ # @return [Twilio::REST::Insights::V1::ConferenceList]
72
+ def conferences(conference_sid=:unset)
73
+ if conference_sid.nil?
74
+ raise ArgumentError, 'conference_sid cannot be nil'
75
+ end
76
+ if conference_sid == :unset
77
+ @conferences ||= ConferenceList.new self
78
+ else
79
+ ConferenceContext.new(self, conference_sid)
80
+ end
81
+ end
82
+
37
83
  ##
38
84
  # @param [String] room_sid The SID of the Room resource.
39
85
  # @return [Twilio::REST::Insights::V1::RoomContext] if room_sid was passed.
@@ -28,6 +28,20 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @return [Twilio::REST::Insights::V1::SettingInstance]
33
+ def settings
34
+ self.v1.settings()
35
+ end
36
+
37
+ ##
38
+ # @param [String] call_sid The call_sid
39
+ # @return [Twilio::REST::Insights::V1::AnnotationInstance] if call_sid was passed.
40
+ # @return [Twilio::REST::Insights::V1::AnnotationList]
41
+ def annotation(call_sid=:unset)
42
+ self.v1.annotation(call_sid)
43
+ end
44
+
31
45
  ##
32
46
  # @param [String] sid The sid
33
47
  # @return [Twilio::REST::Insights::V1::CallInstance] if sid was passed.
@@ -36,6 +50,20 @@ module Twilio
36
50
  self.v1.calls(sid)
37
51
  end
38
52
 
53
+ ##
54
+ # @return [Twilio::REST::Insights::V1::CallSummariesInstance]
55
+ def call_summaries
56
+ self.v1.call_summaries()
57
+ end
58
+
59
+ ##
60
+ # @param [String] conference_sid The unique SID identifier of the Conference.
61
+ # @return [Twilio::REST::Insights::V1::ConferenceInstance] if conference_sid was passed.
62
+ # @return [Twilio::REST::Insights::V1::ConferenceList]
63
+ def conferences(conference_sid=:unset)
64
+ self.v1.conferences(conference_sid)
65
+ end
66
+
39
67
  ##
40
68
  # @param [String] room_sid Unique identifier for the room.
41
69
  # @return [Twilio::REST::Insights::V1::RoomInstance] if room_sid was passed.
@@ -0,0 +1,268 @@
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 Lookups < Domain
12
+ class V2 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class PhoneNumberList < ListResource
16
+ ##
17
+ # Initialize the PhoneNumberList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [PhoneNumberList] PhoneNumberList
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.Lookups.V2.PhoneNumberList>'
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 PhoneNumberPage < Page
37
+ ##
38
+ # Initialize the PhoneNumberPage
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 [PhoneNumberPage] PhoneNumberPage
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 PhoneNumberInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [PhoneNumberInstance] PhoneNumberInstance
54
+ def get_instance(payload)
55
+ PhoneNumberInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Lookups.V2.PhoneNumberPage>'
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 PhoneNumberContext < InstanceContext
68
+ ##
69
+ # Initialize the PhoneNumberContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] phone_number The phone number to lookup in E.164 or national
72
+ # format. Default country code is +1 (North America).
73
+ # @return [PhoneNumberContext] PhoneNumberContext
74
+ def initialize(version, phone_number)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {phone_number: phone_number, }
79
+ @uri = "/PhoneNumbers/#{@solution[:phone_number]}"
80
+ end
81
+
82
+ ##
83
+ # Fetch the PhoneNumberInstance
84
+ # @param [String] fields A comma-separated list of fields to return. Possible
85
+ # values are caller_name, sim_swap, call_forwarding, live_activity,
86
+ # enhanced_line_type or line_type_intelligence.
87
+ # @param [String] country_code The {country
88
+ # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] used if the phone number
89
+ # provided is in national format.
90
+ # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
91
+ def fetch(fields: :unset, country_code: :unset)
92
+ params = Twilio::Values.of({'Fields' => fields, 'CountryCode' => country_code, })
93
+
94
+ payload = @version.fetch('GET', @uri, params: params)
95
+
96
+ PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
97
+ end
98
+
99
+ ##
100
+ # Provide a user friendly representation
101
+ def to_s
102
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
103
+ "#<Twilio.Lookups.V2.PhoneNumberContext #{context}>"
104
+ end
105
+
106
+ ##
107
+ # Provide a detailed, user friendly representation
108
+ def inspect
109
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
110
+ "#<Twilio.Lookups.V2.PhoneNumberContext #{context}>"
111
+ end
112
+ end
113
+
114
+ ##
115
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
116
+ class PhoneNumberInstance < InstanceResource
117
+ ##
118
+ # Initialize the PhoneNumberInstance
119
+ # @param [Version] version Version that contains the resource
120
+ # @param [Hash] payload payload that contains response from Twilio
121
+ # @param [String] phone_number The phone number to lookup in E.164 or national
122
+ # format. Default country code is +1 (North America).
123
+ # @return [PhoneNumberInstance] PhoneNumberInstance
124
+ def initialize(version, payload, phone_number: nil)
125
+ super(version)
126
+
127
+ # Marshaled Properties
128
+ @properties = {
129
+ 'calling_country_code' => payload['calling_country_code'],
130
+ 'country_code' => payload['country_code'],
131
+ 'phone_number' => payload['phone_number'],
132
+ 'national_format' => payload['national_format'],
133
+ 'valid' => payload['valid'],
134
+ 'validation_errors' => payload['validation_errors'],
135
+ 'caller_name' => payload['caller_name'],
136
+ 'sim_swap' => payload['sim_swap'],
137
+ 'call_forwarding' => payload['call_forwarding'],
138
+ 'live_activity' => payload['live_activity'],
139
+ 'enhanced_line_type' => payload['enhanced_line_type'],
140
+ 'line_type_intelligence' => payload['line_type_intelligence'],
141
+ 'url' => payload['url'],
142
+ }
143
+
144
+ # Context
145
+ @instance_context = nil
146
+ @params = {'phone_number' => phone_number || @properties['phone_number'], }
147
+ end
148
+
149
+ ##
150
+ # Generate an instance context for the instance, the context is capable of
151
+ # performing various actions. All instance actions are proxied to the context
152
+ # @return [PhoneNumberContext] PhoneNumberContext for this PhoneNumberInstance
153
+ def context
154
+ unless @instance_context
155
+ @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], )
156
+ end
157
+ @instance_context
158
+ end
159
+
160
+ ##
161
+ # @return [String] International dialing prefix
162
+ def calling_country_code
163
+ @properties['calling_country_code']
164
+ end
165
+
166
+ ##
167
+ # @return [String] Phone number's ISO country code
168
+ def country_code
169
+ @properties['country_code']
170
+ end
171
+
172
+ ##
173
+ # @return [String] Phone number in E.164 format
174
+ def phone_number
175
+ @properties['phone_number']
176
+ end
177
+
178
+ ##
179
+ # @return [String] Phone number in national format
180
+ def national_format
181
+ @properties['national_format']
182
+ end
183
+
184
+ ##
185
+ # @return [Boolean] Boolean which indicates if the phone number is valid
186
+ def valid
187
+ @properties['valid']
188
+ end
189
+
190
+ ##
191
+ # @return [Array[phone_number.ValidationError]] Contains reasons why a phone number is invalid
192
+ def validation_errors
193
+ @properties['validation_errors']
194
+ end
195
+
196
+ ##
197
+ # @return [Hash] An object that contains caller name information
198
+ def caller_name
199
+ @properties['caller_name']
200
+ end
201
+
202
+ ##
203
+ # @return [Hash] An object that contains SIM swap information
204
+ def sim_swap
205
+ @properties['sim_swap']
206
+ end
207
+
208
+ ##
209
+ # @return [Hash] An object that contains call forwarding status information
210
+ def call_forwarding
211
+ @properties['call_forwarding']
212
+ end
213
+
214
+ ##
215
+ # @return [Hash] An object that contains live activity information
216
+ def live_activity
217
+ @properties['live_activity']
218
+ end
219
+
220
+ ##
221
+ # @return [Hash] An object that contains line type information
222
+ def enhanced_line_type
223
+ @properties['enhanced_line_type']
224
+ end
225
+
226
+ ##
227
+ # @return [Hash] An object that contains line type information
228
+ def line_type_intelligence
229
+ @properties['line_type_intelligence']
230
+ end
231
+
232
+ ##
233
+ # @return [String] The absolute URL of the resource
234
+ def url
235
+ @properties['url']
236
+ end
237
+
238
+ ##
239
+ # Fetch the PhoneNumberInstance
240
+ # @param [String] fields A comma-separated list of fields to return. Possible
241
+ # values are caller_name, sim_swap, call_forwarding, live_activity,
242
+ # enhanced_line_type or line_type_intelligence.
243
+ # @param [String] country_code The {country
244
+ # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] used if the phone number
245
+ # provided is in national format.
246
+ # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
247
+ def fetch(fields: :unset, country_code: :unset)
248
+ context.fetch(fields: fields, country_code: country_code, )
249
+ end
250
+
251
+ ##
252
+ # Provide a user friendly representation
253
+ def to_s
254
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
255
+ "<Twilio.Lookups.V2.PhoneNumberInstance #{values}>"
256
+ end
257
+
258
+ ##
259
+ # Provide a detailed, user friendly representation
260
+ def inspect
261
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
262
+ "<Twilio.Lookups.V2.PhoneNumberInstance #{values}>"
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
@@ -0,0 +1,45 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Lookups
12
+ class V2 < Version
13
+ ##
14
+ # Initialize the V2 version of Lookups
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v2'
18
+ @phone_numbers = nil
19
+ end
20
+
21
+ ##
22
+ # @param [String] phone_number The phone number to lookup in E.164 or national
23
+ # format. Default country code is +1 (North America).
24
+ # @return [Twilio::REST::Lookups::V2::PhoneNumberContext] if phone_number was passed.
25
+ # @return [Twilio::REST::Lookups::V2::PhoneNumberList]
26
+ def phone_numbers(phone_number=:unset)
27
+ if phone_number.nil?
28
+ raise ArgumentError, 'phone_number cannot be nil'
29
+ end
30
+ if phone_number == :unset
31
+ @phone_numbers ||= PhoneNumberList.new self
32
+ else
33
+ PhoneNumberContext.new(self, phone_number)
34
+ end
35
+ end
36
+
37
+ ##
38
+ # Provide a user friendly representation
39
+ def to_s
40
+ '<Twilio::REST::Lookups::V2>'
41
+ end
42
+ end
43
+ end
44
+ end
45
+ 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,12 @@ module Twilio
28
29
  @v1 ||= V1.new self
29
30
  end
30
31
 
32
+ ##
33
+ # Version v2 of lookups
34
+ def v2
35
+ @v2 ||= V2.new self
36
+ end
37
+
31
38
  ##
32
39
  # @param [String] phone_number The phone number in
33
40
  # {E.164}[https://www.twilio.com/docs/glossary/what-e164] format, which consists