8000 6.7.1 Release · thecodeflash/twilio-python@895941a · GitHub
[go: up one dir, main page]

Skip to content

Commit 895941a

Browse files
author
Tom Connors
committed
6.7.1 Release
1 parent ff193a1 commit 895941a

File tree

9 files changed

+1337
-0
lines changed

9 files changed

+1337
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class VerificationTestCase(IntegrationTestCase):
16+
17+
def test_create_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.verifications.create(to="to", channel="channel")
23+
24+
values = {
25+
'To': "to",
26+
'Channel': "channel",
27+
}
28+
29+
self.holodeck.assert_has_request(Request(
30+
'post',
31+
'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications',
32+
data=values,
33+
))
34+
35+
def test_create_verification_response(self):
36+
self.holodeck.mock(Response(
37+
201,
38+
'''
39+
{
40+
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41+
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
43+
"to": "+14159373912",
44+
"channel": "sms",
45+
"status": "pending",
46+
"valid": null,
47+
"date_created": "2015-07-30T20:00:00Z",
48+
"date_updated": "2015-07-30T20:00:00Z"
49+
}
50+
'''
51+
))
52+
53+
actual = self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
54+
.verifications.create(to="to", channel="channel")
55+
56+
self.assertIsNotNone(actual)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class VerificationCheckTestCase(IntegrationTestCase):
16+
17+
def test_create_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.verification_checks.create(code="code")
23+
24+
values = {
25+
'Code': "code",
26+
}
27+
28+
self.holodeck.assert_has_request(Request(
29+
'post',
30+
'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck',
31+
data=values,
32+
))
33+
34+
def test_verification_checks_response(self):
35+
self.holodeck.mock(Response(
36+
201,
37+
'''
38+
{
39+
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40+
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42+
"to": "+14159373912",
43+
"channel": "sms",
44+
"status": "approved",
45+
"valid": false,
46+
"date_created": "2015-07-30T20:00:00Z",
47+
"date_updated": "2015-07-30T20:00:00Z"
48+
}
49+
'''
50+
))
51+
52+
actual = self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
53+
.verification_checks.create(code="code")
54+
55+
self.assertIsNotNone(actual)
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class ServiceTestCase(IntegrationTestCase):
16+
17+
def test_create_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+ 10000
with self.assertRaises(TwilioException):
21+
self.client.preview.acc_security.services.create(name="name")
22+
23+
values = {
24+
'Name': "name",
25+
}
26+
27+
self.holodeck.assert_has_request(Request(
28+
'post',
29+
'https://preview.twilio.com/Verification/Services',
30+
data=values,
31+
))
32+
33+
def test_create_record_response(self):
34+
self.holodeck.mock(Response(
35+
201,
36+
'''
37+
{
38+
"sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40+
"name": "name",
41+
"code_length": 4,
42+
"date_created": "2015-07-30T20:00:00Z",
43+
"date_updated": "2015-07-30T20:00:00Z",
44+
"url": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45+
"links": {
46+
"verification_checks": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
47+
"verifications": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications"
48+
}
49+
}
50+
'''
51+
))
52+
53+
actual = self.client.preview.acc_security.services.create(name="name")
54+
55+
self.assertIsNotNone(actual)
56+
57+
def test_fetch_request(self):
58+
self.holodeck.mock(Response(500, ''))
59+
60+
with self.assertRaises(TwilioException):
61+
self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
62+
63+
self.holodeck.assert_has_request(Request(
64+
'get',
65+
'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
66+
))
67+
68+
def test_fetch_record_response(self):
69+
self.holodeck.mock(Response(
70+
200,
71+
'''
72+
{
73+
"sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
74+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
75+
"name": "name",
76+
"code_length": 4,
77+
"date_created": "2015-07-30T20:00:00Z",
78+
"date_updated": "2015-07-30T20:00:00Z",
79+
"url": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
80+
"links": {
81+
"verification_checks": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
82+
"verifications": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications"
83+
}
84+
}
85+
'''
86+
))
87+
88+
actual = self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
89+
90+
self.assertIsNotNone(actual)
91+
92+
def test_list_request(self):
93+
self.holodeck.mock(Response(500, ''))
94+
95+
with self.assertRaises(TwilioException):
96+
self.client.preview.acc_security.services.list()
97+
98+
self.holodeck.assert_has_request(Request(
99+
'get',
100+
'https://preview.twilio.com/Verification/Services',
101+
))
102+
103+
def test_read_all_response(self):
104+
self.holodeck.mock(Response(
105+
200,
106+
'''
107+
{
108+
"meta": {
109+
"page": 0,
110+
"page_size": 50,
111+
"first_page_url": "https://preview.twilio.com/Verification/Services?PageSize=50&Page=0",
112+
"previous_page_url": null,
113+
"next_page_url": null,
114+
"key": "services",
115+
"url": "https://preview.twilio.com/Verification/Services?PageSize=50&Page=0"
116+
},
117+
"services": [
118+
{
119+
"sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
120+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
121+
"name": "name",
122+
"code_length": 4,
123+
"date_created": "2015-07-30T20:00:00Z",
124+
"date_updated": "2015-07-30T20:00:00Z",
125+
"url": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
126+
"links": {
127+
"verification_checks": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
128+
"verifications": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications"
129+
}
130+
}
131+
]
132+
}
133+
'''
134+
))
135+
136+
actual = self.client.preview.acc_security.services.list()
137+
138+
self.assertIsNotNone(actual)
139+
140+
def test_update_request(self):
141+
self.holodeck.mock(Response(500, ''))
142+
143+
with self.assertRaises(TwilioException):
144+
self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
145+
146+
self.holodeck.assert_has_request(Request(
147+
'post',
148+
'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
149+
))
150+
151+
def test_update_record_response(self):
152+
self.holodeck.mock(Response(
153+
200,
154+
'''
155+
{
156+
"sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
157+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
158+
"name": "name",
159+
"code_length": 4,
160+
"date_created": "2015-07-30T20:00:00Z",
161+
"date_updated": "2015-07-30T20:00:00Z",
162+
"url": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
163+
"links": {
164+
"verification_checks": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
165+
"verifications": "https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications"
166+
}
167+
}
168+
'''
169+
))
170+
171+
actual = self.client.preview.acc_security.services(sid="VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
172+
173+
self.assertIsNotNone(actual)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from twilio.base.version import Version
10+
from twilio.rest.preview.acc_security.service import ServiceList
11+
12+
13+
class AccSecurity(Version):
14+
15+
def __init__(self, domain):
16+
"""
17+
Initialize the AccSecurity version of Preview
18+
19+
:returns: AccSecurity version of Preview
20+
:rtype: twilio.rest.preview.acc_security.AccSecurity.AccSecurity
21+
"""
22+
super(AccSecurity, self).__init__(domain)
23+
self.version = 'Verification'
24+
self._services = None
25+
26+
@property
27+
def services(self):
28+
"""
29+
:rtype: twilio.rest.preview.acc_security.service.ServiceList
30+
"""
31+
if self._services is None:
32+
self._services = ServiceList(self)
33+
return self._services
34+
35+
def __repr__(self):
36+
"""
37+
Provide a friendly representation
38+
39+
:returns: Machine friendly representation
40+
:rtype: str
41+
"""
42+
return '<Twilio.Preview.AccSecurity>'

0 commit comments

Comments
 (0)
0