class MasterCard::API::Qkr::Card

Public Class Methods

create(mapObj) click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 64
def self.create(mapObj)
    #
    #Creates object of type Card
    #
    #@param Dict mapObj, containing the required parameters to create a new object
    #@return [Card] of the response of created instance.
    #@raise [APIException] an exception from the response status
    return self.execute("47c85ec3-9957-4c7b-91ef-a3b1a4f95759", Card.new(mapObj))
end
deleteById(id, map = nil) click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 83
def self.deleteById(id, map = nil)
    #Delete object of type Card by id

    #@param [String] id
    #@param [Dict] map, containing additional parameters
    #@return [Card] of the response of the deleted instance.
    #@raise [APIException] an exception from the response status


    mapObj = Card.new
    if !(id.nil? || id.to_s.empty?)
      mapObj.set("id", id)
    end
    if !map.nil?
        if map.instance_of? RequestMap
          mapObj.setAll(map.getObject())
        else
          mapObj.setAll(map)
        end
    end

    return self.execute("fe152d48-7856-4141-adaf-ed04f24cc6e3", mapObj)
end
query(criteria) click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 128
def self.query(criteria)
    #
    #Query objects of type Card by id and optional criteria
    #@param [Dict] criteria
    #@return [Card] object representing the response.
    #@raise [APIException] an exception from the response status
    #

    return self.execute("d43daea2-1c00-4537-bdef-f1d06decf90a",Card.new(criteria))
end
read(id, criteria = nil) click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 144
def self.read(id, criteria = nil)
    #
    #Returns objects of type Card by id and optional criteria
    #@param [String] id
    #@param [Dict] criteria
    #@return [Card] object representing the response
    #@raise [APIException] an exception from the response status

    mapObj = Card.new
    if !(id.nil? || id.to_s.empty?)
      mapObj.set("id", id)
    end
    if !criteria.nil?
        if criteria.instance_of? RequestMap
          mapObj.setAll(criteria.getObject())
        else
          mapObj.setAll(criteria)
        end
    end

    return self.execute("fe5bb16e-5007-44d8-90b0-313468fd9212",Card.new(mapObj))
end

Protected Class Methods

getOperationConfig(operationUUID) click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 50
def self.getOperationConfig(operationUUID)
    if @__store.key?(operationUUID)
        return @__store[operationUUID]
    end
    raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
end
getOperationMetadata() click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 57
def self.getOperationMetadata()
    return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
end

Public Instance Methods

delete() click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 108
def delete
    #
    #Delete object of type Card

    #@param [String] id
    #@return [Card] of the response of the deleted instance.
    #@raise [APIException] an exception from the response status
    #

    return self.class.execute("fe152d48-7856-4141-adaf-ed04f24cc6e3", self)
end
update() click to toggle source
# File lib/mastercard/api/qkr/card.rb, line 170
def update
    #
    #Updates an object of type Card
    #
    #@return [Card] object representing the response.
    #@raise [APIException] an exception from the response status
    #
    return self.class.execute("d8d46d0c-5472-4e50-9af5-778e78bf9d5e",self)
end