mastercard_blockchain 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 340fcca11d09b79f1705a297d4b5b0b427c6eef2
4
+ data.tar.gz: eea9314ed6ce7c8fe2c5ab6c4c83496c528e91f2
5
+ SHA512:
6
+ metadata.gz: eabb1572e3e93f80dafc1a68e080bdbd5f199e89c8a89da71c15684cd377c6aef4d1dc140defac56663f38e6c58f21b30441536d1b89fe92e10a65e93ba880f8
7
+ data.tar.gz: 92ff2aab566266dd35741dc74d664849c5a34b518ef272bde6b6c7984746b5c2362f859b6032f38ad704dfbe513623c2417a482a5cf149cf682a40dc4b0e826b
@@ -0,0 +1,117 @@
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 Blockchain
35
+ class App < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '60d3d50a-8dc8-4e1b-aa80-7d20f27f1678' => OperationConfig.new("/labs/proxy/chain/api/v1/network/app/{id}", "read", [], []),
41
+ '203fa52f-4929-476b-abb6-37f8624b994f' => OperationConfig.new("/labs/proxy/chain/api/v1/network/app/{id}", "update", [], []),
42
+
43
+ }
44
+
45
+ protected
46
+
47
+ def self.getOperationConfig(uuid)
48
+ if @__store.key?(uuid)
49
+ return @__store[uuid]
50
+ end
51
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
52
+ end
53
+
54
+ def self.getOperationMetadata()
55
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative())
56
+ end
57
+
58
+ public
59
+
60
+
61
+
62
+
63
+
64
+
65
+ def self.read(id, criteria = nil)
66
+ #
67
+ #Returns objects of type App by id and optional criteria
68
+ #@param [String] id
69
+ #@param [Dict] criteria
70
+ #@return [App] object representing the response
71
+ #@raise [APIException] an exception from the response status
72
+
73
+ mapObj = App.new
74
+ if !(id.nil? || id.to_s.empty?)
75
+ mapObj.set("id", id)
76
+ end
77
+ if !criteria.nil?
78
+ if criteria.instance_of? RequestMap
79
+ mapObj.setAll(criteria.getObject())
80
+ else
81
+ mapObj.setAll(criteria)
82
+ end
83
+ end
84
+
85
+ return self.execute("60d3d50a-8dc8-4e1b-aa80-7d20f27f1678",App.new(mapObj))
86
+ end
87
+
88
+
89
+
90
+
91
+ def update
92
+ #
93
+ #Updates an object of type App
94
+ #
95
+ #@return [App] object representing the response.
96
+ #@raise [APIException] an exception from the response status
97
+ #
98
+ return self.class.execute("203fa52f-4929-476b-abb6-37f8624b994f",self)
99
+ end
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ end
108
+ end
109
+ end
110
+ end
111
+
112
+
113
+
114
+
115
+
116
+
117
+
@@ -0,0 +1,120 @@
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 Blockchain
35
+ class Block < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '0878693b-dd2b-44ee-9098-e7a4e9d4ae81' => OperationConfig.new("/labs/proxy/chain/api/v1/network/block", "list", [], ["from","to"]),
41
+ 'cf428664-ac27-477d-bd65-8ac2c72e4f1b' => OperationConfig.new("/labs/proxy/chain/api/v1/network/block/{id}", "read", [], []),
42
+
43
+ }
44
+
45
+ protected
46
+
47
+ def self.getOperationConfig(uuid)
48
+ if @__store.key?(uuid)
49
+ return @__store[uuid]
50
+ end
51
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
52
+ end
53
+
54
+ def self.getOperationMetadata()
55
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative())
56
+ end
57
+
58
+ public
59
+
60
+
61
+
62
+
63
+ def self.listByCriteria(criteria = nil)
64
+ #
65
+ #List objects of type Block
66
+ #
67
+ #@param [Dict] criteria
68
+ #@return Array [Block] object matching the criteria.
69
+ #@raise [APIException] an exception from the response status
70
+
71
+ if criteria.nil?
72
+ return self.execute("0878693b-dd2b-44ee-9098-e7a4e9d4ae81",Block.new)
73
+ else
74
+ return self.execute("0878693b-dd2b-44ee-9098-e7a4e9d4ae81",Block.new(criteria))
75
+ end
76
+ end
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ def self.read(id, criteria = nil)
86
+ #
87
+ #Returns objects of type Block by id and optional criteria
88
+ #@param [String] id
89
+ #@param [Dict] criteria
90
+ #@return [Block] object representing the response
91
+ #@raise [APIException] an exception from the response status
92
+
93
+ mapObj = Block.new
94
+ if !(id.nil? || id.to_s.empty?)
95
+ mapObj.set("id", id)
96
+ end
97
+ if !criteria.nil?
98
+ if criteria.instance_of? RequestMap
99
+ mapObj.setAll(criteria.getObject())
100
+ else
101
+ mapObj.setAll(criteria)
102
+ end
103
+ end
104
+
105
+ return self.execute("cf428664-ac27-477d-bd65-8ac2c72e4f1b",Block.new(mapObj))
106
+ end
107
+
108
+
109
+
110
+ end
111
+ end
112
+ end
113
+ end
114
+
115
+
116
+
117
+
118
+
119
+
120
+
@@ -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 Blockchain
35
+ class Encoding < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ 'd6a92e4b-104a-4f91-ab54-ab9c0f37b203' => OperationConfig.new("/labs/proxy/chain/api/v1/network/support/encoding", "create", [], []),
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(), ResourceConfig.instance.getJsonNative())
55
+ end
56
+
57
+ public
58
+
59
+
60
+ def self.create(mapObj)
61
+ #
62
+ #Creates object of type Encoding
63
+ #
64
+ #@param Dict mapObj, containing the required parameters to create a new object
65
+ #@return [Encoding] of the response of created instance.
66
+ #@raise [APIException] an exception from the response status
67
+ return self.execute("d6a92e4b-104a-4f91-ab54-ab9c0f37b203", Encoding.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,168 @@
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 Blockchain
35
+ class Node < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '334a650e-7ce4-43d1-86d6-011ea2c58a7d' => OperationConfig.new("/labs/proxy/chain/api/v1/network/create", "create", [], []),
41
+ '1c7a9588-2662-406c-9324-473086984750' => OperationConfig.new("/labs/proxy/chain/api/v1/network/invite", "create", [], []),
42
+ '4ac1e2ea-7e28-4e74-bde9-3e02bfadd4fe' => OperationConfig.new("/labs/proxy/chain/api/v1/network/join", "create", [], []),
43
+ 'b7d03170-8cc3-4678-bd5d-9c8b87c031af' => OperationConfig.new("/labs/proxy/chain/api/v1/network/node/{address}", "read", [], []),
44
+ 'c13383a7-4499-4d92-a043-35da877be130' => OperationConfig.new("/labs/proxy/chain/api/v1/network/node", "query", [], []),
45
+
46
+ }
47
+
48
+ protected
49
+
50
+ def self.getOperationConfig(uuid)
51
+ if @__store.key?(uuid)
52
+ return @__store[uuid]
53
+ end
54
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
55
+ end
56
+
57
+ def self.getOperationMetadata()
58
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative())
59
+ end
60
+
61
+ public
62
+
63
+
64
+ def self.provision(mapObj)
65
+ #
66
+ #Creates object of type Node
67
+ #
68
+ #@param Dict mapObj, containing the required parameters to create a new object
69
+ #@return [Node] of the response of created instance.
70
+ #@raise [APIException] an exception from the response status
71
+ return self.execute("334a650e-7ce4-43d1-86d6-011ea2c58a7d", Node.new(mapObj))
72
+ end
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+ def self.invite(mapObj)
81
+ #
82
+ #Creates object of type Node
83
+ #
84
+ #@param Dict mapObj, containing the required parameters to create a new object
85
+ #@return [Node] of the response of created instance.
86
+ #@raise [APIException] an exception from the response status
87
+ return self.execute("1c7a9588-2662-406c-9324-473086984750", Node.new(mapObj))
88
+ end
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ def self.join(mapObj)
97
+ #
98
+ #Creates object of type Node
99
+ #
100
+ #@param Dict mapObj, containing the required parameters to create a new object
101
+ #@return [Node] of the response of created instance.
102
+ #@raise [APIException] an exception from the response status
103
+ return self.execute("4ac1e2ea-7e28-4e74-bde9-3e02bfadd4fe", Node.new(mapObj))
104
+ end
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ def self.read(id, criteria = nil)
117
+ #
118
+ #Returns objects of type Node by id and optional criteria
119
+ #@param [String] id
120
+ #@param [Dict] criteria
121
+ #@return [Node] object representing the response
122
+ #@raise [APIException] an exception from the response status
123
+
124
+ mapObj = Node.new
125
+ if !(id.nil? || id.to_s.empty?)
126
+ mapObj.set("id", id)
127
+ end
128
+ if !criteria.nil?
129
+ if criteria.instance_of? RequestMap
130
+ mapObj.setAll(criteria.getObject())
131
+ else
132
+ mapObj.setAll(criteria)
133
+ end
134
+ end
135
+
136
+ return self.execute("b7d03170-8cc3-4678-bd5d-9c8b87c031af",Node.new(mapObj))
137
+ end
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ def self.query(criteria)
147
+ #
148
+ #Query objects of type Node by id and optional criteria
149
+ #@param [Dict] criteria
150
+ #@return [Node] object representing the response.
151
+ #@raise [APIException] an exception from the response status
152
+ #
153
+
154
+ return self.execute("c13383a7-4499-4d92-a043-35da877be130",Node.new(criteria))
155
+ end
156
+
157
+
158
+ end
159
+ end
160
+ end
161
+ end
162
+
163
+
164
+
165
+
166
+
167
+
168
+
@@ -0,0 +1,103 @@
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 Blockchain
34
+ class ResourceConfig
35
+ include MasterCard::Core
36
+
37
+ @@instance = nil
38
+
39
+ def initialize
40
+ @name = "blockchain"
41
+ @override = nil
42
+ @host = nil
43
+ @context = nil
44
+ @version = "blockchain:0.0.1"
45
+ @jsonNative = true
46
+
47
+ Config.registerResourceConfig(self)
48
+ currentEnvironment = Config.getEnvironment()
49
+ self.setEnvironment(currentEnvironment)
50
+
51
+ end
52
+
53
+
54
+ def self.instance
55
+ return @@instance
56
+ end
57
+
58
+
59
+ def getName
60
+ return @name
61
+ end
62
+
63
+
64
+ def getHost
65
+ unless @override.nil? || @override == 0
66
+ return @override
67
+ else
68
+ return @host
69
+ end
70
+ end
71
+
72
+ def getContext
73
+ return @context
74
+ end
75
+
76
+ def getVersion
77
+ return @version
78
+ end
79
+
80
+ def getJsonNative
81
+ return @jsonNative
82
+ end
83
+
84
+ def setEnvironment(environmet)
85
+ if Environment::MAPPING.key?(environmet)
86
+ tuple = Environment::MAPPING[environmet]
87
+ @host = tuple[0]
88
+ @context = tuple[1]
89
+ end
90
+ end
91
+
92
+ def setCustomEnvironment(host,context)
93
+ @host = host
94
+ @context = context
95
+ end
96
+
97
+ @@instance = ResourceConfig.new
98
+
99
+ private_class_method :new
100
+ end
101
+ end
102
+ end
103
+ end
@@ -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 Blockchain
35
+ class Sign < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ 'ac3a9fb6-7f9f-45b6-aee1-cf80ac42a9e6' => OperationConfig.new("/labs/proxy/chain/api/v1/network/sign", "create", [], []),
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(), ResourceConfig.instance.getJsonNative())
55
+ end
56
+
57
+ public
58
+
59
+
60
+ def self.create(mapObj)
61
+ #
62
+ #Creates object of type Sign
63
+ #
64
+ #@param Dict mapObj, containing the required parameters to create a new object
65
+ #@return [Sign] of the response of created instance.
66
+ #@raise [APIException] an exception from the response status
67
+ return self.execute("ac3a9fb6-7f9f-45b6-aee1-cf80ac42a9e6", Sign.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,87 @@
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 Blockchain
35
+ class Status < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '75e35ceb-7d89-4277-a6df-e7c3d15185e2' => OperationConfig.new("/labs/proxy/chain/api/v1/network/status", "query", [], []),
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(), ResourceConfig.instance.getJsonNative())
55
+ end
56
+
57
+ public
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+ def self.query(criteria)
66
+ #
67
+ #Query objects of type Status by id and optional criteria
68
+ #@param [Dict] criteria
69
+ #@return [Status] object representing the response.
70
+ #@raise [APIException] an exception from the response status
71
+ #
72
+
73
+ return self.execute("75e35ceb-7d89-4277-a6df-e7c3d15185e2",Status.new(criteria))
74
+ end
75
+
76
+
77
+ end
78
+ end
79
+ end
80
+ end
81
+
82
+
83
+
84
+
85
+
86
+
87
+
@@ -0,0 +1,116 @@
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 Blockchain
35
+ class TransactionEntry < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '3cc71084-7d1f-4f2c-b5af-902a24a7054c' => OperationConfig.new("/labs/proxy/chain/api/v1/network/entry/{hash}", "read", [], []),
41
+ '1b75cd61-a5f5-425b-a60f-176c73c56eda' => OperationConfig.new("/labs/proxy/chain/api/v1/network/entry", "create", [], []),
42
+
43
+ }
44
+
45
+ protected
46
+
47
+ def self.getOperationConfig(uuid)
48
+ if @__store.key?(uuid)
49
+ return @__store[uuid]
50
+ end
51
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
52
+ end
53
+
54
+ def self.getOperationMetadata()
55
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative())
56
+ end
57
+
58
+ public
59
+
60
+
61
+
62
+
63
+
64
+
65
+ def self.read(id, criteria = nil)
66
+ #
67
+ #Returns objects of type TransactionEntry by id and optional criteria
68
+ #@param [String] id
69
+ #@param [Dict] criteria
70
+ #@return [TransactionEntry] object representing the response
71
+ #@raise [APIException] an exception from the response status
72
+
73
+ mapObj = TransactionEntry.new
74
+ if !(id.nil? || id.to_s.empty?)
75
+ mapObj.set("id", id)
76
+ end
77
+ if !criteria.nil?
78
+ if criteria.instance_of? RequestMap
79
+ mapObj.setAll(criteria.getObject())
80
+ else
81
+ mapObj.setAll(criteria)
82
+ end
83
+ end
84
+
85
+ return self.execute("3cc71084-7d1f-4f2c-b5af-902a24a7054c",TransactionEntry.new(mapObj))
86
+ end
87
+
88
+
89
+
90
+ def self.create(mapObj)
91
+ #
92
+ #Creates object of type TransactionEntry
93
+ #
94
+ #@param Dict mapObj, containing the required parameters to create a new object
95
+ #@return [TransactionEntry] of the response of created instance.
96
+ #@raise [APIException] an exception from the response status
97
+ return self.execute("1b75cd61-a5f5-425b-a60f-176c73c56eda", TransactionEntry.new(mapObj))
98
+ end
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+ end
107
+ end
108
+ end
109
+ end
110
+
111
+
112
+
113
+
114
+
115
+
116
+
@@ -0,0 +1,11 @@
1
+ require 'mastercard_api_core'
2
+
3
+ require 'mastercard/api/blockchain/resourceconfig'
4
+
5
+ require 'mastercard/api/blockchain/app'
6
+ require 'mastercard/api/blockchain/block'
7
+ require 'mastercard/api/blockchain/encoding'
8
+ require 'mastercard/api/blockchain/node'
9
+ require 'mastercard/api/blockchain/sign'
10
+ require 'mastercard/api/blockchain/status'
11
+ require 'mastercard/api/blockchain/transactionentry'
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mastercard_blockchain
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - MasterCard Worldwide
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mastercard_api_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.0
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.4.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 1.4.0
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.4.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: ci_reporter_minitest
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description: MasterCard Blockchain Description
48
+ email:
49
+ - APISupport@mastercard.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - lib/mastercard/api/blockchain/app.rb
55
+ - lib/mastercard/api/blockchain/block.rb
56
+ - lib/mastercard/api/blockchain/encoding.rb
57
+ - lib/mastercard/api/blockchain/node.rb
58
+ - lib/mastercard/api/blockchain/resourceconfig.rb
59
+ - lib/mastercard/api/blockchain/sign.rb
60
+ - lib/mastercard/api/blockchain/status.rb
61
+ - lib/mastercard/api/blockchain/transactionentry.rb
62
+ - lib/mastercard_blockchain.rb
63
+ homepage: https://developer.mastercard.com
64
+ licenses:
65
+ - BSD-2-Clause
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.5.1
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: MasterCard Blockchain SDK
87
+ test_files: []