-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maskingSession #239
Merged
Merged
maskingSession #239
Changes from 11 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
5d53cad
maskingSession
ajay-plivo 3e2cb1e
maskingChanges
ajay-plivo f5b5347
masking
ajay-plivo 59c595a
masking
ajay-plivo 8c4772d
masking
ajay-plivo c048276
endpoint
ajay-plivo 3f83236
changed
ajay-plivo 601f606
masking
ajay-plivo fa23c02
masking
ajay-plivo d9ca3df
masking
ajay-plivo ed46ba0
masking
ajay-plivo bfa9c14
versionFix
ajay-plivo caf0c0f
versionFix
ajay-plivo c3481ef
masterMerge
ajay-plivo 1a18213
unitTestCasesAdded
ajay-plivo ecb4cf1
rename
ajay-plivo 7def2ec
rename
ajay-plivo 7d552f0
rename
ajay-plivo 41443c3
rename
ajay-plivo 68e6599
userFriendly
ajay-plivo 995047f
parse_and_set
ajay-plivo 1edf4b9
parse_and_set
ajay-plivo 33fd688
parse
ajay-plivo 1b95c0a
parse
ajay-plivo 3ee132e
parse
ajay-plivo e829d5a
parse
ajay-plivo a182f90
parse
ajay-plivo c8e7f73
parse
ajay-plivo 5d22904
parse
ajay-plivo dd61852
parse
ajay-plivo 2daa634
parse
ajay-plivo 52181ec
parse
ajay-plivo d175fec
finalCommit
ajay-plivo 97e57fa
VT-7574
ajay-plivo 2baecec
VT-7574
ajay-plivo 3100830
nilValuesRemoved
ajay-plivo 15693a9
test
ajay-plivo 29e8cd4
test
ajay-plivo 6d31d14
test
ajay-plivo 540fb94
url
ajay-plivo 477ee53
url
ajay-plivo 5bfc00c
version
ajay-plivo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
module Plivo | ||
module Resources | ||
include Plivo::Utils | ||
class MaskingSession < Base::Resource | ||
def initialize(client, options = nil) | ||
@_name = 'Masking/Session' | ||
@_identifier_string = 'session_uuid' | ||
super | ||
@_is_voice_request = true | ||
end | ||
|
||
def update(options = nil) | ||
return if options.nil? | ||
valid_param?(:options, options, Hash, true) | ||
|
||
params = {} | ||
params_expected = %i[session_expiry call_time_limit record record_file_format recording_callback_url | ||
callback_url callback_method ring_timeout first_party_play_url second_party_play_url recording_callback_method | ||
subaccount geomatch] | ||
params_expected.each do |param| | ||
if options.key?(param) && | ||
valid_param?(param, options[param], [String, Symbol], true) | ||
params[param] = options[param] | ||
end | ||
end | ||
|
||
perform_update(params) | ||
end | ||
|
||
def delete | ||
perform_delete | ||
end | ||
|
||
def to_s | ||
{ | ||
first_party: @first_party, | ||
second_party: @second_party, | ||
virtual_number: @virtual_number, | ||
status: @status, | ||
initiate_call_to_first_party: @initiate_call_to_first_party, | ||
session_uuid: @session_uuid, | ||
callback_url: @callback_url, | ||
callback_method: @callback_method, | ||
created_time: @created_time, | ||
modified_time: @modified_time, | ||
expiry_time: @expiry_time, | ||
duration: @duration, | ||
amount: @amount, | ||
call_time_limit: @call_time_limit, | ||
ring_timeout: @ring_timeout, | ||
first_party_play_url: @first_party_play_url, | ||
second_party_play_url: @second_party_play_url, | ||
record: @record, | ||
record_file_format: @record_file_format, | ||
recording_callback_url: @recording_callback_url, | ||
recording_callback_method: @recording_callback_method, | ||
interaction: @interaction, | ||
total_call_amount: @total_call_amount, | ||
total_call_count: @total_call_count, | ||
total_call_billed_duration: @total_call_billed_duration, | ||
total_session_amount: @total_session_amount, | ||
last_interaction_time: @last_interaction_time, | ||
is_pin_authentication_required: @is_pin_authentication_required, | ||
generate_pin: @generate_pin, | ||
generate_pin_length: @generate_pin_length, | ||
second_party_pin: @second_party_pin, | ||
pin_prompt_play: @pin_prompt_play, | ||
pin_retry: @pin_retry, | ||
pin_retry_wait: @pin_retry_wait, | ||
incorrect_pin_play: @incorrect_pin_play, | ||
unknown_caller_play: @unknown_caller_play | ||
}.to_s | ||
end | ||
end | ||
|
||
# @!method get | ||
# @!method create | ||
# @!method list | ||
class MaskingSessionInterface < Base::ResourceInterface | ||
def initialize(client, resource_list_json = nil) | ||
@_name = 'Masking/Session' | ||
@_resource_type = MaskingSession | ||
@_identifier_string = 'session_uuid' | ||
super | ||
@_is_voice_request = true | ||
end | ||
|
||
# @param [String] session_uuid | ||
def get(session_uuid) | ||
valid_param?(:session_uuid, session_uuid, [String, Symbol], true) | ||
perform_get_with_response(session_uuid) | ||
end | ||
|
||
def create(first_party, second_party, session_expiry=nil, call_time_limit=nil, record=nil, record_file_format=nil, | ||
recording_callback_url=nil, initiate_call_to_first_party=nil, callback_url=nil, callback_method=nil, ring_timeout=nil, | ||
first_party_play_url=nil, second_party_play_url=nil, recording_callback_method=nil, is_pin_authentication_required=nil, | ||
generate_pin=nil, generate_pin_length=nil, first_party_pin=nil, second_party_pin=nil, pin_prompt_play=nil, pin_retry=nil, | ||
pin_retry_wait=nil, incorrect_pin_play=nil, unknown_caller_play=nil, subaccount=nil, geomatch=nil) | ||
valid_param?(:first_party, first_party, [String, Symbol], true) | ||
valid_param?(:second_party, second_party, [String, Symbol], true) | ||
|
||
params = { | ||
first_party: first_party, | ||
second_party: second_party, | ||
} | ||
|
||
params[:session_expiry] = session_expiry unless session_expiry.nil? | ||
params[:call_time_limit] = call_time_limit unless call_time_limit.nil? | ||
params[:record] = record unless record.nil? | ||
params[:record_file_format] = record_file_format unless record_file_format.nil? | ||
params[:recording_callback_url] = recording_callback_url unless recording_callback_url.nil? | ||
params[:initiate_call_to_first_party] = initiate_call_to_first_party unless initiate_call_to_first_party.nil? | ||
params[:callback_url] = callback_url unless callback_url.nil? | ||
params[:callback_method] = callback_method unless callback_method.nil? | ||
params[:ring_timeout] = ring_timeout unless ring_timeout.nil? | ||
params[:first_party_play_url] = first_party_play_url unless first_party_play_url.nil? | ||
params[:second_party_play_url] = second_party_play_url unless second_party_play_url.nil? | ||
params[:recording_callback_method] = recording_callback_method unless recording_callback_method.nil? | ||
params[:is_pin_authentication_required] = is_pin_authentication_required unless is_pin_authentication_required.nil? | ||
params[:generate_pin_length] = generate_pin_length unless generate_pin_length.nil? | ||
params[:first_party_pin] = first_party_pin unless first_party_pin.nil? | ||
params[:second_party_pin] = second_party_pin unless second_party_pin.nil? | ||
params[:pin_prompt_play] = pin_prompt_play unless pin_prompt_play.nil? | ||
params[:pin_retry] = pin_retry unless pin_retry.nil? | ||
params[:pin_retry_wait] = pin_retry_wait unless pin_retry_wait.nil? | ||
params[:incorrect_pin_play] = incorrect_pin_play unless incorrect_pin_play.nil? | ||
params[:unknown_caller_play] = unknown_caller_play unless unknown_caller_play.nil? | ||
params[:subaccount] = subaccount unless subaccount.nil? | ||
params[:geomatch] = geomatch unless geomatch.nil? | ||
|
||
perform_create(params) | ||
end | ||
|
||
def list(options = nil) | ||
return perform_list_with_response if options.nil? | ||
valid_param?(:options, options, Hash, true) | ||
|
||
raise_invalid_request("Offset can't be negative") if options.key?(:offset) && options[:offset] < 0 | ||
|
||
if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0) | ||
raise_invalid_request('The maximum number of results that can be '\ | ||
"fetched is 20. limit can't be more than 20 or less than 1") | ||
end | ||
|
||
# initial list of possible params | ||
params = %i[ | ||
first_party | ||
second_party | ||
virtual_number | ||
status | ||
created_time | ||
created_time__lt | ||
created_time__gt | ||
created_time__lte | ||
created_time__gte | ||
expiry_time | ||
expiry_time__lt | ||
expiry_time__gt | ||
expiry_time__lte | ||
expiry_time__gte | ||
duration | ||
duration__lt | ||
duration__gt | ||
duration__lte | ||
duration__gte | ||
limit | ||
offset | ||
subaccount | ||
].reduce({}) do |result_hash, param| | ||
if options.key?(param) | ||
if valid_param?(param, options[param], [String, Symbol], true) | ||
result_hash[param] = options[param] | ||
end | ||
end | ||
result_hash | ||
end | ||
|
||
perform_list_with_response(params) | ||
end | ||
|
||
def each | ||
maskingsession_list = list | ||
maskingsession_list[:objects].each { |maskingsession| yield maskingsession } | ||
end | ||
|
||
def update(session_uuid, options = nil) | ||
valid_param?(:session_uuid, session_uuid, [String, Symbol], true) | ||
MaskingSession.new(@_client, | ||
resource_id: session_uuid).update(options) | ||
end | ||
|
||
def delete(session_uuid) | ||
valid_param?(:session_uuid, session_uuid, [String, Symbol], true) | ||
MaskingSession.new(@_client, | ||
resource_id: session_uuid).delete | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Plivo | ||
VERSION = "4.56.0".freeze | ||
VERSION = "4.56.1".freeze | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version should be "4.57.0" |
||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version should be "4.57.0"