twilio-ruby 5.56.0 → 5.58.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +24 -7
  4. data/CHANGES.md +51 -0
  5. data/Gemfile +1 -0
  6. data/README.md +2 -2
  7. data/examples/examples.rb +1 -1
  8. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -3
  9. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +4 -1
  10. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  11. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  12. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  13. data/lib/twilio-ruby/rest/conversations.rb +6 -0
  14. data/lib/twilio-ruby/rest/conversations/v1.rb +7 -0
  15. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  16. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  17. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  18. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  19. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  20. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  21. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  22. data/lib/twilio-ruby/rest/insights.rb +6 -0
  23. data/lib/twilio-ruby/rest/insights/v1.rb +7 -0
  24. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +428 -0
  25. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +19 -1
  26. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  27. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -1
  28. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  29. data/lib/twilio-ruby/version.rb +1 -1
  30. data/sonar-project.properties +13 -0
  31. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80e6c32f919f1a2514aafbbb28a11b07f6099e9ffeca5f95dde586e2a717712d
4
- data.tar.gz: '09a90113868ce5fc759734f819b76040c96da3c237657a5159912ecc4bd7a871'
3
+ metadata.gz: 90245670a85b148807ee4a2be28da950b65530413eef56cf403e16708222a5d4
4
+ data.tar.gz: e279a65d127e4b629c904a9de0081c03effd7fa76ec73aa945bb52a8f4d32806
5
5
  SHA512:
6
- metadata.gz: 456c8ac1a992f24200563b2c754b6b9f9259287b4e4042550420218b18850de8c0a6e1c875c83e3e00b1e487f42c0b9c22a36060f95729a390b957cf34171319
7
- data.tar.gz: dfb91366c5e2db2c817db0a782ec67c5290892daa430c0f32279ba7b7a8ae5e25fac42f9801952845d47c026603b1a95f29f5312637e283cb957bfb671dcd4cc
6
+ metadata.gz: f4cf12efd6b9c6b1a8dd4d3239c369e1592cb920e1c2c68451e5e835dcb43a1aa2d914b2fc6eaadd4daa65c09c980278d2fa6fd09723db8ecede21023bc38108
7
+ data.tar.gz: f92a04a5901154ccdb52b8a79dce167019b61177e90cc050774a2f1bfcb6a3b466b73fe92639363bdc43a697845423fd9d4d00e9ff1cad9fe34c9ae27329c831
data/.gitignore CHANGED
@@ -12,3 +12,5 @@ bin
12
12
  docs/_build
13
13
  *.bak
14
14
  *.iml
15
+
16
+ coverage
data/.travis.yml CHANGED
@@ -3,23 +3,35 @@ cache: bundler
3
3
  bundler_args: "--without development"
4
4
  rvm:
5
5
  - ruby-head
6
- - 3.0
7
- - 2.7
8
- - 2.6
9
- - 2.5
10
- - 2.4
11
6
  - jruby-9.2
7
+ - 2.4
8
+ - 2.5
9
+ - 2.6
10
+ - 2.7
11
+ - 3.0
12
12
  services:
13
13
  - docker
14
14
  install: make install
15
- script: make test
15
+ script:
16
+ - make test
17
+ - if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST"
18
+ == "false" ]; then echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}"
19
+ --password-stdin; fi
16
20
  matrix:
21
+ include:
22
+ - language: ruby
23
+ rvm: '3.0'
24
+ # The below workaround is necessary because of the branch coverage inclusion in simplecov 0.18+
25
+ # more discussion here - https://community.sonarsource.com/t/ruby-coverage-simplecov-json-file-does-not-work/20909/7
26
+ after_success:
27
+ - ruby -rjson -e 'sqube = JSON.load(File.read("coverage/.resultset.json"))["RSpec"]["coverage"].transform_values {|lines| lines["lines"]}; total = { "RSpec" => { "coverage" => sqube, "timestamp" => Time.now.to_i }}; puts JSON.dump(total)' > coverage/.resultset.sonarqube.json
28
+ - sonar-scanner
17
29
  allow_failures:
18
30
  - rvm: ruby-head
19
31
  fast_finish: true
20
32
  deploy:
21
33
  - provider: script
22
- script: echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin && make docker-build && make docker-push
34
+ script: make docker-build && make docker-push
23
35
  skip_cleanup: true
24
36
  on:
25
37
  tags: true
@@ -37,3 +49,8 @@ notifications:
37
49
  on_failure: change
38
50
  rooms:
39
51
  secure: HG7rC5VSDOZiLCkpTsC4ZImh1k59OPi6YEjYKhdGXItybLHa6Yh5C42WvSx3kVW3SeyLOm1CiaMv+pbBZUXStXYsl8eH69MbEZimhDWsPs/m+bh+gEISov22WNUs3ZfUqIXMIb6v18oXPp2Qa1gX5LUEAGoSxHWNmCAcHayWl7M=
52
+ addons:
53
+ sonarcloud:
54
+ organization: twilio
55
+ token:
56
+ secure: OSEahx/yO/r9PdjXbASwJt+ogphxkDDpnlajWNCBTc+hoiEurGP/12CN0oQi7+iishIgIowqo5J9/+m1BQfsAv4fKST+t6mSazx27udiiM9am03lhviW8QSG6STADvtq6uJRqTXMk3WehoSidNRYXamVdCoBbqxCSaMX8MbMsN8=
data/CHANGES.md CHANGED
@@ -1,6 +1,57 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2021-08-11] Version 5.58.0
5
+ ---------------------------
6
+ **Library - Chore**
7
+ - [PR #566](https://github.com/twilio/twilio-ruby/pull/566): integrate sonarcloud. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
8
+
9
+ **Library - Docs**
10
+ - [PR #565](https://github.com/twilio/twilio-ruby/pull/565): update mms example to use media_url. Thanks to [@cnorm35](https://github.com/cnorm35)!
11
+
12
+ **Api**
13
+ - Corrected the `price`, `call_sid_to_coach`, and `uri` data types for Conference, Participant, and Recording **(breaking change)**
14
+ - Made documentation for property `time_limit` in the call api public. **(breaking change)**
15
+ - Added `domain_sid` in sip_credential_list_mapping and sip_ip_access_control_list_mapping APIs **(breaking change)**
16
+
17
+ **Insights**
18
+ - Added new endpoint to fetch Call Summaries
19
+
20
+ **Messaging**
21
+ - Add brand_type field to a2p brand_registration api
22
+ - Revert brand registration api update to add brand_type field
23
+ - Add brand_type field to a2p brand_registration api
24
+
25
+ **Taskrouter**
26
+ - Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` as Response Headers to all TaskRouter endpoints
27
+
28
+ **Verify**
29
+ - Add `TemplateSid` optional parameter on Verification creation.
30
+ - Include `whatsapp` as a channel type in the verifications API.
31
+
32
+
33
+ [2021-07-28] Version 5.57.1
34
+ ---------------------------
35
+ **Conversations**
36
+ - Expose ParticipantConversations resource
37
+
38
+ **Taskrouter**
39
+ - Adding `links` to the activity resource
40
+
41
+ **Verify**
42
+ - Added a `Version` to Verify Factors `Webhooks` to add new fields without breaking old Webhooks.
43
+
44
+
45
+ [2021-07-14] Version 5.57.0
46
+ ---------------------------
47
+ **Conversations**
48
+ - Changed `last_read_message_index` and `unread_messages_count` type in User Conversation's resource **(breaking change)**
49
+ - Expose UserConversations resource
50
+
51
+ **Messaging**
52
+ - Add brand_score field to brand registration responses
53
+
54
+
4
55
  [2021-06-30] Version 5.56.0
5
56
  ---------------------------
6
57
  **Library - Feature**
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
1
  source 'https://rubygems.org'
2
+ gem 'simplecov', require: false, group: :test
2
3
  gemspec
data/README.md CHANGED
@@ -35,13 +35,13 @@ This library supports the following Ruby implementations:
35
35
  To install using [Bundler][bundler] grab the latest stable version:
36
36
 
37
37
  ```ruby
38
- gem 'twilio-ruby', '~> 5.56.0'
38
+ gem 'twilio-ruby', '~> 5.58.0'
39
39
  ```
40
40
 
41
41
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
42
42
 
43
43
  ```bash
44
- gem install twilio-ruby -v 5.56.0
44
+ gem install twilio-ruby -v 5.58.0
45
45
  ```
46
46
 
47
47
  To build and install the development branch yourself from the latest source:
data/examples/examples.rb CHANGED
@@ -69,7 +69,7 @@ puts @client.messages('SMXXXXXXXX').fetch.body
69
69
  @client.messages.create(
70
70
  from: '+14159341234',
71
71
  to: '+16105557069',
72
- media_urls: 'http://example.com/media.png'
72
+ media_url: 'http://example.com/media.png'
73
73
  )
74
74
 
75
75
  ################ PHONE NUMBERS ################
@@ -151,6 +151,8 @@ module Twilio
151
151
  # `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the
152
152
  # audio that is received by Twilio. `outbound` records the audio that is generated
153
153
  # from Twilio. `both` records the audio that is received and generated by Twilio.
154
+ # @param [String] time_limit The maximum duration of the call in seconds.
155
+ # Constraints depend on account and configuration.
154
156
  # @param [String] url The absolute URL that returns the TwiML instructions for the
155
157
  # call. We will call this URL using the `method` when the call connects. For more
156
158
  # information, see the {Url
@@ -162,7 +164,7 @@ module Twilio
162
164
  # @param [String] application_sid The SID of the Application resource that will
163
165
  # handle the call, if the call will be handled by an application.
164
166
  # @return [CallInstance] Created CallInstance
165
- def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, async_amd: :unset, async_amd_status_callback: :unset, async_amd_status_callback_method: :unset, byoc: :unset, call_reason: :unset, call_token: :unset, recording_track: :unset, url: :unset, twiml: :unset, application_sid: :unset)
167
+ def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, async_amd: :unset, async_amd_status_callback: :unset, async_amd_status_callback_method: :unset, byoc: :unset, call_reason: :unset, call_token: :unset, recording_track: :unset, time_limit: :unset, url: :unset, twiml: :unset, application_sid: :unset)
166
168
  data = Twilio::Values.of({
167
169
  'To' => to,
168
170
  'From' => from,
@@ -198,6 +200,7 @@ module Twilio
198
200
  'CallReason' => call_reason,
199
201
  'CallToken' => call_token,
200
202
  'RecordingTrack' => recording_track,
203
+ 'TimeLimit' => time_limit,
201
204
  })
202
205
 
203
206
  payload = @version.create('POST', @uri, data: data)
@@ -488,8 +491,10 @@ module Twilio
488
491
  # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
489
492
  # @param [String] twiml TwiML instructions for the call Twilio will use without
490
493
  # fetching Twiml from url. Twiml and url parameters are mutually exclusive
494
+ # @param [String] time_limit The maximum duration of the call in seconds.
495
+ # Constraints depend on account and configuration.
491
496
  # @return [CallInstance] Updated CallInstance
492
- def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset)
497
+ def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset)
493
498
  data = Twilio::Values.of({
494
499
  'Url' => url,
495
500
  'Method' => method,
@@ -499,6 +504,7 @@ module Twilio
499
504
  'StatusCallback' => status_callback,
500
505
  'StatusCallbackMethod' => status_callback_method,
501
506
  'Twiml' => twiml,
507
+ 'TimeLimit' => time_limit,
502
508
  })
503
509
 
504
510
  payload = @version.update('POST', @uri, data: data)
@@ -874,8 +880,10 @@ module Twilio
874
880
  # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
875
881
  # @param [String] twiml TwiML instructions for the call Twilio will use without
876
882
  # fetching Twiml from url. Twiml and url parameters are mutually exclusive
883
+ # @param [String] time_limit The maximum duration of the call in seconds.
884
+ # Constraints depend on account and configuration.
877
885
  # @return [CallInstance] Updated CallInstance
878
- def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset)
886
+ def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset)
879
887
  context.update(
880
888
  url: url,
881
889
  method: method,
@@ -885,6 +893,7 @@ module Twilio
885
893
  status_callback: status_callback,
886
894
  status_callback_method: status_callback_method,
887
895
  twiml: twiml,
896
+ time_limit: time_limit,
888
897
  )
889
898
  end
890
899
 
@@ -167,8 +167,10 @@ module Twilio
167
167
  # `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the
168
168
  # audio that is received by Twilio. `outbound` records the audio that is sent from
169
169
  # Twilio. `both` records the audio that is received and sent by Twilio.
170
+ # @param [String] time_limit The maximum duration of the call in seconds.
171
+ # Constraints depend on account and configuration.
170
172
  # @return [ParticipantInstance] Created ParticipantInstance
171
- def create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset)
173
+ def create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset, time_limit: :unset)
172
174
  data = Twilio::Values.of({
173
175
  'From' => from,
174
176
  'To' => to,
@@ -208,6 +210,7 @@ module Twilio
208
210
  'CallerId' => caller_id,
209
211
  'CallReason' => call_reason,
210
212
  'RecordingTrack' => recording_track,
213
+ 'TimeLimit' => time_limit,
211
214
  })
212
215
 
213
216
  payload = @version.create('POST', @uri, data: data)
@@ -282,7 +282,7 @@ module Twilio
282
282
  'start_time' => Twilio.deserialize_rfc2822(payload['start_time']),
283
283
  'duration' => payload['duration'],
284
284
  'sid' => payload['sid'],
285
- 'price' => payload['price'].to_f,
285
+ 'price' => payload['price'],
286
286
  'price_unit' => payload['price_unit'],
287
287
  'status' => payload['status'],
288
288
  'channels' => payload['channels'].to_i,
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] account_sid The unique id of the Account that is responsible for
21
21
  # this resource.
22
- # @param [String] domain_sid The unique string that that we created to identify
23
- # the SipDomain resource.
22
+ # @param [String] domain_sid The unique string that is created to identify the
23
+ # SipDomain resource.
24
24
  # @return [CredentialListMappingList] CredentialListMappingList
25
25
  def initialize(version, account_sid: nil, domain_sid: nil)
26
26
  super(version)
@@ -233,8 +233,8 @@ module Twilio
233
233
  # @param [Hash] payload payload that contains response from Twilio
234
234
  # @param [String] account_sid The unique id of the Account that is responsible for
235
235
  # this resource.
236
- # @param [String] domain_sid The unique string that that we created to identify
237
- # the SipDomain resource.
236
+ # @param [String] domain_sid The unique string that is created to identify the
237
+ # SipDomain resource.
238
238
  # @param [String] sid A 34 character string that uniquely identifies the resource
239
239
  # to fetch.
240
240
  # @return [CredentialListMappingInstance] CredentialListMappingInstance
@@ -246,10 +246,10 @@ module Twilio
246
246
  'account_sid' => payload['account_sid'],
247
247
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
248
248
  'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
249
+ 'domain_sid' => payload['domain_sid'],
249
250
  'friendly_name' => payload['friendly_name'],
250
251
  'sid' => payload['sid'],
251
252
  'uri' => payload['uri'],
252
- 'subresource_uris' => payload['subresource_uris'],
253
253
  }
254
254
 
255
255
  # Context
@@ -295,6 +295,12 @@ module Twilio
295
295
  @properties['date_updated']
296
296
  end
297
297
 
298
+ ##
299
+ # @return [String] The unique string that identifies the SipDomain resource.
300
+ def domain_sid
301
+ @properties['domain_sid']
302
+ end
303
+
298
304
  ##
299
305
  # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
300
306
  def friendly_name
@@ -313,12 +319,6 @@ module Twilio
313
319
  @properties['uri']
314
320
  end
315
321
 
316
- ##
317
- # @return [String] The credentials associated with this resource.
318
- def subresource_uris
319
- @properties['subresource_uris']
320
- end
321
-
322
322
  ##
323
323
  # Fetch the CredentialListMappingInstance
324
324
  # @return [CredentialListMappingInstance] Fetched CredentialListMappingInstance
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] account_sid The unique id of the Account that is responsible for
21
21
  # this resource.
22
- # @param [String] domain_sid The unique string that that we created to identify
23
- # the SipDomain resource.
22
+ # @param [String] domain_sid The unique string that is created to identify the
23
+ # SipDomain resource.
24
24
  # @return [IpAccessControlListMappingList] IpAccessControlListMappingList
25
25
  def initialize(version, account_sid: nil, domain_sid: nil)
26
26
  super(version)
@@ -232,8 +232,8 @@ module Twilio
232
232
  # @param [Hash] payload payload that contains response from Twilio
233
233
  # @param [String] account_sid The unique id of the Account that is responsible for
234
234
  # this resource.
235
- # @param [String] domain_sid The unique string that that we created to identify
236
- # the SipDomain resource.
235
+ # @param [String] domain_sid The unique string that is created to identify the
236
+ # SipDomain resource.
237
237
  # @param [String] sid A 34 character string that uniquely identifies the resource
238
238
  # to fetch.
239
239
  # @return [IpAccessControlListMappingInstance] IpAccessControlListMappingInstance
@@ -245,10 +245,10 @@ module Twilio
245
245
  'account_sid' => payload['account_sid'],
246
246
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
247
247
  'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
248
+ 'domain_sid' => payload['domain_sid'],
248
249
  'friendly_name' => payload['friendly_name'],
249
250
  'sid' => payload['sid'],
250
251
  'uri' => payload['uri'],
251
- 'subresource_uris' => payload['subresource_uris'],
252
252
  }
253
253
 
254
254
  # Context
@@ -294,6 +294,12 @@ module Twilio
294
294
  @properties['date_updated']
295
295
  end
296
296
 
297
+ ##
298
+ # @return [String] The unique string that identifies the SipDomain resource.
299
+ def domain_sid
300
+ @properties['domain_sid']
301
+ end
302
+
297
303
  ##
298
304
  # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
299
305
  def friendly_name
@@ -312,12 +318,6 @@ module Twilio
312
318
  @properties['uri']
313
319
  end
314
320
 
315
- ##
316
- # @return [String] The list of IP addresses associated with this domain.
317
- def subresource_uris
318
- @properties['subresource_uris']
319
- end
320
-
321
321
  ##
322
322
  # Fetch the IpAccessControlListMappingInstance
323
323
  # @return [IpAccessControlListMappingInstance] Fetched IpAccessControlListMappingInstance
@@ -52,6 +52,12 @@ module Twilio
52
52
  self.v1.credentials(sid)
53
53
  end
54
54
 
55
+ ##
56
+ # @return [Twilio::REST::Conversations::V1::ParticipantConversationInstance]
57
+ def participant_conversations
58
+ self.v1.participant_conversations()
59
+ end
60
+
55
61
  ##
56
62
  # @param [String] sid The unique string that we created to identify the Role
57
63
  # resource.
@@ -18,6 +18,7 @@ module Twilio
18
18
  @configuration = nil
19
19
  @conversations = nil
20
20
  @credentials = nil
21
+ @participant_conversations = nil
21
22
  @roles = nil
22
23
  @services = nil
23
24
  @users = nil
@@ -61,6 +62,12 @@ module Twilio
61
62
  end
62
63
  end
63
64
 
65
+ ##
66
+ # @return [Twilio::REST::Conversations::V1::ParticipantConversationContext]
67
+ def participant_conversations
68
+ @participant_conversations ||= ParticipantConversationList.new self
69
+ end
70
+
64
71
  ##
65
72
  # @param [String] sid The SID of the Role resource to fetch.
66
73
  # @return [Twilio::REST::Conversations::V1::RoleContext] if sid was passed.
@@ -0,0 +1,312 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Conversations < Domain
12
+ class V1 < Version
13
+ class ParticipantConversationList < ListResource
14
+ ##
15
+ # Initialize the ParticipantConversationList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [ParticipantConversationList] ParticipantConversationList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/ParticipantConversations"
24
+ end
25
+
26
+ ##
27
+ # Lists ParticipantConversationInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [String] identity A unique string identifier for the conversation
31
+ # participant as {Conversation
32
+ # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This
33
+ # parameter is non-null if (and only if) the participant is using the
34
+ # Conversations SDK to communicate. Limited to 256 characters.
35
+ # @param [String] address A unique string identifier for the conversation
36
+ # participant who's not a Conversation User. This parameter could be found in
37
+ # messaging_binding.address field of Participant resource. It should be
38
+ # url-encoded.
39
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
40
+ # guarantees to never return more than limit. Default is no limit
41
+ # @param [Integer] page_size Number of records to fetch per request, when
42
+ # not set will use the default value of 50 records. If no page_size is defined
43
+ # but a limit is defined, stream() will attempt to read the limit with the most
44
+ # efficient page size, i.e. min(limit, 1000)
45
+ # @return [Array] Array of up to limit results
46
+ def list(identity: :unset, address: :unset, limit: nil, page_size: nil)
47
+ self.stream(identity: identity, address: address, limit: limit, page_size: page_size).entries
48
+ end
49
+
50
+ ##
51
+ # Streams ParticipantConversationInstance records from the API as an Enumerable.
52
+ # This operation lazily loads records as efficiently as possible until the limit
53
+ # is reached.
54
+ # @param [String] identity A unique string identifier for the conversation
55
+ # participant as {Conversation
56
+ # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This
57
+ # parameter is non-null if (and only if) the participant is using the
58
+ # Conversations SDK to communicate. Limited to 256 characters.
59
+ # @param [String] address A unique string identifier for the conversation
60
+ # participant who's not a Conversation User. This parameter could be found in
61
+ # messaging_binding.address field of Participant resource. It should be
62
+ # url-encoded.
63
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
64
+ # guarantees to never return more than limit. Default is no limit.
65
+ # @param [Integer] page_size Number of records to fetch per request, when
66
+ # not set will use the default value of 50 records. If no page_size is defined
67
+ # but a limit is defined, stream() will attempt to read the limit with the most
68
+ # efficient page size, i.e. min(limit, 1000)
69
+ # @return [Enumerable] Enumerable that will yield up to limit results
70
+ def stream(identity: :unset, address: :unset, limit: nil, page_size: nil)
71
+ limits = @version.read_limits(limit, page_size)
72
+
73
+ page = self.page(identity: identity, address: address, page_size: limits[:page_size], )
74
+
75
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
76
+ end
77
+
78
+ ##
79
+ # When passed a block, yields ParticipantConversationInstance records from the API.
80
+ # This operation lazily loads records as efficiently as possible until the limit
81
+ # is reached.
82
+ def each
83
+ limits = @version.read_limits
84
+
85
+ page = self.page(page_size: limits[:page_size], )
86
+
87
+ @version.stream(page,
88
+ limit: limits[:limit],
89
+ page_limit: limits[:page_limit]).each {|x| yield x}
90
+ end
91
+
92
+ ##
93
+ # Retrieve a single page of ParticipantConversationInstance records from the API.
94
+ # Request is executed immediately.
95
+ # @param [String] identity A unique string identifier for the conversation
96
+ # participant as {Conversation
97
+ # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This
98
+ # parameter is non-null if (and only if) the participant is using the
99
+ # Conversations SDK to communicate. Limited to 256 characters.
100
+ # @param [String] address A unique string identifier for the conversation
101
+ # participant who's not a Conversation User. This parameter could be found in
102
+ # messaging_binding.address field of Participant resource. It should be
103
+ # url-encoded.
104
+ # @param [String] page_token PageToken provided by the API
105
+ # @param [Integer] page_number Page Number, this value is simply for client state
106
+ # @param [Integer] page_size Number of records to return, defaults to 50
107
+ # @return [Page] Page of ParticipantConversationInstance
108
+ def page(identity: :unset, address: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
109
+ params = Twilio::Values.of({
110
+ 'Identity' => identity,
111
+ 'Address' => address,
112
+ 'PageToken' => page_token,
113
+ 'Page' => page_number,
114
+ 'PageSize' => page_size,
115
+ })
116
+
117
+ response = @version.page('GET', @uri, params: params)
118
+
119
+ ParticipantConversationPage.new(@version, response, @solution)
120
+ end
121
+
122
+ ##
123
+ # Retrieve a single page of ParticipantConversationInstance records from the API.
124
+ # Request is executed immediately.
125
+ # @param [String] target_url API-generated URL for the requested results page
126
+ # @return [Page] Page of ParticipantConversationInstance
127
+ def get_page(target_url)
128
+ response = @version.domain.request(
129
+ 'GET',
130
+ target_url
131
+ )
132
+ ParticipantConversationPage.new(@version, response, @solution)
133
+ end
134
+
135
+ ##
136
+ # Provide a user friendly representation
137
+ def to_s
138
+ '#<Twilio.Conversations.V1.ParticipantConversationList>'
139
+ end
140
+ end
141
+
142
+ class ParticipantConversationPage < Page
143
+ ##
144
+ # Initialize the ParticipantConversationPage
145
+ # @param [Version] version Version that contains the resource
146
+ # @param [Response] response Response from the API
147
+ # @param [Hash] solution Path solution for the resource
148
+ # @return [ParticipantConversationPage] ParticipantConversationPage
149
+ def initialize(version, response, solution)
150
+ super(version, response)
151
+
152
+ # Path Solution
153
+ @solution = solution
154
+ end
155
+
156
+ ##
157
+ # Build an instance of ParticipantConversationInstance
158
+ # @param [Hash] payload Payload response from the API
159
+ # @return [ParticipantConversationInstance] ParticipantConversationInstance
160
+ def get_instance(payload)
161
+ ParticipantConversationInstance.new(@version, payload, )
162
+ end
163
+
164
+ ##
165
+ # Provide a user friendly representation
166
+ def to_s
167
+ '<Twilio.Conversations.V1.ParticipantConversationPage>'
168
+ end
169
+ end
170
+
171
+ class ParticipantConversationInstance < InstanceResource
172
+ ##
173
+ # Initialize the ParticipantConversationInstance
174
+ # @param [Version] version Version that contains the resource
175
+ # @param [Hash] payload payload that contains response from Twilio
176
+ # @return [ParticipantConversationInstance] ParticipantConversationInstance
177
+ def initialize(version, payload)
178
+ super(version)
179
+
180
+ # Marshaled Properties
181
+ @properties = {
182
+ 'account_sid' => payload['account_sid'],
183
+ 'chat_service_sid' => payload['chat_service_sid'],
184
+ 'participant_sid' => payload['participant_sid'],
185
+ 'participant_user_sid' => payload['participant_user_sid'],
186
+ 'participant_identity' => payload['participant_identity'],
187
+ 'participant_messaging_binding' => payload['participant_messaging_binding'],
188
+ 'conversation_sid' => payload['conversation_sid'],
189
+ 'conversation_unique_name' => payload['conversation_unique_name'],
190
+ 'conversation_friendly_name' => payload['conversation_friendly_name'],
191
+ 'conversation_attributes' => payload['conversation_attributes'],
192
+ 'conversation_date_created' => Twilio.deserialize_iso8601_datetime(payload['conversation_date_created']),
193
+ 'conversation_date_updated' => Twilio.deserialize_iso8601_datetime(payload['conversation_date_updated']),
194
+ 'conversation_created_by' => payload['conversation_created_by'],
195
+ 'conversation_state' => payload['conversation_state'],
196
+ 'conversation_timers' => payload['conversation_timers'],
197
+ 'links' => payload['links'],
198
+ }
199
+ end
200
+
201
+ ##
202
+ # @return [String] The unique ID of the Account responsible for this conversation.
203
+ def account_sid
204
+ @properties['account_sid']
205
+ end
206
+
207
+ ##
208
+ # @return [String] The unique ID of the Conversation Service this conversation belongs to.
209
+ def chat_service_sid
210
+ @properties['chat_service_sid']
211
+ end
212
+
213
+ ##
214
+ # @return [String] The unique ID of the Participant.
215
+ def participant_sid
216
+ @properties['participant_sid']
217
+ end
218
+
219
+ ##
220
+ # @return [String] The unique ID for the conversation participant as Conversation User.
221
+ def participant_user_sid
222
+ @properties['participant_user_sid']
223
+ end
224
+
225
+ ##
226
+ # @return [String] A unique string identifier for the conversation participant as Conversation User.
227
+ def participant_identity
228
+ @properties['participant_identity']
229
+ end
230
+
231
+ ##
232
+ # @return [Hash] Information about how this participant exchanges messages with the conversation.
233
+ def participant_messaging_binding
234
+ @properties['participant_messaging_binding']
235
+ end
236
+
237
+ ##
238
+ # @return [String] The unique ID of the Conversation this Participant belongs to.
239
+ def conversation_sid
240
+ @properties['conversation_sid']
241
+ end
242
+
243
+ ##
244
+ # @return [String] An application-defined string that uniquely identifies the Conversation resource
245
+ def conversation_unique_name
246
+ @properties['conversation_unique_name']
247
+ end
248
+
249
+ ##
250
+ # @return [String] The human-readable name of this conversation.
251
+ def conversation_friendly_name
252
+ @properties['conversation_friendly_name']
253
+ end
254
+
255
+ ##
256
+ # @return [String] An optional string metadata field you can use to store any data you wish.
257
+ def conversation_attributes
258
+ @properties['conversation_attributes']
259
+ end
260
+
261
+ ##
262
+ # @return [Time] The date that this conversation was created.
263
+ def conversation_date_created
264
+ @properties['conversation_date_created']
265
+ end
266
+
267
+ ##
268
+ # @return [Time] The date that this conversation was last updated.
269
+ def conversation_date_updated
270
+ @properties['conversation_date_updated']
271
+ end
272
+
273
+ ##
274
+ # @return [String] Creator of this conversation.
275
+ def conversation_created_by
276
+ @properties['conversation_created_by']
277
+ end
278
+
279
+ ##
280
+ # @return [participant_conversation.State] The current state of this User Conversation
281
+ def conversation_state
282
+ @properties['conversation_state']
283
+ end
284
+
285
+ ##
286
+ # @return [Hash] Timer date values for this conversation.
287
+ def conversation_timers
288
+ @properties['conversation_timers']
289
+ end
290
+
291
+ ##
292
+ # @return [String] Absolute URLs to access the participant and conversation of this Participant Conversation.
293
+ def links
294
+ @properties['links']
295
+ end
296
+
297
+ ##
298
+ # Provide a user friendly representation
299
+ def to_s
300
+ "<Twilio.Conversations.V1.ParticipantConversationInstance>"
301
+ end
302
+
303
+ ##
304
+ # Provide a detailed, user friendly representation
305
+ def inspect
306
+ "<Twilio.Conversations.V1.ParticipantConversationInstance>"
307
+ end
308
+ end
309
+ end
310
+ end
311
+ end
312
+ end