twilio-ruby 7.8.1 → 7.8.3

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +16 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/http/client_token_manager.rb +5 -2
  5. data/lib/twilio-ruby/http/org_token_manager.rb +5 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
  7. data/lib/twilio-ruby/rest/client.rb +5 -0
  8. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +3 -3
  9. data/lib/twilio-ruby/rest/knowledge/v1/knowledge/chunk.rb +232 -0
  10. data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +213 -0
  11. data/lib/twilio-ruby/rest/knowledge/v1/knowledge.rb +623 -0
  12. data/lib/twilio-ruby/rest/knowledge/v1.rb +49 -0
  13. data/lib/twilio-ruby/rest/knowledge.rb +6 -0
  14. data/lib/twilio-ruby/rest/knowledge_base.rb +38 -0
  15. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +13 -13
  16. data/lib/twilio-ruby/rest/lookups/v2/query.rb +15 -209
  17. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +91 -0
  18. data/lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb +140 -0
  19. data/lib/twilio-ruby/rest/messaging/v2.rb +6 -0
  20. data/lib/twilio-ruby/rest/numbers/v1/porting_all_port_in.rb +270 -0
  21. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +100 -5
  22. data/lib/twilio-ruby/rest/numbers/v1.rb +6 -0
  23. data/lib/twilio-ruby/rest/oauth/v2/token.rb +2 -2
  24. data/lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb +312 -0
  25. data/lib/twilio-ruby/rest/verify/v2/{new_challenge.rb → service/new_challenge.rb} +9 -4
  26. data/lib/twilio-ruby/rest/verify/v2/service/new_verify_factor.rb +267 -0
  27. data/lib/twilio-ruby/rest/verify/v2/service.rb +49 -12
  28. data/lib/twilio-ruby/rest/verify/v2.rb +0 -15
  29. data/lib/twilio-ruby/version.rb +1 -1
  30. metadata +13 -3
@@ -0,0 +1,38 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # NOTE: This class is auto generated by OpenAPI Generator.
8
+ # https://openapi-generator.tech
9
+ # Do not edit the class manually.
10
+ # frozen_string_literal: true
11
+ module Twilio
12
+ module REST
13
+ class KnowledgeBase < Domain
14
+ ##
15
+ # Initialize knowledge domain
16
+ #
17
+ # @param twilio - The twilio client
18
+ #
19
+ def initialize(twilio)
20
+ super(twilio)
21
+ @base_url = "https://knowledge.twilio.com"
22
+ @host = "knowledge.twilio.com"
23
+ @port = 443
24
+ @v1 = nil
25
+ end
26
+
27
+ def v1
28
+ @v1 ||= Knowledge::V1.new self
29
+ end
30
+
31
+ ##
32
+ # Provide a user friendly representation
33
+ def to_s
34
+ '<Twilio::REST::Knowledge::V1>';
35
+ end
36
+ end
37
+ end
38
+ end
@@ -190,8 +190,8 @@ module Twilio
190
190
  'caller_name' => payload['caller_name'],
191
191
  'sim_swap' => payload['sim_swap'],
192
192
  'call_forwarding' => payload['call_forwarding'],
193
- 'line_status' => payload['line_status'],
194
193
  'line_type_intelligence' => payload['line_type_intelligence'],
194
+ 'line_status' => payload['line_status'],
195
195
  'identity_match' => payload['identity_match'],
196
196
  'reassigned_number' => payload['reassigned_number'],
197
197
  'sms_pumping_risk' => payload['sms_pumping_risk'],
@@ -253,49 +253,49 @@ module Twilio
253
253
  end
254
254
 
255
255
  ##
256
- # @return [Hash] An object that contains caller name information based on [CNAM](https://support.twilio.com/hc/en-us/articles/360051670533-Getting-Started-with-CNAM-Caller-ID).
256
+ # @return [CallerName]
257
257
  def caller_name
258
258
  @properties['caller_name']
259
259
  end
260
260
 
261
261
  ##
262
- # @return [Hash] An object that contains information on the last date the subscriber identity module (SIM) was changed for a mobile phone number.
262
+ # @return [SimSwap]
263
263
  def sim_swap
264
264
  @properties['sim_swap']
265
265
  end
266
266
 
267
267
  ##
268
- # @return [Hash] An object that contains information on the unconditional call forwarding status of mobile phone number.
268
+ # @return [CallForwarding]
269
269
  def call_forwarding
270
270
  @properties['call_forwarding']
271
271
  end
272
272
 
273
273
  ##
274
- # @return [Hash] An object that contains line status information for a mobile phone number.
275
- def line_status
276
- @properties['line_status']
274
+ # @return [LineTypeIntelligence]
275
+ def line_type_intelligence
276
+ @properties['line_type_intelligence']
277
277
  end
278
278
 
279
279
  ##
280
- # @return [Hash] An object that contains line type information including the carrier name, mobile country code, and mobile network code.
281
- def line_type_intelligence
282
- @properties['line_type_intelligence']
280
+ # @return [LineStatus]
281
+ def line_status
282
+ @properties['line_status']
283
283
  end
284
284
 
285
285
  ##
286
- # @return [Hash] An object that contains identity match information. The result of comparing user-provided information including name, address, date of birth, national ID, against authoritative phone-based data sources
286
+ # @return [IdentityMatch]
287
287
  def identity_match
288
288
  @properties['identity_match']
289
289
  end
290
290
 
291
291
  ##
292
- # @return [Hash] An object that contains reassigned number information. Reassigned Numbers will return a phone number's reassignment status given a phone number and date
292
+ # @return [ReassignedNumber]
293
293
  def reassigned_number
294
294
  @properties['reassigned_number']
295
295
  end
296
296
 
297
297
  ##
298
- # @return [Hash] An object that contains information on if a phone number has been currently or previously blocked by Verify Fraud Guard for receiving malicious SMS pumping traffic as well as other signals associated with risky carriers and low conversion rates.
298
+ # @return [SmsPumpingRisk]
299
299
  def sms_pumping_risk
300
300
  @properties['sms_pumping_risk']
301
301
  end
@@ -19,87 +19,6 @@ module Twilio
19
19
  class V2 < Version
20
20
  class QueryList < ListResource
21
21
 
22
- class CallForwarding
23
- # @param [call_forwarding_enabled]: [Boolean]
24
- # @param [error_code]: [Integer]
25
- attr_accessor :call_forwarding_enabled, :error_code
26
- def initialize(payload)
27
- @call_forwarding_enabled = payload["call_forwarding_enabled"]
28
- @error_code = payload["error_code"]
29
- end
30
- def to_json(options = {})
31
- {
32
- "call_forwarding_enabled": @call_forwarding_enabled,
33
- "error_code": @error_code,
34
- }.to_json(options)
35
- end
36
- end
37
-
38
- class CallerName
39
- # @param [caller_name]: [String]
40
- # @param [caller_type]: [String]
41
- # @param [error_code]: [Integer]
42
- attr_accessor :caller_name, :caller_type, :error_code
43
- def initialize(payload)
44
- @caller_name = payload["caller_name"]
45
- @caller_type = payload["caller_type"]
46
- @error_code = payload["error_code"]
47
- end
48
- def to_json(options = {})
49
- {
50
- "caller_name": @caller_name,
51
- "caller_type": @caller_type,
52
- "error_code": @error_code,
53
- }.to_json(options)
54
- end
55
- end
56
-
57
- class IdentityMatch
58
- # @param [first_name_match]: [String]
59
- # @param [last_name_match]: [String]
60
- # @param [address_line_match]: [String]
61
- # @param [city_match]: [String]
62
- # @param [state_match]: [String]
63
- # @param [postal_code_match]: [String]
64
- # @param [country_code_match]: [String]
65
- # @param [national_id_match]: [String]
66
- # @param [date_of_birth_match]: [String]
67
- # @param [summary_score]: [Integer]
68
- # @param [error_code]: [Integer]
69
- # @param [error_message]: [String]
70
- attr_accessor :first_name_match, :last_name_match, :address_line_match, :city_match, :state_match, :postal_code_match, :country_code_match, :national_id_match, :date_of_birth_match, :summary_score, :error_code, :error_message
71
- def initialize(payload)
72
- @first_name_match = payload["first_name_match"]
73
- @last_name_match = payload["last_name_match"]
74
- @address_line_match = payload["address_line_match"]
75
- @city_match = payload["city_match"]
76
- @state_match = payload["state_match"]
77
- @postal_code_match = payload["postal_code_match"]
78
- @country_code_match = payload["country_code_match"]
79
- @national_id_match = payload["national_id_match"]
80
- @date_of_birth_match = payload["date_of_birth_match"]
81
- @summary_score = payload["summary_score"]
82
- @error_code = payload["error_code"]
83
- @error_message = payload["error_message"]
84
- end
85
- def to_json(options = {})
86
- {
87
- "first_name_match": @first_name_match,
88
- "last_name_match": @last_name_match,
89
- "address_line_match": @address_line_match,
90
- "city_match": @city_match,
91
- "state_match": @state_match,
92
- "postal_code_match": @postal_code_match,
93
- "country_code_match": @country_code_match,
94
- "national_id_match": @national_id_match,
95
- "date_of_birth_match": @date_of_birth_match,
96
- "summary_score": @summary_score,
97
- "error_code": @error_code,
98
- "error_message": @error_message,
99
- }.to_json(options)
100
- end
101
- end
102
-
103
22
  class IdentityMatchParameters
104
23
  # @param [first_name]: [String]
105
24
  # @param [last_name]: [String]
@@ -159,68 +78,14 @@ module Twilio
159
78
  end
160
79
  end
161
80
 
162
- class LineStatus
163
- # @param [status]: [String]
164
- # @param [error_code]: [Integer]
165
- attr_accessor :status, :error_code
166
- def initialize(payload)
167
- @status = payload["status"]
168
- @error_code = payload["error_code"]
169
- end
170
- def to_json(options = {})
171
- {
172
- "status": @status,
173
- "error_code": @error_code,
174
- }.to_json(options)
175
- end
176
- end
177
-
178
- class LineTypeIntelligence
179
- # @param [type]: [String]
180
- # @param [carrier_name]: [String]
181
- # @param [mobile_country_code]: [String]
182
- # @param [mobile_network_code]: [String]
183
- # @param [error_code]: [Integer]
184
- attr_accessor :type, :carrier_name, :mobile_country_code, :mobile_network_code, :error_code
185
- def initialize(payload)
186
- @type = payload["type"]
187
- @carrier_name = payload["carrier_name"]
188
- @mobile_country_code = payload["mobile_country_code"]
189
- @mobile_network_code = payload["mobile_network_code"]
190
- @error_code = payload["error_code"]
191
- end
192
- def to_json(options = {})
193
- {
194
- "type": @type,
195
- "carrier_name": @carrier_name,
196
- "mobile_country_code": @mobile_country_code,
197
- "mobile_network_code": @mobile_network_code,
198
- "error_code": @error_code,
199
- }.to_json(options)
200
- end
201
- end
202
-
203
- class LookupRequest1
204
- # @param [phone_numbers]: [Array<QueryList.LookupRequestWithCorId>]
205
- attr_accessor :phone_numbers
206
- def initialize(payload)
207
- @phone_numbers = payload["phone_numbers"]
208
- end
209
- def to_json(options = {})
210
- {
211
- "phone_numbers": @phone_numbers,
212
- }.to_json(options)
213
- end
214
- end
215
-
216
- class LookupRequestWithCorId
81
+ class LookupBatchRequest
217
82
  # @param [correlation_id]: [String] Unique identifier used to match request with response
218
83
  # @param [phone_number]: [String]
219
84
  # @param [fields]: [Array<String>]
220
85
  # @param [country_code]: [String]
221
86
  # @param [identity_match]: [QueryList.IdentityMatchParameters]
222
- # @param [reassigned_number]: [QueryList.ReassignedNumberRequest]
223
- # @param [sms_pumping_risk]: [QueryList.SmsPumpingRiskParameters]
87
+ # @param [reassigned_number]: [QueryList.ReassignedNumberParameters]
88
+ # @param [sms_pumping_risk]: [QueryList.RiskParameters]
224
89
  attr_accessor :correlation_id, :phone_number, :fields, :country_code, :identity_match, :reassigned_number, :sms_pumping_risk
225
90
  def initialize(payload)
226
91
  @correlation_id = payload["correlation_id"]
@@ -244,92 +109,33 @@ module Twilio
244
109
  end
245
110
  end
246
111
 
247
- class ReassignedNumberRequest
248
- # @param [last_verified_date]: [String]
249
- attr_accessor :last_verified_date
112
+ class LookupRequest
113
+ # @param [phone_numbers]: [Array<QueryList.LookupBatchRequest>]
114
+ attr_accessor :phone_numbers
250
115
  def initialize(payload)
251
- @last_verified_date = payload["last_verified_date"]
116
+ @phone_numbers = payload["phone_numbers"]
252
117
  end
253
118
  def to_json(options = {})
254
119
  {
255
- "last_verified_date": @last_verified_date,
120
+ "phone_numbers": @phone_numbers,
256
121
  }.to_json(options)
257
122
  end
258
123
  end
259
124
 
260
- class ReassignedNumberResponse
125
+ class ReassignedNumberParameters
261
126
  # @param [last_verified_date]: [String]
262
- # @param [is_number_reassigned]: [String]
263
- # @param [error_code]: [String]
264
- attr_accessor :last_verified_date, :is_number_reassigned, :error_code
127
+ attr_accessor :last_verified_date
265
128
  def initialize(payload)
266
129
  @last_verified_date = payload["last_verified_date"]
267
- @is_number_reassigned = payload["is_number_reassigned"]
268
- @error_code = payload["error_code"]
269
130
  end
270
131
  def to_json(options = {})
271
132
  {
272
133
  "last_verified_date": @last_verified_date,
273
- "is_number_reassigned": @is_number_reassigned,
274
- "error_code": @error_code,
275
- }.to_json(options)
276
- end
277
- end
278
-
279
- class SimSwap
280
- # @param [last_sim_swap]: [LastSimSwap]
281
- # @param [carrier_name]: [String]
282
- # @param [mobile_country_code]: [String]
283
- # @param [mobile_network_code]: [String]
284
- # @param [error_code]: [Integer]
285
- attr_accessor :last_sim_swap, :carrier_name, :mobile_country_code, :mobile_network_code, :error_code
286
- def initialize(payload)
287
- @last_sim_swap = payload["last_sim_swap"]
288
- @carrier_name = payload["carrier_name"]
289
- @mobile_country_code = payload["mobile_country_code"]
290
- @mobile_network_code = payload["mobile_network_code"]
291
- @error_code = payload["error_code"]
292
- end
293
- def to_json(options = {})
294
- {
295
- "last_sim_swap": @last_sim_swap,
296
- "carrier_name": @carrier_name,
297
- "mobile_country_code": @mobile_country_code,
298
- "mobile_network_code": @mobile_network_code,
299
- "error_code": @error_code,
300
- }.to_json(options)
301
- end
302
- end
303
-
304
- class SmsPumpingRisk
305
- # @param [carrier_risk_category]: [String]
306
- # @param [number_blocked]: [Boolean]
307
- # @param [number_blocked_date]: [Time]
308
- # @param [number_blocked_last_3_months]: [Boolean]
309
- # @param [sms_pumping_risk_score]: [Integer]
310
- # @param [error_code]: [Integer]
311
- attr_accessor :carrier_risk_category, :number_blocked, :number_blocked_date, :number_blocked_last_3_months, :sms_pumping_risk_score, :error_code
312
- def initialize(payload)
313
- @carrier_risk_category = payload["carrier_risk_category"]
314
- @number_blocked = payload["number_blocked"]
315
- @number_blocked_date = payload["number_blocked_date"]
316
- @number_blocked_last_3_months = payload["number_blocked_last_3_months"]
317
- @sms_pumping_risk_score = payload["sms_pumping_risk_score"]
318
- @error_code = payload["error_code"]
319
- end
320
- def to_json(options = {})
321
- {
322
- "carrier_risk_category": @carrier_risk_category,
323
- "number_blocked": @number_blocked,
324
- "number_blocked_date": @number_blocked_date,
325
- "number_blocked_last_3_months": @number_blocked_last_3_months,
326
- "sms_pumping_risk_score": @sms_pumping_risk_score,
327
- "error_code": @error_code,
328
134
  }.to_json(options)
329
135
  end
330
136
  end
331
137
 
332
- class SmsPumpingRiskParameters
138
+ class RiskParameters
333
139
  # @param [partner_sub_id]: [String]
334
140
  attr_accessor :partner_sub_id
335
141
  def initialize(payload)
@@ -356,9 +162,9 @@ module Twilio
356
162
  end
357
163
  ##
358
164
  # Create the QueryInstance
359
- # @param [LookupRequest1] lookup_request1
165
+ # @param [LookupRequest] lookup_request
360
166
  # @return [QueryInstance] Created QueryInstance
361
- def create(lookup_request1: :unset
167
+ def create(lookup_request: :unset
362
168
  )
363
169
 
364
170
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -367,7 +173,7 @@ module Twilio
367
173
 
368
174
 
369
175
 
370
- payload = @version.create('POST', @uri, headers: headers, data: lookup_request1.to_json)
176
+ payload = @version.create('POST', @uri, headers: headers, data: lookup_request.to_json)
371
177
  QueryInstance.new(
372
178
  @version,
373
179
  payload,
@@ -432,7 +238,7 @@ module Twilio
432
238
 
433
239
 
434
240
  ##
435
- # @return [Array<LookupResponseWithCorId>]
241
+ # @return [Array<LookupBatchResponse>]
436
242
  def phone_numbers
437
243
  @properties['phone_numbers']
438
244
  end
@@ -461,12 +461,25 @@ module Twilio
461
461
  'message_volume' => payload['message_volume'],
462
462
  'additional_information' => payload['additional_information'],
463
463
  'tollfree_phone_number_sid' => payload['tollfree_phone_number_sid'],
464
+ 'tollfree_phone_number' => payload['tollfree_phone_number'],
464
465
  'status' => payload['status'],
465
466
  'url' => payload['url'],
466
467
  'rejection_reason' => payload['rejection_reason'],
467
468
  'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
468
469
  'edit_expiration' => Twilio.deserialize_iso8601_datetime(payload['edit_expiration']),
469
470
  'edit_allowed' => payload['edit_allowed'],
471
+ 'business_registration_number' => payload['business_registration_number'],
472
+ 'business_registration_authority' => payload['business_registration_authority'],
473
+ 'business_registration_country' => payload['business_registration_country'],
474
+ 'business_type' => payload['business_type'],
475
+ 'business_registration_phone_number' => payload['business_registration_phone_number'],
476
+ 'doing_business_as' => payload['doing_business_as'],
477
+ 'opt_in_confirmation_message' => payload['opt_in_confirmation_message'],
478
+ 'help_message_sample' => payload['help_message_sample'],
479
+ 'privacy_policy_url' => payload['privacy_policy_url'],
480
+ 'terms_and_conditions_url' => payload['terms_and_conditions_url'],
481
+ 'age_gated_content' => payload['age_gated_content'],
482
+ 'opt_in_keywords' => payload['opt_in_keywords'],
470
483
  'rejection_reasons' => payload['rejection_reasons'],
471
484
  'resource_links' => payload['resource_links'],
472
485
  'external_reference_id' => payload['external_reference_id'],
@@ -656,6 +669,12 @@ module Twilio
656
669
  @properties['tollfree_phone_number_sid']
657
670
  end
658
671
 
672
+ ##
673
+ # @return [String] The E.164 formatted toll-free phone number associated with the verification.
674
+ def tollfree_phone_number
675
+ @properties['tollfree_phone_number']
676
+ end
677
+
659
678
  ##
660
679
  # @return [Status]
661
680
  def status
@@ -692,6 +711,78 @@ module Twilio
692
711
  @properties['edit_allowed']
693
712
  end
694
713
 
714
+ ##
715
+ # @return [String] A legally recognized business registration number
716
+ def business_registration_number
717
+ @properties['business_registration_number']
718
+ end
719
+
720
+ ##
721
+ # @return [String] The organizational authority for business registrations
722
+ def business_registration_authority
723
+ @properties['business_registration_authority']
724
+ end
725
+
726
+ ##
727
+ # @return [String] Country business is registered in
728
+ def business_registration_country
729
+ @properties['business_registration_country']
730
+ end
731
+
732
+ ##
733
+ # @return [String] The type of business, valid values are PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, SOLE_PROPRIETOR, GOVERNMENT
734
+ def business_type
735
+ @properties['business_type']
736
+ end
737
+
738
+ ##
739
+ # @return [String] The E.164 formatted number associated with the business.
740
+ def business_registration_phone_number
741
+ @properties['business_registration_phone_number']
742
+ end
743
+
744
+ ##
745
+ # @return [String] Trade name, sub entity, or downstream business name of business being submitted for verification
746
+ def doing_business_as
747
+ @properties['doing_business_as']
748
+ end
749
+
750
+ ##
751
+ # @return [String] The confirmation message sent to users when they opt in to receive messages.
752
+ def opt_in_confirmation_message
753
+ @properties['opt_in_confirmation_message']
754
+ end
755
+
756
+ ##
757
+ # @return [String] A sample help message provided to users.
758
+ def help_message_sample
759
+ @properties['help_message_sample']
760
+ end
761
+
762
+ ##
763
+ # @return [String] The URL to the privacy policy for the business or organization.
764
+ def privacy_policy_url
765
+ @properties['privacy_policy_url']
766
+ end
767
+
768
+ ##
769
+ # @return [String] The URL to the terms and conditions for the business or organization.
770
+ def terms_and_conditions_url
771
+ @properties['terms_and_conditions_url']
772
+ end
773
+
774
+ ##
775
+ # @return [Boolean] Indicates if the content is age gated.
776
+ def age_gated_content
777
+ @properties['age_gated_content']
778
+ end
779
+
780
+ ##
781
+ # @return [Array<String>] List of keywords that users can text in to opt in to receive messages.
782
+ def opt_in_keywords
783
+ @properties['opt_in_keywords']
784
+ end
785
+
695
786
  ##
696
787
  # @return [Array<Hash>] A list of rejection reasons and codes describing why a Tollfree Verification has been rejected.
697
788
  def rejection_reasons
@@ -0,0 +1,140 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Messaging
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Messaging < MessagingBase
19
+ class V2 < Version
20
+ class TypingIndicatorList < ListResource
21
+
22
+ ##
23
+ # Initialize the TypingIndicatorList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [TypingIndicatorList] TypingIndicatorList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/Indicators/Typing.json"
31
+
32
+ end
33
+ ##
34
+ # Create the TypingIndicatorInstance
35
+ # @param [String] channel Shared channel identifier
36
+ # @param [String] message_id Message SID that identifies the conversation thread for the typing indicator. Must be a valid Twilio Message SID (SM*) or Media SID (MM*) from an existing WhatsApp conversation.
37
+ # @return [TypingIndicatorInstance] Created TypingIndicatorInstance
38
+ def create(
39
+ channel: nil,
40
+ message_id: nil
41
+ )
42
+
43
+ data = Twilio::Values.of({
44
+ 'channel' => channel,
45
+ 'messageId' => message_id,
46
+ })
47
+
48
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
49
+
50
+
51
+
52
+
53
+
54
+ payload = @version.create('POST', @uri, data: data, headers: headers)
55
+ TypingIndicatorInstance.new(
56
+ @version,
57
+ payload,
58
+ )
59
+ end
60
+
61
+
62
+
63
+
64
+ # Provide a user friendly representation
65
+ def to_s
66
+ '#<Twilio.Messaging.V2.TypingIndicatorList>'
67
+ end
68
+ end
69
+
70
+ class TypingIndicatorPage < Page
71
+ ##
72
+ # Initialize the TypingIndicatorPage
73
+ # @param [Version] version Version that contains the resource
74
+ # @param [Response] response Response from the API
75
+ # @param [Hash] solution Path solution for the resource
76
+ # @return [TypingIndicatorPage] TypingIndicatorPage
77
+ def initialize(version, response, solution)
78
+ super(version, response)
79
+
80
+ # Path Solution
81
+ @solution = solution
82
+ end
83
+
84
+ ##
85
+ # Build an instance of TypingIndicatorInstance
86
+ # @param [Hash] payload Payload response from the API
87
+ # @return [TypingIndicatorInstance] TypingIndicatorInstance
88
+ def get_instance(payload)
89
+ TypingIndicatorInstance.new(@version, payload)
90
+ end
91
+
92
+ ##
93
+ # Provide a user friendly representation
94
+ def to_s
95
+ '<Twilio.Messaging.V2.TypingIndicatorPage>'
96
+ end
97
+ end
98
+ class TypingIndicatorInstance < InstanceResource
99
+ ##
100
+ # Initialize the TypingIndicatorInstance
101
+ # @param [Version] version Version that contains the resource
102
+ # @param [Hash] payload payload that contains response from Twilio
103
+ # @param [String] account_sid The SID of the
104
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this TypingIndicator
105
+ # resource.
106
+ # @param [String] sid The SID of the Call resource to fetch.
107
+ # @return [TypingIndicatorInstance] TypingIndicatorInstance
108
+ def initialize(version, payload )
109
+ super(version)
110
+
111
+ # Marshaled Properties
112
+ @properties = {
113
+ 'success' => payload['success'],
114
+ }
115
+ end
116
+
117
+
118
+ ##
119
+ # @return [Boolean] Indicates if the typing indicator was sent successfully.
120
+ def success
121
+ @properties['success']
122
+ end
123
+
124
+ ##
125
+ # Provide a user friendly representation
126
+ def to_s
127
+ "<Twilio.Messaging.V2.TypingIndicatorInstance>"
128
+ end
129
+
130
+ ##
131
+ # Provide a detailed, user friendly representation
132
+ def inspect
133
+ "<Twilio.Messaging.V2.TypingIndicatorInstance>"
134
+ end
135
+ end
136
+
137
+ end
138
+ end
139
+ end
140
+ end