twilio-ruby 5.47.0 → 5.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +17 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/client.rb +7 -0
  5. data/lib/twilio-ruby/rest/events/v1/subscription.rb +2 -2
  6. data/lib/twilio-ruby/rest/messaging.rb +0 -14
  7. data/lib/twilio-ruby/rest/messaging/v1.rb +0 -22
  8. data/lib/twilio-ruby/rest/trusthub.rb +100 -0
  9. data/lib/twilio-ruby/rest/trusthub/v1.rb +139 -0
  10. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
  11. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
  12. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
  13. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
  14. data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
  15. data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
  16. data/lib/twilio-ruby/rest/{messaging/v1/use_case.rb → trusthub/v1/policies.rb} +110 -46
  17. data/lib/twilio-ruby/rest/{messaging/v1/campaign.rb → trusthub/v1/supporting_document.rb} +125 -143
  18. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
  19. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
  20. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
  21. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
  22. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
  23. data/lib/twilio-ruby/rest/verify.rb +9 -0
  24. data/lib/twilio-ruby/rest/verify/v2.rb +15 -0
  25. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
  26. data/lib/twilio-ruby/version.rb +1 -1
  27. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
  28. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
  29. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
  30. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
  31. data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
  32. data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
  33. data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
  34. data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
  35. data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
  36. data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
  37. data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
  38. data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
  39. data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
  40. data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
  41. data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
  42. metadata +46 -8
  43. data/spec/integration/messaging/v1/campaign_spec.rb +0 -194
  44. data/spec/integration/messaging/v1/use_case_spec.rb +0 -55
@@ -1,194 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
- #
7
- # frozen_string_literal: true
8
-
9
- require 'spec_helper.rb'
10
-
11
- describe 'Campaign' do
12
- it "can fetch" do
13
- @holodeck.mock(Twilio::Response.new(500, ''))
14
-
15
- expect {
16
- @client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
17
- }.to raise_exception(Twilio::REST::TwilioError)
18
-
19
- expect(
20
- @holodeck.has_request?(Holodeck::Request.new(
21
- method: 'get',
22
- url: 'https://messaging.twilio.com/v1/a2p/Campaigns/CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
23
- ))).to eq(true)
24
- end
25
-
26
- it "receives fetch responses" do
27
- @holodeck.mock(Twilio::Response.new(
28
- 200,
29
- %q[
30
- {
31
- "sid": "CMdeadbeef66043a43b62be6d67c635c85",
32
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
- "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
- "date_created": "2021-01-27T14:47:52Z",
35
- "date_updated": "2021-01-27T14:47:52Z",
36
- "description": "Test description for test campaing",
37
- "message_samples": [
38
- "Test_Sample_1",
39
- "Another_test_sample_2"
40
- ],
41
- "status": "pending",
42
- "failure_reason": null,
43
- "use_case": "PUBLIC_SERVICE_ANNOUNCEMENT",
44
- "has_embedded_links": true,
45
- "has_embedded_phone": false,
46
- "brand_registration_sid": "BN0044409f7e067e279523808d267e2d85",
47
- "url": "https://messaging.twilio.com/v1/a2p/Campaigns/CMdeadbeef66043a43b62be6d67c635c85"
48
- }
49
- ]
50
- ))
51
-
52
- actual = @client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
53
-
54
- expect(actual).to_not eq(nil)
55
- end
56
-
57
- it "can read" do
58
- @holodeck.mock(Twilio::Response.new(500, ''))
59
-
60
- expect {
61
- @client.messaging.v1.campaigns.list()
62
- }.to raise_exception(Twilio::REST::TwilioError)
63
-
64
- expect(
65
- @holodeck.has_request?(Holodeck::Request.new(
66
- method: 'get',
67
- url: 'https://messaging.twilio.com/v1/a2p/Campaigns',
68
- ))).to eq(true)
69
- end
70
-
71
- it "receives read_full responses" do
72
- @holodeck.mock(Twilio::Response.new(
73
- 200,
74
- %q[
75
- {
76
- "meta": {
77
- "page": 0,
78
- "page_size": 50,
79
- "first_page_url": "https://messaging.twilio.com/v1/a2p/Campaigns?PageSize=50&Page=0",
80
- "previous_page_url": null,
81
- "next_page_url": null,
82
- "key": "data",
83
- "url": "https://messaging.twilio.com/v1/a2p/Campaigns?PageSize=50&Page=0"
84
- },
85
- "data": [
86
- {
87
- "sid": "CMdeadbeef66043a43b62be6d67c635c85",
88
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
89
- "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
90
- "date_created": "2021-01-27T14:47:52Z",
91
- "date_updated": "2021-01-27T14:47:53Z",
92
- "description": "Test description for test campaing",
93
- "message_samples": [
94
- "Test_Sample_1",
95
- "Another_test_sample_2"
96
- ],
97
- "status": "pending",
98
- "failure_reason": null,
99
- "use_case": "GAMBLING_SWEEPSTAKE",
100
- "has_embedded_links": true,
101
- "has_embedded_phone": false,
102
- "brand_registration_sid": "BN0044409f7e067e279523808d267e2d85",
103
- "url": "https://messaging.twilio.com/v1/a2p/Campaigns/CMdeadbeef66043a43b62be6d67c635c85"
104
- }
105
- ]
106
- }
107
- ]
108
- ))
109
-
110
- actual = @client.messaging.v1.campaigns.list()
111
-
112
- expect(actual).to_not eq(nil)
113
- end
114
-
115
- it "can create" do
116
- @holodeck.mock(Twilio::Response.new(500, ''))
117
-
118
- expect {
119
- @client.messaging.v1.campaigns.create(brand_registration_sid: 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', use_case: 'use_case', description: 'description', message_samples: ['message_samples'], has_embedded_links: true, has_embedded_phone: true, messaging_service_sid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
120
- }.to raise_exception(Twilio::REST::TwilioError)
121
-
122
- values = {
123
- 'BrandRegistrationSid' => 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
124
- 'UseCase' => 'use_case',
125
- 'Description' => 'description',
126
- 'MessageSamples' => Twilio.serialize_list(['message_samples']) { |e| e },
127
- 'HasEmbeddedLinks' => true,
128
- 'HasEmbeddedPhone' => true,
129
- 'MessagingServiceSid' => 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
130
- }
131
- expect(
132
- @holodeck.has_request?(Holodeck::Request.new(
133
- method: 'post',
134
- url: 'https://messaging.twilio.com/v1/a2p/Campaigns',
135
- data: values,
136
- ))).to eq(true)
137
- end
138
-
139
- it "receives create responses" do
140
- @holodeck.mock(Twilio::Response.new(
141
- 201,
142
- %q[
143
- {
144
- "sid": "CMdeadbeef66043a43b62be6d67c635c85",
145
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146
- "messaging_service_sid": "MG3u3kcgofdljponkatswl3ad3ev0c123u",
147
- "brand_registration_sid": "BN0044409f7e067e279523808d267e2d85",
148
- "date_created": "2021-01-27T14:47:52Z",
149
- "date_updated": "2021-01-27T14:47:52Z",
150
- "description": "Send marketing messages about sales and offers to opted in customers.",
151
- "message_samples": [
152
- "EXPRESS: Denim Days Event is ON",
153
- "LAST CHANCE: Book your next flight for just 1 (ONE) EUR"
154
- ],
155
- "status": "pending",
156
- "failure_reason": null,
157
- "use_case": "2FA",
158
- "has_embedded_links": true,
159
- "has_embedded_phone": false,
160
- "url": "https://messaging.twilio.com/v1/a2p/Campaigns/CMdeadbeef66043a43b62be6d67c635c85"
161
- }
162
- ]
163
- ))
164
-
165
- actual = @client.messaging.v1.campaigns.create(brand_registration_sid: 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', use_case: 'use_case', description: 'description', message_samples: ['message_samples'], has_embedded_links: true, has_embedded_phone: true, messaging_service_sid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
166
-
167
- expect(actual).to_not eq(nil)
168
- end
169
-
170
- it "can delete" do
171
- @holodeck.mock(Twilio::Response.new(500, ''))
172
-
173
- expect {
174
- @client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
175
- }.to raise_exception(Twilio::REST::TwilioError)
176
-
177
- expect(
178
- @holodeck.has_request?(Holodeck::Request.new(
179
- method: 'delete',
180
- url: 'https://messaging.twilio.com/v1/a2p/Campaigns/CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
181
- ))).to eq(true)
182
- end
183
-
184
- it "receives delete responses" do
185
- @holodeck.mock(Twilio::Response.new(
186
- 204,
187
- nil,
188
- ))
189
-
190
- actual = @client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
191
-
192
- expect(actual).to eq(true)
193
- end
194
- end
@@ -1,55 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
- #
7
- # frozen_string_literal: true
8
-
9
- require 'spec_helper.rb'
10
-
11
- describe 'UseCase' do
12
- it "can read" do
13
- @holodeck.mock(Twilio::Response.new(500, ''))
14
-
15
- expect {
16
- @client.messaging.v1.use_cases.list()
17
- }.to raise_exception(Twilio::REST::TwilioError)
18
-
19
- expect(
20
- @holodeck.has_request?(Holodeck::Request.new(
21
- method: 'get',
22
- url: 'https://messaging.twilio.com/v1/a2p/UseCases',
23
- ))).to eq(true)
24
- end
25
-
26
- it "receives read responses" do
27
- @holodeck.mock(Twilio::Response.new(
28
- 200,
29
- %q[
30
- {
31
- "meta": {
32
- "page": 0,
33
- "page_size": 50,
34
- "first_page_url": "https://messaging.twilio.com/v1/a2p/UseCases?PageSize=50&Page=0",
35
- "previous_page_url": null,
36
- "next_page_url": null,
37
- "key": "data",
38
- "url": "https://messaging.twilio.com/v1/a2p/UseCases?PageSize=50&Page=0"
39
- },
40
- "data": [
41
- {
42
- "code": "HIGHER_EDUCATION",
43
- "name": "Higher Education",
44
- "description": "Higher Education: For campaigns created on behalf of Colleges or Universities"
45
- }
46
- ]
47
- }
48
- ]
49
- ))
50
-
51
- actual = @client.messaging.v1.use_cases.list()
52
-
53
- expect(actual).to_not eq(nil)
54
- end
55
- end