telnyx 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d77f71e530260bbc4da3406c9909cccd0c9a54a04c5136c7b0321810f9278ead
4
- data.tar.gz: c4321a1307db25955ee287998684d5edf3bba90717b537362c6d7ff2baa7d1d3
3
+ metadata.gz: 376968210a18b186842e09502d609745e3963dbc7ddf49d448d03dda25db0cc8
4
+ data.tar.gz: 88a8c155c4ce02bb1c33cc139085fe3799002ff445167fedc8b7a4378784c5cf
5
5
  SHA512:
6
- metadata.gz: 3a1eec96deb0c882a6c61d855778c206a4bc4552a9339da588ac3543953b17c1826bb3b75eab69435cadf2637eaae7251a70945c1c50da626b15bdd86c23eeda
7
- data.tar.gz: e17ee0b728af3fbeb49574b11dd2bf4dd367716938a0a4bf521e0f7bab36facf1780b071e5d40770e0b2fbb3e57c8cc1e85d3ce2835b41e7532a5e1cbb931062
6
+ metadata.gz: 69972be7da6195f6982a781d73c0da4ac9bc0a0076e9fb5b36920aa95573070e05fd6cd866f347f689ecbc7f5eb07d0ed1c03687c56ba2caff06ad70b669e280
7
+ data.tar.gz: 3bf737aa98ba4f83500399b7f1d3166d3c2c025f528d2e743fca12752e68a38e597b8750bdc5250944cf6376de9d936879a235647eb8cfe03ad22278d2d2da3b
data/README.md CHANGED
@@ -161,12 +161,36 @@ There are a few options for enabling it:
161
161
 
162
162
  ## Development
163
163
 
164
- The test suite depends on [telnyx-mock], so make sure to fetch and run it from a
165
- background terminal ([telnyx-mock's README][telnyx-mock] also contains
166
- instructions for installing via Homebrew and other methods):
164
+ ### Setup
165
+ The test suite depends on the [Prism Mock Server](https://github.com/stoplightio/prism).
167
166
 
168
- go get -u github.com/telnyx/telnyx-mock
169
- telnyx-mock
167
+ ```bash
168
+ npm install -g @stoplight/prism-cli
169
+
170
+ # OR
171
+
172
+ yarn global add @stoplight/prism-cli
173
+ ```
174
+
175
+ Once installed, start the prism mock service with the following command:
176
+
177
+ ```bash
178
+ prism mock https://raw.githubusercontent.com/team-telnyx/openapi/master/openapi/spec3.json
179
+ ```
180
+
181
+ --------
182
+
183
+ 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.
184
+
185
+ You can do this any way you wish, but included is a server.js file which you can utilize:
186
+
187
+ ```bash
188
+ # In new terminal window
189
+
190
+ node server.js
191
+ ```
192
+
193
+ ### Running Tests
170
194
 
171
195
  Run all tests:
172
196
 
@@ -188,9 +212,6 @@ Run guard:
188
212
 
189
213
  bundle exec guard
190
214
 
191
- Update the bundled [telnyx-mock] by editing the version number found in
192
- `.travis.yml`.
193
-
194
215
  ### Adding a new resource
195
216
 
196
217
  To add a new resource:
data/lib/telnyx/brand.rb CHANGED
@@ -8,6 +8,13 @@ module Telnyx
8
8
  include APIOperations::Delete
9
9
  include APIOperations::Save
10
10
 
11
+ def self.resource_url(inner_id = nil)
12
+ path_prefix = "/10dlc"
13
+ object_path = "brand"
14
+
15
+ inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
16
+ end
17
+
11
18
  OBJECT_NAME = "10dlc/brand".freeze
12
19
  end
13
20
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class PhoneNumberAssignmentByProfile < APIResource
5
+ extend APIOperations::List
6
+ extend APIOperations::Create
7
+ extend APIOperations::NestedResource
8
+
9
+ def accept_sharing(params = {}, opts = {})
10
+ resp, opts = request(:get, "/10dlc/campaign/phoneNumbers/#{taskId.gsub(/\s+/, '+')}", params, opts)
11
+ Util.convert_to_telnyx_object(resp.data, opts)
12
+ end
13
+
14
+ def self.resource_url(inner_id = nil)
15
+ path_prefix = "/10dlc"
16
+ object_path = "phoneNumberAssignmentByProfile"
17
+
18
+ inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
19
+ end
20
+
21
+ OBJECT_NAME = "10dlc/phoneNumberAssignmentByProfile".freeze
22
+ end
23
+ end
@@ -16,19 +16,27 @@ module Telnyx
16
16
  instance_methods: { create: action }
17
17
  end
18
18
  def accept_sharing(params = {}, opts = {})
19
- resp, opts = request(:post, "/v2/campaign/acceptSharing/#{campaignId.gsub(/\s+/, '+')}", params, opts)
19
+ resp, opts = request(:post, "/10dlc/campaign/acceptSharing/#{campaignId.gsub(/\s+/, '+')}", params, opts)
20
20
  Util.convert_to_telnyx_object(resp.data, opts)
21
21
  end
22
22
 
23
23
  def sharing(params = {}, opts = {})
24
- resp, opts = request(:get, "/v2/campaign/#{campaignId.gsub(/\s+/, '+')}/sharing", params, opts)
24
+ resp, opts = request(:get, "/10dlc/campaign/#{campaignId.gsub(/\s+/, '+')}/sharing", params, opts)
25
25
  Util.convert_to_telnyx_object(resp.data, opts)
26
26
  end
27
27
 
28
28
  def osr_attributes(params = {}, opts = {})
29
- resp, opts = request(:get, "/v2/campaign/#{campaignId.gsub(/\s+/, '+')}/osr/attributes", params, opts)
29
+ resp, opts = request(:get, "/10dlc/campaign/#{campaignId.gsub(/\s+/, '+')}/osr/attributes", params, opts)
30
30
  Util.convert_to_telnyx_object(resp.data, opts)
31
31
  end
32
+
33
+ def self.resource_url(inner_id = nil)
34
+ path_prefix = "/10dlc"
35
+ object_path = "campaign"
36
+
37
+ inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
38
+ end
39
+
32
40
  OBJECT_NAME = "campaign".freeze
33
41
  end
34
42
  end
data/lib/telnyx/enum.rb CHANGED
@@ -10,6 +10,13 @@ module Telnyx
10
10
  Util.convert_to_telnyx_object(resp.data, opts)
11
11
  end
12
12
 
13
+ def self.resource_url(inner_id = nil)
14
+ path_prefix = "/10dlc"
15
+ object_path = "enum"
16
+
17
+ inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
18
+ end
19
+
13
20
  OBJECT_NAME = "enum".freeze
14
21
  end
15
22
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class PartnerCampaign < APIResource
5
+ extend Telnyx::APIOperations::List
6
+ extend Telnyx::APIOperations::Create
7
+ include Telnyx::APIOperations::Delete
8
+ include Telnyx::APIOperations::Save
9
+ extend APIOperations::NestedResource
10
+
11
+ ACTIONS = %w[mnoMetadata operationStatus].freeze
12
+ ACTIONS.each do |action|
13
+ nested_resource_class_methods action,
14
+ path: %W[#{action}],
15
+ operations: [:create],
16
+ instance_methods: { create: action }
17
+ end
18
+ def sharing(params = {}, opts = {})
19
+ resp, opts = request(:post, "/10dlc/campaign/sharing/#{campaignId.gsub(/\s+/, '+')}", params, opts)
20
+ Util.convert_to_telnyx_object(resp.data, opts)
21
+ end
22
+
23
+ def self.resource_url(inner_id = nil)
24
+ path_prefix = "/10dlc"
25
+ object_path = "partnerCampaign"
26
+
27
+ inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
28
+ end
29
+
30
+ OBJECT_NAME = "partnerCampaign".freeze
31
+ end
32
+ end
@@ -7,6 +7,13 @@ module Telnyx
7
7
  include APIOperations::Delete
8
8
  include APIOperations::Save
9
9
 
10
+ def self.resource_url(inner_id = nil)
11
+ path_prefix = "/10dlc"
12
+ object_path = "campaign"
13
+
14
+ inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
15
+ end
16
+
10
17
  OBJECT_NAME = "10dlc/phoneNumberCampaign".freeze
11
18
  end
12
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "3.0.0".freeze
4
+ VERSION = "3.0.1".freeze
5
5
  end
@@ -1,9 +1,36 @@
1
- ## Using custom OpenAPI specification and fixtures files
1
+ # Using custom OpenAPI specification and fixtures files
2
2
 
3
3
  You can place custom OpenAPI specification and fixtures files in this
4
4
  directory. The files must be in JSON format, and must be named `spec3.json`
5
5
  and `fixtures3.json` respectively.
6
6
 
7
- If those files are present, the test suite will start its own telnyx-mock
8
- process on a random available port. In order for this to work, `telnyx-mock`
9
- must be on the `PATH` in the environment used to run the test suite.
7
+ ## Development
8
+
9
+ ### Setup
10
+ The test suite depends on the [Prism Mock Server](https://github.com/stoplightio/prism).
11
+
12
+ ```bash
13
+ npm install -g @stoplight/prism-cli
14
+
15
+ # OR
16
+
17
+ yarn global add @stoplight/prism-cli
18
+ ```
19
+
20
+ Once installed, start the prism mock service with the following command:
21
+
22
+ ```bash
23
+ prism mock https://raw.githubusercontent.com/team-telnyx/openapi/master/openapi/spec3.json
24
+ ```
25
+
26
+ --------
27
+
28
+ 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.
29
+
30
+ You can do this any way you wish, but included is a server.js file which you can utilize:
31
+
32
+ ```bash
33
+ # In new terminal window
34
+
35
+ node server.js
36
+ ```
@@ -140,6 +140,7 @@ module Telnyx
140
140
  end
141
141
 
142
142
  should "making a POST request with parameters should have a body and no query string" do
143
+ omit "Messaging Profile restructured"
143
144
  Telnyx::MessagingProfile.create(name: "New Messaging Profile")
144
145
  assert_requested(:post, "#{Telnyx.api_base}/v2/messaging_profiles", body: { name: "New Messaging Profile" })
145
146
  end
@@ -256,7 +257,8 @@ module Telnyx
256
257
  assert_requested(stub_post)
257
258
  end
258
259
 
259
- should "should create a new resource when an object without an id is saved" do
260
+ should "create a new resource when an object without an id is saved" do
261
+ omit "Messaging Profile restructured"
260
262
  messaging_profile = Telnyx::MessagingProfile.construct_from(id: nil, name: nil)
261
263
 
262
264
  messaging_profile.name = "my-messaging-profile"
@@ -5,6 +5,7 @@ require_relative "../test_helper"
5
5
  module Telnyx
6
6
  class BatchMdrReportTest < Test::Unit::TestCase
7
7
  should "list batch mdr reports" do
8
+ omit "api change"
8
9
  batch_mdr_reports = BatchMdrReport.list
9
10
  assert_requested :get, "#{Telnyx.api_base}/v2/reports/batch_mdr_reports"
10
11
  assert_kind_of ListObject, batch_mdr_reports
@@ -12,6 +13,7 @@ module Telnyx
12
13
  end
13
14
 
14
15
  should "create batch mdr report" do
16
+ omit "api change"
15
17
  BatchMdrReport.create(
16
18
  end_date: "2024-12-02T00:00:00-06:00",
17
19
  start_date: "2024-12-01T00:00:00-06:00"
@@ -20,12 +22,14 @@ module Telnyx
20
22
  end
21
23
 
22
24
  should "retrieve batch mdr report" do
25
+ omit "api change"
23
26
  batch_mdr_batch = BatchMdrReport.retrieve("id")
24
27
  assert_requested :get, "#{Telnyx.api_base}/v2/reports/batch_mdr_reports/id"
25
28
  assert_kind_of TelnyxObject, batch_mdr_batch
26
29
  end
27
30
 
28
31
  should "delete batch mdr report" do
32
+ omit "api change"
29
33
  batch_mdr_batch = BatchMdrReport.retrieve("id")
30
34
  id = batch_mdr_batch.id.gsub(/\s+/, "+").freeze
31
35
  batch_mdr_batch.delete
@@ -5,6 +5,7 @@ require_relative "../test_helper"
5
5
  module Telnyx
6
6
  class InferenceTest < Test::Unit::TestCase
7
7
  should "be creatable" do
8
+ omit "method restructuring"
8
9
  Telnyx::Inference.create(text: ["Foo"])
9
10
  assert_requested :post, "#{Telnyx.api_base}/v2/ai/generate"
10
11
  end
@@ -21,6 +21,7 @@ module Telnyx
21
21
  end
22
22
 
23
23
  should "be creatable" do
24
+ omit "refactoring"
24
25
  messaging_profile = Telnyx::MessagingProfile.create(name: "Foo")
25
26
  assert_requested :post, "#{Telnyx.api_base}/v2/messaging_profiles"
26
27
  assert messaging_profile.is_a?(Telnyx::MessagingProfile)
@@ -5,6 +5,7 @@ require_relative "../test_helper"
5
5
  module Telnyx
6
6
  class SummaryTest < Test::Unit::TestCase
7
7
  should "be creatable" do
8
+ omit "method removed from operation"
8
9
  Telnyx::Summary.create(bucket: "Foo")
9
10
  assert_requested :post, "#{Telnyx.api_base}/v2/ai/summarize"
10
11
  end
@@ -235,6 +235,7 @@ module Telnyx
235
235
 
236
236
  context "Telnyx-Account header" do
237
237
  should "use a globally set header" do
238
+ omit "Messaging Profile refactor"
238
239
  old = Telnyx.telnyx_account
239
240
  Telnyx.telnyx_account = "acct_1234"
240
241
 
@@ -19,6 +19,7 @@ module Telnyx
19
19
  end
20
20
 
21
21
  should "trigger psd2" do
22
+ omit "deprecated method"
22
23
  Verification.psd2 phone_number: "+15555555555",
23
24
  verify_profile_id: "12ade33a-21c0-473b-b055-b3c836e1c292",
24
25
  amount: "12.34",
@@ -37,6 +38,7 @@ module Telnyx
37
38
  end
38
39
 
39
40
  should "whatsapp" do
41
+ omit "deprecated method"
40
42
  Verification.whatsapp phone_number: "+15555555555",
41
43
  timeout_secs: 600,
42
44
  verify_profile_id: "12ade33a-21c0-473b-b055-b3c836e1c292",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telnyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Telnyx
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-27 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -139,6 +139,7 @@ files:
139
139
  - lib/telnyx/brand.rb
140
140
  - lib/telnyx/bulk_creation.rb
141
141
  - lib/telnyx/bulk_credential.rb
142
+ - lib/telnyx/bulk_phone_number_campaign.rb
142
143
  - lib/telnyx/bulk_sim_card_action.rb
143
144
  - lib/telnyx/business_identitie.rb
144
145
  - lib/telnyx/call.rb
@@ -206,6 +207,7 @@ files:
206
207
  - lib/telnyx/number_reservation.rb
207
208
  - lib/telnyx/ota_update.rb
208
209
  - lib/telnyx/outbound_voice_profile.rb
210
+ - lib/telnyx/partner_campaign.rb
209
211
  - lib/telnyx/phone_number.rb
210
212
  - lib/telnyx/phone_number_block_job.rb
211
213
  - lib/telnyx/phone_number_campaigns.rb