twilio-ruby 5.12.1 → 5.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +2 -2
  7. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +2 -2
  8. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +2 -2
  9. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +2 -2
  10. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +2 -2
  11. data/lib/twilio-ruby/rest/chat/v2/service.rb +1 -1
  12. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +1 -1
  13. data/lib/twilio-ruby/rest/preview.rb +8 -8
  14. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  15. data/lib/twilio-ruby/rest/preview/understand/assistant.rb +47 -19
  16. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb +215 -0
  17. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb +215 -0
  18. data/lib/twilio-ruby/rest/preview/understand/assistant/intent.rb +33 -6
  19. data/lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb +246 -0
  20. data/lib/twilio-ruby/rest/pricing.rb +9 -2
  21. data/lib/twilio-ruby/rest/pricing/v2.rb +35 -0
  22. data/lib/twilio-ruby/rest/pricing/v2/voice.rb +126 -0
  23. data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +281 -0
  24. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +3 -3
  25. data/lib/twilio-ruby/rest/video.rb +9 -9
  26. data/lib/twilio-ruby/rest/video/v1.rb +16 -16
  27. data/lib/twilio-ruby/version.rb +1 -1
  28. data/spec/integration/preview/understand/assistant/assistant_fallback_actions_spec.rb +81 -0
  29. data/spec/integration/preview/understand/assistant/assistant_initiation_actions_spec.rb +81 -0
  30. data/spec/integration/preview/understand/assistant/intent/intent_actions_spec.rb +87 -0
  31. data/spec/integration/preview/understand/assistant/intent_spec.rb +4 -0
  32. data/spec/integration/preview/understand/assistant_spec.rb +12 -8
  33. data/spec/integration/pricing/v2/voice/country_spec.rb +181 -0
  34. data/spec/integration/pricing/v2/voice_spec.rb +12 -0
  35. metadata +19 -3
@@ -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 Preview < Domain
12
+ class Understand < Version
13
+ class AssistantContext < InstanceContext
14
+ ##
15
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
16
+ class AssistantInitiationActionsList < ListResource
17
+ ##
18
+ # Initialize the AssistantInitiationActionsList
19
+ # @param [Version] version Version that contains the resource
20
+ # @param [String] assistant_sid The assistant_sid
21
+ # @return [AssistantInitiationActionsList] AssistantInitiationActionsList
22
+ def initialize(version, assistant_sid: nil)
23
+ super(version)
24
+
25
+ # Path Solution
26
+ @solution = {assistant_sid: assistant_sid}
27
+ end
28
+
29
+ ##
30
+ # Provide a user friendly representation
31
+ def to_s
32
+ '#<Twilio.Preview.Understand.AssistantInitiationActionsList>'
33
+ end
34
+ end
35
+
36
+ ##
37
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
38
+ class AssistantInitiationActionsPage < Page
39
+ ##
40
+ # Initialize the AssistantInitiationActionsPage
41
+ # @param [Version] version Version that contains the resource
42
+ # @param [Response] response Response from the API
43
+ # @param [Hash] solution Path solution for the resource
44
+ # @return [AssistantInitiationActionsPage] AssistantInitiationActionsPage
45
+ def initialize(version, response, solution)
46
+ super(version, response)
47
+
48
+ # Path Solution
49
+ @solution = solution
50
+ end
51
+
52
+ ##
53
+ # Build an instance of AssistantInitiationActionsInstance
54
+ # @param [Hash] payload Payload response from the API
55
+ # @return [AssistantInitiationActionsInstance] AssistantInitiationActionsInstance
56
+ def get_instance(payload)
57
+ AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
58
+ end
59
+
60
+ ##
61
+ # Provide a user friendly representation
62
+ def to_s
63
+ '<Twilio.Preview.Understand.AssistantInitiationActionsPage>'
64
+ end
65
+ end
66
+
67
+ ##
68
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
69
+ class AssistantInitiationActionsContext < InstanceContext
70
+ ##
71
+ # Initialize the AssistantInitiationActionsContext
72
+ # @param [Version] version Version that contains the resource
73
+ # @param [String] assistant_sid The assistant_sid
74
+ # @return [AssistantInitiationActionsContext] AssistantInitiationActionsContext
75
+ def initialize(version, assistant_sid)
76
+ super(version)
77
+
78
+ # Path Solution
79
+ @solution = {assistant_sid: assistant_sid, }
80
+ @uri = "/Assistants/#{@solution[:assistant_sid]}/InitiationActions"
81
+ end
82
+
83
+ ##
84
+ # Fetch a AssistantInitiationActionsInstance
85
+ # @return [AssistantInitiationActionsInstance] Fetched AssistantInitiationActionsInstance
86
+ def fetch
87
+ params = Twilio::Values.of({})
88
+
89
+ payload = @version.fetch(
90
+ 'GET',
91
+ @uri,
92
+ params,
93
+ )
94
+
95
+ AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
96
+ end
97
+
98
+ ##
99
+ # Update the AssistantInitiationActionsInstance
100
+ # @param [Hash] initiation_actions The initiation_actions
101
+ # @return [AssistantInitiationActionsInstance] Updated AssistantInitiationActionsInstance
102
+ def update(initiation_actions: :unset)
103
+ data = Twilio::Values.of({'InitiationActions' => Twilio.serialize_object(initiation_actions), })
104
+
105
+ payload = @version.update(
106
+ 'POST',
107
+ @uri,
108
+ data: data,
109
+ )
110
+
111
+ AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
112
+ end
113
+
114
+ ##
115
+ # Provide a user friendly representation
116
+ def to_s
117
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
118
+ "#<Twilio.Preview.Understand.AssistantInitiationActionsContext #{context}>"
119
+ end
120
+ end
121
+
122
+ ##
123
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
124
+ class AssistantInitiationActionsInstance < InstanceResource
125
+ ##
126
+ # Initialize the AssistantInitiationActionsInstance
127
+ # @param [Version] version Version that contains the resource
128
+ # @param [Hash] payload payload that contains response from Twilio
129
+ # @param [String] assistant_sid The assistant_sid
130
+ # @return [AssistantInitiationActionsInstance] AssistantInitiationActionsInstance
131
+ def initialize(version, payload, assistant_sid: nil)
132
+ super(version)
133
+
134
+ # Marshaled Properties
135
+ @properties = {
136
+ 'account_sid' => payload['account_sid'],
137
+ 'assistant_sid' => payload['assistant_sid'],
138
+ 'url' => payload['url'],
139
+ 'data' => payload['data'],
140
+ }
141
+
142
+ # Context
143
+ @instance_context = nil
144
+ @params = {'assistant_sid' => assistant_sid, }
145
+ end
146
+
147
+ ##
148
+ # Generate an instance context for the instance, the context is capable of
149
+ # performing various actions. All instance actions are proxied to the context
150
+ # @return [AssistantInitiationActionsContext] AssistantInitiationActionsContext for this AssistantInitiationActionsInstance
151
+ def context
152
+ unless @instance_context
153
+ @instance_context = AssistantInitiationActionsContext.new(@version, @params['assistant_sid'], )
154
+ end
155
+ @instance_context
156
+ end
157
+
158
+ ##
159
+ # @return [String] The account_sid
160
+ def account_sid
161
+ @properties['account_sid']
162
+ end
163
+
164
+ ##
165
+ # @return [String] The assistant_sid
166
+ def assistant_sid
167
+ @properties['assistant_sid']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The url
172
+ def url
173
+ @properties['url']
174
+ end
175
+
176
+ ##
177
+ # @return [Hash] The data
178
+ def data
179
+ @properties['data']
180
+ end
181
+
182
+ ##
183
+ # Fetch a AssistantInitiationActionsInstance
184
+ # @return [AssistantInitiationActionsInstance] Fetched AssistantInitiationActionsInstance
185
+ def fetch
186
+ context.fetch
187
+ end
188
+
189
+ ##
190
+ # Update the AssistantInitiationActionsInstance
191
+ # @param [Hash] initiation_actions The initiation_actions
192
+ # @return [AssistantInitiationActionsInstance] Updated AssistantInitiationActionsInstance
193
+ def update(initiation_actions: :unset)
194
+ context.update(initiation_actions: initiation_actions, )
195
+ end
196
+
197
+ ##
198
+ # Provide a user friendly representation
199
+ def to_s
200
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
201
+ "<Twilio.Preview.Understand.AssistantInitiationActionsInstance #{values}>"
202
+ end
203
+
204
+ ##
205
+ # Provide a detailed, user friendly representation
206
+ def inspect
207
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
208
+ "<Twilio.Preview.Understand.AssistantInitiationActionsInstance #{values}>"
209
+ end
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -116,9 +116,14 @@ module Twilio
116
116
  # resource as an alternative to the sid. Unique up to 64 characters long.
117
117
  # @param [String] friendly_name A user-provided string that identifies this
118
118
  # resource. It is non-unique and can up to 255 characters long.
119
+ # @param [Hash] actions The actions
119
120
  # @return [IntentInstance] Newly created IntentInstance
120
- def create(unique_name: nil, friendly_name: :unset)
121
- data = Twilio::Values.of({'UniqueName' => unique_name, 'FriendlyName' => friendly_name, })
121
+ def create(unique_name: nil, friendly_name: :unset, actions: :unset)
122
+ data = Twilio::Values.of({
123
+ 'UniqueName' => unique_name,
124
+ 'FriendlyName' => friendly_name,
125
+ 'Actions' => Twilio.serialize_object(actions),
126
+ })
122
127
 
123
128
  payload = @version.create(
124
129
  'POST',
@@ -186,6 +191,7 @@ module Twilio
186
191
  # Dependents
187
192
  @fields = nil
188
193
  @samples = nil
194
+ @intent_actions = nil
189
195
  @statistics = nil
190
196
  end
191
197
 
@@ -215,9 +221,14 @@ module Twilio
215
221
  # resource. It is non-unique and can up to 255 characters long.
216
222
  # @param [String] unique_name A user-provided string that uniquely identifies this
217
223
  # resource as an alternative to the sid. Unique up to 64 characters long.
224
+ # @param [Hash] actions The actions
218
225
  # @return [IntentInstance] Updated IntentInstance
219
- def update(friendly_name: :unset, unique_name: :unset)
220
- data = Twilio::Values.of({'FriendlyName' => friendly_name, 'UniqueName' => unique_name, })
226
+ def update(friendly_name: :unset, unique_name: :unset, actions: :unset)
227
+ data = Twilio::Values.of({
228
+ 'FriendlyName' => friendly_name,
229
+ 'UniqueName' => unique_name,
230
+ 'Actions' => Twilio.serialize_object(actions),
231
+ })
221
232
 
222
233
  payload = @version.update(
223
234
  'POST',
@@ -284,6 +295,14 @@ module Twilio
284
295
  @samples
285
296
  end
286
297
 
298
+ ##
299
+ # Access the intent_actions
300
+ # @return [IntentActionsList]
301
+ # @return [IntentActionsContext]
302
+ def intent_actions
303
+ IntentActionsContext.new(@version, @solution[:assistant_sid], @solution[:sid], )
304
+ end
305
+
287
306
  ##
288
307
  # Access the statistics
289
308
  # @return [IntentStatisticsList]
@@ -409,9 +428,10 @@ module Twilio
409
428
  # resource. It is non-unique and can up to 255 characters long.
410
429
  # @param [String] unique_name A user-provided string that uniquely identifies this
411
430
  # resource as an alternative to the sid. Unique up to 64 characters long.
431
+ # @param [Hash] actions The actions
412
432
  # @return [IntentInstance] Updated IntentInstance
413
- def update(friendly_name: :unset, unique_name: :unset)
414
- context.update(friendly_name: friendly_name, unique_name: unique_name, )
433
+ def update(friendly_name: :unset, unique_name: :unset, actions: :unset)
434
+ context.update(friendly_name: friendly_name, unique_name: unique_name, actions: actions, )
415
435
  end
416
436
 
417
437
  ##
@@ -435,6 +455,13 @@ module Twilio
435
455
  context.samples
436
456
  end
437
457
 
458
+ ##
459
+ # Access the intent_actions
460
+ # @return [intent_actions] intent_actions
461
+ def intent_actions
462
+ context.intent_actions
463
+ end
464
+
438
465
  ##
439
466
  # Access the statistics
440
467
  # @return [statistics] statistics
@@ -0,0 +1,246 @@
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 Preview < Domain
12
+ class Understand < Version
13
+ class AssistantContext < InstanceContext
14
+ class IntentContext < InstanceContext
15
+ ##
16
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
17
+ class IntentActionsList < ListResource
18
+ ##
19
+ # Initialize the IntentActionsList
20
+ # @param [Version] version Version that contains the resource
21
+ # @param [String] assistant_sid The assistant_sid
22
+ # @param [String] intent_sid The intent_sid
23
+ # @return [IntentActionsList] IntentActionsList
24
+ def initialize(version, assistant_sid: nil, intent_sid: nil)
25
+ super(version)
26
+
27
+ # Path Solution
28
+ @solution = {assistant_sid: assistant_sid, intent_sid: intent_sid}
29
+ end
30
+
31
+ ##
32
+ # Provide a user friendly representation
33
+ def to_s
34
+ '#<Twilio.Preview.Understand.IntentActionsList>'
35
+ end
36
+ end
37
+
38
+ ##
39
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
40
+ class IntentActionsPage < Page
41
+ ##
42
+ # Initialize the IntentActionsPage
43
+ # @param [Version] version Version that contains the resource
44
+ # @param [Response] response Response from the API
45
+ # @param [Hash] solution Path solution for the resource
46
+ # @return [IntentActionsPage] IntentActionsPage
47
+ def initialize(version, response, solution)
48
+ super(version, response)
49
+
50
+ # Path Solution
51
+ @solution = solution
52
+ end
53
+
54
+ ##
55
+ # Build an instance of IntentActionsInstance
56
+ # @param [Hash] payload Payload response from the API
57
+ # @return [IntentActionsInstance] IntentActionsInstance
58
+ def get_instance(payload)
59
+ IntentActionsInstance.new(
60
+ @version,
61
+ payload,
62
+ assistant_sid: @solution[:assistant_sid],
63
+ intent_sid: @solution[:intent_sid],
64
+ )
65
+ end
66
+
67
+ ##
68
+ # Provide a user friendly representation
69
+ def to_s
70
+ '<Twilio.Preview.Understand.IntentActionsPage>'
71
+ end
72
+ end
73
+
74
+ ##
75
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
76
+ class IntentActionsContext < InstanceContext
77
+ ##
78
+ # Initialize the IntentActionsContext
79
+ # @param [Version] version Version that contains the resource
80
+ # @param [String] assistant_sid The assistant_sid
81
+ # @param [String] intent_sid The intent_sid
82
+ # @return [IntentActionsContext] IntentActionsContext
83
+ def initialize(version, assistant_sid, intent_sid)
84
+ super(version)
85
+
86
+ # Path Solution
87
+ @solution = {assistant_sid: assistant_sid, intent_sid: intent_sid, }
88
+ @uri = "/Assistants/#{@solution[:assistant_sid]}/Intents/#{@solution[:intent_sid]}/Actions"
89
+ end
90
+
91
+ ##
92
+ # Fetch a IntentActionsInstance
93
+ # @return [IntentActionsInstance] Fetched IntentActionsInstance
94
+ def fetch
95
+ params = Twilio::Values.of({})
96
+
97
+ payload = @version.fetch(
98
+ 'GET',
99
+ @uri,
100
+ params,
101
+ )
102
+
103
+ IntentActionsInstance.new(
104
+ @version,
105
+ payload,
106
+ assistant_sid: @solution[:assistant_sid],
107
+ intent_sid: @solution[:intent_sid],
108
+ )
109
+ end
110
+
111
+ ##
112
+ # Update the IntentActionsInstance
113
+ # @param [Hash] actions The actions
114
+ # @return [IntentActionsInstance] Updated IntentActionsInstance
115
+ def update(actions: :unset)
116
+ data = Twilio::Values.of({'Actions' => Twilio.serialize_object(actions), })
117
+
118
+ payload = @version.update(
119
+ 'POST',
120
+ @uri,
121
+ data: data,
122
+ )
123
+
124
+ IntentActionsInstance.new(
125
+ @version,
126
+ payload,
127
+ assistant_sid: @solution[:assistant_sid],
128
+ intent_sid: @solution[:intent_sid],
129
+ )
130
+ end
131
+
132
+ ##
133
+ # Provide a user friendly representation
134
+ def to_s
135
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
136
+ "#<Twilio.Preview.Understand.IntentActionsContext #{context}>"
137
+ end
138
+ end
139
+
140
+ ##
141
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
142
+ class IntentActionsInstance < InstanceResource
143
+ ##
144
+ # Initialize the IntentActionsInstance
145
+ # @param [Version] version Version that contains the resource
146
+ # @param [Hash] payload payload that contains response from Twilio
147
+ # @param [String] assistant_sid The assistant_sid
148
+ # @param [String] intent_sid The intent_sid
149
+ # @return [IntentActionsInstance] IntentActionsInstance
150
+ def initialize(version, payload, assistant_sid: nil, intent_sid: nil)
151
+ super(version)
152
+
153
+ # Marshaled Properties
154
+ @properties = {
155
+ 'account_sid' => payload['account_sid'],
156
+ 'assistant_sid' => payload['assistant_sid'],
157
+ 'intent_sid' => payload['intent_sid'],
158
+ 'url' => payload['url'],
159
+ 'data' => payload['data'],
160
+ }
161
+
162
+ # Context
163
+ @instance_context = nil
164
+ @params = {'assistant_sid' => assistant_sid, 'intent_sid' => intent_sid, }
165
+ end
166
+
167
+ ##
168
+ # Generate an instance context for the instance, the context is capable of
169
+ # performing various actions. All instance actions are proxied to the context
170
+ # @return [IntentActionsContext] IntentActionsContext for this IntentActionsInstance
171
+ def context
172
+ unless @instance_context
173
+ @instance_context = IntentActionsContext.new(
174
+ @version,
175
+ @params['assistant_sid'],
176
+ @params['intent_sid'],
177
+ )
178
+ end
179
+ @instance_context
180
+ end
181
+
182
+ ##
183
+ # @return [String] The account_sid
184
+ def account_sid
185
+ @properties['account_sid']
186
+ end
187
+
188
+ ##
189
+ # @return [String] The assistant_sid
190
+ def assistant_sid
191
+ @properties['assistant_sid']
192
+ end
193
+
194
+ ##
195
+ # @return [String] The intent_sid
196
+ def intent_sid
197
+ @properties['intent_sid']
198
+ end
199
+
200
+ ##
201
+ # @return [String] The url
202
+ def url
203
+ @properties['url']
204
+ end
205
+
206
+ ##
207
+ # @return [Hash] The data
208
+ def data
209
+ @properties['data']
210
+ end
211
+
212
+ ##
213
+ # Fetch a IntentActionsInstance
214
+ # @return [IntentActionsInstance] Fetched IntentActionsInstance
215
+ def fetch
216
+ context.fetch
217
+ end
218
+
219
+ ##
220
+ # Update the IntentActionsInstance
221
+ # @param [Hash] actions The actions
222
+ # @return [IntentActionsInstance] Updated IntentActionsInstance
223
+ def update(actions: :unset)
224
+ context.update(actions: actions, )
225
+ end
226
+
227
+ ##
228
+ # Provide a user friendly representation
229
+ def to_s
230
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
231
+ "<Twilio.Preview.Understand.IntentActionsInstance #{values}>"
232
+ end
233
+
234
+ ##
235
+ # Provide a detailed, user friendly representation
236
+ def inspect
237
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
238
+ "<Twilio.Preview.Understand.IntentActionsInstance #{values}>"
239
+ end
240
+ end
241
+ end
242
+ end
243
+ end
244
+ end
245
+ end
246
+ end