plivo 4.51.0 → 4.52.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: e9064c62f724b62e2aeea109723c81030fe138ef
4
- data.tar.gz: 8a0348e73d6792c79034d23cb1e7e90748304183
3
+ metadata.gz: 34497f9d142b84bc7c0de42434efea2a2a739b12
4
+ data.tar.gz: 7a05d083a44046f3d659b6aa4c1a698f1e87ce89
5
5
  SHA512:
6
- metadata.gz: 7f2331bc3b7eb435076f747b19e54a30662051b534baff258c5dbaba40baf6ae659f1d7abd073c5529e3fad97ec4aca3018896bd63aa7d7003759171a75fc798
7
- data.tar.gz: cae52fb1615526472e629ca5455c12f4b38b06f9d8332f709487e1f5f2e3e213005981a9fd4a4b57a5285e6c4c3065614c7f5bf4b5e94f29ca9996f202d096a5
6
+ metadata.gz: 824b576009892ffda04e7daac13a926b6804faaedde5ba362707bde53f0fe9e9059db04e131ef2edc54f1c7f6b19e7c364737026b3bd79d85fa8e9a29c2460ee
7
+ data.tar.gz: 38880270d8fedbebf5e5a8c66c06aad68e654c8c408f621818b104110392801a2ac2547d1a1161abf3cb603aa0ead8ed071c65c80ccfa408bb47e1582dd51253
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## [4.52.0](https://github.com/plivo/plivo-ruby/tree/v4.52.0) (2023-11-08)
4
+ **[BETA] Feature - TollFree Verification API Support**
5
+ - API support for Create, Update, Get, Delete, and List Tollfree Verification.
6
+ - Added New Param `toll_free_sms_verification_id` and `toll_free_sms_verification_order_status` in to the response of the [list all numbers API], [list single number API]
7
+ - Added `toll_free_sms_verification_order_status` filter to AccountPhoneNumber - list all my numbers API.
8
+
3
9
  ## [4.51.0](https://github.com/plivo/plivo-ruby/tree/v4.51.0) (2023-10-16)
4
10
  **Introducing campaign_source & import partner camapign API**
5
11
  - New field campaign_source introduced
data/README.md CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'plivo', '>= 4.51.0'
12
+ gem 'plivo', '>= 4.52.0'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -0,0 +1,42 @@
1
+ require 'rubygems'
2
+ require "plivo"
3
+
4
+ include Plivo
5
+ include Plivo::Exceptions
6
+
7
+ AUTH_ID = 'AUTH_ID'
8
+ AUTH_TOKEN = 'AUTH_TOKEN'
9
+
10
+ api = RestClient.new(AUTH_ID, AUTH_TOKEN)
11
+
12
+ begin
13
+ response = api.tollfree_verifications.get('uuid')
14
+ puts response
15
+ rescue PlivoRESTError => e
16
+ puts 'Exception: ' + e.message
17
+ end
18
+
19
+
20
+ begin
21
+ response = api.tollfree_verifications.create('18773582986', '2FA', 'dasas',
22
+ 'd5a9c4d4-d086-42db-940f-e798d480d064', 'VERBAL', 'https://www.aa.com,http://google.com',
23
+ '100', 'qwqwq')
24
+ puts response
25
+ rescue PlivoRESTError => e
26
+ puts 'Exception: ' + e.message
27
+ end
28
+
29
+ begin
30
+ response = api.tollfree_verifications.update('uuid', usecase: '2FA')
31
+ puts response
32
+ rescue PlivoRESTError => e
33
+ puts 'Exception: ' + e.message
34
+ end
35
+
36
+
37
+ begin
38
+ response = api.tollfree_verifications.delete('uuid')
39
+ puts response
40
+ rescue PlivoRESTError => e
41
+ puts 'Exception: ' + e.message
42
+ end
@@ -37,7 +37,9 @@ module Plivo
37
37
  voice_rate: @voice_rate,
38
38
  tendlc_campaign_id: @tendlc_campaign_id,
39
39
  tendlc_registration_status: @tendlc_registration_status,
40
- toll_free_sms_verification: @toll_free_sms_verification
40
+ toll_free_sms_verification: @toll_free_sms_verification,
41
+ toll_free_sms_verification_id: @toll_free_sms_verification_id,
42
+ toll_free_sms_verification_order_status: @toll_free_sms_verification_order_status
41
43
  }.to_s
42
44
  end
43
45
  end
@@ -185,7 +187,9 @@ module Plivo
185
187
  tendlc_registration_status: @tendlc_registration_status,
186
188
  toll_free_sms_verification: @toll_free_sms_verification,
187
189
  renewal_date: @renewal_date,
188
- cnam_lookup: @cnam_lookup
190
+ cnam_lookup: @cnam_lookup,
191
+ toll_free_sms_verification_id: @toll_free_sms_verification_id,
192
+ toll_free_sms_verification_order_status: @toll_free_sms_verification_order_status
189
193
  }.to_s
190
194
  end
191
195
  end
@@ -231,6 +235,8 @@ module Plivo
231
235
  # @option options [String] :cnam_lookup The Cnam Lookup Configuration associated with that number. The following values are valid:
232
236
  # - enabled - Returns the list of numbers for which Cnam Lookup configuration is enabled
233
237
  # - disabled - Returns the list of numbers for which Cnam Lookup configuration is disabled
238
+ # @option options [String] :toll_free_sms_verification_id The id of tollfree verification that the number is currently linked with.
239
+ # @option options [String] :toll_free_sms_verification_order_status Indicates the tollfree verification status of a number.
234
240
  def list(options = nil)
235
241
  return perform_list if options.nil?
236
242
 
@@ -238,7 +244,7 @@ module Plivo
238
244
 
239
245
  params = {}
240
246
 
241
- %i[number_startswith subaccount alias tendlc_campaign_id tendlc_registration_status toll_free_sms_verification renewal_date renewal_date__lt renewal_date__lte renewal_date__gt renewal_date__gte cnam_lookup].each do |param|
247
+ %i[number_startswith subaccount alias tendlc_campaign_id tendlc_registration_status toll_free_sms_verification renewal_date renewal_date__lt renewal_date__lte renewal_date__gt renewal_date__gte cnam_lookup toll_free_sms_verification_order_status].each do |param|
242
248
  if options.key?(param) &&
243
249
  valid_param?(param, options[param], [String, Symbol], true)
244
250
  params[param] = options[param]
@@ -0,0 +1,178 @@
1
+ module Plivo
2
+ module Resources
3
+ include Plivo::Utils
4
+
5
+ class TollfreeVerification < Base::Resource
6
+ def initialize(client, options = nil)
7
+ @_name = 'TollfreeVerification'
8
+ @_identifier_string = 'tollfree_verification'
9
+ super
10
+ end
11
+
12
+ def update(options = nil)
13
+ return perform_update({}) if options.nil?
14
+
15
+ valid_param?(:options, options, Hash, true)
16
+
17
+ params = {}
18
+ params_expected = %i[ usecase usecase_summary profile_uuid optin_type optin_image_url volume message_sample callback_method callback_url extra_data additional_information ]
19
+ params_expected.each do |param|
20
+ if options.key?(param) &&
21
+ valid_param?(param, options[param], [String, Symbol], false)
22
+ params[param] = options[param]
23
+ end
24
+ end
25
+
26
+ perform_update(params)
27
+ end
28
+
29
+ def delete
30
+ perform_delete
31
+ end
32
+
33
+ def to_s
34
+ {
35
+ api_id: @api_id,
36
+ uuid: @uuid,
37
+ number: @number,
38
+ created_at: @created_at,
39
+ updated_at: @updated_at,
40
+ callback_method: @callback_url,
41
+ callback_url: @callback_url,
42
+ extra_data: @extra_data,
43
+ additional_information: @additional_information,
44
+ message_sample: @message_sample,
45
+ optin_image_url: @optin_image_url,
46
+ optin_type: @optin_type,
47
+ profile_uuid: @profile_uuid,
48
+ rejection_reason: @rejection_reason,
49
+ status: @status,
50
+ usecase: @usecase,
51
+ usecase_summary: @usecase_summary,
52
+ volume: @volume
53
+ }.delete_if { |key, value| value.nil? }.to_s
54
+ end
55
+ end
56
+
57
+ class TollfreeVerificationsInterface < Base::ResourceInterface
58
+ def initialize(client, resource_list_json = nil)
59
+ @_name = 'TollfreeVerification'
60
+ @_resource_type = TollfreeVerification
61
+ @_identifier_string = 'tollfree_verification'
62
+ super
63
+ end
64
+
65
+ ##
66
+ # Get an TollfreeVerification
67
+ # @param [String] uuid
68
+ # return [TollfreeVerification]
69
+ def get(uuid)
70
+ valid_param?(:uuid, uuid, [String, Symbol], true)
71
+ perform_get(uuid)
72
+ end
73
+
74
+ ##
75
+ # List all TollfreeVerification
76
+ # @param [Hash] options
77
+ # @option options [Int] :offset
78
+ # @option options [Int] :limit
79
+ # @return [Hash]
80
+ def list(options = nil)
81
+ return perform_list if options.nil?
82
+ valid_param?(:options, options, Hash, true)
83
+
84
+ params = {}
85
+ params_expected = %i[ profile_uuid number status created__lt created__gt usecase created__lte created__gte ]
86
+ params_expected.each do |param|
87
+ if options.key?(param) &&
88
+ valid_param?(param, options[param], [String, Symbol], true)
89
+ params[param] = options[param]
90
+ end
91
+ end
92
+
93
+ %i[offset limit].each do |param|
94
+ if options.key?(param) && valid_param?(param, options[param],
95
+ [Integer], true)
96
+ params[param] = options[param]
97
+ end
98
+ end
99
+
100
+ raise_invalid_request("Offset can't be negative") if options.key?(:offset) && options[:offset] < 0
101
+
102
+ if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0)
103
+ raise_invalid_request('The maximum number of results that can be '\
104
+ "fetched is 20. limit can't be more than 20 or less than 1")
105
+ end
106
+
107
+ perform_list(params)
108
+ end
109
+
110
+ ##
111
+ # Create an TollfreeVerification
112
+ # @param [String] number
113
+ # @param [String] usecase
114
+ # @param [String] usecase_summary
115
+ # @param [String] profile_uuid
116
+ # @param [String] optin_type
117
+ # @param [String] optin_image_url
118
+ # @param [String] volume
119
+ # @param [String] message_sample
120
+ # @param [String] callback_url
121
+ # @param [String] callback_method
122
+ # @param [String] extra_data
123
+ # @param [String] additional_information
124
+ # return [TollfreeVerification] TollfreeVerification
125
+ def create(number, usecase, usecase_summary, profile_uuid, optin_type, optin_image_url, volume, message_sample, callback_url = nil, callback_method = nil, extra_data = nil, additional_information = nil)
126
+ valid_param?(:number, number, [String, Symbol], true)
127
+ valid_param?(:usecase, usecase, [String, Symbol], true)
128
+ valid_param?(:usecase_summary, usecase_summary, [String, Symbol], true)
129
+ valid_param?(:profile_uuid, profile_uuid, [String, Symbol], true)
130
+ valid_param?(:optin_type, optin_type, [String, Symbol], true)
131
+ valid_param?(:optin_image_url, optin_image_url, [String, Symbol], true)
132
+ valid_param?(:volume, volume, [String, Symbol], true)
133
+ valid_param?(:message_sample, message_sample, [String, Symbol], true)
134
+ valid_param?(:callback_url, callback_url, [String, Symbol], false)
135
+ valid_param?(:callback_method, callback_method, [String, Symbol], false)
136
+ valid_param?(:extra_data, extra_data, [String, Symbol], false)
137
+ valid_param?(:additional_information, additional_information, [String, Symbol], false)
138
+
139
+ params = {
140
+ number: number,
141
+ usecase: usecase,
142
+ usecase_summary: usecase_summary,
143
+ profile_uuid: profile_uuid,
144
+ optin_type: optin_type,
145
+ optin_image_url: optin_image_url,
146
+ volume: volume,
147
+ message_sample: message_sample,
148
+ callback_url: callback_url,
149
+ callback_method: callback_method,
150
+ extra_data: extra_data,
151
+ additional_information: additional_information
152
+ }.delete_if { |key, value| value.nil? }
153
+
154
+ return perform_create(params)
155
+ end
156
+
157
+ ##
158
+ # Update an TollfreeVerification
159
+ # @param [String] uuid
160
+ # @param [Hash] options
161
+ # return [TollfreeVerification]
162
+ def update(uuid, options = nil)
163
+ valid_param?(:uuid, uuid, [String, Symbol], true)
164
+ TollfreeVerification.new(@_client,
165
+ resource_id: uuid).update(options)
166
+ end
167
+
168
+ ##
169
+ # Delete an TollfreeVerification.
170
+ # @param [String] uuid
171
+ def delete(uuid)
172
+ valid_param?(:uuid, uuid, [String, Symbol], true)
173
+ TollfreeVerification.new(@_client,
174
+ resource_id: uuid).delete
175
+ end
176
+ end
177
+ end
178
+ end
@@ -22,6 +22,7 @@ require_relative 'resources/profile'
22
22
  require_relative 'resources/lookup'
23
23
  require_relative 'resources/regulatory_compliance'
24
24
  require_relative 'resources/multipartycalls'
25
+ require_relative 'resources/tollfree_verification'
25
26
 
26
27
  module Plivo
27
28
  module Resources
@@ -18,6 +18,7 @@ module Plivo
18
18
  attr_reader :brand, :campaign, :profile
19
19
  attr_reader :end_users
20
20
  attr_reader :compliance_document_types, :compliance_documents, :compliance_requirements, :compliance_applications
21
+ attr_reader :tollfree_verifications
21
22
 
22
23
  def initialize(auth_id = nil, auth_token = nil, proxy_options = nil, timeout = 5)
23
24
  configure_base_uri
@@ -64,6 +65,7 @@ module Plivo
64
65
  @compliance_documents = Resources::ComplianceDocumentsInterface.new(self)
65
66
  @compliance_requirements = Resources::ComplianceRequirementsInterface.new(self)
66
67
  @compliance_applications = Resources::ComplianceApplicationsInterface.new(self)
68
+ @tollfree_verifications = Resources::TollfreeVerificationsInterface.new(self)
67
69
  end
68
70
  end
69
71
  end
data/lib/plivo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = "4.51.0".freeze
2
+ VERSION = "4.52.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.51.0
4
+ version: 4.52.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: 2023-10-16 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -158,6 +158,7 @@ files:
158
158
  - examples/multi_party_call.rb
159
159
  - examples/phlos.rb
160
160
  - examples/regulatory_compliance.rb
161
+ - examples/tollfree_verification.rb
161
162
  - lib/plivo.rb
162
163
  - lib/plivo/base.rb
163
164
  - lib/plivo/base/resource.rb
@@ -192,6 +193,7 @@ files:
192
193
  - lib/plivo/resources/recordings.rb
193
194
  - lib/plivo/resources/regulatory_compliance.rb
194
195
  - lib/plivo/resources/token.rb
196
+ - lib/plivo/resources/tollfree_verification.rb
195
197
  - lib/plivo/rest_client.rb
196
198
  - lib/plivo/template.rb
197
199
  - lib/plivo/utils.rb