twilio-ruby 5.65.1 → 5.66.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +28 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +4 -4
  6. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +10 -10
  7. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  8. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  9. data/lib/twilio-ruby/rest/chat.rb +16 -0
  10. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  11. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  12. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  13. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +377 -0
  14. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  15. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  16. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  17. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  18. data/lib/twilio-ruby/rest/insights/v1.rb +16 -0
  19. data/lib/twilio-ruby/rest/insights.rb +8 -0
  20. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  21. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +26 -5
  22. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +14 -1
  23. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +3 -55
  24. data/lib/twilio-ruby/rest/supersim/v1.rb +0 -16
  25. data/lib/twilio-ruby/rest/supersim.rb +0 -9
  26. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  27. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  28. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  29. data/lib/twilio-ruby/rest/video/v1/composition.rb +14 -0
  30. data/lib/twilio-ruby/rest/video/v1/recording.rb +14 -0
  31. data/lib/twilio-ruby/version.rb +1 -1
  32. metadata +9 -3
  33. data/lib/twilio-ruby/rest/supersim/v1/command.rb +0 -368
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8c2b361aa0bcd563896d6fd8ef7d05b8190b5b8
4
- data.tar.gz: aa8937ed8cdd6e0028547310216ef1735a4c80ea
3
+ metadata.gz: 05d747e6afb3147d260dc189582592a19e650957
4
+ data.tar.gz: 07114f3240dfeebbdd9d3128a6631d6b40255a41
5
5
  SHA512:
6
- metadata.gz: a82d6f932c04746c60217ec81ef4b5708fbbcb4df2fff128a5d01933d4bb86fa45c464805da63ca96c6e0bf8c2ca1cf75d9aea18f799f674b8674aae65b45d32
7
- data.tar.gz: 6a0ff25c7f663d9c51390deb16e9fe3f37b98ebc1fc5d7ccf973ef61bfb6655b37411da34543072cab27d8c13a5847bcceb62fe3110e1b9f785cd81ea212bf6f
6
+ metadata.gz: cceca2b0801fc90db7e7671ef014bfd0d962e44a732be30b6d8e32fa00006cfb9cbcf9742e3ca4848b35f6cf2ea7ca8c6cf3e9a5b078a3a9dd3f900ed19f9f9a
7
+ data.tar.gz: 8d735e1c20ec6c1d5b151ffb100bcad25413bd67e935104bf0b3d6fc4070fc1598c8c8e66427295e54507dcf7fd456a71e45de4b3ef4fc58af8eddadad280bfb
data/CHANGES.md CHANGED
@@ -1,6 +1,34 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2022-03-23] Version 5.66.0
5
+ ---------------------------
6
+ **Api**
7
+ - Change `stream` url parameter to non optional
8
+ - Add `verify-totp` and `verify-whatsapp-conversations-business-initiated` categories to `usage_record` API
9
+
10
+ **Chat**
11
+ - Added v3 Channel update endpoint to support Public to Private channel migration
12
+
13
+ **Flex**
14
+ - Private Beta release of the Interactions API to support the upcoming release of Flex Conversations at the end of Q1 2022.
15
+ - Adding `channel_configs` object to Flex Configuration
16
+
17
+ **Media**
18
+ - Add max_duration param to PlayerStreamer
19
+
20
+ **Supersim**
21
+ - Remove Commands resource, use SmsCommands resource instead **(breaking change)**
22
+
23
+ **Taskrouter**
24
+ - Add limits to `split_by_wait_time` for Cumulative Statistics Endpoint
25
+
26
+ **Video**
27
+ - Change recording `status_callback_method` type from `enum` to `http_method` **(breaking change)**
28
+ - Add `status_callback` and `status_callback_method` to composition
29
+ - Add `status_callback` and `status_callback_method` to recording
30
+
31
+
4
32
  [2022-03-09] Version 5.65.1
5
33
  ---------------------------
6
34
  **Library - Fix**
data/README.md CHANGED
@@ -36,13 +36,13 @@ This library supports the following Ruby implementations:
36
36
  To install using [Bundler][bundler] grab the latest stable version:
37
37
 
38
38
  ```ruby
39
- gem 'twilio-ruby', '~> 5.65.1'
39
+ gem 'twilio-ruby', '~> 5.66.0'
40
40
  ```
41
41
 
42
42
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
43
43
 
44
44
  ```bash
45
- gem install twilio-ruby -v 5.65.1
45
+ gem install twilio-ruby -v 5.66.0
46
46
  ```
47
47
 
48
48
  To build and install the development branch yourself from the latest source:
@@ -63,8 +63,8 @@ module Twilio
63
63
  # @param [String] min_postal_code_length A positive integer that is used to
64
64
  # validate the length of the `PostalCode` inputted by the user. User must enter
65
65
  # this many digits.
66
- # @param [Hash] parameter A single level JSON string that is required when
67
- # accepting certain information specific only to ACH payments. The information
66
+ # @param [Hash] parameter A single-level JSON object used to pass custom
67
+ # parameters to payment processors. (Required for ACH payments). The information
68
68
  # that has to be included here depends on the <Pay> Connector. {Read
69
69
  # more}[https://www.twilio.com/console/voice/pay-connectors].
70
70
  # @param [String] payment_connector This is the unique name corresponding to the
@@ -33,10 +33,10 @@ module Twilio
33
33
 
34
34
  ##
35
35
  # Create the StreamInstance
36
- # @param [String] name The user-specified name of this Stream, if one was given
37
- # when the Stream was created. This may be used to stop the Stream.
38
36
  # @param [String] url Relative or absolute url where WebSocket connection will be
39
37
  # established.
38
+ # @param [String] name The user-specified name of this Stream, if one was given
39
+ # when the Stream was created. This may be used to stop the Stream.
40
40
  # @param [stream.Track] track One of `inbound_track`, `outbound_track`,
41
41
  # `both_tracks`.
42
42
  # @param [String] status_callback Absolute URL of the status callback.
@@ -241,10 +241,10 @@ module Twilio
241
241
  # @param [String] parameter99_name Parameter name
242
242
  # @param [String] parameter99_value Parameter value
243
243
  # @return [StreamInstance] Created StreamInstance
244
- def create(name: :unset, url: :unset, track: :unset, status_callback: :unset, status_callback_method: :unset, parameter1_name: :unset, parameter1_value: :unset, parameter2_name: :unset, parameter2_value: :unset, parameter3_name: :unset, parameter3_value: :unset, parameter4_name: :unset, parameter4_value: :unset, parameter5_name: :unset, parameter5_value: :unset, parameter6_name: :unset, parameter6_value: :unset, parameter7_name: :unset, parameter7_value: :unset, parameter8_name: :unset, parameter8_value: :unset, parameter9_name: :unset, parameter9_value: :unset, parameter10_name: :unset, parameter10_value: :unset, parameter11_name: :unset, parameter11_value: :unset, parameter12_name: :unset, parameter12_value: :unset, parameter13_name: :unset, parameter13_value: :unset, parameter14_name: :unset, parameter14_value: :unset, parameter15_name: :unset, parameter15_value: :unset, parameter16_name: :unset, parameter16_value: :unset, parameter17_name: :unset, parameter17_value: :unset, parameter18_name: :unset, parameter18_value: :unset, parameter19_name: :unset, parameter19_value: :unset, parameter20_name: :unset, parameter20_value: :unset, parameter21_name: :unset, parameter21_value: :unset, parameter22_name: :unset, parameter22_value: :unset, parameter23_name: :unset, parameter23_value: :unset, parameter24_name: :unset, parameter24_value: :unset, parameter25_name: :unset, parameter25_value: :unset, parameter26_name: :unset, parameter26_value: :unset, parameter27_name: :unset, parameter27_value: :unset, parameter28_name: :unset, parameter28_value: :unset, parameter29_name: :unset, parameter29_value: :unset, parameter30_name: :unset, parameter30_value: :unset, parameter31_name: :unset, parameter31_value: :unset, parameter32_name: :unset, parameter32_value: :unset, parameter33_name: :unset, parameter33_value: :unset, parameter34_name: :unset, parameter34_value: :unset, parameter35_name: :unset, parameter35_value: :unset, parameter36_name: :unset, parameter36_value: :unset, parameter37_name: :unset, parameter37_value: :unset, parameter38_name: :unset, parameter38_value: :unset, parameter39_name: :unset, parameter39_value: :unset, parameter40_name: :unset, parameter40_value: :unset, parameter41_name: :unset, parameter41_value: :unset, parameter42_name: :unset, parameter42_value: :unset, parameter43_name: :unset, parameter43_value: :unset, parameter44_name: :unset, parameter44_value: :unset, parameter45_name: :unset, parameter45_value: :unset, parameter46_name: :unset, parameter46_value: :unset, parameter47_name: :unset, parameter47_value: :unset, parameter48_name: :unset, parameter48_value: :unset, parameter49_name: :unset, parameter49_value: :unset, parameter50_name: :unset, parameter50_value: :unset, parameter51_name: :unset, parameter51_value: :unset, parameter52_name: :unset, parameter52_value: :unset, parameter53_name: :unset, parameter53_value: :unset, parameter54_name: :unset, parameter54_value: :unset, parameter55_name: :unset, parameter55_value: :unset, parameter56_name: :unset, parameter56_value: :unset, parameter57_name: :unset, parameter57_value: :unset, parameter58_name: :unset, parameter58_value: :unset, parameter59_name: :unset, parameter59_value: :unset, parameter60_name: :unset, parameter60_value: :unset, parameter61_name: :unset, parameter61_value: :unset, parameter62_name: :unset, parameter62_value: :unset, parameter63_name: :unset, parameter63_value: :unset, parameter64_name: :unset, parameter64_value: :unset, parameter65_name: :unset, parameter65_value: :unset, parameter66_name: :unset, parameter66_value: :unset, parameter67_name: :unset, parameter67_value: :unset, parameter68_name: :unset, parameter68_value: :unset, parameter69_name: :unset, parameter69_value: :unset, parameter70_name: :unset, parameter70_value: :unset, parameter71_name: :unset, parameter71_value: :unset, parameter72_name: :unset, parameter72_value: :unset, parameter73_name: :unset, parameter73_value: :unset, parameter74_name: :unset, parameter74_value: :unset, parameter75_name: :unset, parameter75_value: :unset, parameter76_name: :unset, parameter76_value: :unset, parameter77_name: :unset, parameter77_value: :unset, parameter78_name: :unset, parameter78_value: :unset, parameter79_name: :unset, parameter79_value: :unset, parameter80_name: :unset, parameter80_value: :unset, parameter81_name: :unset, parameter81_value: :unset, parameter82_name: :unset, parameter82_value: :unset, parameter83_name: :unset, parameter83_value: :unset, parameter84_name: :unset, parameter84_value: :unset, parameter85_name: :unset, parameter85_value: :unset, parameter86_name: :unset, parameter86_value: :unset, parameter87_name: :unset, parameter87_value: :unset, parameter88_name: :unset, parameter88_value: :unset, parameter89_name: :unset, parameter89_value: :unset, parameter90_name: :unset, parameter90_value: :unset, parameter91_name: :unset, parameter91_value: :unset, parameter92_name: :unset, parameter92_value: :unset, parameter93_name: :unset, parameter93_value: :unset, parameter94_name: :unset, parameter94_value: :unset, parameter95_name: :unset, parameter95_value: :unset, parameter96_name: :unset, parameter96_value: :unset, parameter97_name: :unset, parameter97_value: :unset, parameter98_name: :unset, parameter98_value: :unset, parameter99_name: :unset, parameter99_value: :unset)
244
+ def create(url: nil, name: :unset, track: :unset, status_callback: :unset, status_callback_method: :unset, parameter1_name: :unset, parameter1_value: :unset, parameter2_name: :unset, parameter2_value: :unset, parameter3_name: :unset, parameter3_value: :unset, parameter4_name: :unset, parameter4_value: :unset, parameter5_name: :unset, parameter5_value: :unset, parameter6_name: :unset, parameter6_value: :unset, parameter7_name: :unset, parameter7_value: :unset, parameter8_name: :unset, parameter8_value: :unset, parameter9_name: :unset, parameter9_value: :unset, parameter10_name: :unset, parameter10_value: :unset, parameter11_name: :unset, parameter11_value: :unset, parameter12_name: :unset, parameter12_value: :unset, parameter13_name: :unset, parameter13_value: :unset, parameter14_name: :unset, parameter14_value: :unset, parameter15_name: :unset, parameter15_value: :unset, parameter16_name: :unset, parameter16_value: :unset, parameter17_name: :unset, parameter17_value: :unset, parameter18_name: :unset, parameter18_value: :unset, parameter19_name: :unset, parameter19_value: :unset, parameter20_name: :unset, parameter20_value: :unset, parameter21_name: :unset, parameter21_value: :unset, parameter22_name: :unset, parameter22_value: :unset, parameter23_name: :unset, parameter23_value: :unset, parameter24_name: :unset, parameter24_value: :unset, parameter25_name: :unset, parameter25_value: :unset, parameter26_name: :unset, parameter26_value: :unset, parameter27_name: :unset, parameter27_value: :unset, parameter28_name: :unset, parameter28_value: :unset, parameter29_name: :unset, parameter29_value: :unset, parameter30_name: :unset, parameter30_value: :unset, parameter31_name: :unset, parameter31_value: :unset, parameter32_name: :unset, parameter32_value: :unset, parameter33_name: :unset, parameter33_value: :unset, parameter34_name: :unset, parameter34_value: :unset, parameter35_name: :unset, parameter35_value: :unset, parameter36_name: :unset, parameter36_value: :unset, parameter37_name: :unset, parameter37_value: :unset, parameter38_name: :unset, parameter38_value: :unset, parameter39_name: :unset, parameter39_value: :unset, parameter40_name: :unset, parameter40_value: :unset, parameter41_name: :unset, parameter41_value: :unset, parameter42_name: :unset, parameter42_value: :unset, parameter43_name: :unset, parameter43_value: :unset, parameter44_name: :unset, parameter44_value: :unset, parameter45_name: :unset, parameter45_value: :unset, parameter46_name: :unset, parameter46_value: :unset, parameter47_name: :unset, parameter47_value: :unset, parameter48_name: :unset, parameter48_value: :unset, parameter49_name: :unset, parameter49_value: :unset, parameter50_name: :unset, parameter50_value: :unset, parameter51_name: :unset, parameter51_value: :unset, parameter52_name: :unset, parameter52_value: :unset, parameter53_name: :unset, parameter53_value: :unset, parameter54_name: :unset, parameter54_value: :unset, parameter55_name: :unset, parameter55_value: :unset, parameter56_name: :unset, parameter56_value: :unset, parameter57_name: :unset, parameter57_value: :unset, parameter58_name: :unset, parameter58_value: :unset, parameter59_name: :unset, parameter59_value: :unset, parameter60_name: :unset, parameter60_value: :unset, parameter61_name: :unset, parameter61_value: :unset, parameter62_name: :unset, parameter62_value: :unset, parameter63_name: :unset, parameter63_value: :unset, parameter64_name: :unset, parameter64_value: :unset, parameter65_name: :unset, parameter65_value: :unset, parameter66_name: :unset, parameter66_value: :unset, parameter67_name: :unset, parameter67_value: :unset, parameter68_name: :unset, parameter68_value: :unset, parameter69_name: :unset, parameter69_value: :unset, parameter70_name: :unset, parameter70_value: :unset, parameter71_name: :unset, parameter71_value: :unset, parameter72_name: :unset, parameter72_value: :unset, parameter73_name: :unset, parameter73_value: :unset, parameter74_name: :unset, parameter74_value: :unset, parameter75_name: :unset, parameter75_value: :unset, parameter76_name: :unset, parameter76_value: :unset, parameter77_name: :unset, parameter77_value: :unset, parameter78_name: :unset, parameter78_value: :unset, parameter79_name: :unset, parameter79_value: :unset, parameter80_name: :unset, parameter80_value: :unset, parameter81_name: :unset, parameter81_value: :unset, parameter82_name: :unset, parameter82_value: :unset, parameter83_name: :unset, parameter83_value: :unset, parameter84_name: :unset, parameter84_value: :unset, parameter85_name: :unset, parameter85_value: :unset, parameter86_name: :unset, parameter86_value: :unset, parameter87_name: :unset, parameter87_value: :unset, parameter88_name: :unset, parameter88_value: :unset, parameter89_name: :unset, parameter89_value: :unset, parameter90_name: :unset, parameter90_value: :unset, parameter91_name: :unset, parameter91_value: :unset, parameter92_name: :unset, parameter92_value: :unset, parameter93_name: :unset, parameter93_value: :unset, parameter94_name: :unset, parameter94_value: :unset, parameter95_name: :unset, parameter95_value: :unset, parameter96_name: :unset, parameter96_value: :unset, parameter97_name: :unset, parameter97_value: :unset, parameter98_name: :unset, parameter98_value: :unset, parameter99_name: :unset, parameter99_value: :unset)
245
245
  data = Twilio::Values.of({
246
- 'Name' => name,
247
246
  'Url' => url,
247
+ 'Name' => name,
248
248
  'Track' => track,
249
249
  'StatusCallback' => status_callback,
250
250
  'StatusCallbackMethod' => status_callback_method,
@@ -40,8 +40,8 @@ module Twilio
40
40
  # @param [String] conference_sid The Conference SID that identifies the conference
41
41
  # associated with the recording to read.
42
42
  # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
43
- # retrieve soft deleted recordings or not. Recordings are kept after deletion for
44
- # a retention period of 40 days.
43
+ # retrieve soft deleted recordings or not. Recordings metadata are kept after
44
+ # deletion for a retention period of 40 days.
45
45
  # @param [Integer] limit Upper limit for the number of records to return. stream()
46
46
  # guarantees to never return more than limit. Default is no limit
47
47
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -75,8 +75,8 @@ module Twilio
75
75
  # @param [String] conference_sid The Conference SID that identifies the conference
76
76
  # associated with the recording to read.
77
77
  # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
78
- # retrieve soft deleted recordings or not. Recordings are kept after deletion for
79
- # a retention period of 40 days.
78
+ # retrieve soft deleted recordings or not. Recordings metadata are kept after
79
+ # deletion for a retention period of 40 days.
80
80
  # @param [Integer] limit Upper limit for the number of records to return. stream()
81
81
  # guarantees to never return more than limit. Default is no limit.
82
82
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -126,8 +126,8 @@ module Twilio
126
126
  # @param [String] conference_sid The Conference SID that identifies the conference
127
127
  # associated with the recording to read.
128
128
  # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
129
- # retrieve soft deleted recordings or not. Recordings are kept after deletion for
130
- # a retention period of 40 days.
129
+ # retrieve soft deleted recordings or not. Recordings metadata are kept after
130
+ # deletion for a retention period of 40 days.
131
131
  # @param [String] page_token PageToken provided by the API
132
132
  # @param [Integer] page_number Page Number, this value is simply for client state
133
133
  # @param [Integer] page_size Number of records to return, defaults to 50
@@ -224,8 +224,8 @@ module Twilio
224
224
  ##
225
225
  # Fetch the RecordingInstance
226
226
  # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
227
- # retrieve soft deleted recordings or not. Recordings are kept after deletion for
228
- # a retention period of 40 days.
227
+ # retrieve soft deleted recordings or not. Recordings metadata are kept after
228
+ # deletion for a retention period of 40 days.
229
229
  # @return [RecordingInstance] Fetched RecordingInstance
230
230
  def fetch(include_soft_deleted: :unset)
231
231
  params = Twilio::Values.of({'IncludeSoftDeleted' => include_soft_deleted, })
@@ -464,8 +464,8 @@ module Twilio
464
464
  ##
465
465
  # Fetch the RecordingInstance
466
466
  # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
467
- # retrieve soft deleted recordings or not. Recordings are kept after deletion for
468
- # a retention period of 40 days.
467
+ # retrieve soft deleted recordings or not. Recordings metadata are kept after
468
+ # deletion for a retention period of 40 days.
469
469
  # @return [RecordingInstance] Fetched RecordingInstance
470
470
  def fetch(include_soft_deleted: :unset)
471
471
  context.fetch(include_soft_deleted: include_soft_deleted, )
@@ -0,0 +1,275 @@
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 Chat < Domain
12
+ class V3 < Version
13
+ class ChannelList < ListResource
14
+ ##
15
+ # Initialize the ChannelList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [ChannelList] ChannelList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Chat.V3.ChannelList>'
29
+ end
30
+ end
31
+
32
+ class ChannelPage < Page
33
+ ##
34
+ # Initialize the ChannelPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [ChannelPage] ChannelPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of ChannelInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [ChannelInstance] ChannelInstance
50
+ def get_instance(payload)
51
+ ChannelInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Chat.V3.ChannelPage>'
58
+ end
59
+ end
60
+
61
+ class ChannelContext < InstanceContext
62
+ ##
63
+ # Initialize the ChannelContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] service_sid The unique SID identifier of the Service.
66
+ # @param [String] sid A 34 character string that uniquely identifies this Channel.
67
+ # @return [ChannelContext] ChannelContext
68
+ def initialize(version, service_sid, sid)
69
+ super(version)
70
+
71
+ # Path Solution
72
+ @solution = {service_sid: service_sid, sid: sid, }
73
+ @uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:sid]}"
74
+ end
75
+
76
+ ##
77
+ # Update the ChannelInstance
78
+ # @param [channel.ChannelType] type TThe Type for this Channel to migrate to. Can
79
+ # only be `private`. Migration to 'public' is not allowed.
80
+ # @param [String] messaging_service_sid The unique ID of the {Messaging
81
+ # Service}[https://www.twilio.com/docs/sms/services/api] this channel belongs to.
82
+ # @param [channel.WebhookEnabledType] x_twilio_webhook_enabled The
83
+ # X-Twilio-Webhook-Enabled HTTP request header
84
+ # @return [ChannelInstance] Updated ChannelInstance
85
+ def update(type: :unset, messaging_service_sid: :unset, x_twilio_webhook_enabled: :unset)
86
+ data = Twilio::Values.of({'Type' => type, 'MessagingServiceSid' => messaging_service_sid, })
87
+ headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
88
+
89
+ payload = @version.update('POST', @uri, data: data, headers: headers)
90
+
91
+ ChannelInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], )
92
+ end
93
+
94
+ ##
95
+ # Provide a user friendly representation
96
+ def to_s
97
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
98
+ "#<Twilio.Chat.V3.ChannelContext #{context}>"
99
+ end
100
+
101
+ ##
102
+ # Provide a detailed, user friendly representation
103
+ def inspect
104
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
105
+ "#<Twilio.Chat.V3.ChannelContext #{context}>"
106
+ end
107
+ end
108
+
109
+ class ChannelInstance < InstanceResource
110
+ ##
111
+ # Initialize the ChannelInstance
112
+ # @param [Version] version Version that contains the resource
113
+ # @param [Hash] payload payload that contains response from Twilio
114
+ # @param [String] service_sid The unique SID identifier of the Service.
115
+ # @param [String] sid A 34 character string that uniquely identifies this Channel.
116
+ # @return [ChannelInstance] ChannelInstance
117
+ def initialize(version, payload, service_sid: nil, sid: nil)
118
+ super(version)
119
+
120
+ # Marshaled Properties
121
+ @properties = {
122
+ 'sid' => payload['sid'],
123
+ 'account_sid' => payload['account_sid'],
124
+ 'service_sid' => payload['service_sid'],
125
+ 'friendly_name' => payload['friendly_name'],
126
+ 'unique_name' => payload['unique_name'],
127
+ 'attributes' => payload['attributes'],
128
+ 'type' => payload['type'],
129
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
130
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
131
+ 'created_by' => payload['created_by'],
132
+ 'members_count' => payload['members_count'].to_i,
133
+ 'messages_count' => payload['messages_count'].to_i,
134
+ 'messaging_service_sid' => payload['messaging_service_sid'],
135
+ 'url' => payload['url'],
136
+ }
137
+
138
+ # Context
139
+ @instance_context = nil
140
+ @params = {
141
+ 'service_sid' => service_sid || @properties['service_sid'],
142
+ 'sid' => sid || @properties['sid'],
143
+ }
144
+ end
145
+
146
+ ##
147
+ # Generate an instance context for the instance, the context is capable of
148
+ # performing various actions. All instance actions are proxied to the context
149
+ # @return [ChannelContext] ChannelContext for this ChannelInstance
150
+ def context
151
+ unless @instance_context
152
+ @instance_context = ChannelContext.new(@version, @params['service_sid'], @params['sid'], )
153
+ end
154
+ @instance_context
155
+ end
156
+
157
+ ##
158
+ # @return [String] The unique string that identifies the resource
159
+ def sid
160
+ @properties['sid']
161
+ end
162
+
163
+ ##
164
+ # @return [String] The SID of the Account that created the resource
165
+ def account_sid
166
+ @properties['account_sid']
167
+ end
168
+
169
+ ##
170
+ # @return [String] The SID of the Service that the resource is associated with
171
+ def service_sid
172
+ @properties['service_sid']
173
+ end
174
+
175
+ ##
176
+ # @return [String] The string that you assigned to describe the resource
177
+ def friendly_name
178
+ @properties['friendly_name']
179
+ end
180
+
181
+ ##
182
+ # @return [String] An application-defined string that uniquely identifies the resource
183
+ def unique_name
184
+ @properties['unique_name']
185
+ end
186
+
187
+ ##
188
+ # @return [String] The JSON string that stores application-specific data
189
+ def attributes
190
+ @properties['attributes']
191
+ end
192
+
193
+ ##
194
+ # @return [channel.ChannelType] The visibility of the channel. Can be: `public` or `private`
195
+ def type
196
+ @properties['type']
197
+ end
198
+
199
+ ##
200
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
201
+ def date_created
202
+ @properties['date_created']
203
+ end
204
+
205
+ ##
206
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
207
+ def date_updated
208
+ @properties['date_updated']
209
+ end
210
+
211
+ ##
212
+ # @return [String] The identity of the User that created the channel
213
+ def created_by
214
+ @properties['created_by']
215
+ end
216
+
217
+ ##
218
+ # @return [String] The number of Members in the Channel
219
+ def members_count
220
+ @properties['members_count']
221
+ end
222
+
223
+ ##
224
+ # @return [String] The number of Messages that have been passed in the Channel
225
+ def messages_count
226
+ @properties['messages_count']
227
+ end
228
+
229
+ ##
230
+ # @return [String] The unique ID of the Messaging Service this channel belongs to.
231
+ def messaging_service_sid
232
+ @properties['messaging_service_sid']
233
+ end
234
+
235
+ ##
236
+ # @return [String] The absolute URL of the Channel resource
237
+ def url
238
+ @properties['url']
239
+ end
240
+
241
+ ##
242
+ # Update the ChannelInstance
243
+ # @param [channel.ChannelType] type TThe Type for this Channel to migrate to. Can
244
+ # only be `private`. Migration to 'public' is not allowed.
245
+ # @param [String] messaging_service_sid The unique ID of the {Messaging
246
+ # Service}[https://www.twilio.com/docs/sms/services/api] this channel belongs to.
247
+ # @param [channel.WebhookEnabledType] x_twilio_webhook_enabled The
248
+ # X-Twilio-Webhook-Enabled HTTP request header
249
+ # @return [ChannelInstance] Updated ChannelInstance
250
+ def update(type: :unset, messaging_service_sid: :unset, x_twilio_webhook_enabled: :unset)
251
+ context.update(
252
+ type: type,
253
+ messaging_service_sid: messaging_service_sid,
254
+ x_twilio_webhook_enabled: x_twilio_webhook_enabled,
255
+ )
256
+ end
257
+
258
+ ##
259
+ # Provide a user friendly representation
260
+ def to_s
261
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
262
+ "<Twilio.Chat.V3.ChannelInstance #{values}>"
263
+ end
264
+
265
+ ##
266
+ # Provide a detailed, user friendly representation
267
+ def inspect
268
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
269
+ "<Twilio.Chat.V3.ChannelInstance #{values}>"
270
+ end
271
+ end
272
+ end
273
+ end
274
+ end
275
+ end
@@ -0,0 +1,48 @@
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 Chat
12
+ class V3 < Version
13
+ ##
14
+ # Initialize the V3 version of Chat
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v3'
18
+ @channels = nil
19
+ end
20
+
21
+ ##
22
+ # @param [String] service_sid The unique SID identifier of the Service.
23
+ # @param [String] sid A 34 character string that uniquely identifies this Channel.
24
+ # @return [Twilio::REST::Chat::V3::ChannelContext] if sid was passed.
25
+ # @return [Twilio::REST::Chat::V3::ChannelList]
26
+ def channels(service_sid=:unset, sid=:unset)
27
+ if service_sid.nil?
28
+ raise ArgumentError, 'service_sid cannot be nil'
29
+ end
30
+ if sid.nil?
31
+ raise ArgumentError, 'sid cannot be nil'
32
+ end
33
+ if service_sid == :unset && sid == :unset
34
+ @channels ||= ChannelList.new self
35
+ else
36
+ ChannelContext.new(self, service_sid, sid)
37
+ end
38
+ end
39
+
40
+ ##
41
+ # Provide a user friendly representation
42
+ def to_s
43
+ '<Twilio::REST::Chat::V3>'
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -21,6 +21,7 @@ module Twilio
21
21
  # Versions
22
22
  @v1 = nil
23
23
  @v2 = nil
24
+ @v3 = nil
24
25
  end
25
26
 
26
27
  ##
@@ -35,6 +36,12 @@ module Twilio
35
36
  @v2 ||= V2.new self
36
37
  end
37
38
 
39
+ ##
40
+ # Version v3 of chat
41
+ def v3
42
+ @v3 ||= V3.new self
43
+ end
44
+
38
45
  ##
39
46
  # @param [String] sid The unique string that we created to identify the Credential
40
47
  # resource.
@@ -53,6 +60,15 @@ module Twilio
53
60
  self.v2.services(sid)
54
61
  end
55
62
 
63
+ ##
64
+ # @param [String] sid The unique string that we created to identify the Channel
65
+ # resource.
66
+ # @return [Twilio::REST::Chat::V3::ChannelInstance] if sid was passed.
67
+ # @return [Twilio::REST::Chat::V3::ChannelList]
68
+ def channels(service_sid=:unset, sid=:unset)
69
+ self.v3.channels(service_sid, sid)
70
+ end
71
+
56
72
  ##
57
73
  # Provide a user friendly representation
58
74
  def to_s
@@ -170,6 +170,7 @@ module Twilio
170
170
  'flex_insights_hr' => payload['flex_insights_hr'],
171
171
  'flex_insights_drilldown' => payload['flex_insights_drilldown'],
172
172
  'flex_url' => payload['flex_url'],
173
+ 'channel_configs' => payload['channel_configs'],
173
174
  }
174
175
 
175
176
  # Context
@@ -440,6 +441,12 @@ module Twilio
440
441
  @properties['flex_url']
441
442
  end
442
443
 
444
+ ##
445
+ # @return [Array[Hash]] Flex Conversations channels' attachments configurations
446
+ def channel_configs
447
+ @properties['channel_configs']
448
+ end
449
+
443
450
  ##
444
451
  # Fetch the ConfigurationInstance
445
452
  # @param [String] ui_version The Pinned UI version of the Configuration resource