Class: MasterCard::API::Spendcontrols::Card
- Inherits:
-
Core::Model::BaseObject
- Object
- Core::Model::BaseObject
- MasterCard::API::Spendcontrols::Card
- Includes:
- Core::Model
- Defined in:
- lib/mastercard/api/spendcontrols/card.rb
Class Method Summary collapse
- .create(mapObj) ⇒ Object
- .deleteById(id, map = nil) ⇒ Object
- .read(mapObj) ⇒ Object
- .retrievePan(id, criteria = nil) ⇒ Object
- .update(mapObj) ⇒ Object
Instance Method Summary collapse
Class Method Details
.create(mapObj) ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/mastercard/api/spendcontrols/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("100b2b84-4ee1-4e22-9927-7baad788eb36", Card.new(mapObj)) end |
.deleteById(id, map = nil) ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/mastercard/api/spendcontrols/card.rb', line 128 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("2ee8dec7-7a7e-4533-aa73-80d716f8aaba", mapObj) end |
.read(mapObj) ⇒ Object
109 110 111 112 113 114 115 116 117 |
# File 'lib/mastercard/api/spendcontrols/card.rb', line 109 def self.read(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("7b2f5fb5-3b8c-4dcb-b18f-108e0953e090", Card.new(mapObj)) end |
.retrievePan(id, criteria = nil) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/mastercard/api/spendcontrols/card.rb', line 84 def self.retrievePan(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("0d453728-973c-486b-86d9-0b08386725ba",Card.new(mapObj)) end |
.update(mapObj) ⇒ Object
168 169 170 171 172 173 174 175 176 |
# File 'lib/mastercard/api/spendcontrols/card.rb', line 168 def self.update(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("92dccd41-bec2-45ee-a449-93d0230796b8", Card.new(mapObj)) end |
Instance Method Details
#delete ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/mastercard/api/spendcontrols/card.rb', line 153 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("2ee8dec7-7a7e-4533-aa73-80d716f8aaba", self) end |