File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1212
1313
1414class Config (object ):
15- API_URL = 'https://api.mailjet.com/'
15+ DEFAULT_API_URL = 'https://api.eu .mailjet.com/'
1616 API_REF = 'http://dev.mailjet.com/email-api/v3/'
1717 version = 'v3'
1818 user_agent = 'mailjet-apiv3-python/v' + get_version ()
1919
20- def __init__ (self , version = None ):
20+ def __init__ (self , version = None , api_url = None ):
2121 if version is not None :
2222 self .version = version
23+ self .api_url = api_url or self .DEFAULT_API_URL
2324
2425 def __getitem__ (self , key ):
25- url = self .API_URL [0 :]
26+ url = self .api_url [0 :]
2627 # Append version to URL.
2728 # Forward slash is ignored if present in self.version.
2829 url = urljoin (url , self .version + '/' )
@@ -75,7 +76,8 @@ class Client(object):
7576 def __init__ (self , auth = None , ** kwargs ):
7677 self .auth = auth
7778 version = kwargs .get ('version' , None )
78- self .config = Config (version = version )
79+ api_url = kwargs .get ('api_url' , None )
80+ self .config = Config (version = version , api_url = api_url )
7981
8082 def __getattr__ (self , name ):
8183 split = name .split ('_' )
You can’t perform that action at this time.
0 commit comments