plivo 4.22.0 → 4.23.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
  SHA1:
3
- metadata.gz: 99a81ae9a72d5cd9f5332d84de77f442c565b9a5
4
- data.tar.gz: 274d0f0c5e278e9fb003eda9c2b022a6840a99b0
3
+ metadata.gz: 7320a94bdddc31cfc0e965fd97ca151c2706f215
4
+ data.tar.gz: 623c12c0d63b5ef5a676180e24e3e2fc3a1dbc4e
5
5
  SHA512:
6
- metadata.gz: 8e5703701787286d5a30a520dedb09bd7c03593f0ac7f8d54a1cfa0ceafaaec31a8b91e135282022f8fcf2fc3fb79191e794bafe844733ac7fc09c337c1d86a3
7
- data.tar.gz: edf485c5a4d6e3429dc1dec71fe32fe3d31662627bec06d2de407ee6320fc6b5b0bc1d5dce6ef79d6e88305fe76264dfbea5c848bc77e7f829a5168e3577cda9
6
+ metadata.gz: bfd70b72b182ba65825c2e3504d2842b21bb23a6b4c1a15f6debabbf766caaeccff58b5e2ec3afe1693a012999f63bf7cb490f4cd262c08916aeb527cd9e3060
7
+ data.tar.gz: 5441c0463add6758e0f4fa7025712b458d62897618bc53bdbdc461d781c0df7368099c2ef71d717ea27f0e755a044b5c6723ca38cbb3f5b3f7a3293d12f31b42
@@ -0,0 +1,32 @@
1
+ name: UnitTest
2
+
3
+ on:
4
+ push:
5
+ branches: [ unitTests ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ name: UnitTest
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ ruby-version: [ '2.4', '2.5', '2.6' ,'2.7', '3.0' ]
16
+
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v2
20
+ - name: Set up Ruby ${{ matrix.ruby-version }}
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ - name: Dependencies Installation
25
+ run: |
26
+ bundle install --without development
27
+ - name: Run Tests
28
+ run: |
29
+ ruby --version
30
+ bundle exec rake
31
+ rm Gemfile.lock
32
+
data/CHANGELOG.md CHANGED
@@ -1,7 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## [4.23.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.23.0) (2021-12-02)
4
+ **Features - Messaging: 10 DLC**
5
+ - 10DLC API's for brand and campaign support.
6
+
3
7
  ## [4.22.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.22.0) (2021-11-11)
4
- **Features - Voice: Multiparty calls**
8
+ **Features - Voice: Multiparty call**
5
9
  - The [Add Multiparty Call API](https://www.plivo.com/docs/voice/api/multiparty-call/participants#add-a-participant) allows for greater functionality by accepting options like `start recording audio`, `stop recording audio`, and their HTTP methods.
6
10
  - [Multiparty Calls](https://www.plivo.com/docs/voice/api/multiparty-call/) now has new APIs to `stop` and `play` audio.
7
11
 
data/Gemfile CHANGED
@@ -7,4 +7,5 @@ group :test do
7
7
  gem 'rspec', '~> 3.0'
8
8
  gem 'simplecov'
9
9
  gem 'json'
10
+ gem 'rexml'
10
11
  end
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # plivo-ruby
2
2
 
3
- [![Build Status](https://travis-ci.org/plivo/plivo-ruby.svg?branch=4.0)](https://travis-ci.org/plivo/plivo-ruby)
3
+ [![UnitTest](https://github.com/plivo/plivo-ruby/actions/workflows/unitTests.yml/badge.svg?branch=ns-ut-fix)](https://github.com/plivo/plivo-ruby/actions/workflows/unitTests.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/plivo.svg)](https://badge.fury.io/rb/plivo)
4
5
 
5
6
  The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby applications using the Plivo REST API. Using the SDK, you will be able to make voice calls, send SMS and generate Plivo XML to control your call flows.
6
7
 
@@ -8,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
8
9
  Add this line to your application's Gemfile:
9
10
 
10
11
  ```ruby
11
- gem 'plivo', '>= 4.22.0'
12
+ gem 'plivo', '>= 4.23.0'
12
13
  ```
13
14
 
14
15
  And then execute:
@@ -0,0 +1,62 @@
1
+ module Plivo
2
+ module Resources
3
+ include Plivo::Utils
4
+ class Brand < Base::Resource
5
+ def initialize(client, options = nil)
6
+ @_name = '10dlc/Brand'
7
+ @_identifier_string = 'brand_id'
8
+ super
9
+ end
10
+
11
+ def to_s
12
+ {
13
+ api_id: @api_id,
14
+ brand: @brand
15
+ }.to_s
16
+ end
17
+ end
18
+
19
+ class BrandInterface < Base::ResourceInterface
20
+ def initialize(client, resource_list_json = nil)
21
+ @_name = '10dlc/Brand'
22
+ @_resource_type = Brand
23
+ @_identifier_string = 'brand_id'
24
+ super
25
+ end
26
+
27
+ ##
28
+ # Get an Brand
29
+ # @param [String] brand_id
30
+ # @return [Brand] Brand
31
+ def get(brand_id)
32
+ valid_param?(:brand_id, brand_id, [String, Symbol], true)
33
+ perform_get(brand_id)
34
+ end
35
+
36
+ ##
37
+ # List all Brand
38
+ # @param [Hash] options
39
+ # @option options [String] :type
40
+ # @option options [Status] :status
41
+ # @return [Hash]
42
+ def list(options=nil)
43
+ return perform_list_without_object if options.nil?
44
+
45
+ params = {}
46
+ %i[status type].each do |param|
47
+ if options.key?(param) && valid_param?(param, options[param],
48
+ [String], true)
49
+ params[param] = options[param]
50
+ end
51
+ end
52
+ perform_list_without_object(params)
53
+ end
54
+
55
+ ##
56
+ # Create a new brand
57
+ def create(params)
58
+ perform_create(params)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,62 @@
1
+ module Plivo
2
+ module Resources
3
+ include Plivo::Utils
4
+ class Campaign < Base::Resource
5
+ def initialize(client, options = nil)
6
+ @_name = '10dlc/Campaign'
7
+ @_identifier_string = 'campaign_id'
8
+ super
9
+ end
10
+
11
+ def to_s
12
+ {
13
+ api_id: @api_id,
14
+ campaign: @campaign
15
+ }.to_s
16
+ end
17
+ end
18
+
19
+ class CampaignInterface < Base::ResourceInterface
20
+ def initialize(client, resource_list_json = nil)
21
+ @_name = '10dlc/Campaign'
22
+ @_resource_type = Campaign
23
+ @_identifier_string = 'campaign_id'
24
+ super
25
+ end
26
+
27
+ ##
28
+ # Get an Campaign
29
+ # @param [String] campaign_id
30
+ # @return [Campaign] Campaign
31
+ def get(campaign_id)
32
+ valid_param?(:campaign_id, campaign_id, [String, Symbol], true)
33
+ perform_get(campaign_id)
34
+ end
35
+
36
+ ##
37
+ # List all Campaign
38
+ # @param [Hash] options
39
+ # @option options [String] :brand
40
+ # @option options [Status] :usecase
41
+ # @return [Hash]
42
+ def list(options=nil)
43
+ return perform_list_without_object if options.nil?
44
+
45
+ params = {}
46
+ %i[usecase brand].each do |param|
47
+ if options.key?(param) && valid_param?(param, options[param],
48
+ [String], true)
49
+ params[param] = options[param]
50
+ end
51
+ end
52
+ perform_list_without_object(params)
53
+ end
54
+
55
+ ##
56
+ # Create a new Camapign
57
+ def create(params)
58
+ perform_create(params)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -15,6 +15,8 @@ require_relative 'resources/nodes'
15
15
  require_relative 'resources/phlo_member'
16
16
  require_relative 'resources/call_feedback'
17
17
  require_relative 'resources/media'
18
+ require_relative 'resources/brand'
19
+ require_relative 'resources/campaign'
18
20
  require_relative 'resources/lookup'
19
21
  require_relative 'resources/regulatory_compliance'
20
22
  require_relative 'resources/multipartycalls'
@@ -14,6 +14,7 @@ module Plivo
14
14
  attr_reader :powerpacks
15
15
  attr_reader :powerpacks, :media
16
16
  attr_reader :lookup
17
+ attr_reader :brand, :campaign
17
18
  attr_reader :end_users
18
19
  attr_reader :compliance_document_types, :compliance_documents, :compliance_requirements, :compliance_applications
19
20
 
@@ -39,6 +40,8 @@ module Plivo
39
40
  @messages = Resources::MessagesInterface.new(self)
40
41
  @powerpacks = Resources::PowerpackInterface.new(self)
41
42
  @media = Resources::MediaInterface.new(self)
43
+ @brand = Resources::BrandInterface.new(self)
44
+ @campaign = Resources::CampaignInterface.new(self)
42
45
  @subaccounts = Resources::SubaccountInterface.new(self)
43
46
  @recordings = Resources::RecordingInterface.new(self)
44
47
  @pricings = Resources::PricingInterface.new(self)
data/lib/plivo/utils.rb CHANGED
@@ -227,7 +227,7 @@ module Plivo
227
227
  uri += "?"
228
228
  end
229
229
  if parsed_uri.query.to_s.length > 0
230
- parsed_uri_query = URI.decode(parsed_uri.query)
230
+ parsed_uri_query = URI.decode_www_form_component(parsed_uri.query)
231
231
  if method == "GET"
232
232
  queryParamMap = getMapFromQueryString?(parsed_uri_query)
233
233
  params.keys.sort.each { |key|
data/lib/plivo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = "4.22.0".freeze
2
+ VERSION = "4.23.0".freeze
3
3
  end
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.22.0
4
+ version: 4.23.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: 2021-11-10 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -152,6 +152,7 @@ executables: []
152
152
  extensions: []
153
153
  extra_rdoc_files: []
154
154
  files:
155
+ - ".github/workflows/unitTests.yml"
155
156
  - ".gitignore"
156
157
  - ".rspec"
157
158
  - ".travis.yml"
@@ -182,8 +183,10 @@ files:
182
183
  - lib/plivo/resources/accounts.rb
183
184
  - lib/plivo/resources/addresses.rb
184
185
  - lib/plivo/resources/applications.rb
186
+ - lib/plivo/resources/brand.rb
185
187
  - lib/plivo/resources/call_feedback.rb
186
188
  - lib/plivo/resources/calls.rb
189
+ - lib/plivo/resources/campaign.rb
187
190
  - lib/plivo/resources/conferences.rb
188
191
  - lib/plivo/resources/endpoints.rb
189
192
  - lib/plivo/resources/identities.rb