telesign 3.0.0__py2.py3-none-any.whl → 4.0.0__py2.py3-none-any.whl

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.
telesign/__init__.py CHANGED
@@ -1,7 +1,5 @@
1
1
  from pkg_resources import get_distribution
2
2
 
3
- __import__('pkg_resources').declare_namespace(__name__)
4
-
5
3
  __version__ = get_distribution("telesign").version
6
4
  __author__ = "TeleSign"
7
5
  __copyright__ = "Copyright 2017, TeleSign Corp."
telesign/score.py CHANGED
@@ -1,25 +1,35 @@
1
- from __future__ import unicode_literals
2
-
3
1
  from telesign.rest import RestClient
4
2
 
5
- SCORE_RESOURCE = "/v1/score/{phone_number}"
6
-
3
+ DETECT_HOST = "https://detect.telesign.com"
4
+ INTELLIGENCE_RESOURCE = "/intelligence/phone"
7
5
 
8
6
  class ScoreClient(RestClient):
9
7
  """
10
- Score provides risk information about a specified phone number.
8
+ ScoreClient for TeleSign Intelligence Cloud.
9
+ Supports POST /intelligence/phone endpoint(Cloud migration).
11
10
  """
12
11
 
13
- def __init__(self, customer_id, api_key, **kwargs):
14
- super(ScoreClient, self).__init__(customer_id, api_key, **kwargs)
12
+ def __init__(self, customer_id, api_key, rest_endpoint=DETECT_HOST, **kwargs):
13
+ super(ScoreClient, self).__init__(customer_id, api_key, rest_endpoint, **kwargs)
15
14
 
16
15
  def score(self, phone_number, account_lifecycle_event, **params):
17
16
  """
18
- Score is an API that delivers reputation scoring based on phone number intelligence, traffic patterns, machine
19
- learning, and a global data consortium.
20
-
21
- See https://developer.telesign.com/docs/score-api for detailed API documentation.
17
+ Obtain a risk recommendation for a phone number using Telesign Intelligence Cloud API.
18
+ Required parameters:
19
+ - phone_number
20
+ - account_lifecycle_event ("create", "sign-in", "transact", "update", "delete")
21
+ Optional parameters: account_id, device_id, email_address, external_id, originating_ip, etc.
22
22
  """
23
- return self.post(SCORE_RESOURCE.format(phone_number=phone_number),
24
- account_lifecycle_event=account_lifecycle_event,
25
- **params)
23
+ if not phone_number:
24
+ raise ValueError("phone_number cannot be null or empty")
25
+
26
+ if not account_lifecycle_event:
27
+ raise ValueError("account_lifecycle_event cannot be null or empty")
28
+
29
+ params["phone_number"] = phone_number
30
+ params["account_lifecycle_event"] = account_lifecycle_event
31
+
32
+ return self.post(
33
+ INTELLIGENCE_RESOURCE,
34
+ **params
35
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: telesign
3
- Version: 3.0.0
3
+ Version: 4.0.0
4
4
  Summary: TeleSign SDK
5
5
  Home-page: https://github.com/telesign/python_telesign
6
6
  Author: TeleSign Corp.
@@ -21,6 +21,12 @@ Classifier: Programming Language :: Python :: 3.3
21
21
  Classifier: Programming Language :: Python :: 3.4
22
22
  Classifier: Programming Language :: Python :: 3.5
23
23
  Classifier: Programming Language :: Python :: 3.6
24
+ Classifier: Programming Language :: Python :: 3.7
25
+ Classifier: Programming Language :: Python :: 3.8
26
+ Classifier: Programming Language :: Python :: 3.9
27
+ Classifier: Programming Language :: Python :: 3.10
28
+ Classifier: Programming Language :: Python :: 3.11
29
+ Classifier: Programming Language :: Python :: 3.12
24
30
  Requires-Dist: requests
25
31
 
26
32
  .. image:: https://raw.github.com/TeleSign/python_telesign/master/python_banner.jpg
@@ -0,0 +1,12 @@
1
+ telesign/__init__.py,sha256=eDyQza1OnvJhC8uVA6AQ6Jq95mhuFNtCh9Dk9EZgAn4,310
2
+ telesign/messaging.py,sha256=v7l-eKUPqz7Nrwka0YNPMkC2TaoFUvQm3yp_djuTPu0,1367
3
+ telesign/phoneid.py,sha256=mk03NxL3wlaXpd8b-BB6q_SKfCxbtuTO19ayAHxmzz0,954
4
+ telesign/rest.py,sha256=AHNDyVZLa1vm2RWD4TSxr6uM4K50eH29C2Kjr3eCq8c,13911
5
+ telesign/score.py,sha256=VebZhJWSzneuMOoVvDKtv79tWlJqjffQ8gpzsH8wYVA,1326
6
+ telesign/util.py,sha256=stDxpL5ZQeGskE_OSGP04UFHs3ZP2ACaRpW1WyQGMHg,1624
7
+ telesign/voice.py,sha256=DJaWyQpun-T7LfNjpxpsUjupiv2ShW1jqoFQA-CE2-Y,1341
8
+ telesign-4.0.0.dist-info/LICENSE.txt,sha256=a--xZ4PCKUL5rpct8RrUC6ODU_8ZKIU51kJPfsA4HUs,1058
9
+ telesign-4.0.0.dist-info/METADATA,sha256=L8KulTzOsrRqXjL9ZZsFFsg3D6UUGln6fhpPdZXtCqg,4835
10
+ telesign-4.0.0.dist-info/WHEEL,sha256=z9j0xAa_JmUKMpmz72K0ZGALSM_n-wQVmGbleXx2VHg,110
11
+ telesign-4.0.0.dist-info/top_level.txt,sha256=6LG7Jcr1jnpVhOWaIShoTdwYJn0QCfPhfudyVJNz1qg,9
12
+ telesign-4.0.0.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- telesign/__init__.py,sha256=D8kANX0FKxBD7-a7xQ21xPz3ojM2WAOK8lThGLtDZuE,367
2
- telesign/messaging.py,sha256=v7l-eKUPqz7Nrwka0YNPMkC2TaoFUvQm3yp_djuTPu0,1367
3
- telesign/phoneid.py,sha256=mk03NxL3wlaXpd8b-BB6q_SKfCxbtuTO19ayAHxmzz0,954
4
- telesign/rest.py,sha256=AHNDyVZLa1vm2RWD4TSxr6uM4K50eH29C2Kjr3eCq8c,13911
5
- telesign/score.py,sha256=Kceu6IrirN9SsuT1geEWs0QHAn6H9ZNFyIDVHcBJdwg,908
6
- telesign/util.py,sha256=stDxpL5ZQeGskE_OSGP04UFHs3ZP2ACaRpW1WyQGMHg,1624
7
- telesign/voice.py,sha256=DJaWyQpun-T7LfNjpxpsUjupiv2ShW1jqoFQA-CE2-Y,1341
8
- telesign-3.0.0.dist-info/LICENSE.txt,sha256=a--xZ4PCKUL5rpct8RrUC6ODU_8ZKIU51kJPfsA4HUs,1058
9
- telesign-3.0.0.dist-info/METADATA,sha256=FbEOaOQ1w0LnFmiKDKo3SnGJKZ56Lf19ltUg83dYZ0g,4532
10
- telesign-3.0.0.dist-info/WHEEL,sha256=z9j0xAa_JmUKMpmz72K0ZGALSM_n-wQVmGbleXx2VHg,110
11
- telesign-3.0.0.dist-info/top_level.txt,sha256=6LG7Jcr1jnpVhOWaIShoTdwYJn0QCfPhfudyVJNz1qg,9
12
- telesign-3.0.0.dist-info/RECORD,,