Skip to content

Commit 926a73d

Browse files
committed
use openapi-generator for Ruby client
1 parent 721ff48 commit 926a73d

85 files changed

Lines changed: 2181 additions & 4181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

rest_client_ruby/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by: https://github.com/swagger-api/swagger-codegen.git
1+
# Generated by: https://openapi-generator.tech
22
#
33

44
*.gem

rest_client_ruby/.swagger-codegen-ignore renamed to rest_client_ruby/.openapi-generator-ignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Swagger Codegen Ignore
2-
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
33

44
# Use this file to prevent files from being overwritten by the generator.
55
# The patterns follow closely to .gitignore or .dockerignore.
66

77
# As an example, the C# client generator defines ApiClient.cs.
8-
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
99
#ApiClient.cs
1010

1111
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.2

rest_client_ruby/.rubocop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
2-
# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen)
2+
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
33
AllCops:
4-
TargetRubyVersion: 2.2
4+
TargetRubyVersion: 2.4
55
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
66
# to ignore them, so only the ones explicitly set in this file are enabled.
77
DisabledByDefault: true
@@ -46,7 +46,7 @@ Layout/EmptyLinesAroundMethodBody:
4646
Layout/EmptyLinesAroundModuleBody:
4747
Enabled: true
4848

49-
Layout/FirstParameterIndentation:
49+
Layout/IndentFirstArgument:
5050
Enabled: true
5151

5252
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
@@ -136,7 +136,7 @@ Style/UnneededPercentQ:
136136

137137
# Align `end` with the matching keyword or starting expression except for
138138
# assignments, where it should be aligned with the LHS.
139-
Lint/EndAlignment:
139+
Layout/EndAlignment:
140140
Enabled: true
141141
EnforcedStyleAlignWith: variable
142142
AutoCorrect: true

rest_client_ruby/.swagger-codegen/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

rest_client_ruby/.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: ruby
2+
cache: bundler
3+
rvm:
4+
- 2.3
5+
- 2.4
6+
- 2.5
7+
script:
8+
- bundle install --path vendor/bundle
9+
- bundle exec rspec
10+
- gem build openapi_client.gemspec
11+
- gem install ./openapi_client-1.0.0.gem

rest_client_ruby/Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ gemspec
44

55
group :development, :test do
66
gem 'rake', '~> 12.0.0'
7+
gem 'pry-byebug'
8+
gem 'rubocop', '~> 0.66.0'
79
end

rest_client_ruby/Gemfile.lock

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,78 @@
11
PATH
22
remote: .
33
specs:
4-
swagger_client (1.0.0)
5-
ffi (= 1.10.0)
4+
openapi_client (1.0.0)
65
json (~> 2.1, >= 2.1.0)
76
typhoeus (~> 1.0, >= 1.0.1)
87

98
GEM
109
remote: https://rubygems.org/
1110
specs:
1211
ZenTest (4.11.2)
13-
addressable (2.6.0)
12+
addressable (2.5.2)
1413
public_suffix (>= 2.0.2, < 4.0)
14+
ast (2.4.0)
1515
autotest (4.4.6)
1616
ZenTest (>= 4.4.1)
1717
autotest-fsevent (0.2.14)
1818
sys-uname
1919
autotest-growl (0.2.16)
2020
autotest-rails-pure (4.1.2)
21+
byebug (10.0.2)
22+
coderay (1.1.2)
2123
crack (0.4.3)
2224
safe_yaml (~> 1.0.0)
2325
diff-lcs (1.3)
24-
ethon (0.12.0)
26+
ethon (0.11.0)
2527
ffi (>= 1.3.0)
26-
ffi (1.10.0)
27-
hashdiff (0.4.0)
28-
json (2.2.0)
28+
ffi (1.9.25)
29+
hashdiff (0.3.7)
30+
jaro_winkler (1.5.3)
31+
json (2.1.0)
2932
mastercard-client-encryption (1.0.0)
3033
mastercard_oauth1_signer (1.1.0)
31-
public_suffix (3.1.0)
34+
method_source (0.9.0)
35+
parallel (1.17.0)
36+
parser (2.6.3.0)
37+
ast (~> 2.4.0)
38+
pry (0.11.3)
39+
coderay (~> 1.1.0)
40+
method_source (~> 0.9.0)
41+
pry-byebug (3.6.0)
42+
byebug (~> 10.0)
43+
pry (~> 0.10)
44+
psych (3.1.0)
45+
public_suffix (3.0.3)
46+
rainbow (3.0.0)
3247
rake (12.0.0)
3348
rspec (3.8.0)
3449
rspec-core (~> 3.8.0)
3550
rspec-expectations (~> 3.8.0)
3651
rspec-mocks (~> 3.8.0)
3752
rspec-core (3.8.0)
3853
rspec-support (~> 3.8.0)
39-
rspec-expectations (3.8.3)
54+
rspec-expectations (3.8.1)
4055
diff-lcs (>= 1.2.0, < 2.0)
4156
rspec-support (~> 3.8.0)
4257
rspec-mocks (3.8.0)
4358
diff-lcs (>= 1.2.0, < 2.0)
4459
rspec-support (~> 3.8.0)
4560
rspec-support (3.8.0)
46-
safe_yaml (1.0.5)
47-
sys-uname (1.0.4)
61+
rubocop (0.66.0)
62+
jaro_winkler (~> 1.5.1)
63+
parallel (~> 1.10)
64+
parser (>= 2.5, != 2.5.1.1)
65+
psych (>= 3.1.0)
66+
rainbow (>= 2.2.2, < 4.0)
67+
ruby-progressbar (~> 1.7)
68+
unicode-display_width (>= 1.4.0, < 1.6)
69+
ruby-progressbar (1.10.1)
70+
safe_yaml (1.0.4)
71+
sys-uname (1.0.3)
4872
ffi (>= 1.0.0)
49-
typhoeus (1.3.1)
73+
typhoeus (1.3.0)
5074
ethon (>= 0.9.0)
75+
unicode-display_width (1.5.0)
5176
vcr (3.0.3)
5277
webmock (1.24.6)
5378
addressable (>= 2.3.6)
@@ -64,9 +89,11 @@ DEPENDENCIES
6489
autotest-rails-pure (~> 4.1, >= 4.1.2)
6590
mastercard-client-encryption
6691
mastercard_oauth1_signer
92+
openapi_client!
93+
pry-byebug
6794
rake (~> 12.0.0)
6895
rspec (~> 3.6, >= 3.6.0)
69-
swagger_client!
96+
rubocop (~> 0.66.0)
7097
vcr (~> 3.0, >= 3.0.1)
7198
webmock (~> 1.24, >= 1.24.3)
7299

rest_client_ruby/README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# openapi_client
2+
3+
OpenapiClient - the Ruby gem for the MDES for Merchants
4+
5+
The MDES APIs are designed as RPC style stateless web services where each API endpoint represents an operation to be performed. All request and response payloads are sent in the JSON (JavaScript Object Notation) data-interchange format. Each endpoint in the API specifies the HTTP Method used to access it. All strings in request and response objects are to be UTF-8 encoded. Each API URI includes the major and minor version of API that it conforms to. This will allow multiple concurrent versions of the API to be deployed simultaneously.
6+
7+
8+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
9+
10+
- API version: 1.2.7
11+
- Package version: 1.0.0
12+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
13+
14+
## Installation
15+
16+
### Build a gem
17+
18+
To build the Ruby code into a gem:
19+
20+
```shell
21+
gem build openapi_client.gemspec
22+
```
23+
24+
Then either install the gem locally:
25+
26+
```shell
27+
gem install ./openapi_client-1.0.0.gem
28+
```
29+
30+
(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
31+
32+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33+
34+
Finally add this to the Gemfile:
35+
36+
gem 'openapi_client', '~> 1.0.0'
37+
38+
### Install from Git
39+
40+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
41+
42+
gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
43+
44+
### Include the Ruby code directly
45+
46+
Include the Ruby code directly using `-I` as follows:
47+
48+
```shell
49+
ruby -Ilib script.rb
50+
```
51+
52+
## Getting Started
53+
54+
Please follow the [installation](#installation) procedure and then run the following code:
55+
56+
```ruby
57+
# Load the gem
58+
require 'openapi_client'
59+
60+
api_instance = OpenapiClient::DeleteApi.new
61+
opts = {
62+
delete_request_schema: OpenapiClient::DeleteRequestSchema.new # DeleteRequestSchema | Contains the details of the request message.
63+
}
64+
65+
begin
66+
#Used to delete one or more Tokens. The API is limited to 10 Tokens per request.
67+
result = api_instance.delete_digitization(opts)
68+
p result
69+
rescue OpenapiClient::ApiError => e
70+
puts "Exception when calling DeleteApi->delete_digitization: #{e}"
71+
end
72+
73+
```
74+
75+
## Documentation for API Endpoints
76+
77+
All URIs are relative to *https://api.mastercard.com/mdes*
78+
79+
Class | Method | HTTP request | Description
80+
------------ | ------------- | ------------- | -------------
81+
*OpenapiClient::DeleteApi* | [**delete_digitization**](docs/DeleteApi.md#delete_digitization) | **POST** /digitization/static/1/0/delete | Used to delete one or more Tokens. The API is limited to 10 Tokens per request.
82+
*OpenapiClient::GetAssetApi* | [**get_asset**](docs/GetAssetApi.md#get_asset) | **GET** /assets/static/1/0/asset/{AssetId} | Used to retrieve static Assets from MDES�s repository, such as Card art, MasterCard brand logos, Issuer logos, and Terms and Conditions.
83+
*OpenapiClient::GetTaskStatusApi* | [**get_task_status**](docs/GetTaskStatusApi.md#get_task_status) | **POST** /digitization/static/1/0/getTaskStatus | Used to check the status of any asynchronous task that was previously requested.
84+
*OpenapiClient::GetTokenApi* | [**get_token**](docs/GetTokenApi.md#get_token) | **POST** /digitization/static/1/0/getToken | Used to get the status and details of a single given Token.
85+
*OpenapiClient::NotifyTokenUpdatedApi* | [**notify_token_update__for_token_state_change**](docs/NotifyTokenUpdatedApi.md#notify_token_update__for_token_state_change) | **POST** /digitization/static/1/0/notifyTokenUpdated | Outbound API used by MDES to notify the Token Requestor of significant Token updates, such as when the Token is activated, suspended, unsuspended or deleted; or when information about the Token or its product configuration has changed.
86+
*OpenapiClient::SearchTokensApi* | [**search_tokens**](docs/SearchTokensApi.md#search_tokens) | **POST** /digitization/static/1/0/searchTokens | Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN.
87+
*OpenapiClient::SuspendApi* | [**create_suspend**](docs/SuspendApi.md#create_suspend) | **POST** /digitization/static/1/0/suspend | Used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost). The API is limited to 10 Tokens per request.
88+
*OpenapiClient::TokenizeApi* | [**create_tokenize**](docs/TokenizeApi.md#create_tokenize) | **POST** /digitization/static/1/0/tokenize | Used to digitize a card to create a server-based Token.
89+
*OpenapiClient::TransactApi* | [**create_transact**](docs/TransactApi.md#create_transact) | **POST** /remotetransaction/static/1/0/transact | Used by the Token Requestor to create a Digital Secure Remote Payment (\"DSRP\") transaction cryptogram using the credentials stored within MDES in order to perform a DSRP transaction.
90+
*OpenapiClient::UnsuspendApi* | [**create_unsuspend**](docs/UnsuspendApi.md#create_unsuspend) | **POST** /digitization/static/1/0/unsuspend | Used to unsuspend one or more previously suspended Tokens. The API is limited to 10 Tokens per request.
91+
92+
93+
## Documentation for Models
94+
95+
- [OpenapiClient::AssetResponseSchema](docs/AssetResponseSchema.md)
96+
- [OpenapiClient::AuthenticationMethods](docs/AuthenticationMethods.md)
97+
- [OpenapiClient::BillingAddress](docs/BillingAddress.md)
98+
- [OpenapiClient::CardInfo](docs/CardInfo.md)
99+
- [OpenapiClient::CardInfoData](docs/CardInfoData.md)
100+
- [OpenapiClient::DecisioningData](docs/DecisioningData.md)
101+
- [OpenapiClient::DeleteRequestSchema](docs/DeleteRequestSchema.md)
102+
- [OpenapiClient::DeleteResponseSchema](docs/DeleteResponseSchema.md)
103+
- [OpenapiClient::EncryptedPayload](docs/EncryptedPayload.md)
104+
- [OpenapiClient::EncryptedPayloadTransact](docs/EncryptedPayloadTransact.md)
105+
- [OpenapiClient::Error](docs/Error.md)
106+
- [OpenapiClient::ErrorsResponse](docs/ErrorsResponse.md)
107+
- [OpenapiClient::GetTaskStatusRequestSchema](docs/GetTaskStatusRequestSchema.md)
108+
- [OpenapiClient::GetTaskStatusResponseSchema](docs/GetTaskStatusResponseSchema.md)
109+
- [OpenapiClient::GetTokenRequestSchema](docs/GetTokenRequestSchema.md)
110+
- [OpenapiClient::GetTokenResponseSchema](docs/GetTokenResponseSchema.md)
111+
- [OpenapiClient::MediaContent](docs/MediaContent.md)
112+
- [OpenapiClient::NotifyTokenEncryptedPayload](docs/NotifyTokenEncryptedPayload.md)
113+
- [OpenapiClient::NotifyTokenUpdatedRequestSchema](docs/NotifyTokenUpdatedRequestSchema.md)
114+
- [OpenapiClient::NotifyTokenUpdatedResponseSchema](docs/NotifyTokenUpdatedResponseSchema.md)
115+
- [OpenapiClient::ProductConfig](docs/ProductConfig.md)
116+
- [OpenapiClient::SearchTokensRequestSchema](docs/SearchTokensRequestSchema.md)
117+
- [OpenapiClient::SearchTokensResponseSchema](docs/SearchTokensResponseSchema.md)
118+
- [OpenapiClient::SuspendRequestSchema](docs/SuspendRequestSchema.md)
119+
- [OpenapiClient::SuspendResponseSchema](docs/SuspendResponseSchema.md)
120+
- [OpenapiClient::Token](docs/Token.md)
121+
- [OpenapiClient::TokenDetail](docs/TokenDetail.md)
122+
- [OpenapiClient::TokenDetailData](docs/TokenDetailData.md)
123+
- [OpenapiClient::TokenDetailDataPAR](docs/TokenDetailDataPAR.md)
124+
- [OpenapiClient::TokenDetailTokenizeResponse](docs/TokenDetailTokenizeResponse.md)
125+
- [OpenapiClient::TokenForLCM](docs/TokenForLCM.md)
126+
- [OpenapiClient::TokenInfo](docs/TokenInfo.md)
127+
- [OpenapiClient::TokenizeRequestSchema](docs/TokenizeRequestSchema.md)
128+
- [OpenapiClient::TokenizeResponseSchema](docs/TokenizeResponseSchema.md)
129+
- [OpenapiClient::TransactEncryptedData](docs/TransactEncryptedData.md)
130+
- [OpenapiClient::TransactError](docs/TransactError.md)
131+
- [OpenapiClient::TransactRequestSchema](docs/TransactRequestSchema.md)
132+
- [OpenapiClient::TransactResponseSchema](docs/TransactResponseSchema.md)
133+
- [OpenapiClient::UnSuspendRequestSchema](docs/UnSuspendRequestSchema.md)
134+
- [OpenapiClient::UnSuspendResponseSchema](docs/UnSuspendResponseSchema.md)
135+
136+
137+
## Documentation for Authorization
138+
139+
All endpoints do not require authorization.
140+

rest_client_ruby/Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "bundler/gem_tasks"
2+
13
begin
24
require 'rspec/core/rake_task'
35

0 commit comments

Comments
 (0)