Skip to content

Commit ba87b6c

Browse files
committed
refactor: standardize all variable names
1 parent 8166361 commit ba87b6c

File tree

15 files changed

+39
-60
lines changed

15 files changed

+39
-60
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SINCH_PROJECT_ID=
2+
SINCH_KEY_ID=
3+
SINCH_KEY_SECRET=

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ celerybeat.pid
9393
*.sage.py
9494

9595
# Environments
96-
.env
9796
.venv
9897
env/
9998
venv/

README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,3 @@ Sinch Python SDK Code Snippets Repository
44

55
This repository contains code snippets demonstrating usage of the
66
[Sinch Python SDK](https://github.com/sinch/sinch-sdk-python).
7-
8-
9-
## Functions Demonstrated
10-
11-
- **Active Numbers**
12-
- [List active numbers](snippets/numbers/active_numbers/list/snippet.py)
13-
- [List active numbers (auto pagination)](snippets/numbers/active_numbers/list_auto/snippet.py)
14-
- [Retrieve an active phone number](snippets/numbers/active_numbers/get/snippet.py)
15-
- [Update an active phone number](snippets/numbers/active_numbers/update/snippet.py)
16-
- [Release an active number](snippets/numbers/active_numbers/release/snippet.py)
17-
18-
- **Available Numbers**
19-
- [Search for available numbers](snippets/numbers/available_numbers/search_for_available_numbers/snippet.py)
20-
- [Search for a specific phone number](snippets/numbers/available_numbers/check_availability/snippet.py)
21-
- [Activate a new phone number](snippets/numbers/available_numbers/rent/snippet.py)
22-
- [Rent any number that matches the criteria](snippets/numbers/available_numbers/rent_any/snippet.py)
23-
24-
- **Available Regions**
25-
- [List available regions](snippets/numbers/available_regions/list/snippet.py)
26-
27-
- **Callback Configuration**
28-
- [Get callbacks configuration](snippets/numbers/callback_configuration/get/snippet.py)
29-
- [Update callback configuration](snippets/numbers/callback_configuration/update/snippet.py)

snippets/numbers/active_numbers/get/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
load_dotenv()
66

77
sinch_client = SinchClient(
8-
project_id=os.environ["PROJECT_ID"],
9-
key_id=os.environ["KEY_ID"],
10-
key_secret=os.environ["KEY_SECRET"]
8+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
9+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
10+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1111
)
1212

1313
phone_number = "YOUR_RENTED_PHONE_NUMBER"

snippets/numbers/active_numbers/list/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
load_dotenv()
66

77
sinch_client = SinchClient(
8-
project_id=os.environ["PROJECT_ID"],
9-
key_id=os.environ["KEY_ID"],
10-
key_secret=os.environ["KEY_SECRET"]
8+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
9+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
10+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1111
)
1212

1313
active_numbers = sinch_client.numbers.list(

snippets/numbers/active_numbers/list_auto/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
load_dotenv()
66

77
sinch_client = SinchClient(
8-
project_id=os.environ["PROJECT_ID"],
9-
key_id=os.environ["KEY_ID"],
10-
key_secret=os.environ["KEY_SECRET"]
8+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
9+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
10+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1111
)
1212

1313
active_numbers = sinch_client.numbers.list(

snippets/numbers/active_numbers/release/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
load_dotenv()
66

77
sinch_client = SinchClient(
8-
project_id=os.environ["PROJECT_ID"],
9-
key_id=os.environ["KEY_ID"],
10-
key_secret=os.environ["KEY_SECRET"]
8+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
9+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
10+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1111
)
1212

1313
phone_number = "PHONE_NUMBER_TO_BE_RELEASED"

snippets/numbers/active_numbers/update/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
load_dotenv()
77

88
sinch_client = SinchClient(
9-
project_id=os.environ["PROJECT_ID"],
10-
key_id=os.environ["KEY_ID"],
11-
key_secret=os.environ["KEY_SECRET"]
9+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
10+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
11+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1212
)
1313

1414
phone_number = "PHONE_NUMBER"

snippets/numbers/available_numbers/check_availability/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
load_dotenv()
66

77
sinch_client = SinchClient(
8-
project_id=os.environ["PROJECT_ID"],
9-
key_id=os.environ["KEY_ID"],
10-
key_secret=os.environ["KEY_SECRET"]
8+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
9+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
10+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1111
)
1212

1313
phone_number = "PHONE_NUMBER"

snippets/numbers/available_numbers/rent/snippet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
load_dotenv()
77

88
sinch_client = SinchClient(
9-
project_id=os.environ["PROJECT_ID"],
10-
key_id=os.environ["KEY_ID"],
11-
key_secret=os.environ["KEY_SECRET"]
9+
project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID",
10+
key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID",
11+
key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET"
1212
)
1313

1414
phone_number = "AVAILABLE_PHONE_NUMBER_TO_BE_RENTED"

0 commit comments

Comments
 (0)