Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.0
current_version = 1.0.0
commit = False
tag = False

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For information about the API itself, head on over to our
Just use everyone's favourite python package installer: `pip`

```bash
pip install python-dialpad
pip install python-dialpad-httpx-open
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ bump2version
swagger-spec-validator == 2.7.3
swagger-stub == 0.2.1
jsonschema<4.0
git+https://github.com/jakedialpad/swagger-parser@v1.0.1b#egg=swagger-parser
git+https://github.com/gaureshdialpad/swagger-parser@v1.0.1b#egg=swagger-parser
5 changes: 5 additions & 0 deletions dialpad/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
UserResource,
CallResource,
NumberResource,
OAuthAppsResource,
OfficeResource,
WebhookResource,
CompanyResource,
Expand Down Expand Up @@ -149,6 +150,10 @@ def event_subscription(self):
def number(self):
return NumberResource(self)

@cached_property
def oauth_apps(self):
return OAuthAppsResource(self)

@cached_property
def office(self):
return OfficeResource(self)
Expand Down
1 change: 1 addition & 0 deletions dialpad/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .department import DepartmentResource
from .event_subscription import EventSubscriptionResource
from .number import NumberResource
from .oauth_apps import OAuthAppsResource
from .office import OfficeResource
from .room import RoomResource
from .sms import SMSResource
Expand Down
29 changes: 29 additions & 0 deletions dialpad/resources/oauth_apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from .resource import DialpadResource

class OAuthAppsResource(DialpadResource):
"""OAuthAppsResource implements python bindings for the Dialpad API's oauth-apps
endpoints.

See https://developers.dialpad.com/reference/oauthappapi_toggleoauthapp for additional
documentation.
"""
_resource_path = ['oauth_apps']

def toggle(self, oauth_app_id, enable, target_id=None, target_type=None):
"""Enables or disables an OAuth App for a given target or the API key's target.

Args:
oauth_app_id (str, required): The OAuth App's ID (client_id).
enable (bool, required): Whether or not the OAuth app should be enabled.
target_id (int, optional): The id of the target that the OAuth app should be toggled for.
target_type (str, optional): The type of the target that the OAuth app should be toggled for.

See Also:
https://developers.dialpad.com/reference/oauthappapi_toggleoauthapp
"""
data = dict(enable=enable)
if target_id is not None:
data['target_id'] = target_id
if target_type is not None:
data['target_type'] = target_type
return self.request([oauth_app_id, 'toggle'], method='PATCH', data=data)
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def readme():


setup(
name='python-dialpad-httpx',
version='1.1.0',
description='A python wrapper for the Dialpad REST API',
name='python-dialpad-httpx-open',
version='1.0.0',
description='A clone of the python wrapper for the Dialpad REST API',
long_description=readme(),
long_description_content_type="text/markdown",
author='Jake Nielsen',
author_email='jnielsen@dialpad.com',
author='Gauresh Shirodkar',
author_email='gshirodkar@dialpad.com',
license='MIT',
url='https://github.com/dialpad/dialpad-python-sdk',
url='https://github.com/gaureshdialpad/dialpad-python-sdk-async',
install_requires=[
'cached-property',
'certifi',
Expand Down
2 changes: 1 addition & 1 deletion test/test_resource_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""Tests to automatically detect common issues with resource definitions.

In particular these tests will look through the files in dialpad-python-sdk/dialpad/resources/ and
In particular these tests will look through the files in dialpad-python-sdk-async/dialpad/resources/ and
ensure:

- All subclasses of DialpadResource are exposed directly in resources/__init__.py
Expand Down
2 changes: 1 addition & 1 deletion tools/create_release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DOC="Build and release a new version of the python-dialpad package.
DOC="Build and release a new version of the python-dialpad-httpx-open package.

Usage:
create_version.sh [-h] [--patch|--minor|--major] [--bump-only|--no-upload]
Expand Down