Skip to content

Commit

Permalink
masking
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-plivo committed May 6, 2024
1 parent 601f606 commit fa23c02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/plivo/base/resource_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def perform_get(identifier, params = nil)
@_resource_type.new(@_client, resource_json: response_json)
end

def perform_get_with_response(identifier, params = nil)
valid_param?(:identifier, identifier, [String, Symbol], true)
response_json = @_client.send_request(@_resource_uri + identifier.to_s + '/', 'GET', params, nil, false, is_voice_request: @_is_voice_request)
resource_json = response_json["response"]
# Pass the parsed JSON to initialize the resource object
@_resource_type.new(@_client, resource_json: resource_json)
end

def perform_get_without_identifier(params)
valid_param?(:params, params, Hash, true)
response_json = @_client.send_request(@_resource_uri, 'GET', params, nil, false, is_voice_request: @_is_voice_request)
Expand Down
2 changes: 1 addition & 1 deletion lib/plivo/resources/maskingsession.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def initialize(client, resource_list_json = nil)
# @param [String] session_uuid
def get(session_uuid)
valid_param?(:session_uuid, session_uuid, [String, Symbol], true)
perform_get_without_identifier(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,
Expand Down

0 comments on commit fa23c02

Please sign in to comment.