plivo 4.28.0 → 4.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/plivo/resources/token.rb +66 -0
- data/lib/plivo/resources.rb +1 -0
- data/lib/plivo/rest_client.rb +2 -0
- data/lib/plivo/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec364fb43089ee282e74b34a0583506cf779b969
|
4
|
+
data.tar.gz: 35c6813354cbc974ebe0643b00c74d1032c7b8cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72145e3123568e80e427b3335877943bb75ffac9afb88d16f222c9e5622e8876d9342697c749b1c04e912d2c92b35063ef82cdc89ef3ca78b7fc71542d903354
|
7
|
+
data.tar.gz: 6f52fa44fc0f450b0f0aeee39a076bb0bf7c4021575d41cf4d23f861bd9270044c37974518d862403921fbee13238254c037f11de7b99aa2cf91115425b7b8e3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [4.29.0](https://github.com/plivo/plivo-go/tree/v4.29.0) (2022-08-01)
|
4
|
+
**Feature - Token Creation**
|
5
|
+
- `JWT Token Creation API` added functionality to create a new JWT token.
|
6
|
+
|
3
7
|
## [4.28.0](https://github.com/plivo/plivo-go/tree/v4.28.0) (2022-07-11)
|
4
8
|
**Feature - STIR Attestation**
|
5
9
|
- Add stir attestation param as part of Get CDR and Get live call APIs Response
|
data/README.md
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
module Plivo
|
2
|
+
module Resources
|
3
|
+
include Plivo
|
4
|
+
include Plivo::Utils
|
5
|
+
class Token < Base::Resource
|
6
|
+
def initialize(client, options = nil)
|
7
|
+
@_name = 'JWT/Token'
|
8
|
+
super
|
9
|
+
@_is_voice_request = true
|
10
|
+
end
|
11
|
+
def to_s
|
12
|
+
{
|
13
|
+
api_id: @api_id,
|
14
|
+
token: @token
|
15
|
+
}.to_s
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class TokenInterface < Base::ResourceInterface
|
20
|
+
def initialize(client, resource_list_json = nil)
|
21
|
+
@_name = 'JWT/Token'
|
22
|
+
@_resource_type = Token
|
23
|
+
super
|
24
|
+
@_is_voice_request = true
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def create(iss , options = nil)
|
29
|
+
valid_param?(:iss, iss, [String, Symbol, Hash], true)
|
30
|
+
params = {}
|
31
|
+
params[:iss] = iss
|
32
|
+
|
33
|
+
return perform_create(params, false) if options.nil?
|
34
|
+
# return perform_action('Record', 'POST', nil, true) if options.nil?
|
35
|
+
valid_param?(:options, options, [Hash], false)
|
36
|
+
|
37
|
+
|
38
|
+
if options.key?("sub") && valid_param?("sub", options["sub"], [String, Symbol], false )
|
39
|
+
params[:sub] = options["sub"]
|
40
|
+
end
|
41
|
+
if options.key("nbf") && valid_param?("nbf", options["nbf"], [Integer, Symbol], false )
|
42
|
+
params[:nbf] = options["nbf"]
|
43
|
+
end
|
44
|
+
if options.key("exp") && valid_param?("exp", options["exp"], [Integer, Symbol], false )
|
45
|
+
params[:exp] = options["exp"]
|
46
|
+
end
|
47
|
+
if options.key?("incoming_allow") || options.key?("outgoing_allow")
|
48
|
+
params[:per] = {}
|
49
|
+
params[:per][:voice] = {}
|
50
|
+
if options.key?("incoming_allow") && valid_param?("incoming_allow", options["incoming_allow"], [TrueClass, FalseClass, String,Symbol], false)
|
51
|
+
params[:per][:voice][:incoming_allow] = options["incoming_allow"]
|
52
|
+
end
|
53
|
+
if options.key?("outgoing_allow") && valid_param?("outgoing_allow", options["outgoing_allow"], [TrueClass, FalseClass, String, Symbol], false)
|
54
|
+
params[:per][:voice][:outgoing_allow] = options["outgoing_allow"]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
if options.key?("app") && valid_param?("app", options["app"], [String, Symbol], false)
|
58
|
+
params[:app] = options["app"]
|
59
|
+
end
|
60
|
+
|
61
|
+
perform_create(params.merge(options), false)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
data/lib/plivo/resources.rb
CHANGED
@@ -7,6 +7,7 @@ require_relative 'resources/pricings'
|
|
7
7
|
require_relative 'resources/numbers'
|
8
8
|
require_relative 'resources/conferences'
|
9
9
|
require_relative 'resources/calls'
|
10
|
+
require_relative 'resources/token'
|
10
11
|
require_relative 'resources/endpoints'
|
11
12
|
require_relative 'resources/addresses'
|
12
13
|
require_relative 'resources/identities'
|
data/lib/plivo/rest_client.rb
CHANGED
@@ -8,6 +8,7 @@ module Plivo
|
|
8
8
|
# Resources
|
9
9
|
attr_reader :messages, :account, :subaccounts, :recordings
|
10
10
|
attr_reader :pricings, :numbers, :calls, :conferences
|
11
|
+
attr_reader :token
|
11
12
|
attr_reader :phone_numbers, :applications, :endpoints, :multipartycalls
|
12
13
|
attr_reader :addresses, :identities
|
13
14
|
attr_reader :call_feedback
|
@@ -49,6 +50,7 @@ module Plivo
|
|
49
50
|
@phone_numbers = Resources::PhoneNumberInterface.new(self)
|
50
51
|
@conferences = Resources::ConferenceInterface.new(self)
|
51
52
|
@calls = Resources::CallInterface.new(self)
|
53
|
+
@token = Resources::TokenInterface.new(self)
|
52
54
|
@endpoints = Resources::EndpointInterface.new(self)
|
53
55
|
@applications = Resources::ApplicationInterface.new(self)
|
54
56
|
@addresses = Resources::AddressInterface.new(self)
|
data/lib/plivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- lib/plivo/resources/pricings.rb
|
202
202
|
- lib/plivo/resources/recordings.rb
|
203
203
|
- lib/plivo/resources/regulatory_compliance.rb
|
204
|
+
- lib/plivo/resources/token.rb
|
204
205
|
- lib/plivo/rest_client.rb
|
205
206
|
- lib/plivo/utils.rb
|
206
207
|
- lib/plivo/version.rb
|