mastercard_spendcontrols 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 Declineall < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ 'acd8f571-bed8-4004-9c18-ee5b8f107ded' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/all", "delete", [], []),
41
+ 'fbb4d36f-0f7a-4b7d-b178-b474840fdf26' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/all", "query", [], []),
42
+ 'b6349d13-13b1-4ffc-925f-7501d3daef27' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines/all", "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 Declineall by id
67
+
68
+ #@param [String] id
69
+ #@param [Dict] map, containing additional parameters
70
+ #@return [Declineall] of the response of the deleted instance.
71
+ #@raise [APIException] an exception from the response status
72
+
73
+
74
+ mapObj = Declineall.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("acd8f571-bed8-4004-9c18-ee5b8f107ded", mapObj)
87
+ end
88
+
89
+
90
+ def delete
91
+ #
92
+ #Delete object of type Declineall
93
+
94
+ #@param [String] id
95
+ #@return [Declineall] of the response of the deleted instance.
96
+ #@raise [APIException] an exception from the response status
97
+ #
98
+
99
+ return self.class.execute("acd8f571-bed8-4004-9c18-ee5b8f107ded", self)
100
+ end
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ def self.query(criteria)
111
+ #
112
+ #Query objects of type Declineall by id and optional criteria
113
+ #@param [Dict] criteria
114
+ #@return [Declineall] object representing the response.
115
+ #@raise [APIException] an exception from the response status
116
+ #
117
+
118
+ return self.execute("fbb4d36f-0f7a-4b7d-b178-b474840fdf26",Declineall.new(criteria))
119
+ end
120
+
121
+
122
+ def self.create(mapObj)
123
+ #
124
+ #Creates object of type Declineall
125
+ #
126
+ #@param Dict mapObj, containing the required parameters to create a new object
127
+ #@return [Declineall] of the response of created instance.
128
+ #@raise [APIException] an exception from the response status
129
+ return self.execute("b6349d13-13b1-4ffc-925f-7501d3daef27", Declineall.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 Declines < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '8099d757-2a42-4cb9-b04d-cc4d90a8e948' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines", "delete", [], []),
41
+ 'f80899ae-4899-4ce9-ae7a-de7f5e28d5dd' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines", "query", [], []),
42
+ '8c44822b-8dd3-42c4-ad26-ff1a4edfc6c6' => OperationConfig.new("/issuer/v1/card/{uuid}/controls/declines", "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 Declines by id
67
+
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
72
+
73
+
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
85
+
86
+ return self.execute("8099d757-2a42-4cb9-b04d-cc4d90a8e948", mapObj)
87
+ end
88
+
89
+
90
+ def delete
91
+ #
92
+ #Delete object of type Declines
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
+ #
98
+
99
+ return self.class.execute("8099d757-2a42-4cb9-b04d-cc4d90a8e948", self)
100
+ end
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
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
+ #
117
+
118
+ return self.execute("f80899ae-4899-4ce9-ae7a-de7f5e28d5dd",Declines.new(criteria))
119
+ end
120
+
121
+
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("8c44822b-8dd3-42c4-ad26-ff1a4edfc6c6", Declines.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,86 @@
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 Notification < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ 'd60e0ebe-df90-4d74-b755-2a635cc5bd00' => OperationConfig.new("/issuer/v1/test/notificationUrl", "create", ["x-request-endpoint-uri"], []),
41
+
42
+ }
43
+
44
+ protected
45
+
46
+ def self.getOperationConfig(uuid)
47
+ if @__store.key?(uuid)
48
+ return @__store[uuid]
49
+ end
50
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
51
+ end
52
+
53
+ def self.getOperationMetadata()
54
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
55
+ end
56
+
57
+ public
58
+
59
+
60
+ def self.create(mapObj)
61
+ #
62
+ #Creates object of type Notification
63
+ #
64
+ #@param Dict mapObj, containing the required parameters to create a new object
65
+ #@return [Notification] of the response of created instance.
66
+ #@raise [APIException] an exception from the response status
67
+ return self.execute("d60e0ebe-df90-4d74-b755-2a635cc5bd00", Notification.new(mapObj))
68
+ end
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ end
77
+ end
78
+ end
79
+ end
80
+
81
+
82
+
83
+
84
+
85
+
86
+
@@ -0,0 +1,98 @@
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
+ require "mastercard/core/constants"
29
+ require "mastercard/core/config"
30
+
31
+ module MasterCard
32
+ module API
33
+ module Spendcontrols
34
+ class ResourceConfig
35
+ include MasterCard::Core
36
+
37
+ @@instance = nil
38
+
39
+ def initialize
40
+ @name = "spendcontrols"
41
+ @override = nil
42
+ @host = nil
43
+ @context = nil
44
+ @version = "1.0.0"
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
98
+ end