twilio-ruby 7.5.1 → 7.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aad54e4127225802d5b5d4a1e3711e2237721b9b
4
- data.tar.gz: 33661730ed8d04136f1d82c41d06637efacba9f2
3
+ metadata.gz: d712ec9531d94615ce16b7b859693eb92efe8aef
4
+ data.tar.gz: 81f4f2fe625f922615d0874cfe652058d6419229
5
5
  SHA512:
6
- metadata.gz: c4ab77c9062fc59a357c9ee328461b8d1d65a940cd90316abe2c1c31e519e2c8929f9185bcd167f4076783f1c355f073945acad8edc45aa6c624608a77ce6b92
7
- data.tar.gz: ac5416a1673ba49aafef4a58dc5f5dbb77a88dec86e620c97cf2a04fd9f10f9fc8fa6ba761d9ab22f70375d6fb5816b7aefbc05ccb8e943b74795fd39a0603f7
6
+ metadata.gz: 33d089a34b55b75c13a3643d14b02183c368906770af28917ef9a8441abffd73afb88c3495b9a6bf7a41868bc36372c18999fc04ff4f40376a8a4cb552bbe982
7
+ data.tar.gz: 103dbb5c6885d46b382df7083ad299fb278392af5c9326fb63ec1e66fb0ce5af1be8ade1b2d4598c1b71b684f98af6c631d16c03f2fd8389c2f6b47dfc0529ba
data/CHANGES.md CHANGED
@@ -1,6 +1,12 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2025-04-07] Version 7.5.2
5
+ --------------------------
6
+ **Studio**
7
+ - Add documentation for parent_step_sid field in Step resource
8
+
9
+
4
10
  [2025-03-20] Version 7.5.1
5
11
  --------------------------
6
12
  **Accounts**
data/README.md CHANGED
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
39
39
  To install using [Bundler][bundler] grab the latest stable version:
40
40
 
41
41
  ```ruby
42
- gem 'twilio-ruby', '~> 7.5.1'
42
+ gem 'twilio-ruby', '~> 7.5.2'
43
43
  ```
44
44
 
45
45
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
46
46
 
47
47
  ```bash
48
- gem install twilio-ruby -v 7.5.1
48
+ gem install twilio-ruby -v 7.5.2
49
49
  ```
50
50
 
51
51
  To build and install the development branch yourself from the latest source:
@@ -92,6 +92,11 @@ module Twilio
92
92
  @ip_messaging ||= IpMessaging.new self
93
93
  end
94
94
  ##
95
+ # Access the Knowledge Twilio Domain
96
+ def knowledge
97
+ @knowledge ||= Knowledge.new self
98
+ end
99
+ ##
95
100
  # Access the Lookups Twilio Domain
96
101
  def lookups
97
102
  @lookups ||= Lookups.new self
@@ -0,0 +1,232 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Knowledge
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 Knowledge < KnowledgeBase
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
+ headers = Twilio::Values.of({})
102
+
103
+
104
+
105
+ response = @version.page('GET', @uri, params: params, headers: headers)
106
+
107
+ ChunkPage.new(@version, response, @solution)
108
+ end
109
+
110
+ ##
111
+ # Retrieve a single page of ChunkInstance records from the API.
112
+ # Request is executed immediately.
113
+ # @param [String] target_url API-generated URL for the requested results page
114
+ # @return [Page] Page of ChunkInstance
115
+ def get_page(target_url)
116
+ response = @version.domain.request(
117
+ 'GET',
118
+ target_url
119
+ )
120
+ ChunkPage.new(@version, response, @solution)
121
+ end
122
+
123
+
124
+
125
+ # Provide a user friendly representation
126
+ def to_s
127
+ '#<Twilio.Knowledge.V1.ChunkList>'
128
+ end
129
+ end
130
+
131
+ class ChunkPage < Page
132
+ ##
133
+ # Initialize the ChunkPage
134
+ # @param [Version] version Version that contains the resource
135
+ # @param [Response] response Response from the API
136
+ # @param [Hash] solution Path solution for the resource
137
+ # @return [ChunkPage] ChunkPage
138
+ def initialize(version, response, solution)
139
+ super(version, response)
140
+
141
+ # Path Solution
142
+ @solution = solution
143
+ end
144
+
145
+ ##
146
+ # Build an instance of ChunkInstance
147
+ # @param [Hash] payload Payload response from the API
148
+ # @return [ChunkInstance] ChunkInstance
149
+ def get_instance(payload)
150
+ ChunkInstance.new(@version, payload, id: @solution[:id])
151
+ end
152
+
153
+ ##
154
+ # Provide a user friendly representation
155
+ def to_s
156
+ '<Twilio.Knowledge.V1.ChunkPage>'
157
+ end
158
+ end
159
+ class ChunkInstance < InstanceResource
160
+ ##
161
+ # Initialize the ChunkInstance
162
+ # @param [Version] version Version that contains the resource
163
+ # @param [Hash] payload payload that contains response from Twilio
164
+ # @param [String] account_sid The SID of the
165
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Chunk
166
+ # resource.
167
+ # @param [String] sid The SID of the Call resource to fetch.
168
+ # @return [ChunkInstance] ChunkInstance
169
+ def initialize(version, payload , id: nil)
170
+ super(version)
171
+
172
+ # Marshaled Properties
173
+ @properties = {
174
+ 'account_sid' => payload['account_sid'],
175
+ 'content' => payload['content'],
176
+ 'metadata' => payload['metadata'],
177
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
178
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
179
+ }
180
+ end
181
+
182
+
183
+ ##
184
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
185
+ def account_sid
186
+ @properties['account_sid']
187
+ end
188
+
189
+ ##
190
+ # @return [String] The chunk content.
191
+ def content
192
+ @properties['content']
193
+ end
194
+
195
+ ##
196
+ # @return [Hash] The metadata of the chunk.
197
+ def metadata
198
+ @properties['metadata']
199
+ end
200
+
201
+ ##
202
+ # @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.
203
+ def date_created
204
+ @properties['date_created']
205
+ end
206
+
207
+ ##
208
+ # @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.
209
+ def date_updated
210
+ @properties['date_updated']
211
+ end
212
+
213
+ ##
214
+ # Provide a user friendly representation
215
+ def to_s
216
+ "<Twilio.Knowledge.V1.ChunkInstance>"
217
+ end
218
+
219
+ ##
220
+ # Provide a detailed, user friendly representation
221
+ def inspect
222
+ "<Twilio.Knowledge.V1.ChunkInstance>"
223
+ end
224
+ end
225
+
226
+ end
227
+ end
228
+ end
229
+ end
230
+ end
231
+
232
+
@@ -0,0 +1,213 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Knowledge
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 Knowledge < KnowledgeBase
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.Knowledge.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
+
68
+
69
+
70
+
71
+ payload = @version.fetch('GET', @uri, headers: headers)
72
+ KnowledgeStatusInstance.new(
73
+ @version,
74
+ payload,
75
+ id: @solution[:id],
76
+ )
77
+ end
78
+
79
+
80
+ ##
81
+ # Provide a user friendly representation
82
+ def to_s
83
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
84
+ "#<Twilio.Knowledge.V1.KnowledgeStatusContext #{context}>"
85
+ end
86
+
87
+ ##
88
+ # Provide a detailed, user friendly representation
89
+ def inspect
90
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
91
+ "#<Twilio.Knowledge.V1.KnowledgeStatusContext #{context}>"
92
+ end
93
+ end
94
+
95
+ class KnowledgeStatusPage < Page
96
+ ##
97
+ # Initialize the KnowledgeStatusPage
98
+ # @param [Version] version Version that contains the resource
99
+ # @param [Response] response Response from the API
100
+ # @param [Hash] solution Path solution for the resource
101
+ # @return [KnowledgeStatusPage] KnowledgeStatusPage
102
+ def initialize(version, response, solution)
103
+ super(version, response)
104
+
105
+ # Path Solution
106
+ @solution = solution
107
+ end
108
+
109
+ ##
110
+ # Build an instance of KnowledgeStatusInstance
111
+ # @param [Hash] payload Payload response from the API
112
+ # @return [KnowledgeStatusInstance] KnowledgeStatusInstance
113
+ def get_instance(payload)
114
+ KnowledgeStatusInstance.new(@version, payload, id: @solution[:id])
115
+ end
116
+
117
+ ##
118
+ # Provide a user friendly representation
119
+ def to_s
120
+ '<Twilio.Knowledge.V1.KnowledgeStatusPage>'
121
+ end
122
+ end
123
+ class KnowledgeStatusInstance < InstanceResource
124
+ ##
125
+ # Initialize the KnowledgeStatusInstance
126
+ # @param [Version] version Version that contains the resource
127
+ # @param [Hash] payload payload that contains response from Twilio
128
+ # @param [String] account_sid The SID of the
129
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this KnowledgeStatus
130
+ # resource.
131
+ # @param [String] sid The SID of the Call resource to fetch.
132
+ # @return [KnowledgeStatusInstance] KnowledgeStatusInstance
133
+ def initialize(version, payload , id: nil)
134
+ super(version)
135
+
136
+ # Marshaled Properties
137
+ @properties = {
138
+ 'account_sid' => payload['account_sid'],
139
+ 'status' => payload['status'],
140
+ 'last_status' => payload['last_status'],
141
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
142
+ }
143
+
144
+ # Context
145
+ @instance_context = nil
146
+ @params = { 'id' => id || @properties['id'] , }
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 [KnowledgeStatusContext] CallContext for this CallInstance
153
+ def context
154
+ unless @instance_context
155
+ @instance_context = KnowledgeStatusContext.new(@version , @params['id'])
156
+ end
157
+ @instance_context
158
+ end
159
+
160
+ ##
161
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
162
+ def account_sid
163
+ @properties['account_sid']
164
+ end
165
+
166
+ ##
167
+ # @return [String] The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
168
+ def status
169
+ @properties['status']
170
+ end
171
+
172
+ ##
173
+ # @return [String] The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
174
+ def last_status
175
+ @properties['last_status']
176
+ end
177
+
178
+ ##
179
+ # @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.
180
+ def date_updated
181
+ @properties['date_updated']
182
+ end
183
+
184
+ ##
185
+ # Fetch the KnowledgeStatusInstance
186
+ # @return [KnowledgeStatusInstance] Fetched KnowledgeStatusInstance
187
+ def fetch
188
+
189
+ context.fetch
190
+ end
191
+
192
+ ##
193
+ # Provide a user friendly representation
194
+ def to_s
195
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
196
+ "<Twilio.Knowledge.V1.KnowledgeStatusInstance #{values}>"
197
+ end
198
+
199
+ ##
200
+ # Provide a detailed, user friendly representation
201
+ def inspect
202
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
203
+ "<Twilio.Knowledge.V1.KnowledgeStatusInstance #{values}>"
204
+ end
205
+ end
206
+
207
+ end
208
+ end
209
+ end
210
+ end
211
+ end
212
+
213
+