Skip to content

Commit

Permalink
Made first party and second party params optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaBharat-plivo committed Sep 20, 2024
1 parent 70162fd commit b6578d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/plivo/resources/maskingsession.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ def get(session_uuid)
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,
def create(first_party: nil, second_party: nil, 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)
pin_retry_wait: nil, incorrect_pin_play: nil, unknown_caller_play: nil, subaccount: nil, geomatch: nil, force_pin_authentication: nil, virtual_number_cooloff_period: nil, create_session_with_single_party: nil)

valid_param?(:first_party, first_party, [String, Symbol], true)
valid_param?(:second_party, second_party, [String, Symbol], true)
valid_param?(:first_party, first_party, [String, Symbol], false)
valid_param?(:second_party, second_party, [String, Symbol], false)

params = {}
params[:first_party] = first_party
params[:second_party] = second_party
params[:first_party] = first_party unless first_party.nil?
params[:second_party] = second_party unless second_party.nil?
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?
Expand Down

0 comments on commit b6578d3

Please sign in to comment.