twilio-ruby 7.3.3 → 7.3.5

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: 4f2e73c51c288976c1c887e2f7b531eac33660aa
4
- data.tar.gz: 7cd72222c429642bdbc322d64074b1d949dae3e3
3
+ metadata.gz: e25ad4751d947c97ea1f1b024808691fca6ced5c
4
+ data.tar.gz: 7b04ac93d6f0cf9113143ebcf95caab81b4d6b60
5
5
  SHA512:
6
- metadata.gz: c01620723f63074f14f586946d602a29e82b49a348753fae96686d8c573ca968a7c738f04e6d69ecccfd5943d9e27befeadfbe336331e15cc4cb10ccac5fac0a
7
- data.tar.gz: 21442f7a242ef06a5b5f0dfe6ccc4d7da1599973707b4dbb0945814e42220264ec1de69c8354318c230dce73e8e71f3562f1754ea18d25dc37e5c55eedbf1212
6
+ metadata.gz: f2a4fa936804210bc6884dc97ee6254af4cdfbc08f415408a2ecf02d405cd94339e26de0e21927dc157fd74efb2107c4adf4e4b3b5a097839e4c570b944850b2
7
+ data.tar.gz: ed941f50e2bec4a7f5c733d29fbd791400a2d03a968659ca2fae3003e93cc6c26c427d36769812385326b51e30c64e5a19f2dc124f133191f09b7efc0f83c7de
data/CHANGES.md CHANGED
@@ -1,6 +1,21 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2024-10-24] Version 7.3.5
5
+ --------------------------
6
+ **Conversations**
7
+ - Expose ConversationWithParticipants resource that allows creating a conversation with participants
8
+
9
+
10
+ [2024-10-17] Version 7.3.4
11
+ --------------------------
12
+ **Api**
13
+ - Add response key `country` to fetch AvailablePhoneNumber resource by specific country.
14
+
15
+ **Messaging**
16
+ - Make library and doc public for requestManagedCert Endpoint
17
+
18
+
4
19
  [2024-10-03] Version 7.3.3
5
20
  --------------------------
6
21
  **Messaging**
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.3.3'
42
+ gem 'twilio-ruby', '~> 7.3.5'
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.3.3
48
+ gem install twilio-ruby -v 7.3.5
49
49
  ```
50
50
 
51
51
  To build and install the development branch yourself from the latest source:
@@ -209,9 +209,9 @@ module Twilio
209
209
  @uri = "/Conversations/#{@solution[:sid]}"
210
210
 
211
211
  # Dependents
212
- @webhooks = nil
213
212
  @messages = nil
214
213
  @participants = nil
214
+ @webhooks = nil
215
215
  end
216
216
  ##
217
217
  # Delete the ConversationInstance
@@ -295,25 +295,6 @@ module Twilio
295
295
  )
296
296
  end
297
297
 
298
- ##
299
- # Access the webhooks
300
- # @return [WebhookList]
301
- # @return [WebhookContext] if sid was passed.
302
- def webhooks(sid=:unset)
303
-
304
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
305
-
306
- if sid != :unset
307
- return WebhookContext.new(@version, @solution[:sid],sid )
308
- end
309
-
310
- unless @webhooks
311
- @webhooks = WebhookList.new(
312
- @version, conversation_sid: @solution[:sid], )
313
- end
314
-
315
- @webhooks
316
- end
317
298
  ##
318
299
  # Access the messages
319
300
  # @return [MessageList]
@@ -352,6 +333,25 @@ module Twilio
352
333
 
353
334
  @participants
354
335
  end
336
+ ##
337
+ # Access the webhooks
338
+ # @return [WebhookList]
339
+ # @return [WebhookContext] if sid was passed.
340
+ def webhooks(sid=:unset)
341
+
342
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
343
+
344
+ if sid != :unset
345
+ return WebhookContext.new(@version, @solution[:sid],sid )
346
+ end
347
+
348
+ unless @webhooks
349
+ @webhooks = WebhookList.new(
350
+ @version, conversation_sid: @solution[:sid], )
351
+ end
352
+
353
+ @webhooks
354
+ end
355
355
 
356
356
  ##
357
357
  # Provide a user friendly representation
@@ -594,13 +594,6 @@ module Twilio
594
594
  )
595
595
  end
596
596
 
597
- ##
598
- # Access the webhooks
599
- # @return [webhooks] webhooks
600
- def webhooks
601
- context.webhooks
602
- end
603
-
604
597
  ##
605
598
  # Access the messages
606
599
  # @return [messages] messages
@@ -615,6 +608,13 @@ module Twilio
615
608
  context.participants
616
609
  end
617
610
 
611
+ ##
612
+ # Access the webhooks
613
+ # @return [webhooks] webhooks
614
+ def webhooks
615
+ context.webhooks
616
+ end
617
+
618
618
  ##
619
619
  # Provide a user friendly representation
620
620
  def to_s
@@ -0,0 +1,259 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Conversations
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 Conversations < ConversationsBase
19
+ class V1 < Version
20
+ class ConversationWithParticipantsList < ListResource
21
+
22
+ ##
23
+ # Initialize the ConversationWithParticipantsList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [ConversationWithParticipantsList] ConversationWithParticipantsList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/ConversationWithParticipants"
31
+
32
+ end
33
+ ##
34
+ # Create the ConversationWithParticipantsInstance
35
+ # @param [String] friendly_name The human-readable name of this conversation, limited to 256 characters. Optional.
36
+ # @param [String] unique_name An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL.
37
+ # @param [Time] date_created The date that this resource was created.
38
+ # @param [Time] date_updated The date that this resource was last updated.
39
+ # @param [String] messaging_service_sid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
40
+ # @param [String] attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned.
41
+ # @param [State] state
42
+ # @param [String] timers_inactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute.
43
+ # @param [String] timers_closed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes.
44
+ # @param [String] bindings_email_address The default email address that will be used when sending outbound emails in this conversation.
45
+ # @param [String] bindings_email_name The default name that will be used when sending outbound emails in this conversation.
46
+ # @param [Array[String]] participant The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10.
47
+ # @param [ConversationWithParticipantsEnumWebhookEnabledType] x_twilio_webhook_enabled The X-Twilio-Webhook-Enabled HTTP request header
48
+ # @return [ConversationWithParticipantsInstance] Created ConversationWithParticipantsInstance
49
+ def create(
50
+ friendly_name: :unset,
51
+ unique_name: :unset,
52
+ date_created: :unset,
53
+ date_updated: :unset,
54
+ messaging_service_sid: :unset,
55
+ attributes: :unset,
56
+ state: :unset,
57
+ timers_inactive: :unset,
58
+ timers_closed: :unset,
59
+ bindings_email_address: :unset,
60
+ bindings_email_name: :unset,
61
+ participant: :unset,
62
+ x_twilio_webhook_enabled: :unset
63
+ )
64
+
65
+ data = Twilio::Values.of({
66
+ 'FriendlyName' => friendly_name,
67
+ 'UniqueName' => unique_name,
68
+ 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
69
+ 'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
70
+ 'MessagingServiceSid' => messaging_service_sid,
71
+ 'Attributes' => attributes,
72
+ 'State' => state,
73
+ 'Timers.Inactive' => timers_inactive,
74
+ 'Timers.Closed' => timers_closed,
75
+ 'Bindings.Email.Address' => bindings_email_address,
76
+ 'Bindings.Email.Name' => bindings_email_name,
77
+ 'Participant' => Twilio.serialize_list(participant) { |e| e },
78
+ })
79
+
80
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
81
+
82
+ payload = @version.create('POST', @uri, data: data, headers: headers)
83
+ ConversationWithParticipantsInstance.new(
84
+ @version,
85
+ payload,
86
+ )
87
+ end
88
+
89
+
90
+
91
+
92
+ # Provide a user friendly representation
93
+ def to_s
94
+ '#<Twilio.Conversations.V1.ConversationWithParticipantsList>'
95
+ end
96
+ end
97
+
98
+ class ConversationWithParticipantsPage < Page
99
+ ##
100
+ # Initialize the ConversationWithParticipantsPage
101
+ # @param [Version] version Version that contains the resource
102
+ # @param [Response] response Response from the API
103
+ # @param [Hash] solution Path solution for the resource
104
+ # @return [ConversationWithParticipantsPage] ConversationWithParticipantsPage
105
+ def initialize(version, response, solution)
106
+ super(version, response)
107
+
108
+ # Path Solution
109
+ @solution = solution
110
+ end
111
+
112
+ ##
113
+ # Build an instance of ConversationWithParticipantsInstance
114
+ # @param [Hash] payload Payload response from the API
115
+ # @return [ConversationWithParticipantsInstance] ConversationWithParticipantsInstance
116
+ def get_instance(payload)
117
+ ConversationWithParticipantsInstance.new(@version, payload)
118
+ end
119
+
120
+ ##
121
+ # Provide a user friendly representation
122
+ def to_s
123
+ '<Twilio.Conversations.V1.ConversationWithParticipantsPage>'
124
+ end
125
+ end
126
+ class ConversationWithParticipantsInstance < InstanceResource
127
+ ##
128
+ # Initialize the ConversationWithParticipantsInstance
129
+ # @param [Version] version Version that contains the resource
130
+ # @param [Hash] payload payload that contains response from Twilio
131
+ # @param [String] account_sid The SID of the
132
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this ConversationWithParticipants
133
+ # resource.
134
+ # @param [String] sid The SID of the Call resource to fetch.
135
+ # @return [ConversationWithParticipantsInstance] ConversationWithParticipantsInstance
136
+ def initialize(version, payload )
137
+ super(version)
138
+
139
+ # Marshaled Properties
140
+ @properties = {
141
+ 'account_sid' => payload['account_sid'],
142
+ 'chat_service_sid' => payload['chat_service_sid'],
143
+ 'messaging_service_sid' => payload['messaging_service_sid'],
144
+ 'sid' => payload['sid'],
145
+ 'friendly_name' => payload['friendly_name'],
146
+ 'unique_name' => payload['unique_name'],
147
+ 'attributes' => payload['attributes'],
148
+ 'state' => payload['state'],
149
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
150
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
151
+ 'timers' => payload['timers'],
152
+ 'links' => payload['links'],
153
+ 'bindings' => payload['bindings'],
154
+ 'url' => payload['url'],
155
+ }
156
+ end
157
+
158
+
159
+ ##
160
+ # @return [String] The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation.
161
+ def account_sid
162
+ @properties['account_sid']
163
+ end
164
+
165
+ ##
166
+ # @return [String] The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to.
167
+ def chat_service_sid
168
+ @properties['chat_service_sid']
169
+ end
170
+
171
+ ##
172
+ # @return [String] The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
173
+ def messaging_service_sid
174
+ @properties['messaging_service_sid']
175
+ end
176
+
177
+ ##
178
+ # @return [String] A 34 character string that uniquely identifies this resource.
179
+ def sid
180
+ @properties['sid']
181
+ end
182
+
183
+ ##
184
+ # @return [String] The human-readable name of this conversation, limited to 256 characters. Optional.
185
+ def friendly_name
186
+ @properties['friendly_name']
187
+ end
188
+
189
+ ##
190
+ # @return [String] An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL.
191
+ def unique_name
192
+ @properties['unique_name']
193
+ end
194
+
195
+ ##
196
+ # @return [String] An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned.
197
+ def attributes
198
+ @properties['attributes']
199
+ end
200
+
201
+ ##
202
+ # @return [State]
203
+ def state
204
+ @properties['state']
205
+ end
206
+
207
+ ##
208
+ # @return [Time] The date that this resource was created.
209
+ def date_created
210
+ @properties['date_created']
211
+ end
212
+
213
+ ##
214
+ # @return [Time] The date that this resource was last updated.
215
+ def date_updated
216
+ @properties['date_updated']
217
+ end
218
+
219
+ ##
220
+ # @return [Hash] Timer date values representing state update for this conversation.
221
+ def timers
222
+ @properties['timers']
223
+ end
224
+
225
+ ##
226
+ # @return [Hash] Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation.
227
+ def links
228
+ @properties['links']
229
+ end
230
+
231
+ ##
232
+ # @return [Hash]
233
+ def bindings
234
+ @properties['bindings']
235
+ end
236
+
237
+ ##
238
+ # @return [String] An absolute API resource URL for this conversation.
239
+ def url
240
+ @properties['url']
241
+ end
242
+
243
+ ##
244
+ # Provide a user friendly representation
245
+ def to_s
246
+ "<Twilio.Conversations.V1.ConversationWithParticipantsInstance>"
247
+ end
248
+
249
+ ##
250
+ # Provide a detailed, user friendly representation
251
+ def inspect
252
+ "<Twilio.Conversations.V1.ConversationWithParticipantsInstance>"
253
+ end
254
+ end
255
+
256
+ end
257
+ end
258
+ end
259
+ end
@@ -56,8 +56,8 @@ module Twilio
56
56
  @uri = "/Services/#{@solution[:chat_service_sid]}/Configuration"
57
57
 
58
58
  # Dependents
59
- @notifications = nil
60
59
  @webhooks = nil
60
+ @notifications = nil
61
61
  end
62
62
  ##
63
63
  # Fetch the ConfigurationInstance
@@ -105,16 +105,6 @@ module Twilio
105
105
  )
106
106
  end
107
107
 
108
- ##
109
- # Access the notifications
110
- # @return [NotificationList]
111
- # @return [NotificationContext]
112
- def notifications
113
- NotificationContext.new(
114
- @version,
115
- @solution[:chat_service_sid]
116
- )
117
- end
118
108
  ##
119
109
  # Access the webhooks
120
110
  # @return [WebhookList]
@@ -125,6 +115,16 @@ module Twilio
125
115
  @solution[:chat_service_sid]
126
116
  )
127
117
  end
118
+ ##
119
+ # Access the notifications
120
+ # @return [NotificationList]
121
+ # @return [NotificationContext]
122
+ def notifications
123
+ NotificationContext.new(
124
+ @version,
125
+ @solution[:chat_service_sid]
126
+ )
127
+ end
128
128
 
129
129
  ##
130
130
  # Provide a user friendly representation
@@ -281,13 +281,6 @@ module Twilio
281
281
  )
282
282
  end
283
283
 
284
- ##
285
- # Access the notifications
286
- # @return [notifications] notifications
287
- def notifications
288
- context.notifications
289
- end
290
-
291
284
  ##
292
285
  # Access the webhooks
293
286
  # @return [webhooks] webhooks
@@ -295,6 +288,13 @@ module Twilio
295
288
  context.webhooks
296
289
  end
297
290
 
291
+ ##
292
+ # Access the notifications
293
+ # @return [notifications] notifications
294
+ def notifications
295
+ context.notifications
296
+ end
297
+
298
298
  ##
299
299
  # Provide a user friendly representation
300
300
  def to_s
@@ -214,8 +214,8 @@ module Twilio
214
214
 
215
215
  # Dependents
216
216
  @participants = nil
217
- @messages = nil
218
217
  @webhooks = nil
218
+ @messages = nil
219
219
  end
220
220
  ##
221
221
  # Delete the ConversationInstance
@@ -321,42 +321,42 @@ module Twilio
321
321
  @participants
322
322
  end
323
323
  ##
324
- # Access the messages
325
- # @return [MessageList]
326
- # @return [MessageContext] if sid was passed.
327
- def messages(sid=:unset)
324
+ # Access the webhooks
325
+ # @return [WebhookList]
326
+ # @return [WebhookContext] if sid was passed.
327
+ def webhooks(sid=:unset)
328
328
 
329
329
  raise ArgumentError, 'sid cannot be nil' if sid.nil?
330
330
 
331
331
  if sid != :unset
332
- return MessageContext.new(@version, @solution[:chat_service_sid], @solution[:sid],sid )
332
+ return WebhookContext.new(@version, @solution[:chat_service_sid], @solution[:sid],sid )
333
333
  end
334
334
 
335
- unless @messages
336
- @messages = MessageList.new(
335
+ unless @webhooks
336
+ @webhooks = WebhookList.new(
337
337
  @version, chat_service_sid: @solution[:chat_service_sid], conversation_sid: @solution[:sid], )
338
338
  end
339
339
 
340
- @messages
340
+ @webhooks
341
341
  end
342
342
  ##
343
- # Access the webhooks
344
- # @return [WebhookList]
345
- # @return [WebhookContext] if sid was passed.
346
- def webhooks(sid=:unset)
343
+ # Access the messages
344
+ # @return [MessageList]
345
+ # @return [MessageContext] if sid was passed.
346
+ def messages(sid=:unset)
347
347
 
348
348
  raise ArgumentError, 'sid cannot be nil' if sid.nil?
349
349
 
350
350
  if sid != :unset
351
- return WebhookContext.new(@version, @solution[:chat_service_sid], @solution[:sid],sid )
351
+ return MessageContext.new(@version, @solution[:chat_service_sid], @solution[:sid],sid )
352
352
  end
353
353
 
354
- unless @webhooks
355
- @webhooks = WebhookList.new(
354
+ unless @messages
355
+ @messages = MessageList.new(
356
356
  @version, chat_service_sid: @solution[:chat_service_sid], conversation_sid: @solution[:sid], )
357
357
  end
358
358
 
359
- @webhooks
359
+ @messages
360
360
  end
361
361
 
362
362
  ##
@@ -607,13 +607,6 @@ module Twilio
607
607
  context.participants
608
608
  end
609
609
 
610
- ##
611
- # Access the messages
612
- # @return [messages] messages
613
- def messages
614
- context.messages
615
- end
616
-
617
610
  ##
618
611
  # Access the webhooks
619
612
  # @return [webhooks] webhooks
@@ -621,6 +614,13 @@ module Twilio
621
614
  context.webhooks
622
615
  end
623
616
 
617
+ ##
618
+ # Access the messages
619
+ # @return [messages] messages
620
+ def messages
621
+ context.messages
622
+ end
623
+
624
624
  ##
625
625
  # Provide a user friendly representation
626
626
  def to_s