class MasterCard::API::Qkr::Cart

Public Class Methods

deleteById(id, map = nil) click to toggle source
# File lib/mastercard/api/qkr/cart.rb, line 65
def self.deleteById(id, map = nil)
    #Delete object of type Cart by id

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


    mapObj = Cart.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("9236940b-ea62-4266-bf66-a2019bcfdd28", mapObj)
end
query(criteria) click to toggle source
# File lib/mastercard/api/qkr/cart.rb, line 110
def self.query(criteria)
    #
    #Query objects of type Cart by id and optional criteria
    #@param [Dict] criteria
    #@return [Cart] object representing the response.
    #@raise [APIException] an exception from the response status
    #

    return self.execute("b3ec9047-7a66-44d4-9117-780f38655ec7",Cart.new(criteria))
end
read(id, criteria = nil) click to toggle source
# File lib/mastercard/api/qkr/cart.rb, line 126
def self.read(id, criteria = nil)
    #
    #Returns objects of type Cart by id and optional criteria
    #@param [String] id
    #@param [Dict] criteria
    #@return [Cart] object representing the response
    #@raise [APIException] an exception from the response status

    mapObj = Cart.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("dba29f55-e820-42bb-8ef7-881d13dcfba9",Cart.new(mapObj))
end

Protected Class Methods

getOperationConfig(operationUUID) click to toggle source
# File lib/mastercard/api/qkr/cart.rb, line 48
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/cart.rb, line 55
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/cart.rb, line 90
def delete
    #
    #Delete object of type Cart

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

    return self.class.execute("9236940b-ea62-4266-bf66-a2019bcfdd28", self)
end