Class: MasterCard::API::Qkr::Cart

Inherits:
Core::Model::BaseObject
  • Object
show all
Includes:
Core::Model
Defined in:
lib/mastercard/api/qkr/cart.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.deleteById(id, map = nil) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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("aaeb3387-f6bd-47e2-8986-19ec157f05a9", mapObj)
end

.query(criteria) ⇒ Object



110
111
112
113
114
115
116
117
118
119
# 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("2a8c0034-0338-420d-900f-34f669092002",Cart.new(criteria))
end

.read(id, criteria = nil) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# 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("32383045-71e5-4545-a4ae-07bca62c5624",Cart.new(mapObj))
end

Instance Method Details

#deleteObject



90
91
92
93
94
95
96
97
98
99
100
# 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("aaeb3387-f6bd-47e2-8986-19ec157f05a9", self)
end