twilio-ruby 5.33.0 → 5.36.0

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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -0
  3. data/.rubocop_todo.yml +5 -26
  4. data/.travis.yml +9 -1
  5. data/CHANGES.md +110 -0
  6. data/README.md +17 -2
  7. data/lib/twilio-ruby.rb +4 -12
  8. data/lib/twilio-ruby/framework/error.rb +3 -3
  9. data/lib/twilio-ruby/jwt/jwt.rb +6 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +90 -90
  11. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +75 -72
  13. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  14. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  15. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  16. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  17. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  18. data/lib/twilio-ruby/rest/client.rb +35 -8
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +19 -3
  20. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  21. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  22. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  23. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +20 -11
  24. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  26. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  27. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +239 -0
  28. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +197 -0
  30. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  31. data/lib/twilio-ruby/rest/studio.rb +2 -2
  32. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +26 -0
  33. data/lib/twilio-ruby/rest/studio/v2.rb +3 -3
  34. data/lib/twilio-ruby/rest/studio/v2/flow.rb +7 -0
  35. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +71 -24
  36. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +12 -11
  37. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +21 -20
  38. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +18 -15
  39. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  40. data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
  41. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +53 -10
  42. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  43. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +378 -0
  44. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  45. data/lib/twilio-ruby/rest/verify.rb +9 -0
  46. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  47. data/lib/twilio-ruby/rest/verify/v2/form.rb +197 -0
  48. data/lib/twilio-ruby/rest/verify/v2/service.rb +48 -3
  49. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +379 -0
  50. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +500 -0
  51. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor/challenge.rb +494 -0
  52. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  53. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -12
  54. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -12
  55. data/lib/twilio-ruby/rest/voice.rb +36 -0
  56. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  57. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  58. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  59. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  60. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  61. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  62. data/lib/twilio-ruby/twiml/twiml.rb +4 -0
  63. data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
  64. data/lib/twilio-ruby/util/configuration.rb +9 -1
  65. data/lib/twilio-ruby/version.rb +1 -1
  66. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  67. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  68. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  69. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  70. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  71. data/spec/integration/bulkexports/v1/export/day_spec.rb +1 -1
  72. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  73. data/spec/integration/conversations/v1/conversation_spec.rb +4 -0
  74. data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
  75. data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
  76. data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
  77. data/spec/integration/preview/bulk_exports/export/day_spec.rb +1 -1
  78. data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
  79. data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
  80. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
  81. data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
  82. data/spec/integration/serverless/v1/service/asset/asset_version_spec.rb +1 -1
  83. data/spec/integration/serverless/v1/service/build_spec.rb +4 -4
  84. data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
  85. data/spec/integration/serverless/v1/service/function/function_version_spec.rb +1 -1
  86. data/spec/integration/studio/v1/flow/execution_spec.rb +46 -0
  87. data/spec/integration/studio/v2/flow/execution_spec.rb +45 -0
  88. data/spec/integration/studio/v2/flow_spec.rb +4 -0
  89. data/spec/integration/studio/v2/flow_validate_spec.rb +2 -2
  90. data/spec/integration/supersim/v1/fleet_spec.rb +12 -4
  91. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  92. data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
  93. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  94. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  95. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  96. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  97. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  98. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  99. data/spec/integration/verify/v2/form_spec.rb +48 -0
  100. data/spec/integration/verify/v2/service/entity/factor/challenge_spec.rb +353 -0
  101. data/spec/integration/verify/v2/service/entity/factor_spec.rb +298 -0
  102. data/spec/integration/verify/v2/service/entity_spec.rb +201 -0
  103. data/spec/integration/verify/v2/service_spec.rb +28 -4
  104. data/spec/integration/video/v1/composition_settings_spec.rb +2 -2
  105. data/spec/integration/video/v1/recording_settings_spec.rb +2 -2
  106. data/spec/integration/video/v1/recording_spec.rb +2 -2
  107. data/spec/integration/video/v1/room/recording_spec.rb +2 -2
  108. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  109. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  110. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  111. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  112. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  113. data/spec/rest/client_spec.rb +173 -23
  114. data/spec/util/configuration_spec.rb +12 -0
  115. data/twilio-ruby.gemspec +4 -4
  116. metadata +67 -10
@@ -37,6 +37,12 @@ module Twilio
37
37
  self.v1.assistants(sid)
38
38
  end
39
39
 
40
+ ##
41
+ # @return [Twilio::REST::Autopilot::V1::RestoreAssistantInstance]
42
+ def restore_assistant
43
+ self.v1.restore_assistant()
44
+ end
45
+
40
46
  ##
41
47
  # Provide a user friendly representation
42
48
  def to_s
@@ -16,6 +16,7 @@ module Twilio
16
16
  super
17
17
  @version = 'v1'
18
18
  @assistants = nil
19
+ @restore_assistant = nil
19
20
  end
20
21
 
21
22
  ##
@@ -33,6 +34,12 @@ module Twilio
33
34
  end
34
35
  end
35
36
 
37
+ ##
38
+ # @return [Twilio::REST::Autopilot::V1::RestoreAssistantContext]
39
+ def restore_assistant
40
+ @restore_assistant ||= RestoreAssistantList.new self
41
+ end
42
+
36
43
  ##
37
44
  # Provide a user friendly representation
38
45
  def to_s
@@ -0,0 +1,198 @@
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 Autopilot < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
+ class RestoreAssistantList < ListResource
16
+ ##
17
+ # Initialize the RestoreAssistantList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [RestoreAssistantList] RestoreAssistantList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Assistants/Restore"
26
+ end
27
+
28
+ ##
29
+ # Update the RestoreAssistantInstance
30
+ # @param [String] assistant The Twilio-provided string that uniquely identifies
31
+ # the Assistant resource to restore.
32
+ # @return [RestoreAssistantInstance] Updated RestoreAssistantInstance
33
+ def update(assistant: nil)
34
+ data = Twilio::Values.of({'Assistant' => assistant, })
35
+
36
+ payload = @version.update(
37
+ 'POST',
38
+ @uri,
39
+ data: data,
40
+ )
41
+
42
+ RestoreAssistantInstance.new(@version, payload, )
43
+ end
44
+
45
+ ##
46
+ # Provide a user friendly representation
47
+ def to_s
48
+ '#<Twilio.Autopilot.V1.RestoreAssistantList>'
49
+ end
50
+ end
51
+
52
+ ##
53
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
54
+ class RestoreAssistantPage < Page
55
+ ##
56
+ # Initialize the RestoreAssistantPage
57
+ # @param [Version] version Version that contains the resource
58
+ # @param [Response] response Response from the API
59
+ # @param [Hash] solution Path solution for the resource
60
+ # @return [RestoreAssistantPage] RestoreAssistantPage
61
+ def initialize(version, response, solution)
62
+ super(version, response)
63
+
64
+ # Path Solution
65
+ @solution = solution
66
+ end
67
+
68
+ ##
69
+ # Build an instance of RestoreAssistantInstance
70
+ # @param [Hash] payload Payload response from the API
71
+ # @return [RestoreAssistantInstance] RestoreAssistantInstance
72
+ def get_instance(payload)
73
+ RestoreAssistantInstance.new(@version, payload, )
74
+ end
75
+
76
+ ##
77
+ # Provide a user friendly representation
78
+ def to_s
79
+ '<Twilio.Autopilot.V1.RestoreAssistantPage>'
80
+ end
81
+ end
82
+
83
+ ##
84
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
85
+ class RestoreAssistantInstance < InstanceResource
86
+ ##
87
+ # Initialize the RestoreAssistantInstance
88
+ # @param [Version] version Version that contains the resource
89
+ # @param [Hash] payload payload that contains response from Twilio
90
+ # @return [RestoreAssistantInstance] RestoreAssistantInstance
91
+ def initialize(version, payload)
92
+ super(version)
93
+
94
+ # Marshaled Properties
95
+ @properties = {
96
+ 'account_sid' => payload['account_sid'],
97
+ 'sid' => payload['sid'],
98
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
99
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
100
+ 'unique_name' => payload['unique_name'],
101
+ 'friendly_name' => payload['friendly_name'],
102
+ 'needs_model_build' => payload['needs_model_build'],
103
+ 'latest_model_build_sid' => payload['latest_model_build_sid'],
104
+ 'log_queries' => payload['log_queries'],
105
+ 'development_stage' => payload['development_stage'],
106
+ 'callback_url' => payload['callback_url'],
107
+ 'callback_events' => payload['callback_events'],
108
+ }
109
+ end
110
+
111
+ ##
112
+ # @return [String] The SID of the Account that created the resource
113
+ def account_sid
114
+ @properties['account_sid']
115
+ end
116
+
117
+ ##
118
+ # @return [String] The unique string that identifies the resource
119
+ def sid
120
+ @properties['sid']
121
+ end
122
+
123
+ ##
124
+ # @return [Time] The RFC 2822 date and time in GMT when the resource was created
125
+ def date_created
126
+ @properties['date_created']
127
+ end
128
+
129
+ ##
130
+ # @return [Time] The RFC 2822 date and time in GMT when the resource was last updated
131
+ def date_updated
132
+ @properties['date_updated']
133
+ end
134
+
135
+ ##
136
+ # @return [String] An application-defined string that uniquely identifies the resource
137
+ def unique_name
138
+ @properties['unique_name']
139
+ end
140
+
141
+ ##
142
+ # @return [String] The string that you assigned to describe the resource
143
+ def friendly_name
144
+ @properties['friendly_name']
145
+ end
146
+
147
+ ##
148
+ # @return [Boolean] Whether model needs to be rebuilt
149
+ def needs_model_build
150
+ @properties['needs_model_build']
151
+ end
152
+
153
+ ##
154
+ # @return [String] Reserved
155
+ def latest_model_build_sid
156
+ @properties['latest_model_build_sid']
157
+ end
158
+
159
+ ##
160
+ # @return [Boolean] Whether queries should be logged and kept after training
161
+ def log_queries
162
+ @properties['log_queries']
163
+ end
164
+
165
+ ##
166
+ # @return [String] A string describing the state of the assistant.
167
+ def development_stage
168
+ @properties['development_stage']
169
+ end
170
+
171
+ ##
172
+ # @return [String] Reserved
173
+ def callback_url
174
+ @properties['callback_url']
175
+ end
176
+
177
+ ##
178
+ # @return [String] Reserved
179
+ def callback_events
180
+ @properties['callback_events']
181
+ end
182
+
183
+ ##
184
+ # Provide a user friendly representation
185
+ def to_s
186
+ "<Twilio.Autopilot.V1.RestoreAssistantInstance>"
187
+ end
188
+
189
+ ##
190
+ # Provide a detailed, user friendly representation
191
+ def inspect
192
+ "<Twilio.Autopilot.V1.RestoreAssistantInstance>"
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
@@ -11,14 +11,17 @@ module Twilio
11
11
  ##
12
12
  # A client for accessing the Twilio API.
13
13
  class Client
14
- attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region
14
+ @@default_region = 'us1'
15
+
16
+ attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region, :edge
15
17
 
16
18
  ##
17
19
  # Initializes the Twilio Client
18
20
  def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=nil)
19
21
  @username = username || Twilio.account_sid
20
22
  @password = password || Twilio.auth_token
21
- @region = region
23
+ @region = region || Twilio.region
24
+ @edge = Twilio.edge
22
25
  @account_sid = account_sid || @username
23
26
  @auth_token = @password
24
27
  @auth = [@username, @password]
@@ -75,12 +78,7 @@ module Twilio
75
78
  headers['Accept'] = 'application/json'
76
79
  end
77
80
 
78
- if !region.nil?
79
- head, tail = uri.split('.', 2)
80
- if !tail.start_with?(region)
81
- uri = [head, region, tail].join('.')
82
- end
83
- end
81
+ uri = build_uri(uri)
84
82
 
85
83
  @http_client.request(
86
84
  host,
@@ -95,6 +93,35 @@ module Twilio
95
93
  )
96
94
  end
97
95
 
96
+ ##
97
+ # Build the final request uri
98
+ def build_uri(uri)
99
+ if @region.nil? and @edge.nil?
100
+ return uri
101
+ end
102
+
103
+ parsed_url = URI(uri)
104
+ pieces = parsed_url.host.split('.')
105
+ product = pieces[0]
106
+ domain = pieces[-2, 2]
107
+ new_edge = @edge
108
+ new_region = @region
109
+
110
+ if pieces.length == 4
111
+ new_region ||= pieces[1]
112
+ elsif pieces.length == 5
113
+ new_edge ||= pieces[1]
114
+ new_region ||= pieces[2]
115
+ end
116
+
117
+ if !new_edge.nil? && new_region.nil?
118
+ new_region = @@default_region
119
+ end
120
+
121
+ parsed_url.host = [product, new_edge, new_region, domain].select {|item| !item.nil?}.join('.')
122
+ parsed_url.to_s
123
+ end
124
+
98
125
  ##
99
126
  # Validate the new SSL certificate for the Twilio API
100
127
  def validate_ssl_certificate
@@ -39,14 +39,17 @@ module Twilio
39
39
  # store any data you wish. The string value must contain structurally valid JSON
40
40
  # if specified. **Note** that if the attributes are not set "{}" will be
41
41
  # returned.
42
+ # @param [conversation.State] state Current state of this conversation. Can be
43
+ # either `active`, `inactive` or `closed` and defaults to `active`
42
44
  # @return [ConversationInstance] Newly created ConversationInstance
43
- def create(friendly_name: :unset, date_created: :unset, date_updated: :unset, messaging_service_sid: :unset, attributes: :unset)
45
+ def create(friendly_name: :unset, date_created: :unset, date_updated: :unset, messaging_service_sid: :unset, attributes: :unset, state: :unset)
44
46
  data = Twilio::Values.of({
45
47
  'FriendlyName' => friendly_name,
46
48
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
47
49
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
48
50
  'MessagingServiceSid' => messaging_service_sid,
49
51
  'Attributes' => attributes,
52
+ 'State' => state,
50
53
  })
51
54
 
52
55
  payload = @version.create(
@@ -213,14 +216,17 @@ module Twilio
213
216
  # @param [String] messaging_service_sid The unique id of the [SMS
214
217
  # Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs
215
218
  # to.
219
+ # @param [conversation.State] state Current state of this conversation. Can be
220
+ # either `active`, `inactive` or `closed` and defaults to `active`
216
221
  # @return [ConversationInstance] Updated ConversationInstance
217
- def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset)
222
+ def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset)
218
223
  data = Twilio::Values.of({
219
224
  'FriendlyName' => friendly_name,
220
225
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
221
226
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
222
227
  'Attributes' => attributes,
223
228
  'MessagingServiceSid' => messaging_service_sid,
229
+ 'State' => state,
224
230
  })
225
231
 
226
232
  payload = @version.update(
@@ -344,6 +350,7 @@ module Twilio
344
350
  'sid' => payload['sid'],
345
351
  'friendly_name' => payload['friendly_name'],
346
352
  'attributes' => payload['attributes'],
353
+ 'state' => payload['state'],
347
354
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
348
355
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
349
356
  'url' => payload['url'],
@@ -402,6 +409,12 @@ module Twilio
402
409
  @properties['attributes']
403
410
  end
404
411
 
412
+ ##
413
+ # @return [conversation.State] Current state of this conversation.
414
+ def state
415
+ @properties['state']
416
+ end
417
+
405
418
  ##
406
419
  # @return [Time] The date that this resource was created.
407
420
  def date_created
@@ -439,14 +452,17 @@ module Twilio
439
452
  # @param [String] messaging_service_sid The unique id of the [SMS
440
453
  # Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs
441
454
  # to.
455
+ # @param [conversation.State] state Current state of this conversation. Can be
456
+ # either `active`, `inactive` or `closed` and defaults to `active`
442
457
  # @return [ConversationInstance] Updated ConversationInstance
443
- def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset)
458
+ def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset)
444
459
  context.update(
445
460
  friendly_name: friendly_name,
446
461
  date_created: date_created,
447
462
  date_updated: date_updated,
448
463
  attributes: attributes,
449
464
  messaging_service_sid: messaging_service_sid,
465
+ state: state,
450
466
  )
451
467
  end
452
468
 
@@ -53,8 +53,11 @@ module Twilio
53
53
  # @param [String] messaging_binding_projected_address The address of the Twilio
54
54
  # phone number that is used in Group MMS. Communication mask for the Chat
55
55
  # participant with Identity.
56
+ # @param [String] role_sid The SID of the
57
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
58
+ # participant.
56
59
  # @return [ParticipantInstance] Newly created ParticipantInstance
57
- def create(identity: :unset, messaging_binding_address: :unset, messaging_binding_proxy_address: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_binding_projected_address: :unset)
60
+ def create(identity: :unset, messaging_binding_address: :unset, messaging_binding_proxy_address: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_binding_projected_address: :unset, role_sid: :unset)
58
61
  data = Twilio::Values.of({
59
62
  'Identity' => identity,
60
63
  'MessagingBinding.Address' => messaging_binding_address,
@@ -63,6 +66,7 @@ module Twilio
63
66
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
64
67
  'Attributes' => attributes,
65
68
  'MessagingBinding.ProjectedAddress' => messaging_binding_projected_address,
69
+ 'RoleSid' => role_sid,
66
70
  })
67
71
 
68
72
  payload = @version.create(
@@ -221,12 +225,16 @@ module Twilio
221
225
  # store any data you wish. The string value must contain structurally valid JSON
222
226
  # if specified. **Note** that if the attributes are not set "{}" will be
223
227
  # returned.
228
+ # @param [String] role_sid The SID of the
229
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
230
+ # participant.
224
231
  # @return [ParticipantInstance] Updated ParticipantInstance
225
- def update(date_created: :unset, date_updated: :unset, attributes: :unset)
232
+ def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset)
226
233
  data = Twilio::Values.of({
227
234
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
228
235
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
229
236
  'Attributes' => attributes,
237
+ 'RoleSid' => role_sid,
230
238
  })
231
239
 
232
240
  payload = @version.update(
@@ -308,6 +316,7 @@ module Twilio
308
316
  'identity' => payload['identity'],
309
317
  'attributes' => payload['attributes'],
310
318
  'messaging_binding' => payload['messaging_binding'],
319
+ 'role_sid' => payload['role_sid'],
311
320
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
312
321
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
313
322
  'url' => payload['url'],
@@ -365,6 +374,12 @@ module Twilio
365
374
  @properties['messaging_binding']
366
375
  end
367
376
 
377
+ ##
378
+ # @return [String] The SID of the Role to assign to the participant
379
+ def role_sid
380
+ @properties['role_sid']
381
+ end
382
+
368
383
  ##
369
384
  # @return [Time] The date that this resource was created.
370
385
  def date_created
@@ -391,9 +406,17 @@ module Twilio
391
406
  # store any data you wish. The string value must contain structurally valid JSON
392
407
  # if specified. **Note** that if the attributes are not set "{}" will be
393
408
  # returned.
409
+ # @param [String] role_sid The SID of the
410
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
411
+ # participant.
394
412
  # @return [ParticipantInstance] Updated ParticipantInstance
395
- def update(date_created: :unset, date_updated: :unset, attributes: :unset)
396
- context.update(date_created: date_created, date_updated: date_updated, attributes: attributes, )
413
+ def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset)
414
+ context.update(
415
+ date_created: date_created,
416
+ date_updated: date_updated,
417
+ attributes: attributes,
418
+ role_sid: role_sid,
419
+ )
397
420
  end
398
421
 
399
422
  ##