twilio-ruby 7.3.0 → 7.3.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +21 -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/assistants/v1/assistant/assistants_knowledge.rb +355 -0
  8. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +362 -0
  9. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +303 -0
  10. data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +201 -0
  11. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +668 -0
  12. data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +229 -0
  13. data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +209 -0
  14. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +591 -0
  15. data/lib/twilio-ruby/rest/assistants/v1/policy.rb +264 -0
  16. data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +264 -0
  17. data/lib/twilio-ruby/rest/assistants/v1/session.rb +328 -0
  18. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +586 -0
  19. data/lib/twilio-ruby/rest/assistants/v1.rb +100 -0
  20. data/lib/twilio-ruby/rest/assistants.rb +6 -0
  21. data/lib/twilio-ruby/rest/assistants_base.rb +38 -0
  22. data/lib/twilio-ruby/rest/client.rb +5 -0
  23. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +11 -11
  24. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +11 -24
  25. data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +28 -15
  26. data/lib/twilio-ruby/rest/numbers/v1/{porting_webhook_configuration_fetch.rb → webhook.rb} +20 -20
  27. data/lib/twilio-ruby/rest/numbers/v1.rb +6 -6
  28. data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +2 -2
  29. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +4 -4
  30. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -1
  31. data/lib/twilio-ruby/version.rb +1 -1
  32. metadata +20 -3
@@ -0,0 +1,229 @@
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 ChunkList < ListResource
23
+
24
+ ##
25
+ # Initialize the ChunkList
26
+ # @param [Version] version Version that contains the resource
27
+ # @return [ChunkList] ChunkList
28
+ def initialize(version, id: nil)
29
+ super(version)
30
+ # Path Solution
31
+ @solution = { id: id }
32
+ @uri = "/Knowledge/#{@solution[:id]}/Chunks"
33
+
34
+ end
35
+
36
+ ##
37
+ # Lists ChunkInstance records from the API as a list.
38
+ # Unlike stream(), this operation is eager and will load `limit` records into
39
+ # memory before returning.
40
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
41
+ # guarantees to never return more than limit. Default is no limit
42
+ # @param [Integer] page_size Number of records to fetch per request, when
43
+ # not set will use the default value of 50 records. If no page_size is defined
44
+ # but a limit is defined, stream() will attempt to read the limit with the most
45
+ # efficient page size, i.e. min(limit, 1000)
46
+ # @return [Array] Array of up to limit results
47
+ def list(limit: nil, page_size: nil)
48
+ self.stream(
49
+ limit: limit,
50
+ page_size: page_size
51
+ ).entries
52
+ end
53
+
54
+ ##
55
+ # Streams Instance records from the API as an Enumerable.
56
+ # This operation lazily loads records as efficiently as possible until the limit
57
+ # is reached.
58
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
59
+ # guarantees to never return more than limit. Default is no limit
60
+ # @param [Integer] page_size Number of records to fetch per request, when
61
+ # not set will use the default value of 50 records. If no page_size is defined
62
+ # but a limit is defined, stream() will attempt to read the limit with the most
63
+ # efficient page size, i.e. min(limit, 1000)
64
+ # @return [Enumerable] Enumerable that will yield up to limit results
65
+ def stream(limit: nil, page_size: nil)
66
+ limits = @version.read_limits(limit, page_size)
67
+
68
+ page = self.page(
69
+ page_size: limits[:page_size], )
70
+
71
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
72
+ end
73
+
74
+ ##
75
+ # When passed a block, yields ChunkInstance records from the API.
76
+ # This operation lazily loads records as efficiently as possible until the limit
77
+ # is reached.
78
+ def each
79
+ limits = @version.read_limits
80
+
81
+ page = self.page(page_size: limits[:page_size], )
82
+
83
+ @version.stream(page,
84
+ limit: limits[:limit],
85
+ page_limit: limits[:page_limit]).each {|x| yield x}
86
+ end
87
+
88
+ ##
89
+ # Retrieve a single page of ChunkInstance records from the API.
90
+ # Request is executed immediately.
91
+ # @param [String] page_token PageToken provided by the API
92
+ # @param [Integer] page_number Page Number, this value is simply for client state
93
+ # @param [Integer] page_size Number of records to return, defaults to 50
94
+ # @return [Page] Page of ChunkInstance
95
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
96
+ params = Twilio::Values.of({
97
+ 'PageToken' => page_token,
98
+ 'Page' => page_number,
99
+ 'PageSize' => page_size,
100
+ })
101
+
102
+ response = @version.page('GET', @uri, params: params)
103
+
104
+ ChunkPage.new(@version, response, @solution)
105
+ end
106
+
107
+ ##
108
+ # Retrieve a single page of ChunkInstance records from the API.
109
+ # Request is executed immediately.
110
+ # @param [String] target_url API-generated URL for the requested results page
111
+ # @return [Page] Page of ChunkInstance
112
+ def get_page(target_url)
113
+ response = @version.domain.request(
114
+ 'GET',
115
+ target_url
116
+ )
117
+ ChunkPage.new(@version, response, @solution)
118
+ end
119
+
120
+
121
+
122
+ # Provide a user friendly representation
123
+ def to_s
124
+ '#<Twilio.Assistants.V1.ChunkList>'
125
+ end
126
+ end
127
+
128
+ class ChunkPage < Page
129
+ ##
130
+ # Initialize the ChunkPage
131
+ # @param [Version] version Version that contains the resource
132
+ # @param [Response] response Response from the API
133
+ # @param [Hash] solution Path solution for the resource
134
+ # @return [ChunkPage] ChunkPage
135
+ def initialize(version, response, solution)
136
+ super(version, response)
137
+
138
+ # Path Solution
139
+ @solution = solution
140
+ end
141
+
142
+ ##
143
+ # Build an instance of ChunkInstance
144
+ # @param [Hash] payload Payload response from the API
145
+ # @return [ChunkInstance] ChunkInstance
146
+ def get_instance(payload)
147
+ ChunkInstance.new(@version, payload, id: @solution[:id])
148
+ end
149
+
150
+ ##
151
+ # Provide a user friendly representation
152
+ def to_s
153
+ '<Twilio.Assistants.V1.ChunkPage>'
154
+ end
155
+ end
156
+ class ChunkInstance < InstanceResource
157
+ ##
158
+ # Initialize the ChunkInstance
159
+ # @param [Version] version Version that contains the resource
160
+ # @param [Hash] payload payload that contains response from Twilio
161
+ # @param [String] account_sid The SID of the
162
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Chunk
163
+ # resource.
164
+ # @param [String] sid The SID of the Call resource to fetch.
165
+ # @return [ChunkInstance] ChunkInstance
166
+ def initialize(version, payload , id: nil)
167
+ super(version)
168
+
169
+ # Marshaled Properties
170
+ @properties = {
171
+ 'account_sid' => payload['account_sid'],
172
+ 'content' => payload['content'],
173
+ 'metadata' => payload['metadata'],
174
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
175
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
176
+ }
177
+ end
178
+
179
+
180
+ ##
181
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
182
+ def account_sid
183
+ @properties['account_sid']
184
+ end
185
+
186
+ ##
187
+ # @return [String] The chunk content.
188
+ def content
189
+ @properties['content']
190
+ end
191
+
192
+ ##
193
+ # @return [Hash] The metadata of the chunk.
194
+ def metadata
195
+ @properties['metadata']
196
+ end
197
+
198
+ ##
199
+ # @return [Time] The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
200
+ def date_created
201
+ @properties['date_created']
202
+ end
203
+
204
+ ##
205
+ # @return [Time] The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
206
+ def date_updated
207
+ @properties['date_updated']
208
+ end
209
+
210
+ ##
211
+ # Provide a user friendly representation
212
+ def to_s
213
+ "<Twilio.Assistants.V1.ChunkInstance>"
214
+ end
215
+
216
+ ##
217
+ # Provide a detailed, user friendly representation
218
+ def inspect
219
+ "<Twilio.Assistants.V1.ChunkInstance>"
220
+ end
221
+ end
222
+
223
+ end
224
+ end
225
+ end
226
+ end
227
+ end
228
+
229
+
@@ -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
+