mastercard_spendalerts 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mastercard/api/spendalerts/alerts.rb +76 -68
- data/lib/mastercard/api/spendalerts/amount.rb +76 -68
- data/lib/mastercard/api/spendalerts/card.rb +76 -69
- data/lib/mastercard/api/spendalerts/carddisable.rb +76 -68
- data/lib/mastercard/api/spendalerts/channel.rb +76 -68
- data/lib/mastercard/api/spendalerts/controls.rb +76 -68
- data/lib/mastercard/api/spendalerts/crossborder.rb +76 -68
- data/lib/mastercard/api/spendalerts/declines.rb +76 -68
- data/lib/mastercard/api/spendalerts/{skdconfig.rb → resourceconfig.rb} +70 -22
- data/lib/mastercard/api/spendalerts/verify.rb +35 -32
- data/lib/mastercard_spendalerts.rb +9 -7
- metadata +7 -7
@@ -27,109 +27,117 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
30
31
|
|
31
32
|
module MasterCard
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
module API
|
34
|
+
module Spendalerts
|
35
|
+
class Crossborder < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
@__store = {
|
40
|
+
'cf438386-2de4-46d4-a6a1-78bf6a12bfe0' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/alerts/crossborder", "delete", [], []),
|
41
|
+
'541a8a8a-a1c7-4d41-afb8-9c00842cab75' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/alerts/crossborder", "query", [], []),
|
42
|
+
'ee5fcb58-607e-4d5b-ad2d-0ffc7f968fb0' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/alerts/crossborder", "create", [], []),
|
43
|
+
|
44
|
+
}
|
44
45
|
|
45
|
-
|
46
|
+
protected
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
def self.getOperationConfig(uuid)
|
49
|
+
if @__store.key?(uuid)
|
50
|
+
return @__store[uuid]
|
51
|
+
end
|
52
|
+
raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
+
public
|
59
60
|
|
60
61
|
|
61
62
|
|
62
63
|
|
63
64
|
|
65
|
+
def self.deleteById(id, map = nil)
|
66
|
+
#Delete object of type Crossborder by id
|
64
67
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
#@return Crossborder object representing the response.
|
70
|
-
#
|
68
|
+
#@param [String] id
|
69
|
+
#@param [Dict] map, containing additional parameters
|
70
|
+
#@return [Crossborder] of the response of the deleted instance.
|
71
|
+
#@raise [APIException] an exception from the response status
|
71
72
|
|
72
|
-
return self.execute("5d0b7ee2-6574-462d-8803-b1b38304efc9",Crossborder.new(criteria))
|
73
|
-
end
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
74
|
+
mapObj = Crossborder.new
|
75
|
+
if !(id.nil? || id.to_s.empty?)
|
76
|
+
mapObj.set("id", id)
|
77
|
+
end
|
78
|
+
if !map.nil?
|
79
|
+
if map.instance_of? RequestMap
|
80
|
+
mapObj.setAll(map.getObject())
|
81
|
+
else
|
82
|
+
mapObj.setAll(map)
|
83
|
+
end
|
84
|
+
end
|
84
85
|
|
86
|
+
return self.execute("cf438386-2de4-46d4-a6a1-78bf6a12bfe0", mapObj)
|
87
|
+
end
|
85
88
|
|
86
89
|
|
90
|
+
def delete
|
91
|
+
#
|
92
|
+
#Delete object of type Crossborder
|
87
93
|
|
94
|
+
#@param [String] id
|
95
|
+
#@return [Crossborder] of the response of the deleted instance.
|
96
|
+
#@raise [APIException] an exception from the response status
|
97
|
+
#
|
88
98
|
|
99
|
+
return self.class.execute("cf438386-2de4-46d4-a6a1-78bf6a12bfe0", self)
|
100
|
+
end
|
89
101
|
|
90
102
|
|
91
103
|
|
92
104
|
|
93
|
-
def self.deleteById(id, map = nil)
|
94
|
-
#Delete object of type Crossborder by id
|
95
105
|
|
96
|
-
#@param str id
|
97
|
-
#@param Dict map, containing additional parameters
|
98
|
-
#@return Crossborder of the response of the deleted instance.
|
99
106
|
|
100
107
|
|
101
|
-
mapObj = Crossborder.new
|
102
|
-
if !(id.nil? || id.to_s.empty?)
|
103
|
-
mapObj.set("id", id)
|
104
|
-
end
|
105
|
-
if !map.nil?
|
106
|
-
if map.instance_of? RequestMap
|
107
|
-
mapObj.setAll(map.getObject())
|
108
|
-
else
|
109
|
-
mapObj.setAll(map)
|
110
|
-
end
|
111
|
-
end
|
112
108
|
|
113
|
-
return self.execute("8298e85a-978a-48b8-8c35-45519a576743", mapObj)
|
114
|
-
end
|
115
109
|
|
110
|
+
def self.query(criteria)
|
111
|
+
#
|
112
|
+
#Query objects of type Crossborder by id and optional criteria
|
113
|
+
#@param [Dict] criteria
|
114
|
+
#@return [Crossborder] object representing the response.
|
115
|
+
#@raise [APIException] an exception from the response status
|
116
|
+
#
|
116
117
|
|
117
|
-
|
118
|
-
|
119
|
-
#Delete object of type Crossborder
|
118
|
+
return self.execute("541a8a8a-a1c7-4d41-afb8-9c00842cab75",Crossborder.new(criteria))
|
119
|
+
end
|
120
120
|
|
121
|
-
#@param str id
|
122
|
-
#@return Crossborder of the response of the deleted instance.
|
123
|
-
#
|
124
121
|
|
125
|
-
|
126
|
-
|
122
|
+
def self.create(mapObj)
|
123
|
+
#
|
124
|
+
#Creates object of type Crossborder
|
125
|
+
#
|
126
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
127
|
+
#@return [Crossborder] of the response of created instance.
|
128
|
+
#@raise [APIException] an exception from the response status
|
129
|
+
return self.execute("ee5fcb58-607e-4d5b-ad2d-0ffc7f968fb0", Crossborder.new(mapObj))
|
130
|
+
end
|
127
131
|
|
128
132
|
|
129
133
|
|
130
|
-
|
131
|
-
|
132
|
-
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
133
141
|
end
|
134
142
|
|
135
143
|
|
@@ -27,109 +27,117 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
30
31
|
|
31
32
|
module MasterCard
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
module API
|
34
|
+
module Spendalerts
|
35
|
+
class Declines < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
@__store = {
|
40
|
+
'7b4086ce-58a6-4b21-b87d-5c8e04bc52cd' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines", "delete", [], []),
|
41
|
+
'0f6586cf-36d4-4174-b5b9-436b1801e9e1' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines", "query", [], []),
|
42
|
+
'a7ab0b38-94b2-49b9-853f-3fbaccc79cd8' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines", "create", [], []),
|
43
|
+
|
44
|
+
}
|
44
45
|
|
45
|
-
|
46
|
+
protected
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
def self.getOperationConfig(uuid)
|
49
|
+
if @__store.key?(uuid)
|
50
|
+
return @__store[uuid]
|
51
|
+
end
|
52
|
+
raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
+
public
|
59
60
|
|
60
61
|
|
61
62
|
|
62
63
|
|
63
64
|
|
65
|
+
def self.deleteById(id, map = nil)
|
66
|
+
#Delete object of type Declines by id
|
64
67
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
#@return Declines object representing the response.
|
70
|
-
#
|
68
|
+
#@param [String] id
|
69
|
+
#@param [Dict] map, containing additional parameters
|
70
|
+
#@return [Declines] of the response of the deleted instance.
|
71
|
+
#@raise [APIException] an exception from the response status
|
71
72
|
|
72
|
-
return self.execute("6e4bc79c-c888-44da-9dce-05e7853336f2",Declines.new(criteria))
|
73
|
-
end
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
74
|
+
mapObj = Declines.new
|
75
|
+
if !(id.nil? || id.to_s.empty?)
|
76
|
+
mapObj.set("id", id)
|
77
|
+
end
|
78
|
+
if !map.nil?
|
79
|
+
if map.instance_of? RequestMap
|
80
|
+
mapObj.setAll(map.getObject())
|
81
|
+
else
|
82
|
+
mapObj.setAll(map)
|
83
|
+
end
|
84
|
+
end
|
84
85
|
|
86
|
+
return self.execute("7b4086ce-58a6-4b21-b87d-5c8e04bc52cd", mapObj)
|
87
|
+
end
|
85
88
|
|
86
89
|
|
90
|
+
def delete
|
91
|
+
#
|
92
|
+
#Delete object of type Declines
|
87
93
|
|
94
|
+
#@param [String] id
|
95
|
+
#@return [Declines] of the response of the deleted instance.
|
96
|
+
#@raise [APIException] an exception from the response status
|
97
|
+
#
|
88
98
|
|
99
|
+
return self.class.execute("7b4086ce-58a6-4b21-b87d-5c8e04bc52cd", self)
|
100
|
+
end
|
89
101
|
|
90
102
|
|
91
103
|
|
92
104
|
|
93
|
-
def self.deleteById(id, map = nil)
|
94
|
-
#Delete object of type Declines by id
|
95
105
|
|
96
|
-
#@param str id
|
97
|
-
#@param Dict map, containing additional parameters
|
98
|
-
#@return Declines of the response of the deleted instance.
|
99
106
|
|
100
107
|
|
101
|
-
mapObj = Declines.new
|
102
|
-
if !(id.nil? || id.to_s.empty?)
|
103
|
-
mapObj.set("id", id)
|
104
|
-
end
|
105
|
-
if !map.nil?
|
106
|
-
if map.instance_of? RequestMap
|
107
|
-
mapObj.setAll(map.getObject())
|
108
|
-
else
|
109
|
-
mapObj.setAll(map)
|
110
|
-
end
|
111
|
-
end
|
112
108
|
|
113
|
-
return self.execute("fc28b750-eedf-4b49-9815-4c60dc703531", mapObj)
|
114
|
-
end
|
115
109
|
|
110
|
+
def self.query(criteria)
|
111
|
+
#
|
112
|
+
#Query objects of type Declines by id and optional criteria
|
113
|
+
#@param [Dict] criteria
|
114
|
+
#@return [Declines] object representing the response.
|
115
|
+
#@raise [APIException] an exception from the response status
|
116
|
+
#
|
116
117
|
|
117
|
-
|
118
|
-
|
119
|
-
#Delete object of type Declines
|
118
|
+
return self.execute("0f6586cf-36d4-4174-b5b9-436b1801e9e1",Declines.new(criteria))
|
119
|
+
end
|
120
120
|
|
121
|
-
#@param str id
|
122
|
-
#@return Declines of the response of the deleted instance.
|
123
|
-
#
|
124
121
|
|
125
|
-
|
126
|
-
|
122
|
+
def self.create(mapObj)
|
123
|
+
#
|
124
|
+
#Creates object of type Declines
|
125
|
+
#
|
126
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
127
|
+
#@return [Declines] of the response of created instance.
|
128
|
+
#@raise [APIException] an exception from the response status
|
129
|
+
return self.execute("a7ab0b38-94b2-49b9-853f-3fbaccc79cd8", Declines.new(mapObj))
|
130
|
+
end
|
127
131
|
|
128
132
|
|
129
133
|
|
130
|
-
|
131
|
-
|
132
|
-
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
133
141
|
end
|
134
142
|
|
135
143
|
|
@@ -24,27 +24,75 @@
|
|
24
24
|
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
25
|
# SUCH DAMAGE.
|
26
26
|
#
|
27
|
+
|
28
|
+
require "mastercard/core/constants"
|
29
|
+
require "mastercard/core/config"
|
30
|
+
|
27
31
|
module MasterCard
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
32
|
+
module API
|
33
|
+
module Spendalerts
|
34
|
+
class ResourceConfig
|
35
|
+
include MasterCard::Core
|
36
|
+
|
37
|
+
@@instance = nil
|
38
|
+
|
39
|
+
def initialize
|
40
|
+
@name = "spendalerts"
|
41
|
+
@override = nil
|
42
|
+
@host = nil
|
43
|
+
@context = nil
|
44
|
+
@version = "1.0.1"
|
45
|
+
|
46
|
+
Config.registerResourceConfig(self)
|
47
|
+
currentEnvironment = Config.getEnvironment()
|
48
|
+
self.setEnvironment(currentEnvironment)
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def self.instance
|
54
|
+
return @@instance
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
def getName
|
59
|
+
return @name
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
def getHost
|
64
|
+
unless @override.nil? || @override == 0
|
65
|
+
return @override
|
66
|
+
else
|
67
|
+
return @host
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def getContext
|
72
|
+
return @context
|
73
|
+
end
|
74
|
+
|
75
|
+
def getVersion
|
76
|
+
return @version
|
77
|
+
end
|
78
|
+
|
79
|
+
def setEnvironment(environmet)
|
80
|
+
if Environment::MAPPING.key?(environmet)
|
81
|
+
tuple = Environment::MAPPING[environmet]
|
82
|
+
@host = tuple[0]
|
83
|
+
@context = tuple[1]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def setCustomEnvironment(host,context)
|
88
|
+
@host = host
|
89
|
+
@context = context
|
90
|
+
end
|
91
|
+
|
92
|
+
@@instance = ResourceConfig.new
|
93
|
+
|
94
|
+
private_class_method :new
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
50
98
|
end
|