mastercard_places 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67aa60d29ba01e121b044e89047c8300c30f286e
4
- data.tar.gz: 6cf173a5465c02a3356d8fa37f4e112d05b24184
3
+ metadata.gz: dd6861b81a3a862c6fbe273ab9159ef690fb261e
4
+ data.tar.gz: 1537ced4232f57be9d3d2426b456e9603adeab8c
5
5
  SHA512:
6
- metadata.gz: 3d2193ae387fdc15bcde0bd1370e2dd5f552946e9a36271567f614725f439a8d0e588833bc99a1a9b6fb1378dd4e96eaa8556a0af13dc367eda0c9b99f07bc81
7
- data.tar.gz: 3f96d6b6ef88f6b0c797f96e506fa4072e218bcdceda9a99605e91bb0ef37488755ed9e62c998ba3338124925497791f58b6b2219f1f7f736bdb6e287ac6cd46
6
+ metadata.gz: 6bd64ef3119cadddb2af5883ebe983750b3db5f5d7bb8f05449af9a4da10552a8342468736f6f3851f169982d0c83632e22a6f33815256f220bc04c88ff64be0
7
+ data.tar.gz: d93fdac4d30d513341d94c251558b59fe003e77028abdb195c7527b553cebcf1195da5b079f00e8572b52e097e42301a7219aab4086d523e87e426338b48bd6f
@@ -27,52 +27,56 @@
27
27
 
28
28
 
29
29
  require "mastercard/core/model"
30
+ require "mastercard/core/baseobject"
30
31
 
31
32
  module MasterCard
32
- module API
33
- module Places
34
- class GeocodeLocation < MasterCard::Core::Model::BaseObject
35
- include MasterCard::Core::Model
36
- #
33
+ module API
34
+ module Places
35
+ class GeocodeLocation < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
37
38
 
38
- @__store = {
39
- '21b67c48-3147-417a-9817-1bb90ee1ef01' => OperationConfig.new("/merchantpoi/v1/merchantpoi/geoCodeLocation", "query", [], ["addressLine1","addressLine2","cityName","countrySubDivision","countryCode","postalCode"]),
40
-
41
- }
39
+ @__store = {
40
+ 'f1c9db58-6498-4538-86f0-ccd9a0084a17' => OperationConfig.new("/merchantpoi/v1/merchantpoi/geoCodeLocation", "query", [], ["addressLine1","addressLine2","cityName","countrySubDivision","countryCode","postalCode"]),
41
+
42
+ }
42
43
 
43
- protected
44
+ protected
44
45
 
45
- def self.getOperationConfig(uuid)
46
- if @__store.key?(uuid)
47
- return @__store[uuid]
48
- end
49
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
50
- end
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
51
52
 
52
- def self.getOperationMetadata()
53
- return OperationMetadata.new(SDKConfig.getVersion(), SDKConfig.getHost())
54
- end
53
+ def self.getOperationMetadata()
54
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
55
+ end
55
56
 
56
- public
57
+ public
57
58
 
58
59
 
59
60
 
60
61
 
61
62
 
62
63
 
63
- def self.query(criteria)
64
- #
65
- #Query objects of type GeocodeLocation by id and optional criteria
66
- #@param type criteria
67
- #@return GeocodeLocation object representing the response.
68
- #
69
64
 
70
- return self.execute("21b67c48-3147-417a-9817-1bb90ee1ef01",GeocodeLocation.new(criteria))
71
- end
65
+ def self.query(criteria)
66
+ #
67
+ #Query objects of type GeocodeLocation by id and optional criteria
68
+ #@param [Dict] criteria
69
+ #@return [GeocodeLocation] object representing the response.
70
+ #@raise [APIException] an exception from the response status
71
+ #
72
72
 
73
- end
74
- end
75
- end
73
+ return self.execute("f1c9db58-6498-4538-86f0-ccd9a0084a17",GeocodeLocation.new(criteria))
74
+ end
75
+
76
+
77
+ end
78
+ end
79
+ end
76
80
  end
77
81
 
78
82
 
@@ -27,52 +27,56 @@
27
27
 
28
28
 
29
29
  require "mastercard/core/model"
30
+ require "mastercard/core/baseobject"
30
31
 
31
32
  module MasterCard
32
- module API
33
- module Places
34
- class MerchantCategoryCodes < MasterCard::Core::Model::BaseObject
35
- include MasterCard::Core::Model
36
- #
33
+ module API
34
+ module Places
35
+ class MerchantCategoryCodes < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
37
38
 
38
- @__store = {
39
- '0107607d-d425-403a-a378-be06b87793d5' => OperationConfig.new("/merchantpoi/v1/merchantpoi/merchantcategorycodes", "query", [], ["MCC_Codes"]),
40
-
41
- }
39
+ @__store = {
40
+ 'b3865d0f-477a-4237-bfff-457d9733b219' => OperationConfig.new("/merchantpoi/v1/merchantpoi/merchantcategorycodes", "query", [], ["MCC_Codes"]),
41
+
42
+ }
42
43
 
43
- protected
44
+ protected
44
45
 
45
- def self.getOperationConfig(uuid)
46
- if @__store.key?(uuid)
47
- return @__store[uuid]
48
- end
49
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
50
- end
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
51
52
 
52
- def self.getOperationMetadata()
53
- return OperationMetadata.new(SDKConfig.getVersion(), SDKConfig.getHost())
54
- end
53
+ def self.getOperationMetadata()
54
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
55
+ end
55
56
 
56
- public
57
+ public
57
58
 
58
59
 
59
60
 
60
61
 
61
62
 
62
63
 
63
- def self.query(criteria)
64
- #
65
- #Query objects of type MerchantCategoryCodes by id and optional criteria
66
- #@param type criteria
67
- #@return MerchantCategoryCodes object representing the response.
68
- #
69
64
 
70
- return self.execute("0107607d-d425-403a-a378-be06b87793d5",MerchantCategoryCodes.new(criteria))
71
- end
65
+ def self.query(criteria)
66
+ #
67
+ #Query objects of type MerchantCategoryCodes by id and optional criteria
68
+ #@param [Dict] criteria
69
+ #@return [MerchantCategoryCodes] object representing the response.
70
+ #@raise [APIException] an exception from the response status
71
+ #
72
72
 
73
- end
74
- end
75
- end
73
+ return self.execute("b3865d0f-477a-4237-bfff-457d9733b219",MerchantCategoryCodes.new(criteria))
74
+ end
75
+
76
+
77
+ end
78
+ end
79
+ end
76
80
  end
77
81
 
78
82
 
@@ -27,52 +27,56 @@
27
27
 
28
28
 
29
29
  require "mastercard/core/model"
30
+ require "mastercard/core/baseobject"
30
31
 
31
32
  module MasterCard
32
- module API
33
- module Places
34
- class MerchantIndustries < MasterCard::Core::Model::BaseObject
35
- include MasterCard::Core::Model
36
- #
33
+ module API
34
+ module Places
35
+ class MerchantIndustries < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
37
38
 
38
- @__store = {
39
- '8a286e15-8c71-4717-bb3c-a2ab6720aee3' => OperationConfig.new("/merchantpoi/v1/merchantpoi/merchantindustries", "query", [], ["IND_Codes"]),
40
-
41
- }
39
+ @__store = {
40
+ '3f81146b-509e-4af3-aa35-083bc417f9ce' => OperationConfig.new("/merchantpoi/v1/merchantpoi/merchantindustries", "query", [], ["IND_Codes"]),
41
+
42
+ }
42
43
 
43
- protected
44
+ protected
44
45
 
45
- def self.getOperationConfig(uuid)
46
- if @__store.key?(uuid)
47
- return @__store[uuid]
48
- end
49
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
50
- end
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
51
52
 
52
- def self.getOperationMetadata()
53
- return OperationMetadata.new(SDKConfig.getVersion(), SDKConfig.getHost())
54
- end
53
+ def self.getOperationMetadata()
54
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
55
+ end
55
56
 
56
- public
57
+ public
57
58
 
58
59
 
59
60
 
60
61
 
61
62
 
62
63
 
63
- def self.query(criteria)
64
- #
65
- #Query objects of type MerchantIndustries by id and optional criteria
66
- #@param type criteria
67
- #@return MerchantIndustries object representing the response.
68
- #
69
64
 
70
- return self.execute("8a286e15-8c71-4717-bb3c-a2ab6720aee3",MerchantIndustries.new(criteria))
71
- end
65
+ def self.query(criteria)
66
+ #
67
+ #Query objects of type MerchantIndustries by id and optional criteria
68
+ #@param [Dict] criteria
69
+ #@return [MerchantIndustries] object representing the response.
70
+ #@raise [APIException] an exception from the response status
71
+ #
72
72
 
73
- end
74
- end
75
- end
73
+ return self.execute("3f81146b-509e-4af3-aa35-083bc417f9ce",MerchantIndustries.new(criteria))
74
+ end
75
+
76
+
77
+ end
78
+ end
79
+ end
76
80
  end
77
81
 
78
82
 
@@ -27,52 +27,55 @@
27
27
 
28
28
 
29
29
  require "mastercard/core/model"
30
+ require "mastercard/core/baseobject"
30
31
 
31
32
  module MasterCard
32
- module API
33
- module Places
34
- class MerchantPointOfInterest < MasterCard::Core::Model::BaseObject
35
- include MasterCard::Core::Model
36
- #
33
+ module API
34
+ module Places
35
+ class MerchantPointOfInterest < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
37
38
 
38
- @__store = {
39
- 'ff7b5090-e551-4e98-ab72-bbbf98667fbc' => OperationConfig.new("/merchantpoi/v1/merchantpoi/places", "create", [], ["pageOffset","pageLength","radiusSearch","unit","distance"]),
40
-
41
- }
39
+ @__store = {
40
+ 'd556c3fb-570f-44f2-ae23-15bc7738b39b' => OperationConfig.new("/merchantpoi/v1/merchantpoi/places", "create", [], ["pageOffset","pageLength","radiusSearch","unit","distance"]),
41
+
42
+ }
42
43
 
43
- protected
44
+ protected
44
45
 
45
- def self.getOperationConfig(uuid)
46
- if @__store.key?(uuid)
47
- return @__store[uuid]
48
- end
49
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
50
- end
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
51
52
 
52
- def self.getOperationMetadata()
53
- return OperationMetadata.new(SDKConfig.getVersion(), SDKConfig.getHost())
54
- end
53
+ def self.getOperationMetadata()
54
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
55
+ end
55
56
 
56
- public
57
+ public
57
58
 
58
- def self.create(mapObj)
59
- #
60
- #Creates object of type MerchantPointOfInterest
61
- #
62
- #@param Dict mapObj, containing the required parameters to create a new object
63
- #@return MerchantPointOfInterest of the response of created instance.
64
- #
65
- return self.execute("ff7b5090-e551-4e98-ab72-bbbf98667fbc", MerchantPointOfInterest.new(mapObj))
66
- end
67
59
 
60
+ def self.create(mapObj)
61
+ #
62
+ #Creates object of type MerchantPointOfInterest
63
+ #
64
+ #@param Dict mapObj, containing the required parameters to create a new object
65
+ #@return [MerchantPointOfInterest] of the response of created instance.
66
+ #@raise [APIException] an exception from the response status
67
+ return self.execute("d556c3fb-570f-44f2-ae23-15bc7738b39b", MerchantPointOfInterest.new(mapObj))
68
+ end
68
69
 
69
70
 
70
71
 
71
72
 
72
73
 
73
- end
74
- end
75
- end
74
+
75
+
76
+ end
77
+ end
78
+ end
76
79
  end
77
80
 
78
81
 
@@ -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
- module API
29
- module Places
30
- class SDKConfig
31
-
32
- private
33
- @@host = nil
34
-
35
- public
36
- def self.setHost(host)
37
- @@host = host
38
- end
39
-
40
- def self.getHost()
41
- return @@host
42
- end
43
-
44
- def self.getVersion()
45
- return "1.0.2"
46
- end
47
- end
48
- end
49
- end
32
+ module API
33
+ module Places
34
+ class ResourceConfig
35
+ include MasterCard::Core
36
+
37
+ @@instance = nil
38
+
39
+ def initialize
40
+ @name = "places"
41
+ @override = nil
42
+ @host = nil
43
+ @context = nil
44
+ @version = "1.0.3"
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
@@ -1,6 +1,8 @@
1
1
  require 'mastercard_api_core'
2
- require 'mastercard/api/places/skdconfig'
3
- require 'mastercard/api/places/merchantpointofinterest'
4
- require 'mastercard/api/places/merchantindustries'
5
- require 'mastercard/api/places/merchantcategorycodes'
2
+
3
+ require 'mastercard/api/places/resourceconfig'
4
+
6
5
  require 'mastercard/api/places/geocodelocation'
6
+ require 'mastercard/api/places/merchantcategorycodes'
7
+ require 'mastercard/api/places/merchantindustries'
8
+ require 'mastercard/api/places/merchantpointofinterest'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastercard_places
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MasterCard Worldwide
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mastercard_api_core
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.0
19
+ version: 1.4.0
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.2.0
22
+ version: 1.4.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2.0
29
+ version: 1.4.0
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.2.0
32
+ version: 1.4.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: ci_reporter_minitest
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -55,7 +55,7 @@ files:
55
55
  - lib/mastercard/api/places/merchantcategorycodes.rb
56
56
  - lib/mastercard/api/places/merchantindustries.rb
57
57
  - lib/mastercard/api/places/merchantpointofinterest.rb
58
- - lib/mastercard/api/places/skdconfig.rb
58
+ - lib/mastercard/api/places/resourceconfig.rb
59
59
  - lib/mastercard_places.rb
60
60
  homepage: https://developer.mastercard.com
61
61
  licenses: