-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
59 additions
and
10 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import absolute_import, division, print_function | ||
|
||
from telnyx.api_resources.abstract import UpdateableAPIResource | ||
|
||
|
||
class InboundChannel(UpdateableAPIResource): | ||
OBJECT_NAME = "inbound_channels" | ||
|
||
@classmethod | ||
def class_url(cls): | ||
return "/v2/phone_numbers/inbound_channels" | ||
|
||
def instance_url(self): | ||
return "/v2/phone_numbers/inbound_channels" | ||
|
||
@classmethod | ||
def modify(cls, **params): | ||
url = "/v2/phone_numbers/inbound_channels" | ||
return cls._modify(url, **params) | ||
|
||
@classmethod | ||
def retrieve(cls, api_key=None, **params): | ||
return super().retrieve(None, api_key, **params) | ||
|
||
def save_method(self): | ||
return "patch" |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from __future__ import absolute_import, division, print_function | ||
|
||
import pytest | ||
|
||
import telnyx | ||
|
||
|
||
class TestInboundChannels(object): | ||
def test_is_retrievable(self, request_mock): | ||
resource = telnyx.InboundChannel.retrieve() | ||
request_mock.assert_requested("get", "/v2/phone_numbers/inbound_channels") | ||
assert isinstance(resource, telnyx.InboundChannel) | ||
|
||
def test_is_saveable(self, request_mock): | ||
inbound_channels = telnyx.InboundChannel.retrieve() | ||
inbound_channels.channels = 10 | ||
resource = inbound_channels.save() | ||
request_mock.assert_requested("patch", "/v2/phone_numbers/inbound_channels") | ||
assert isinstance(resource, telnyx.InboundChannel) | ||
assert resource is inbound_channels | ||
|
||
def test_is_modifiable(self, request_mock): | ||
resource = telnyx.InboundChannel.modify(channels=10) | ||
request_mock.assert_requested("patch", "/v2/phone_numbers/inbound_channels") | ||
assert isinstance(resource, telnyx.InboundChannel) |
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