tenios-api 1.0.6 → 1.1.0

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: 8370041249fab07d5612a7ab194318f1f8d241d7b0dfa4ecc0631410b7ac4e1f
4
- data.tar.gz: 300afe17af0c5726c1693368c3012084d62acd813f122b886c3778455533cd35
3
+ metadata.gz: a0e73ef7e52ab5bbfae41a177338236a552a0331fa9fd8fc9e4f424d9e1de5c2
4
+ data.tar.gz: c137fae68a120b4b30d8f509ba5adb74712456f44da4563512a685c366d03046
5
5
  SHA512:
6
- metadata.gz: 835967c7f1d407e193a297d8e18f99f1fd1831608fe90c21d193b8c012a168c67991ed56f22ec9a7423ca166920e38390338d34c9e1f6636d8e4114742366ed2
7
- data.tar.gz: fd1c63d0ea0e2f86615bf688b7534ff7e3b9b9807f01543ce8bd665797729b5ee2565ef4889bd5f48f95cd2e47f1d982d9f5a0755d5befd4ca97ba99ede006bd
6
+ metadata.gz: 4fcba57440cd1892ac5e987bc91ace9da2ba9c5206ec9f2c46ab02f293394810a050c1919ac87dc2ecb2e40fa3e55aa63343457c909165984636e1f9cebf40c1
7
+ data.tar.gz: a812c7c25f9c466e75713a5e174cb79e445d1763df3e6faf754fa9026de1316ec8be7b6b0852347d453970c2bbafdd4f13998f91a73b34afc110affdd1e22e72
data/CHANGELOG.md CHANGED
@@ -8,6 +8,22 @@
8
8
  ### Security
9
9
  ### Misc
10
10
 
11
+ ## [1.1.0] - 2023-02-08
12
+
13
+ ### Added
14
+
15
+ * Support for `/transfer-call` API
16
+
17
+ [1.1.0]: https://github.com/carwow/tenios-api-ruby/compare/v1.0.6...v1.1.0
18
+
19
+ ## [1.0.6] - 2023-01-04
20
+
21
+ ### Fixed
22
+
23
+ * Ruby 3.1 support - splat kargs in `CallDetailsRecords#retrieve`
24
+
25
+ [1.0.6]: https://github.com/carwow/tenios-api-ruby/compare/v1.0.5...v1.0.6
26
+
11
27
  ## [1.0.5] - 2022-12-21
12
28
 
13
29
  ### Changed
@@ -15,7 +31,7 @@
15
31
  * Relax ruby version constraint to support ruby 3.1
16
32
  * Relax faraday version constraint to major v1
17
33
 
18
- [1.0.5]: https://github.com/carwow/tenios-api-ruby/compare/v1.0.3...v1.0.4
34
+ [1.0.5]: https://github.com/carwow/tenios-api-ruby/compare/v1.0.4...v1.0.5
19
35
 
20
36
  ## [1.0.4] - 2021-02-22
21
37
 
data/README.md CHANGED
@@ -75,6 +75,19 @@ client.record_call.stop(
75
75
  )
76
76
  ```
77
77
 
78
+ ### Transfer Call
79
+
80
+ [Tenios documentation](https://www.tenios.de/en/doc/transfer-call-api)
81
+
82
+ #### Transfer
83
+
84
+ ```ruby
85
+ client.transfer_call(
86
+ call_uuid: '9315b018-86bd-424f-a086-7095ce427130',
87
+ destination: '+441234567890'
88
+ )
89
+ ```
90
+
78
91
  ## Contributing
79
92
 
80
93
  Bug reports and pull requests are welcome on GitHub at https://github.com/carwow/tenios-api-ruby.
@@ -3,6 +3,7 @@
3
3
  require "json"
4
4
  require "faraday"
5
5
  require "faraday_middleware"
6
+ require_relative "transfer_call"
6
7
 
7
8
  module Tenios
8
9
  module API
@@ -33,6 +34,11 @@ module Tenios
33
34
  endpoint :number, :Number
34
35
  endpoint :record_call, :RecordCall
35
36
 
37
+ def transfer_call(...)
38
+ @transfer_call ||= Tenios::API::TransferCall.new(self)
39
+ @transfer_call.transfer_call(...)
40
+ end
41
+
36
42
  # @api private
37
43
  def post(path, **payload)
38
44
  @http_client.post(path, payload.merge(access_key: @access_key)).body
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tenios
4
+ module API
5
+ class TransferCall
6
+ EXTERNAL_NUMBER = "EXTERNALNUMBER"
7
+ SIP_USER = "SIP_USER"
8
+ SIP_TRUNK = "SIP_TRUNK"
9
+
10
+ DESTINATION_TYPES = [
11
+ EXTERNAL_NUMBER,
12
+ SIP_USER,
13
+ SIP_TRUNK
14
+ ].freeze
15
+
16
+ attr_reader :client
17
+
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ def transfer_call(call_uuid:, destination:, destination_type: EXTERNAL_NUMBER)
23
+ raise "destination_type must be one of #{DESTINATION_TYPES}" unless DESTINATION_TYPES.include?(destination_type)
24
+
25
+ client.post(
26
+ "/transfer-call",
27
+ call_uuid: call_uuid,
28
+ destination_type: destination_type,
29
+ destination: destination
30
+ )
31
+ end
32
+ end
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tenios
4
4
  module API
5
- VERSION = "1.0.6"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tenios-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-04 00:00:00.000000000 Z
11
+ date: 2023-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -117,6 +117,7 @@ files:
117
117
  - lib/tenios/api/client.rb
118
118
  - lib/tenios/api/number.rb
119
119
  - lib/tenios/api/record_call.rb
120
+ - lib/tenios/api/transfer_call.rb
120
121
  - lib/tenios/api/verification.rb
121
122
  - lib/tenios/api/version.rb
122
123
  - tenios-api.gemspec
@@ -128,7 +129,7 @@ metadata:
128
129
  source_code_uri: https://github.com/carwow/tenios-api-ruby
129
130
  homepage_uri: https://github.com/carwow/tenios-api-ruby/blob/main/README.md
130
131
  changelog_uri: https://github.com/carwow/tenios-api-ruby/blob/main/CHANGELOG.md
131
- post_install_message:
132
+ post_install_message:
132
133
  rdoc_options: []
133
134
  require_paths:
134
135
  - lib
@@ -143,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
144
  - !ruby/object:Gem::Version
144
145
  version: '0'
145
146
  requirements: []
146
- rubygems_version: 3.3.11
147
- signing_key:
147
+ rubygems_version: 3.1.6
148
+ signing_key:
148
149
  specification_version: 4
149
150
  summary: Tenios API Client ☎️
150
151
  test_files: []