-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ENGDESK-31143/31111 * Test fixes * Adding docs for proxy server/mock service
- Loading branch information
1 parent
d8f4242
commit 0f9da5c
Showing
16 changed files
with
161 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telnyx | ||
class PhoneNumberAssignmentByProfile < APIResource | ||
extend APIOperations::List | ||
extend APIOperations::Create | ||
extend APIOperations::NestedResource | ||
|
||
def accept_sharing(params = {}, opts = {}) | ||
resp, opts = request(:get, "/10dlc/campaign/phoneNumbers/#{taskId.gsub(/\s+/, '+')}", params, opts) | ||
Util.convert_to_telnyx_object(resp.data, opts) | ||
end | ||
|
||
def self.resource_url(inner_id = nil) | ||
path_prefix = "/10dlc" | ||
object_path = "phoneNumberAssignmentByProfile" | ||
|
||
inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}" | ||
end | ||
|
||
OBJECT_NAME = "10dlc/phoneNumberAssignmentByProfile".freeze | ||
end | ||
end |
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,32 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telnyx | ||
class PartnerCampaign < APIResource | ||
extend Telnyx::APIOperations::List | ||
extend Telnyx::APIOperations::Create | ||
include Telnyx::APIOperations::Delete | ||
include Telnyx::APIOperations::Save | ||
extend APIOperations::NestedResource | ||
|
||
ACTIONS = %w[mnoMetadata operationStatus].freeze | ||
ACTIONS.each do |action| | ||
nested_resource_class_methods action, | ||
path: %W[#{action}], | ||
operations: [:create], | ||
instance_methods: { create: action } | ||
end | ||
def sharing(params = {}, opts = {}) | ||
resp, opts = request(:post, "/10dlc/campaign/sharing/#{campaignId.gsub(/\s+/, '+')}", params, opts) | ||
Util.convert_to_telnyx_object(resp.data, opts) | ||
end | ||
|
||
def self.resource_url(inner_id = nil) | ||
path_prefix = "/10dlc" | ||
object_path = "partnerCampaign" | ||
|
||
inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}" | ||
end | ||
|
||
OBJECT_NAME = "partnerCampaign".freeze | ||
end | ||
end |
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,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telnyx | ||
VERSION = "3.0.0".freeze | ||
VERSION = "3.0.1".freeze | ||
end |
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,36 @@ | ||
## Using custom OpenAPI specification and fixtures files | ||
# Using custom OpenAPI specification and fixtures files | ||
|
||
You can place custom OpenAPI specification and fixtures files in this | ||
directory. The files must be in JSON format, and must be named `spec3.json` | ||
and `fixtures3.json` respectively. | ||
|
||
If those files are present, the test suite will start its own telnyx-mock | ||
process on a random available port. In order for this to work, `telnyx-mock` | ||
must be on the `PATH` in the environment used to run the test suite. | ||
## Development | ||
|
||
### Setup | ||
The test suite depends on the [Prism Mock Server](https://github.com/stoplightio/prism). | ||
|
||
```bash | ||
npm install -g @stoplight/prism-cli | ||
|
||
# OR | ||
|
||
yarn global add @stoplight/prism-cli | ||
``` | ||
|
||
Once installed, start the prism mock service with the following command: | ||
|
||
```bash | ||
prism mock https://raw.githubusercontent.com/team-telnyx/openapi/master/openapi/spec3.json | ||
``` | ||
|
||
-------- | ||
|
||
One final step -- because the Ruby SDK originally expected to reach the legacy `telnyx-mock` service at port 12111 (in addition to providing a `/v2/` base path), we need to setup a proxy server. | ||
|
||
You can do this any way you wish, but included is a server.js file which you can utilize: | ||
|
||
```bash | ||
# In new terminal window | ||
|
||
node server.js | ||
``` |
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
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