reference_service 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +79 -0
- data/README.md +126 -0
- data/Rakefile +10 -0
- data/docs/ActiveSubscription.md +27 -0
- data/docs/Error.md +17 -0
- data/docs/ErrorErrors.md +17 -0
- data/docs/ErrorErrorsError.md +25 -0
- data/docs/ReportsApi.md +168 -0
- data/docs/Sector.md +19 -0
- data/docs/SectorApi.md +100 -0
- data/docs/SectorSpending.md +23 -0
- data/docs/SpendingReport.md +23 -0
- data/docs/SubscribeApi.md +244 -0
- data/docs/Subscription.md +17 -0
- data/docs/SubscriptionObject.md +27 -0
- data/docs/SubscriptionPaymentCard.md +21 -0
- data/docs/SubscriptionResponse.md +19 -0
- data/docs/TopLocationsReport.md +17 -0
- data/docs/UnsubscribedResponse.md +19 -0
- data/git_push.sh +55 -0
- data/lib/openapi_client.rb +55 -0
- data/lib/openapi_client/api/reports_api.rb +252 -0
- data/lib/openapi_client/api/sector_api.rb +151 -0
- data/lib/openapi_client/api/subscribe_api.rb +334 -0
- data/lib/openapi_client/api_client.rb +386 -0
- data/lib/openapi_client/api_error.rb +57 -0
- data/lib/openapi_client/configuration.rb +244 -0
- data/lib/openapi_client/models/active_subscription.rb +262 -0
- data/lib/openapi_client/models/error.rb +201 -0
- data/lib/openapi_client/models/error_errors.rb +203 -0
- data/lib/openapi_client/models/error_errors_error.rb +232 -0
- data/lib/openapi_client/models/sector.rb +216 -0
- data/lib/openapi_client/models/sector_spending.rb +244 -0
- data/lib/openapi_client/models/spending_report.rb +235 -0
- data/lib/openapi_client/models/subscription.rb +197 -0
- data/lib/openapi_client/models/subscription_object.rb +247 -0
- data/lib/openapi_client/models/subscription_payment_card.rb +254 -0
- data/lib/openapi_client/models/subscription_response.rb +206 -0
- data/lib/openapi_client/models/top_locations_report.rb +200 -0
- data/lib/openapi_client/models/unsubscribed_response.rb +207 -0
- data/lib/openapi_client/version.rb +15 -0
- data/openapi_client.gemspec +38 -0
- data/spec/api/reports_api_spec.rb +77 -0
- data/spec/api/sector_api_spec.rb +58 -0
- data/spec/api/subscribe_api_spec.rb +92 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/active_subscription_spec.rb +71 -0
- data/spec/models/error_errors_error_spec.rb +65 -0
- data/spec/models/error_errors_spec.rb +41 -0
- data/spec/models/error_spec.rb +41 -0
- data/spec/models/sector_spec.rb +47 -0
- data/spec/models/sector_spending_spec.rb +59 -0
- data/spec/models/spending_report_spec.rb +59 -0
- data/spec/models/subscription_object_spec.rb +71 -0
- data/spec/models/subscription_payment_card_spec.rb +53 -0
- data/spec/models/subscription_response_spec.rb +47 -0
- data/spec/models/subscription_spec.rb +41 -0
- data/spec/models/top_locations_report_spec.rb +41 -0
- data/spec/models/unsubscribed_response_spec.rb +47 -0
- data/spec/spec_helper.rb +111 -0
- metadata +199 -0
data/docs/Sector.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# OpenapiClient::Sector
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**sector_id** | **Integer** | |
|
8
|
+
**sector_name** | **String** | |
|
9
|
+
|
10
|
+
## Code Sample
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'OpenapiClient'
|
14
|
+
|
15
|
+
instance = OpenapiClient::Sector.new(sector_id: 0,
|
16
|
+
sector_name: CLOTHING)
|
17
|
+
```
|
18
|
+
|
19
|
+
|
data/docs/SectorApi.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# OpenapiClient::SectorApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://stage.api.mastercard.com/golden-service*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_sectors**](SectorApi.md#get_sectors) | **GET** /sectors | Returns the valid sectors which can be passed to various other endpoints in the sector field
|
8
|
+
[**get_top_sectors**](SectorApi.md#get_top_sectors) | **GET** /top-sectors | Retrieves the top grossing sectors for the specified date & location
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
## get_sectors
|
13
|
+
|
14
|
+
> Array<Sector> get_sectors
|
15
|
+
|
16
|
+
Returns the valid sectors which can be passed to various other endpoints in the sector field
|
17
|
+
|
18
|
+
### Example
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
# load the gem
|
22
|
+
require 'openapi_client'
|
23
|
+
|
24
|
+
api_instance = OpenapiClient::SectorApi.new
|
25
|
+
|
26
|
+
begin
|
27
|
+
#Returns the valid sectors which can be passed to various other endpoints in the sector field
|
28
|
+
result = api_instance.get_sectors
|
29
|
+
p result
|
30
|
+
rescue OpenapiClient::ApiError => e
|
31
|
+
puts "Exception when calling SectorApi->get_sectors: #{e}"
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
### Parameters
|
36
|
+
|
37
|
+
This endpoint does not need any parameter.
|
38
|
+
|
39
|
+
### Return type
|
40
|
+
|
41
|
+
[**Array<Sector>**](Sector.md)
|
42
|
+
|
43
|
+
### Authorization
|
44
|
+
|
45
|
+
No authorization required
|
46
|
+
|
47
|
+
### HTTP request headers
|
48
|
+
|
49
|
+
- **Content-Type**: Not defined
|
50
|
+
- **Accept**: application/json
|
51
|
+
|
52
|
+
|
53
|
+
## get_top_sectors
|
54
|
+
|
55
|
+
> Array<Array> get_top_sectors(date, location, spending_type)
|
56
|
+
|
57
|
+
Retrieves the top grossing sectors for the specified date & location
|
58
|
+
|
59
|
+
### Example
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
# load the gem
|
63
|
+
require 'openapi_client'
|
64
|
+
|
65
|
+
api_instance = OpenapiClient::SectorApi.new
|
66
|
+
date = Date.parse('29/02/2019') # Date | The date for the requested data
|
67
|
+
location = 'New York' # String | The location for which you wish to receive the top-sectors report.
|
68
|
+
spending_type = 'ATV' # String | Used to distinguish between gross spending (GS) & average transaction value (ATV)
|
69
|
+
|
70
|
+
begin
|
71
|
+
#Retrieves the top grossing sectors for the specified date & location
|
72
|
+
result = api_instance.get_top_sectors(date, location, spending_type)
|
73
|
+
p result
|
74
|
+
rescue OpenapiClient::ApiError => e
|
75
|
+
puts "Exception when calling SectorApi->get_top_sectors: #{e}"
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
### Parameters
|
80
|
+
|
81
|
+
|
82
|
+
Name | Type | Description | Notes
|
83
|
+
------------- | ------------- | ------------- | -------------
|
84
|
+
**date** | **Date**| The date for the requested data |
|
85
|
+
**location** | **String**| The location for which you wish to receive the top-sectors report. |
|
86
|
+
**spending_type** | **String**| Used to distinguish between gross spending (GS) & average transaction value (ATV) |
|
87
|
+
|
88
|
+
### Return type
|
89
|
+
|
90
|
+
**Array<Array>**
|
91
|
+
|
92
|
+
### Authorization
|
93
|
+
|
94
|
+
No authorization required
|
95
|
+
|
96
|
+
### HTTP request headers
|
97
|
+
|
98
|
+
- **Content-Type**: Not defined
|
99
|
+
- **Accept**: application/json
|
100
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# OpenapiClient::SectorSpending
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**sector_id** | **Integer** | |
|
8
|
+
**sector_name** | **String** | |
|
9
|
+
**amount_spent** | **Float** | |
|
10
|
+
**average_per_transaction** | **Float** | |
|
11
|
+
|
12
|
+
## Code Sample
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'OpenapiClient'
|
16
|
+
|
17
|
+
instance = OpenapiClient::SectorSpending.new(sector_id: 0,
|
18
|
+
sector_name: Clothing,
|
19
|
+
amount_spent: 1000000.12,
|
20
|
+
average_per_transaction: 120.0)
|
21
|
+
```
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# OpenapiClient::SpendingReport
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**location** | **String** | The location being reported on |
|
8
|
+
**spending_type** | **String** | The spending type being reported | [optional]
|
9
|
+
**amount** | **Float** | The amount spent for the given location | [optional]
|
10
|
+
**sectors** | [**Array<SectorSpending>**](SectorSpending.md) | Array of sector spending objects | [optional]
|
11
|
+
|
12
|
+
## Code Sample
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'OpenapiClient'
|
16
|
+
|
17
|
+
instance = OpenapiClient::SpendingReport.new(location: New York,
|
18
|
+
spending_type: ATV,
|
19
|
+
amount: 10432.13123,
|
20
|
+
sectors: null)
|
21
|
+
```
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,244 @@
|
|
1
|
+
# OpenapiClient::SubscribeApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://stage.api.mastercard.com/golden-service*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_subscription**](SubscribeApi.md#get_subscription) | **GET** /subscriptions/{subscription_id} | Gets a specific subscription using a subscription Id passed as in the path
|
8
|
+
[**list_subscriptions**](SubscribeApi.md#list_subscriptions) | **GET** /subscriptions | gets all active subscriptions for a particular user. Returned list size can be limited using the limit parameter
|
9
|
+
[**subscribe**](SubscribeApi.md#subscribe) | **POST** /subscriptions | Allows the user to subscribe to a particular location and receive updates on e-commerce spending in their chosen area. The user can pay for the subscription on a daily basis. The user is charged for every report they receive until their subscription is cancelled
|
10
|
+
[**unsubscribe**](SubscribeApi.md#unsubscribe) | **DELETE** /subscriptions | Un-subscribes from a specified subcription
|
11
|
+
[**update_subscription**](SubscribeApi.md#update_subscription) | **PUT** /subscriptions | Updates an active subscription
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
## get_subscription
|
16
|
+
|
17
|
+
> SubscriptionResponse get_subscription(subscription_id)
|
18
|
+
|
19
|
+
Gets a specific subscription using a subscription Id passed as in the path
|
20
|
+
|
21
|
+
### Example
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
# load the gem
|
25
|
+
require 'openapi_client'
|
26
|
+
|
27
|
+
api_instance = OpenapiClient::SubscribeApi.new
|
28
|
+
subscription_id = 'cb9fa3cc-8a06-39af-b605-934799914275' # String | Unique identifier of a particular subscription (UUID Version 4)
|
29
|
+
|
30
|
+
begin
|
31
|
+
#Gets a specific subscription using a subscription Id passed as in the path
|
32
|
+
result = api_instance.get_subscription(subscription_id)
|
33
|
+
p result
|
34
|
+
rescue OpenapiClient::ApiError => e
|
35
|
+
puts "Exception when calling SubscribeApi->get_subscription: #{e}"
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
### Parameters
|
40
|
+
|
41
|
+
|
42
|
+
Name | Type | Description | Notes
|
43
|
+
------------- | ------------- | ------------- | -------------
|
44
|
+
**subscription_id** | [**String**](.md)| Unique identifier of a particular subscription (UUID Version 4) |
|
45
|
+
|
46
|
+
### Return type
|
47
|
+
|
48
|
+
[**SubscriptionResponse**](SubscriptionResponse.md)
|
49
|
+
|
50
|
+
### Authorization
|
51
|
+
|
52
|
+
No authorization required
|
53
|
+
|
54
|
+
### HTTP request headers
|
55
|
+
|
56
|
+
- **Content-Type**: Not defined
|
57
|
+
- **Accept**: application/json
|
58
|
+
|
59
|
+
|
60
|
+
## list_subscriptions
|
61
|
+
|
62
|
+
> Array<ActiveSubscription> list_subscriptions(opts)
|
63
|
+
|
64
|
+
gets all active subscriptions for a particular user. Returned list size can be limited using the limit parameter
|
65
|
+
|
66
|
+
### Example
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
# load the gem
|
70
|
+
require 'openapi_client'
|
71
|
+
|
72
|
+
api_instance = OpenapiClient::SubscribeApi.new
|
73
|
+
opts = {
|
74
|
+
limit: 5, # Integer | Can be used to limit the amount of results returned from a query (Pagination)
|
75
|
+
offset: 5 # Integer | The number of items to offset the start of the list from (Pagination)
|
76
|
+
}
|
77
|
+
|
78
|
+
begin
|
79
|
+
#gets all active subscriptions for a particular user. Returned list size can be limited using the limit parameter
|
80
|
+
result = api_instance.list_subscriptions(opts)
|
81
|
+
p result
|
82
|
+
rescue OpenapiClient::ApiError => e
|
83
|
+
puts "Exception when calling SubscribeApi->list_subscriptions: #{e}"
|
84
|
+
end
|
85
|
+
```
|
86
|
+
|
87
|
+
### Parameters
|
88
|
+
|
89
|
+
|
90
|
+
Name | Type | Description | Notes
|
91
|
+
------------- | ------------- | ------------- | -------------
|
92
|
+
**limit** | **Integer**| Can be used to limit the amount of results returned from a query (Pagination) | [optional]
|
93
|
+
**offset** | **Integer**| The number of items to offset the start of the list from (Pagination) | [optional]
|
94
|
+
|
95
|
+
### Return type
|
96
|
+
|
97
|
+
[**Array<ActiveSubscription>**](ActiveSubscription.md)
|
98
|
+
|
99
|
+
### Authorization
|
100
|
+
|
101
|
+
No authorization required
|
102
|
+
|
103
|
+
### HTTP request headers
|
104
|
+
|
105
|
+
- **Content-Type**: Not defined
|
106
|
+
- **Accept**: application/json
|
107
|
+
|
108
|
+
|
109
|
+
## subscribe
|
110
|
+
|
111
|
+
> Array<SubscriptionResponse> subscribe(request_body)
|
112
|
+
|
113
|
+
Allows the user to subscribe to a particular location and receive updates on e-commerce spending in their chosen area. The user can pay for the subscription on a daily basis. The user is charged for every report they receive until their subscription is cancelled
|
114
|
+
|
115
|
+
### Example
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
# load the gem
|
119
|
+
require 'openapi_client'
|
120
|
+
|
121
|
+
api_instance = OpenapiClient::SubscribeApi.new
|
122
|
+
request_body = {'key' => OpenapiClient::SubscriptionObject.new} # Hash<String, SubscriptionObject> | Request body required to create a particular subscription
|
123
|
+
|
124
|
+
begin
|
125
|
+
#Allows the user to subscribe to a particular location and receive updates on e-commerce spending in their chosen area. The user can pay for the subscription on a daily basis. The user is charged for every report they receive until their subscription is cancelled
|
126
|
+
result = api_instance.subscribe(request_body)
|
127
|
+
p result
|
128
|
+
rescue OpenapiClient::ApiError => e
|
129
|
+
puts "Exception when calling SubscribeApi->subscribe: #{e}"
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Parameters
|
134
|
+
|
135
|
+
|
136
|
+
Name | Type | Description | Notes
|
137
|
+
------------- | ------------- | ------------- | -------------
|
138
|
+
**request_body** | [**Hash<String, SubscriptionObject>**](SubscriptionObject.md)| Request body required to create a particular subscription |
|
139
|
+
|
140
|
+
### Return type
|
141
|
+
|
142
|
+
[**Array<SubscriptionResponse>**](SubscriptionResponse.md)
|
143
|
+
|
144
|
+
### Authorization
|
145
|
+
|
146
|
+
No authorization required
|
147
|
+
|
148
|
+
### HTTP request headers
|
149
|
+
|
150
|
+
- **Content-Type**: application/json
|
151
|
+
- **Accept**: application/json
|
152
|
+
|
153
|
+
|
154
|
+
## unsubscribe
|
155
|
+
|
156
|
+
> UnsubscribedResponse unsubscribe(subscription_id)
|
157
|
+
|
158
|
+
Un-subscribes from a specified subcription
|
159
|
+
|
160
|
+
### Example
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
# load the gem
|
164
|
+
require 'openapi_client'
|
165
|
+
|
166
|
+
api_instance = OpenapiClient::SubscribeApi.new
|
167
|
+
subscription_id = 'cb9fa3cc-8a06-39af-b605-934799914275' # String | Unique identifier of a particular subscription (Version 4 UUID)
|
168
|
+
|
169
|
+
begin
|
170
|
+
#Un-subscribes from a specified subcription
|
171
|
+
result = api_instance.unsubscribe(subscription_id)
|
172
|
+
p result
|
173
|
+
rescue OpenapiClient::ApiError => e
|
174
|
+
puts "Exception when calling SubscribeApi->unsubscribe: #{e}"
|
175
|
+
end
|
176
|
+
```
|
177
|
+
|
178
|
+
### Parameters
|
179
|
+
|
180
|
+
|
181
|
+
Name | Type | Description | Notes
|
182
|
+
------------- | ------------- | ------------- | -------------
|
183
|
+
**subscription_id** | [**String**](.md)| Unique identifier of a particular subscription (Version 4 UUID) |
|
184
|
+
|
185
|
+
### Return type
|
186
|
+
|
187
|
+
[**UnsubscribedResponse**](UnsubscribedResponse.md)
|
188
|
+
|
189
|
+
### Authorization
|
190
|
+
|
191
|
+
No authorization required
|
192
|
+
|
193
|
+
### HTTP request headers
|
194
|
+
|
195
|
+
- **Content-Type**: Not defined
|
196
|
+
- **Accept**: application/json
|
197
|
+
|
198
|
+
|
199
|
+
## update_subscription
|
200
|
+
|
201
|
+
> SubscriptionResponse update_subscription(subscription_id, subscription_object)
|
202
|
+
|
203
|
+
Updates an active subscription
|
204
|
+
|
205
|
+
### Example
|
206
|
+
|
207
|
+
```ruby
|
208
|
+
# load the gem
|
209
|
+
require 'openapi_client'
|
210
|
+
|
211
|
+
api_instance = OpenapiClient::SubscribeApi.new
|
212
|
+
subscription_id = 'cb9fa3cc-8a06-39af-b605-934799914275' # String | Unique identifier of a particular subscription (UUID Version 4)
|
213
|
+
subscription_object = OpenapiClient::SubscriptionObject.new # SubscriptionObject | Request body required to update a particular subscription
|
214
|
+
|
215
|
+
begin
|
216
|
+
#Updates an active subscription
|
217
|
+
result = api_instance.update_subscription(subscription_id, subscription_object)
|
218
|
+
p result
|
219
|
+
rescue OpenapiClient::ApiError => e
|
220
|
+
puts "Exception when calling SubscribeApi->update_subscription: #{e}"
|
221
|
+
end
|
222
|
+
```
|
223
|
+
|
224
|
+
### Parameters
|
225
|
+
|
226
|
+
|
227
|
+
Name | Type | Description | Notes
|
228
|
+
------------- | ------------- | ------------- | -------------
|
229
|
+
**subscription_id** | [**String**](.md)| Unique identifier of a particular subscription (UUID Version 4) |
|
230
|
+
**subscription_object** | [**SubscriptionObject**](SubscriptionObject.md)| Request body required to update a particular subscription |
|
231
|
+
|
232
|
+
### Return type
|
233
|
+
|
234
|
+
[**SubscriptionResponse**](SubscriptionResponse.md)
|
235
|
+
|
236
|
+
### Authorization
|
237
|
+
|
238
|
+
No authorization required
|
239
|
+
|
240
|
+
### HTTP request headers
|
241
|
+
|
242
|
+
- **Content-Type**: application/json
|
243
|
+
- **Accept**: application/json
|
244
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# OpenapiClient::Subscription
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'OpenapiClient'
|
13
|
+
|
14
|
+
instance = OpenapiClient::Subscription.new(subscription: null)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# OpenapiClient::SubscriptionObject
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**email_address** | **String** | The email address to which the reports will be sent to | [optional]
|
8
|
+
**location** | **String** | The location you wish to create a subscription for | [optional]
|
9
|
+
**sector** | **Integer** | The sector for which you wish to receive reports. Sector ids can be retrieved from sectors call | [optional]
|
10
|
+
**frequency** | **String** | b - Bi-Daily, d - Daily, w - Weekly | [optional]
|
11
|
+
**subscription_image** | **String** | An image that can be included as part of the subscription. MUST be sent in base64 format. | [optional]
|
12
|
+
**subscription_payment_card** | [**SubscriptionPaymentCard**](SubscriptionPaymentCard.md) | | [optional]
|
13
|
+
|
14
|
+
## Code Sample
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'OpenapiClient'
|
18
|
+
|
19
|
+
instance = OpenapiClient::SubscriptionObject.new(email_address: example@mastercard.com,
|
20
|
+
location: New York,
|
21
|
+
sector: 0,
|
22
|
+
frequency: b,
|
23
|
+
subscription_image: null,
|
24
|
+
subscription_payment_card: null)
|
25
|
+
```
|
26
|
+
|
27
|
+
|