Skip to content

Commit d8b3600

Browse files
committed
use openapi-generator for Java client
1 parent 8142559 commit d8b3600

100 files changed

Lines changed: 2466 additions & 2226 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_java/.swagger-codegen-ignore renamed to rest_client_java/.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_java/.project

Lines changed: 0 additions & 17 deletions
This file was deleted.

rest_client_java/.swagger-codegen/VERSION

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

rest_client_java/.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Generated by: https://github.com/swagger-api/swagger-codegen.git
2+
# Generated by: https://openapi-generator.tech
33
#
44
language: java
55
jdk:

rest_client_java/README.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# swagger-java-client
1+
# openapi-java-client
22

33
MDES for Merchants
44
- API version: 1.2.8
5-
- Build date: 2019-05-28T14:53:12.694+01:00
5+
- Build date: 2019-07-25T13:27:17.040+02:00[Europe/Rome]
66

77
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. <br> __Authentication__ Mastercard uses OAuth 1.0a with body hash extension for authenticating the API clients. This requires every request that you send to Mastercard to be signed with an RSA private key. A private-public RSA key pair must be generated consisting of: <br> 1 . A private key for the OAuth signature for API requests. It is recommended to keep the private key in a password-protected or hardware keystore. <br> 2. A public key is shared with Mastercard during the project setup process through either a certificate signing request (CSR) or the API Key Generator. Mastercard will use the public key to verify the OAuth signature that is provided on every API call.<br> An OAUTH1.0a signer library is available on [GitHub](https://github.com/Mastercard/oauth1-signer-java) <br> __Encryption__<br> All communications between Issuer web service and the Mastercard gateway is encrypted using TLS. <br> __Additional Encryption of Sensitive Data__ In addition to the OAuth authentication, when using MDES Digital Enablement Service, any PCI sensitive and all account holder Personally Identifiable Information (PII) data must be encrypted. This requirement applies to the API fields containing encryptedData. Sensitive data is encrypted using a symmetric session (one-time-use) key. The symmetric session key is then wrapped with an RSA Public Key supplied by Mastercard during API setup phase (the Customer Encryption Key). <br> Java Client Encryption Library available on [GitHub](https://github.com/Mastercard/client-encryption-java)
88

99

10-
*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)*
10+
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
1111

1212

1313
## Requirements
@@ -38,9 +38,9 @@ Add this dependency to your project's POM:
3838

3939
```xml
4040
<dependency>
41-
<groupId>io.swagger</groupId>
42-
<artifactId>swagger-java-client</artifactId>
43-
<version>1.0.0</version>
41+
<groupId>org.openapitools</groupId>
42+
<artifactId>openapi-java-client</artifactId>
43+
<version>1.2.8</version>
4444
<scope>compile</scope>
4545
</dependency>
4646
```
@@ -50,7 +50,7 @@ Add this dependency to your project's POM:
5050
Add this dependency to your project's build file:
5151

5252
```groovy
53-
compile "io.swagger:swagger-java-client:1.0.0"
53+
compile "org.openapitools:openapi-java-client:1.2.8"
5454
```
5555

5656
### Others
@@ -63,7 +63,7 @@ mvn clean package
6363

6464
Then manually install the following JARs:
6565

66-
* `target/swagger-java-client-1.0.0.jar`
66+
* `target/openapi-java-client-1.2.8.jar`
6767
* `target/lib/*.jar`
6868

6969
## Getting Started
@@ -72,28 +72,31 @@ Please follow the [installation](#installation) instruction and execute the foll
7272

7373
```java
7474

75-
import io.swagger.client.*;
76-
import io.swagger.client.auth.*;
77-
import io.swagger.client.model.*;
78-
import io.swagger.client.api.DeleteApi;
79-
80-
import java.io.File;
81-
import java.util.*;
82-
83-
public class DeleteApiExample {
84-
85-
public static void main(String[] args) {
86-
87-
DeleteApi apiInstance = new DeleteApi();
88-
DeleteRequestSchema deleteRequestSchema = new DeleteRequestSchema(); // DeleteRequestSchema | Contains the details of the request message.
89-
try {
90-
DeleteResponseSchema result = apiInstance.deleteDigitization(deleteRequestSchema);
91-
System.out.println(result);
92-
} catch (ApiException e) {
93-
System.err.println("Exception when calling DeleteApi#deleteDigitization");
94-
e.printStackTrace();
95-
}
75+
// Import classes:
76+
import org.openapitools.client.ApiClient;
77+
import org.openapitools.client.ApiException;
78+
import org.openapitools.client.Configuration;
79+
import org.openapitools.client.models.*;
80+
import org.openapitools.client.api.DeleteApi;
81+
82+
public class Example {
83+
public static void main(String[] args) {
84+
ApiClient defaultClient = Configuration.getDefaultApiClient();
85+
defaultClient.setBasePath("https://api.mastercard.com/mdes");
86+
87+
DeleteApi apiInstance = new DeleteApi(defaultClient);
88+
DeleteRequestSchema deleteRequestSchema = new DeleteRequestSchema(); // DeleteRequestSchema | Contains the details of the request message.
89+
try {
90+
DeleteResponseSchema result = apiInstance.deleteDigitization(deleteRequestSchema);
91+
System.out.println(result);
92+
} catch (ApiException e) {
93+
System.err.println("Exception when calling DeleteApi#deleteDigitization");
94+
System.err.println("Status code: " + e.getCode());
95+
System.err.println("Reason: " + e.getResponseBody());
96+
System.err.println("Response headers: " + e.getResponseHeaders());
97+
e.printStackTrace();
9698
}
99+
}
97100
}
98101

99102
```

rest_client_java/build.gradle

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
apply plugin: 'idea'
22
apply plugin: 'eclipse'
3+
apply plugin: 'java'
34

4-
group = 'io.swagger'
5-
version = '1.0.0'
5+
group = 'org.openapitools'
6+
version = '1.2.8'
67

78
buildscript {
89
repositories {
10+
mavenCentral()
911
jcenter()
1012
}
1113
dependencies {
@@ -17,7 +19,9 @@ buildscript {
1719
repositories {
1820
jcenter()
1921
}
20-
22+
sourceSets {
23+
main.java.srcDirs = ['src/main/java']
24+
}
2125

2226
if(hasProperty('target') && target == 'android') {
2327

@@ -83,7 +87,7 @@ if(hasProperty('target') && target == 'android') {
8387

8488
install {
8589
repositories.mavenInstaller {
86-
pom.artifactId = 'swagger-java-client'
90+
pom.artifactId = 'openapi-java-client'
8791
}
8892
}
8993

@@ -94,11 +98,12 @@ if(hasProperty('target') && target == 'android') {
9498
}
9599

96100
dependencies {
97-
compile 'io.swagger:swagger-annotations:1.5.17'
98-
compile 'com.squareup.okhttp:okhttp:2.7.5'
99-
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
100-
compile 'com.google.code.gson:gson:2.8.1'
101-
compile 'io.gsonfire:gson-fire:1.8.0'
101+
compile 'io.swagger:swagger-annotations:1.5.22'
102+
compile 'com.squareup.okhttp3:okhttp:3.14.2'
103+
compile 'com.squareup.okhttp3:logging-interceptor:3.14.2'
104+
compile 'com.google.code.gson:gson:2.8.5'
105+
compile 'io.gsonfire:gson-fire:1.8.3'
106+
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
102107
compile 'org.threeten:threetenbp:1.3.5'
103108
testCompile 'junit:junit:4.12'
104109
}

rest_client_java/build.sbt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
lazy val root = (project in file(".")).
22
settings(
3-
organization := "io.swagger",
4-
name := "swagger-java-client",
5-
version := "1.0.0",
3+
organization := "org.openapitools",
4+
name := "openapi-java-client",
5+
version := "1.2.8",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),
99
publishArtifact in (Compile, packageDoc) := false,
1010
resolvers += Resolver.mavenLocal,
1111
libraryDependencies ++= Seq(
12-
"io.swagger" % "swagger-annotations" % "1.5.17",
13-
"com.squareup.okhttp" % "okhttp" % "2.7.5",
14-
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
15-
"com.google.code.gson" % "gson" % "2.8.1",
12+
"io.swagger" % "swagger-annotations" % "1.5.22",
13+
"com.squareup.okhttp3" % "okhttp" % "3.14.2",
14+
"com.squareup.okhttp3" % "logging-interceptor" % "3.14.2",
15+
"com.google.code.gson" % "gson" % "2.8.5",
16+
"org.apache.commons" % "commons-lang3" % "3.9",
1617
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
17-
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
18+
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
1819
"junit" % "junit" % "4.12" % "test",
1920
"com.novocode" % "junit-interface" % "0.10" % "test"
2021
)

rest_client_java/git_push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
55

66
git_user_id=$1
77
git_repo_id=$2
1.51 KB
Binary file not shown.

0 commit comments

Comments
 (0)