twilio-ruby 7.8.1 → 7.8.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: 63da26cfdb1e46e561d69fc12866a3d6fe004da7
4
- data.tar.gz: 483a0abb0e0d9dee81f63057e181faaad5b193b5
3
+ metadata.gz: 8ed68053a51691a7772045403d8fa29d5ff86d9a
4
+ data.tar.gz: e1507f6091b864caf41abd0da30416ae793135bd
5
5
  SHA512:
6
- metadata.gz: e8df0759d0aa220c2b26e26fe4210641eb87cdcb645a1efc4c83ca8fed8bf60c92ea148435798302e1e2dac9f13fd26ab4ae907d2718c4036e6169d5530beee9
7
- data.tar.gz: 3db5b3c4c4343e61a5f8371c6671c28064b31053b1d11963cbbdd6e7913ee5834d34df51b530dbd4b9d43ba7837dd0da0e332ae4935cd85ed365e82e32b9e481
6
+ metadata.gz: 4150296b045e7a008046ebc083d6547bf81d0f7a3b1998623d6ce5a5fb79c29230ac14954092b6ce05c20dcaa3112d0551a4cc87c55290f912aece5484cf4a9a
7
+ data.tar.gz: 45948295c59d88c401e0cba4b03ac1c0a115c1724a1ca185e66ca544532f262cd63769e59584c74c680e33cb00443982a5ed603191b8ab66b611c9f61a1a4360
data/CHANGES.md CHANGED
@@ -1,6 +1,13 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2025-09-25] Version 7.8.2
5
+ --------------------------
6
+ **Api**
7
+ - Added optional parameter `CallerDisplayName` for conference participant outbound
8
+ - Updated description for property `to` in the participant create request
9
+
10
+
4
11
  [2025-09-18] Version 7.8.1
5
12
  --------------------------
6
13
  **Library - Chore**
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.8.1'
42
+ gem 'twilio-ruby', '~> 7.8.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.8.1
48
+ gem install twilio-ruby -v 7.8.2
49
49
  ```
50
50
 
51
51
  To build and install the development branch yourself from the latest source:
@@ -36,7 +36,7 @@ module Twilio
36
36
  ##
37
37
  # Create the ParticipantInstance
38
38
  # @param [String] from The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint.
39
- # @param [String] to The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified.
39
+ # @param [String] to The phone number, SIP address, Client, TwiML App identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. TwiML App identifiers are formatted `app:<APP_SID>`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified.
40
40
  # @param [String] status_callback The URL we should call using the `status_callback_method` to send status information to your application.
41
41
  # @param [String] status_callback_method The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`.
42
42
  # @param [Array[String]] status_callback_event The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`.
@@ -83,6 +83,7 @@ module Twilio
83
83
  # @param [String] amd_status_callback_method The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`.
84
84
  # @param [String] trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`.
85
85
  # @param [String] call_token A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call.
86
+ # @param [String] caller_display_name The name that appears to the called party for this call. Must be between 2 and 255 characters.
86
87
  # @return [ParticipantInstance] Created ParticipantInstance
87
88
  def create(
88
89
  from: nil,
@@ -132,7 +133,8 @@ module Twilio
132
133
  amd_status_callback: :unset,
133
134
  amd_status_callback_method: :unset,
134
135
  trim: :unset,
135
- call_token: :unset
136
+ call_token: :unset,
137
+ caller_display_name: :unset
136
138
  )
137
139
 
138
140
  data = Twilio::Values.of({
@@ -184,6 +186,7 @@ module Twilio
184
186
  'AmdStatusCallbackMethod' => amd_status_callback_method,
185
187
  'Trim' => trim,
186
188
  'CallToken' => call_token,
189
+ 'CallerDisplayName' => caller_display_name,
187
190
  })
188
191
 
189
192
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -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
+