twilio-ruby 7.3.1 → 7.3.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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +24 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +133 -0
  5. data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +133 -0
  6. data/lib/twilio-ruby/rest/accounts/v1.rb +12 -0
  7. data/lib/twilio-ruby/rest/{preview/deployed_devices/fleet/key.rb → assistants/v1/assistant/assistants_knowledge.rb} +104 -170
  8. data/lib/twilio-ruby/rest/{preview/deployed_devices/fleet/deployment.rb → assistants/v1/assistant/assistants_tool.rb} +111 -157
  9. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +1 -1
  10. data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +201 -0
  11. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +57 -15
  12. data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +209 -0
  13. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +21 -23
  14. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +37 -0
  15. data/lib/twilio-ruby/rest/iam/v1/{new_api_key.rb → key.rb} +20 -20
  16. data/lib/twilio-ruby/rest/iam/v1.rb +4 -4
  17. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +8 -2
  18. data/lib/twilio-ruby/rest/numbers/v1/{porting_webhook_configuration_fetch.rb → webhook.rb} +20 -20
  19. data/lib/twilio-ruby/rest/numbers/v1.rb +6 -6
  20. data/lib/twilio-ruby/rest/preview_base.rb +0 -5
  21. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -1
  22. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  23. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -0
  24. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +4 -1
  25. data/lib/twilio-ruby/version.rb +1 -1
  26. metadata +10 -10
  27. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +0 -424
  28. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +0 -463
  29. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +0 -511
  30. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +0 -49
@@ -0,0 +1,201 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Assistants
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Assistants < AssistantsBase
19
+ class V1 < Version
20
+ class AssistantContext < InstanceContext
21
+
22
+ class MessageList < ListResource
23
+
24
+ class AssistantsV1ServiceAssistantSendMessageRequest
25
+ # @param [identity]: [String] The unique identity of user for the session.
26
+ # @param [session_id]: [String] The unique name for the session.
27
+ # @param [body]: [String] The query to ask the assistant.
28
+ # @param [webhook]: [String] The webhook url to call after the assistant has generated a response or report an error.
29
+ # @param [mode]: [String] one of the modes 'chat', 'email' or 'voice'
30
+ attr_accessor :identity, :session_id, :body, :webhook, :mode
31
+ def initialize(payload)
32
+ @identity = payload["identity"]
33
+ @session_id = payload["session_id"]
34
+ @body = payload["body"]
35
+ @webhook = payload["webhook"]
36
+ @mode = payload["mode"]
37
+ end
38
+ def to_json(options = {})
39
+ {
40
+ identity: @identity,
41
+ session_id: @session_id,
42
+ body: @body,
43
+ webhook: @webhook,
44
+ mode: @mode,
45
+ }.to_json(options)
46
+ end
47
+ end
48
+
49
+ ##
50
+ # Initialize the MessageList
51
+ # @param [Version] version Version that contains the resource
52
+ # @return [MessageList] MessageList
53
+ def initialize(version, id: nil)
54
+ super(version)
55
+ # Path Solution
56
+ @solution = { id: id }
57
+ @uri = "/Assistants/#{@solution[:id]}/Messages"
58
+
59
+ end
60
+ ##
61
+ # Create the MessageInstance
62
+ # @param [AssistantsV1ServiceAssistantSendMessageRequest] assistants_v1_service_assistant_send_message_request
63
+ # @return [MessageInstance] Created MessageInstance
64
+ def create(assistants_v1_service_assistant_send_message_request: nil
65
+ )
66
+
67
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
68
+ headers['Content-Type'] = 'application/json'
69
+ payload = @version.create('POST', @uri, headers: headers, data: assistants_v1_service_assistant_send_message_request.to_json)
70
+ MessageInstance.new(
71
+ @version,
72
+ payload,
73
+ id: @solution[:id],
74
+ )
75
+ end
76
+
77
+
78
+
79
+
80
+ # Provide a user friendly representation
81
+ def to_s
82
+ '#<Twilio.Assistants.V1.MessageList>'
83
+ end
84
+ end
85
+
86
+ class MessagePage < Page
87
+ ##
88
+ # Initialize the MessagePage
89
+ # @param [Version] version Version that contains the resource
90
+ # @param [Response] response Response from the API
91
+ # @param [Hash] solution Path solution for the resource
92
+ # @return [MessagePage] MessagePage
93
+ def initialize(version, response, solution)
94
+ super(version, response)
95
+
96
+ # Path Solution
97
+ @solution = solution
98
+ end
99
+
100
+ ##
101
+ # Build an instance of MessageInstance
102
+ # @param [Hash] payload Payload response from the API
103
+ # @return [MessageInstance] MessageInstance
104
+ def get_instance(payload)
105
+ MessageInstance.new(@version, payload, id: @solution[:id])
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ '<Twilio.Assistants.V1.MessagePage>'
112
+ end
113
+ end
114
+ class MessageInstance < InstanceResource
115
+ ##
116
+ # Initialize the MessageInstance
117
+ # @param [Version] version Version that contains the resource
118
+ # @param [Hash] payload payload that contains response from Twilio
119
+ # @param [String] account_sid The SID of the
120
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Message
121
+ # resource.
122
+ # @param [String] sid The SID of the Call resource to fetch.
123
+ # @return [MessageInstance] MessageInstance
124
+ def initialize(version, payload , id: nil)
125
+ super(version)
126
+
127
+ # Marshaled Properties
128
+ @properties = {
129
+ 'status' => payload['status'],
130
+ 'flagged' => payload['flagged'],
131
+ 'aborted' => payload['aborted'],
132
+ 'session_id' => payload['session_id'],
133
+ 'account_sid' => payload['account_sid'],
134
+ 'body' => payload['body'],
135
+ 'error' => payload['error'],
136
+ }
137
+ end
138
+
139
+
140
+ ##
141
+ # @return [String] success or failure based on whether the request successfully generated a response.
142
+ def status
143
+ @properties['status']
144
+ end
145
+
146
+ ##
147
+ # @return [Boolean] If successful, this property will denote whether the response was flagged or not.
148
+ def flagged
149
+ @properties['flagged']
150
+ end
151
+
152
+ ##
153
+ # @return [Boolean] This property will denote whether the request was aborted or not.
154
+ def aborted
155
+ @properties['aborted']
156
+ end
157
+
158
+ ##
159
+ # @return [String] The unique name for the session.
160
+ def session_id
161
+ @properties['session_id']
162
+ end
163
+
164
+ ##
165
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that sent the Message.
166
+ def account_sid
167
+ @properties['account_sid']
168
+ end
169
+
170
+ ##
171
+ # @return [String] If successful, the body of the generated response
172
+ def body
173
+ @properties['body']
174
+ end
175
+
176
+ ##
177
+ # @return [String] The error message if generation was not successful
178
+ def error
179
+ @properties['error']
180
+ end
181
+
182
+ ##
183
+ # Provide a user friendly representation
184
+ def to_s
185
+ "<Twilio.Assistants.V1.MessageInstance>"
186
+ end
187
+
188
+ ##
189
+ # Provide a detailed, user friendly representation
190
+ def inspect
191
+ "<Twilio.Assistants.V1.MessageInstance>"
192
+ end
193
+ end
194
+
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
200
+
201
+
@@ -326,7 +326,8 @@ module Twilio
326
326
  # Dependents
327
327
  @feedbacks = nil
328
328
  @messages = nil
329
- @tools = nil
329
+ @assistants_tools = nil
330
+ @assistants_knowledge = nil
330
331
  end
331
332
  ##
332
333
  # Delete the AssistantInstance
@@ -377,7 +378,7 @@ module Twilio
377
378
  def feedbacks
378
379
  unless @feedbacks
379
380
  @feedbacks = FeedbackList.new(
380
- @version, )
381
+ @version, id: @solution[:id], )
381
382
  end
382
383
  @feedbacks
383
384
  end
@@ -388,20 +389,47 @@ module Twilio
388
389
  def messages
389
390
  unless @messages
390
391
  @messages = MessageList.new(
391
- @version, )
392
+ @version, id: @solution[:id], )
392
393
  end
393
394
  @messages
394
395
  end
395
396
  ##
396
- # Access the tools
397
- # @return [ToolList]
398
- # @return [ToolContext]
399
- def tools
400
- unless @tools
401
- @tools = ToolList.new(
397
+ # Access the assistants_tools
398
+ # @return [AssistantsToolList]
399
+ # @return [AssistantsToolContext] if sid was passed.
400
+ def assistants_tools(id=:unset)
401
+
402
+ raise ArgumentError, 'id cannot be nil' if id.nil?
403
+
404
+ if id != :unset
405
+ return AssistantsToolContext.new(@version, @solution[:id],id )
406
+ end
407
+
408
+ unless @assistants_tools
409
+ @assistants_tools = AssistantsToolList.new(
402
410
  @version, )
403
- end
404
- @tools
411
+ end
412
+
413
+ @assistants_tools
414
+ end
415
+ ##
416
+ # Access the assistants_knowledge
417
+ # @return [AssistantsKnowledgeList]
418
+ # @return [AssistantsKnowledgeContext] if sid was passed.
419
+ def assistants_knowledge(id=:unset)
420
+
421
+ raise ArgumentError, 'id cannot be nil' if id.nil?
422
+
423
+ if id != :unset
424
+ return AssistantsKnowledgeContext.new(@version, @solution[:id],id )
425
+ end
426
+
427
+ unless @assistants_knowledge
428
+ @assistants_knowledge = AssistantsKnowledgeList.new(
429
+ @version, )
430
+ end
431
+
432
+ @assistants_knowledge
405
433
  end
406
434
 
407
435
  ##
@@ -468,6 +496,7 @@ module Twilio
468
496
  'model' => payload['model'],
469
497
  'name' => payload['name'],
470
498
  'owner' => payload['owner'],
499
+ 'url' => payload['url'],
471
500
  'personality_prompt' => payload['personality_prompt'],
472
501
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
473
502
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
@@ -527,6 +556,12 @@ module Twilio
527
556
  @properties['owner']
528
557
  end
529
558
 
559
+ ##
560
+ # @return [String] The url of the assistant resource.
561
+ def url
562
+ @properties['url']
563
+ end
564
+
530
565
  ##
531
566
  # @return [String] The personality prompt to be used for assistant.
532
567
  def personality_prompt
@@ -599,10 +634,17 @@ module Twilio
599
634
  end
600
635
 
601
636
  ##
602
- # Access the tools
603
- # @return [tools] tools
604
- def tools
605
- context.tools
637
+ # Access the assistants_tools
638
+ # @return [assistants_tools] assistants_tools
639
+ def assistants_tools
640
+ context.assistants_tools
641
+ end
642
+
643
+ ##
644
+ # Access the assistants_knowledge
645
+ # @return [assistants_knowledge] assistants_knowledge
646
+ def assistants_knowledge
647
+ context.assistants_knowledge
606
648
  end
607
649
 
608
650
  ##
@@ -0,0 +1,209 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Assistants
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Assistants < AssistantsBase
19
+ class V1 < Version
20
+ class Knowledge < InstanceContext
21
+
22
+ class KnowledgeStatusList < ListResource
23
+
24
+ ##
25
+ # Initialize the KnowledgeStatusList
26
+ # @param [Version] version Version that contains the resource
27
+ # @return [KnowledgeStatusList] KnowledgeStatusList
28
+ def initialize(version, id: nil)
29
+ super(version)
30
+ # Path Solution
31
+ @solution = { id: id }
32
+
33
+
34
+ end
35
+
36
+
37
+
38
+ # Provide a user friendly representation
39
+ def to_s
40
+ '#<Twilio.Assistants.V1.KnowledgeStatusList>'
41
+ end
42
+ end
43
+
44
+
45
+ class KnowledgeStatusContext < InstanceContext
46
+ ##
47
+ # Initialize the KnowledgeStatusContext
48
+ # @param [Version] version Version that contains the resource
49
+ # @param [String] id the Knowledge ID.
50
+ # @return [KnowledgeStatusContext] KnowledgeStatusContext
51
+ def initialize(version, id)
52
+ super(version)
53
+
54
+ # Path Solution
55
+ @solution = { id: id, }
56
+ @uri = "/Knowledge/#{@solution[:id]}/Status"
57
+
58
+
59
+ end
60
+ ##
61
+ # Fetch the KnowledgeStatusInstance
62
+ # @return [KnowledgeStatusInstance] Fetched KnowledgeStatusInstance
63
+ def fetch
64
+
65
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
66
+
67
+ payload = @version.fetch('GET', @uri, headers: headers)
68
+ KnowledgeStatusInstance.new(
69
+ @version,
70
+ payload,
71
+ id: @solution[:id],
72
+ )
73
+ end
74
+
75
+
76
+ ##
77
+ # Provide a user friendly representation
78
+ def to_s
79
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
80
+ "#<Twilio.Assistants.V1.KnowledgeStatusContext #{context}>"
81
+ end
82
+
83
+ ##
84
+ # Provide a detailed, user friendly representation
85
+ def inspect
86
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
87
+ "#<Twilio.Assistants.V1.KnowledgeStatusContext #{context}>"
88
+ end
89
+ end
90
+
91
+ class KnowledgeStatusPage < Page
92
+ ##
93
+ # Initialize the KnowledgeStatusPage
94
+ # @param [Version] version Version that contains the resource
95
+ # @param [Response] response Response from the API
96
+ # @param [Hash] solution Path solution for the resource
97
+ # @return [KnowledgeStatusPage] KnowledgeStatusPage
98
+ def initialize(version, response, solution)
99
+ super(version, response)
100
+
101
+ # Path Solution
102
+ @solution = solution
103
+ end
104
+
105
+ ##
106
+ # Build an instance of KnowledgeStatusInstance
107
+ # @param [Hash] payload Payload response from the API
108
+ # @return [KnowledgeStatusInstance] KnowledgeStatusInstance
109
+ def get_instance(payload)
110
+ KnowledgeStatusInstance.new(@version, payload, id: @solution[:id])
111
+ end
112
+
113
+ ##
114
+ # Provide a user friendly representation
115
+ def to_s
116
+ '<Twilio.Assistants.V1.KnowledgeStatusPage>'
117
+ end
118
+ end
119
+ class KnowledgeStatusInstance < InstanceResource
120
+ ##
121
+ # Initialize the KnowledgeStatusInstance
122
+ # @param [Version] version Version that contains the resource
123
+ # @param [Hash] payload payload that contains response from Twilio
124
+ # @param [String] account_sid The SID of the
125
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this KnowledgeStatus
126
+ # resource.
127
+ # @param [String] sid The SID of the Call resource to fetch.
128
+ # @return [KnowledgeStatusInstance] KnowledgeStatusInstance
129
+ def initialize(version, payload , id: nil)
130
+ super(version)
131
+
132
+ # Marshaled Properties
133
+ @properties = {
134
+ 'account_sid' => payload['account_sid'],
135
+ 'status' => payload['status'],
136
+ 'last_status' => payload['last_status'],
137
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
138
+ }
139
+
140
+ # Context
141
+ @instance_context = nil
142
+ @params = { 'id' => id || @properties['id'] , }
143
+ end
144
+
145
+ ##
146
+ # Generate an instance context for the instance, the context is capable of
147
+ # performing various actions. All instance actions are proxied to the context
148
+ # @return [KnowledgeStatusContext] CallContext for this CallInstance
149
+ def context
150
+ unless @instance_context
151
+ @instance_context = KnowledgeStatusContext.new(@version , @params['id'])
152
+ end
153
+ @instance_context
154
+ end
155
+
156
+ ##
157
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
158
+ def account_sid
159
+ @properties['account_sid']
160
+ end
161
+
162
+ ##
163
+ # @return [String] The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
164
+ def status
165
+ @properties['status']
166
+ end
167
+
168
+ ##
169
+ # @return [String] The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
170
+ def last_status
171
+ @properties['last_status']
172
+ end
173
+
174
+ ##
175
+ # @return [Time] The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
176
+ def date_updated
177
+ @properties['date_updated']
178
+ end
179
+
180
+ ##
181
+ # Fetch the KnowledgeStatusInstance
182
+ # @return [KnowledgeStatusInstance] Fetched KnowledgeStatusInstance
183
+ def fetch
184
+
185
+ context.fetch
186
+ end
187
+
188
+ ##
189
+ # Provide a user friendly representation
190
+ def to_s
191
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
192
+ "<Twilio.Assistants.V1.KnowledgeStatusInstance #{values}>"
193
+ end
194
+
195
+ ##
196
+ # Provide a detailed, user friendly representation
197
+ def inspect
198
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
199
+ "<Twilio.Assistants.V1.KnowledgeStatusInstance #{values}>"
200
+ end
201
+ end
202
+
203
+ end
204
+ end
205
+ end
206
+ end
207
+ end
208
+
209
+
@@ -184,8 +184,7 @@ module Twilio
184
184
  # Path Solution
185
185
  @solution = { }
186
186
  @uri = "/Knowledge"
187
- # Components
188
- @search = nil
187
+
189
188
  end
190
189
  ##
191
190
  # Create the KnowledgeInstance
@@ -295,13 +294,6 @@ module Twilio
295
294
  end
296
295
 
297
296
 
298
- ##
299
- # Access the search
300
- # @return [SearchList]
301
- # @return [SearchContext]
302
- def search
303
- @search ||= SearchList.new(@version )
304
- end
305
297
 
306
298
  # Provide a user friendly representation
307
299
  def to_s
@@ -325,7 +317,7 @@ module Twilio
325
317
 
326
318
  # Dependents
327
319
  @chunks = nil
328
- @status = nil
320
+ @knowledge_status = nil
329
321
  end
330
322
  ##
331
323
  # Delete the KnowledgeInstance
@@ -381,15 +373,14 @@ module Twilio
381
373
  @chunks
382
374
  end
383
375
  ##
384
- # Access the status
385
- # @return [StatusList]
386
- # @return [StatusContext]
387
- def status
388
- unless @status
389
- @status = StatusList.new(
390
- @version, )
391
- end
392
- @status
376
+ # Access the knowledge_status
377
+ # @return [KnowledgeStatusList]
378
+ # @return [KnowledgeStatusContext]
379
+ def knowledge_status
380
+ KnowledgeStatusContext.new(
381
+ @version,
382
+ @solution[:id]
383
+ )
393
384
  end
394
385
 
395
386
  ##
@@ -457,6 +448,7 @@ module Twilio
457
448
  'name' => payload['name'],
458
449
  'status' => payload['status'],
459
450
  'type' => payload['type'],
451
+ 'url' => payload['url'],
460
452
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
461
453
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
462
454
  }
@@ -519,6 +511,12 @@ module Twilio
519
511
  @properties['type']
520
512
  end
521
513
 
514
+ ##
515
+ # @return [String] The url of the knowledge resource.
516
+ def url
517
+ @properties['url']
518
+ end
519
+
522
520
  ##
523
521
  # @return [Time] The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
524
522
  def date_created
@@ -566,10 +564,10 @@ module Twilio
566
564
  end
567
565
 
568
566
  ##
569
- # Access the status
570
- # @return [status] status
571
- def status
572
- context.status
567
+ # Access the knowledge_status
568
+ # @return [knowledge_status] knowledge_status
569
+ def knowledge_status
570
+ context.knowledge_status
573
571
  end
574
572
 
575
573
  ##