mastercard_spendcontrols 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/mastercard/api/spendcontrols/alertall.rb +148 -0
- data/lib/mastercard/api/spendcontrols/alerts.rb +148 -0
- data/lib/mastercard/api/spendcontrols/amount.rb +148 -0
- data/lib/mastercard/api/spendcontrols/amountdecline.rb +148 -0
- data/lib/mastercard/api/spendcontrols/card.rb +147 -0
- data/lib/mastercard/api/spendcontrols/carddisable.rb +148 -0
- data/lib/mastercard/api/spendcontrols/channel.rb +148 -0
- data/lib/mastercard/api/spendcontrols/channeldecline.rb +148 -0
- data/lib/mastercard/api/spendcontrols/controls.rb +148 -0
- data/lib/mastercard/api/spendcontrols/crossborder.rb +148 -0
- data/lib/mastercard/api/spendcontrols/crossborderdecline.rb +148 -0
- data/lib/mastercard/api/spendcontrols/declineall.rb +148 -0
- data/lib/mastercard/api/spendcontrols/declines.rb +148 -0
- data/lib/mastercard/api/spendcontrols/notification.rb +86 -0
- data/lib/mastercard/api/spendcontrols/resourceconfig.rb +98 -0
- data/lib/mastercard/api/spendcontrols/verify.rb +86 -0
- data/lib/mastercard_spendcontrols.rb +19 -0
- metadata +95 -0
@@ -0,0 +1,148 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2016 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
31
|
+
|
32
|
+
module MasterCard
|
33
|
+
module API
|
34
|
+
module Spendcontrols
|
35
|
+
class Amountdecline < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
38
|
+
|
39
|
+
@__store = {
|
40
|
+
'ded42f87-d69f-477e-af12-938e8b0d4c99' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/transactionamount", "create", [], []),
|
41
|
+
'1eb4752e-0e07-4e8e-a8f5-abea4fd99c14' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/transactionamount", "delete", [], []),
|
42
|
+
'2e73694c-985b-4b85-bcb2-1a598c7f3ae6' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/transactionamount", "query", [], []),
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
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
|
54
|
+
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
58
|
+
|
59
|
+
public
|
60
|
+
|
61
|
+
|
62
|
+
def self.create(mapObj)
|
63
|
+
#
|
64
|
+
#Creates object of type Amountdecline
|
65
|
+
#
|
66
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
67
|
+
#@return [Amountdecline] of the response of created instance.
|
68
|
+
#@raise [APIException] an exception from the response status
|
69
|
+
return self.execute("ded42f87-d69f-477e-af12-938e8b0d4c99", Amountdecline.new(mapObj))
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
def self.deleteById(id, map = nil)
|
82
|
+
#Delete object of type Amountdecline by id
|
83
|
+
|
84
|
+
#@param [String] id
|
85
|
+
#@param [Dict] map, containing additional parameters
|
86
|
+
#@return [Amountdecline] of the response of the deleted instance.
|
87
|
+
#@raise [APIException] an exception from the response status
|
88
|
+
|
89
|
+
|
90
|
+
mapObj = Amountdecline.new
|
91
|
+
if !(id.nil? || id.to_s.empty?)
|
92
|
+
mapObj.set("id", id)
|
93
|
+
end
|
94
|
+
if !map.nil?
|
95
|
+
if map.instance_of? RequestMap
|
96
|
+
mapObj.setAll(map.getObject())
|
97
|
+
else
|
98
|
+
mapObj.setAll(map)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
return self.execute("1eb4752e-0e07-4e8e-a8f5-abea4fd99c14", mapObj)
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
def delete
|
107
|
+
#
|
108
|
+
#Delete object of type Amountdecline
|
109
|
+
|
110
|
+
#@param [String] id
|
111
|
+
#@return [Amountdecline] of the response of the deleted instance.
|
112
|
+
#@raise [APIException] an exception from the response status
|
113
|
+
#
|
114
|
+
|
115
|
+
return self.class.execute("1eb4752e-0e07-4e8e-a8f5-abea4fd99c14", self)
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
def self.query(criteria)
|
127
|
+
#
|
128
|
+
#Query objects of type Amountdecline by id and optional criteria
|
129
|
+
#@param [Dict] criteria
|
130
|
+
#@return [Amountdecline] object representing the response.
|
131
|
+
#@raise [APIException] an exception from the response status
|
132
|
+
#
|
133
|
+
|
134
|
+
return self.execute("2e73694c-985b-4b85-bcb2-1a598c7f3ae6",Amountdecline.new(criteria))
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
@@ -0,0 +1,147 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2016 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
31
|
+
|
32
|
+
module MasterCard
|
33
|
+
module API
|
34
|
+
module Spendcontrols
|
35
|
+
class Card < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
38
|
+
|
39
|
+
@__store = {
|
40
|
+
'e29334ed-c3f0-4bfe-bee7-b2707d3e7eab' => OperationConfig.new("/issuer/v1/card", "create", [], []),
|
41
|
+
'8bd4be20-b836-452f-b9cc-7dcd208836bc' => OperationConfig.new("/issuer/v1/card/{uuid}", "delete", [], []),
|
42
|
+
'5f1174b0-6b65-415d-80e3-816790638b56' => OperationConfig.new("/issuer/v1/card/{uuid}", "create", [], []),
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
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
|
54
|
+
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
58
|
+
|
59
|
+
public
|
60
|
+
|
61
|
+
|
62
|
+
def self.create(mapObj)
|
63
|
+
#
|
64
|
+
#Creates object of type Card
|
65
|
+
#
|
66
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
67
|
+
#@return [Card] of the response of created instance.
|
68
|
+
#@raise [APIException] an exception from the response status
|
69
|
+
return self.execute("e29334ed-c3f0-4bfe-bee7-b2707d3e7eab", Card.new(mapObj))
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
def self.deleteById(id, map = nil)
|
82
|
+
#Delete object of type Card by id
|
83
|
+
|
84
|
+
#@param [String] id
|
85
|
+
#@param [Dict] map, containing additional parameters
|
86
|
+
#@return [Card] of the response of the deleted instance.
|
87
|
+
#@raise [APIException] an exception from the response status
|
88
|
+
|
89
|
+
|
90
|
+
mapObj = Card.new
|
91
|
+
if !(id.nil? || id.to_s.empty?)
|
92
|
+
mapObj.set("id", id)
|
93
|
+
end
|
94
|
+
if !map.nil?
|
95
|
+
if map.instance_of? RequestMap
|
96
|
+
mapObj.setAll(map.getObject())
|
97
|
+
else
|
98
|
+
mapObj.setAll(map)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
return self.execute("8bd4be20-b836-452f-b9cc-7dcd208836bc", mapObj)
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
def delete
|
107
|
+
#
|
108
|
+
#Delete object of type Card
|
109
|
+
|
110
|
+
#@param [String] id
|
111
|
+
#@return [Card] of the response of the deleted instance.
|
112
|
+
#@raise [APIException] an exception from the response status
|
113
|
+
#
|
114
|
+
|
115
|
+
return self.class.execute("8bd4be20-b836-452f-b9cc-7dcd208836bc", self)
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
def self.update(mapObj)
|
122
|
+
#
|
123
|
+
#Creates object of type Card
|
124
|
+
#
|
125
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
126
|
+
#@return [Card] of the response of created instance.
|
127
|
+
#@raise [APIException] an exception from the response status
|
128
|
+
return self.execute("5f1174b0-6b65-415d-80e3-816790638b56", Card.new(mapObj))
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
@@ -0,0 +1,148 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2016 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
31
|
+
|
32
|
+
module MasterCard
|
33
|
+
module API
|
34
|
+
module Spendcontrols
|
35
|
+
class Carddisable < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
38
|
+
|
39
|
+
@__store = {
|
40
|
+
'e32fb56c-3eb7-41fe-ba8b-77f7fadd7f45' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/carddisable", "delete", [], []),
|
41
|
+
'87bdb738-e91d-421f-9fe9-cf1010c05f1b' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/carddisable", "query", [], []),
|
42
|
+
'87361e3b-5f62-43cc-b4be-9fc1908919a3' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/carddisable", "create", [], []),
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
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
|
54
|
+
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
58
|
+
|
59
|
+
public
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
def self.deleteById(id, map = nil)
|
66
|
+
#Delete object of type Carddisable by id
|
67
|
+
|
68
|
+
#@param [String] id
|
69
|
+
#@param [Dict] map, containing additional parameters
|
70
|
+
#@return [Carddisable] of the response of the deleted instance.
|
71
|
+
#@raise [APIException] an exception from the response status
|
72
|
+
|
73
|
+
|
74
|
+
mapObj = Carddisable.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
|
85
|
+
|
86
|
+
return self.execute("e32fb56c-3eb7-41fe-ba8b-77f7fadd7f45", mapObj)
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
def delete
|
91
|
+
#
|
92
|
+
#Delete object of type Carddisable
|
93
|
+
|
94
|
+
#@param [String] id
|
95
|
+
#@return [Carddisable] of the response of the deleted instance.
|
96
|
+
#@raise [APIException] an exception from the response status
|
97
|
+
#
|
98
|
+
|
99
|
+
return self.class.execute("e32fb56c-3eb7-41fe-ba8b-77f7fadd7f45", self)
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
def self.query(criteria)
|
111
|
+
#
|
112
|
+
#Query objects of type Carddisable by id and optional criteria
|
113
|
+
#@param [Dict] criteria
|
114
|
+
#@return [Carddisable] object representing the response.
|
115
|
+
#@raise [APIException] an exception from the response status
|
116
|
+
#
|
117
|
+
|
118
|
+
return self.execute("87bdb738-e91d-421f-9fe9-cf1010c05f1b",Carddisable.new(criteria))
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
def self.create(mapObj)
|
123
|
+
#
|
124
|
+
#Creates object of type Carddisable
|
125
|
+
#
|
126
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
127
|
+
#@return [Carddisable] of the response of created instance.
|
128
|
+
#@raise [APIException] an exception from the response status
|
129
|
+
return self.execute("87361e3b-5f62-43cc-b4be-9fc1908919a3", Carddisable.new(mapObj))
|
130
|
+
end
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
@@ -0,0 +1,148 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2016 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
31
|
+
|
32
|
+
module MasterCard
|
33
|
+
module API
|
34
|
+
module Spendcontrols
|
35
|
+
class Channel < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
38
|
+
|
39
|
+
@__store = {
|
40
|
+
'2fb3ca93-b08f-40bb-ac07-2051e38c7375' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/alerts/channels", "delete", [], []),
|
41
|
+
'2786a543-d76b-4bc4-aed9-835253b29fd4' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/alerts/channels", "query", [], []),
|
42
|
+
'd9dae43a-c68c-4a8b-8673-9db23d703e76' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/alerts/channels", "create", [], []),
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
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
|
54
|
+
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
58
|
+
|
59
|
+
public
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
def self.deleteById(id, map = nil)
|
66
|
+
#Delete object of type Channel by id
|
67
|
+
|
68
|
+
#@param [String] id
|
69
|
+
#@param [Dict] map, containing additional parameters
|
70
|
+
#@return [Channel] of the response of the deleted instance.
|
71
|
+
#@raise [APIException] an exception from the response status
|
72
|
+
|
73
|
+
|
74
|
+
mapObj = Channel.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
|
85
|
+
|
86
|
+
return self.execute("2fb3ca93-b08f-40bb-ac07-2051e38c7375", mapObj)
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
def delete
|
91
|
+
#
|
92
|
+
#Delete object of type Channel
|
93
|
+
|
94
|
+
#@param [String] id
|
95
|
+
#@return [Channel] of the response of the deleted instance.
|
96
|
+
#@raise [APIException] an exception from the response status
|
97
|
+
#
|
98
|
+
|
99
|
+
return self.class.execute("2fb3ca93-b08f-40bb-ac07-2051e38c7375", self)
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
def self.query(criteria)
|
111
|
+
#
|
112
|
+
#Query objects of type Channel by id and optional criteria
|
113
|
+
#@param [Dict] criteria
|
114
|
+
#@return [Channel] object representing the response.
|
115
|
+
#@raise [APIException] an exception from the response status
|
116
|
+
#
|
117
|
+
|
118
|
+
return self.execute("2786a543-d76b-4bc4-aed9-835253b29fd4",Channel.new(criteria))
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
def self.create(mapObj)
|
123
|
+
#
|
124
|
+
#Creates object of type Channel
|
125
|
+
#
|
126
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
127
|
+
#@return [Channel] of the response of created instance.
|
128
|
+
#@raise [APIException] an exception from the response status
|
129
|
+
return self.execute("d9dae43a-c68c-4a8b-8673-9db23d703e76", Channel.new(mapObj))
|
130
|
+
end
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|