tenios-api 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 271e9862406c304f79991354c299ef3ff6a9565b78c4f65c1a94a31e63a723b1
4
- data.tar.gz: ffe703322dd26118913045fb13e1056c9ff4db54ef794f834e387031989de421
3
+ metadata.gz: a0e73ef7e52ab5bbfae41a177338236a552a0331fa9fd8fc9e4f424d9e1de5c2
4
+ data.tar.gz: c137fae68a120b4b30d8f509ba5adb74712456f44da4563512a685c366d03046
5
5
  SHA512:
6
- metadata.gz: fedf15ffe70855e48d67c3088258b7d9f02000129883343c031c8007e8ea65beb97520b067b9cd9a93a745af3cf21eff38877ac05c2026d4e97fe5cb12d5e7f9
7
- data.tar.gz: b0b36d9fc1e6c2ec07aab52b436511c3ded6e331628751385302442d444a566fd04ca155bd98158c49108c80fff86781ab6ca03d5eb11a5c3245edbed5b7a915
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.
@@ -12,7 +12,7 @@ module Tenios
12
12
  def retrieve(date_range, page_size: 100)
13
13
  stream do |page|
14
14
  payload = build_payload(date_range, page: page, page_size: page_size)
15
- client.post("/cdrs/retrieve", payload)
15
+ client.post("/cdrs/retrieve", **payload)
16
16
  end
17
17
  end
18
18
 
@@ -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.5"
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.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 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