-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/devexp 1324 sms api groups #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b8057b2
refactor(sms): remove deprecated groups and inbound models
marcos-sinch 69ee1ca
chore(update version): update version to 2.1.0
marcos-sinch f1898ec
feat(sms): add list and create groups
marcos-sinch 4882538
feat(sms): add delete, list_members, update and replace groups
marcos-sinch 25bd731
feat(sms): fix ruff format
marcos-sinch 3de66e3
test(sms): add groups unit tests
marcos-sinch a8053e4
test(sms): add groups e2e tests
marcos-sinch de86292
test(sms): fix update group excludes none
marcos-sinch f808e08
feat(sms): fix kwargs in list_members and delete
marcos-sinch c27ff78
feat(sms): fix group list snippet
marcos-sinch a567fdc
Merge branch 'v2.1-next' into feature/DEVEXP-1324-sms-api-groups
marcos-sinch 1ce96ac
feat(sms): fix group list snippet
marcos-sinch b94020d
feat(sms): address PR review comments
marcos-sinch 4794003
feat(sms): address PR review comments
marcos-sinch e44635b
feat(sms): address PR review comments
marcos-sinch 415bb4e
feat(sms): address PR review comments
marcos-sinch 764a424
feat(sms): change list groups and members print on snippet
marcos-sinch db0a8ff
feat(sms): missing Groups in apis __init__
marcos-sinch e912020
feat(sms): delete strong typing in snippets
marcos-sinch 0d15c22
feat(sms): update CHANGELOG.md and MIGRATION_GUIDE.md
marcos-sinch 3fddd99
Merge branch 'v2.1-next' into feature/DEVEXP-1324-sms-api-groups
marcos-sinch 092f023
feat(sms): update MIGRATION_GUIDE.md version
marcos-sinch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ coverage.xml | |
| .hypothesis/ | ||
| .pytest_cache/ | ||
| cover/ | ||
| lcov.info | ||
|
|
||
| # E2E features | ||
| *.feature | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| response = sinch_client.sms.groups.create( | ||
| name="Sinch Python SDK group", members=["+1234567890", "+1987654321"] | ||
| ) | ||
|
|
||
| print(f"Group created:\n{response}") |
This file contains hidden or 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,27 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| # The ID of the group to delete | ||
| group_id = "GROUP_ID" | ||
|
|
||
| sinch_client.sms.groups.delete(group_id=group_id) | ||
|
|
||
| print(f"Group {group_id} deleted") |
This file contains hidden or 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,29 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| # The ID of the group to retrieve | ||
| GROUP_ID = "GROUP_ID" | ||
|
|
||
| response = sinch_client.sms.groups.get( | ||
| group_id=GROUP_ID | ||
| ) | ||
|
|
||
| print(f"Group details:\n{response}") | ||
This file contains hidden or 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,26 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| groups = sinch_client.sms.groups.list() | ||
|
|
||
| print("List of groups:\n") | ||
| for group in groups.iterator(): | ||
| print(group) |
This file contains hidden or 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,30 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
| from typing import List | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| # The ID of the group to list members for | ||
| group_id = "GROUP_ID" | ||
|
|
||
| members = sinch_client.sms.groups.list_members(group_id=group_id) | ||
|
|
||
| print("List of members:\n") | ||
| for member in members.iterator(): | ||
| print(member) |
This file contains hidden or 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,30 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| # The ID of the group to replace | ||
| group_id = "GROUP_ID" | ||
|
|
||
| response = sinch_client.sms.groups.replace( | ||
| group_id=group_id, | ||
| members=["+1234567890", "+1987654321"], | ||
| ) | ||
|
|
||
| print(f"Group replaced:\n{response}") |
This file contains hidden or 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,32 @@ | ||
| """ | ||
| Sinch Python Snippet | ||
|
|
||
| This snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| from sinch import SinchClient | ||
|
|
||
| load_dotenv() | ||
|
|
||
| sinch_client = SinchClient( | ||
| project_id=os.environ.get("SINCH_PROJECT_ID") or "MY_PROJECT_ID", | ||
| key_id=os.environ.get("SINCH_KEY_ID") or "MY_KEY_ID", | ||
| key_secret=os.environ.get("SINCH_KEY_SECRET") or "MY_KEY_SECRET", | ||
| sms_region=os.environ.get("SINCH_SMS_REGION") or "MY_SMS_REGION" | ||
| ) | ||
|
|
||
| # The ID of the group to update | ||
| group_id = "GROUP_ID" | ||
|
|
||
| response = sinch_client.sms.groups.update( | ||
| group_id=group_id, | ||
| add=["+1234567890"], | ||
| remove=["+1987654321"], | ||
| name="Renamed Group", | ||
| ) | ||
|
|
||
| print(f"Group updated:\n{response}") |
This file contains hidden or 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 hidden or 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,7 +1,9 @@ | ||
| from sinch.domains.sms.api.v1.batches_apis import Batches | ||
| from sinch.domains.sms.api.v1.delivery_reports_apis import DeliveryReports | ||
| from sinch.domains.sms.api.v1.groups_apis import Groups | ||
|
|
||
| __all__ = [ | ||
| "Batches", | ||
| "DeliveryReports", | ||
| "Groups", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.