-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fixed serialiser for enums, added url builder
- Loading branch information
Showing
12 changed files
with
118 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
import os | ||
import platform | ||
|
||
# __init__.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
|
||
|
||
# Handle different of authentications, Currently sendgrid authenticate using apikey. | ||
# Handle different of authentications, Currently sendgrid authenticate using apikey. | ||
# class AuthStrategy: | ||
# def authenticate(self): | ||
# print('Not yet implemented') | ||
# | ||
# | ||
# | ||
# | ||
# class ApiKeyAuthStrategy(AuthStrategy): | ||
# def __init__(self, api_key): | ||
# self.api_key = api_key | ||
# print('init ApiKeyAuthStrategy') | ||
# def authenticate(self, api_key): | ||
# print(f"Authenticating {api_key} using Token Authentication.") | ||
# print(f"Authenticating {api_key} using Token Authentication.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
class ClientBase: | ||
|
||
def __init__(self): | ||
print('Creating ClientBase class') | ||
print("Creating ClientBase class") | ||
|
||
def request(self): | ||
print('Making request') | ||
|
||
|
||
print("Making request") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
def build_url(url: str, region: str) -> str: | ||
base_url = "https://api.sendgrid.com" | ||
|
||
if region and isinstance(region, str): | ||
new_url = f"https://api.{region}.sendgrid.com" | ||
else: | ||
new_url = base_url | ||
|
||
# Ensure that there's a '/' before appending the url | ||
if not new_url.endswith('/'): | ||
new_url += '/' | ||
|
||
new_url += url.lstrip('/') | ||
|
||
return new_url | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
|
||
from logging import Logger | ||
from typing import Any, Dict, Optional, Tuple | ||
from urllib.parse import urlencode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters