Skip to content

Commit 26c2a8e

Browse files
Merge pull request #23 from mxenabled/bm/readme_and_openapi_updates
README and OpenAPI updates
2 parents 1be50ae + 21cc81d commit 26c2a8e

14 files changed

Lines changed: 522 additions & 136 deletions

README.md

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-java/issues) to report issues using the MX Platform API Java Library.*
1+
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-java/issues) to report issues using the MX Platform Java library.*
22

3-
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech).*
3+
# MX Platform Java
44

5-
# MX Platform Java - v0.3.3
5+
The [MX Platform API](https://www.mx.com/products/platform-api) is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
66

7-
The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
7+
## Documentation
88

9-
Please [visit](https://www.mx.com/products/platform-api) for more information.
9+
Examples for the API endpoints can be found [here.](https://docs.mx.com/api)
1010

1111
## Requirements
1212

1313
Building the API client library requires:
1414

15-
1. Java 1.7+
16-
2. Maven
17-
18-
### Documentation
19-
20-
See the [documentation](https://docs.mx.com/api).
15+
- Java 1.7+
16+
- Maven
2117

2218
## Installation
2319

@@ -28,7 +24,7 @@ mvn clean package
2824
```
2925

3026
Then manually install the following JARs:
31-
- `target/mx-platform-java-0.3.3.jar`
27+
- `target/mx-platform-java-0.3.4.jar`
3228
- `target/lib/*.jar`
3329

3430
### Maven users
@@ -39,7 +35,7 @@ Add this dependency to your project's POM:
3935
<dependency>
4036
<groupId>com.mx</groupId>
4137
<artifactId>mx-platform-java</artifactId>
42-
<version>0.3.3</version>
38+
<version>0.3.4</version>
4339
<scope>compile</scope>
4440
</dependency>
4541
```
@@ -50,44 +46,62 @@ You can find the MX Platform Java Library in the [Maven Central Repository](http
5046

5147
In order to make requests, you will need to [sign up](https://dashboard.mx.com/sign_up) for the MX Platform API and get a `Client ID` and `API Key`.
5248

53-
Please follow the [installation](#installation) instruction and execute the following Java code:
49+
Please follow the [installation](#installation) procedure and then run the following code to create your first User:
5450

5551
```java
56-
57-
import com.mx.client.*;
52+
import com.mx.client.ApiClient;
53+
import com.mx.client.ApiException;
54+
import com.mx.client.Configuration;
5855
import com.mx.client.auth.*;
5956
import com.mx.client.model.*;
6057
import com.mx.client.mx_platform_api.MxPlatformApi;
6158

62-
public class MxPlatformApiExample {
63-
59+
public class Example {
6460
public static void main(String[] args) {
61+
// Configure environment. https://int-api.mx.com for development, https://api.mx.com for production
6562
ApiClient defaultClient = Configuration.getDefaultApiClient();
66-
defaultClient.setBasePath("https://api.mx.com");
67-
68-
// Configure HTTP basic authorization: basicAuth
63+
defaultClient.setBasePath("https://int-api.mx.com");
64+
65+
// Configure with your Client ID/API Key from https://dashboard.mx.com
6966
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
70-
basicAuth.setUsername("YOUR USERNAME");
71-
basicAuth.setPassword("YOUR PASSWORD");
67+
basicAuth.setUsername("Your Client ID");
68+
basicAuth.setPassword("Your API Key");
7269

7370
MxPlatformApi apiInstance = new MxPlatformApi(defaultClient);
74-
String memberGuid = "MBR-7c6f361b-e582-15b6-60c0-358f12466b4b"; // String | The unique id for a `member`.
75-
String userGuid = "USR-fa7537f3-48aa-a683-a02a-b18940482f54"; // String | The unique id for a `user`.
71+
72+
UserCreateRequest userCreateRequest = new UserCreateRequest();
73+
userCreateRequest.setMetadata("Creating a user!");
74+
75+
UserCreateRequestBody userCreateRequestBody = new UserCreateRequestBody();
76+
userCreateRequestBody.setUser(userCreateRequest);
77+
7678
try {
77-
MemberResponseBody response = apiInstance.aggregateMember(memberGuid, userGuid);
79+
UserResponseBody response = apiInstance.createUser(userCreateRequestBody);
7880
System.out.println(response);
7981
} catch (ApiException e) {
80-
System.err.println("Exception when calling MxPlatformApi#aggregateMember");
82+
System.err.println("Exception when calling MxPlatformApi#createUser");
8183
System.err.println("Status code: " + e.getCode());
8284
System.err.println("Reason: " + e.getResponseBody());
8385
System.err.println("Response headers: " + e.getResponseHeaders());
8486
e.printStackTrace();
8587
}
8688
}
8789
}
90+
```
8891

92+
## Development
93+
94+
This project was generated by the [OpenAPI Generator](https://openapi-generator.tech). To generate this library, verify you have the latest version of the `openapi-generator-cli` found [here.](https://github.com/OpenAPITools/openapi-generator#17---npm)
95+
96+
Running the following command in this repo's directory will generate this library using the [MX Platform API OpenAPI spec](https://github.com/mxenabled/openapi/blob/master/openapi/mx_platform_api_beta.yml) with our [configuration and templates.](https://github.com/mxenabled/mx-platform-ruby/tree/master/openapi)
97+
```shell
98+
openapi-generator-cli generate \
99+
-i https://raw.githubusercontent.com/mxenabled/openapi/master/openapi/mx_platform_api_beta.yml \
100+
-g java \
101+
-c ./openapi/config.yml \
102+
-t ./openapi/templates
89103
```
90104

91-
## Recommendation
105+
## Contributing
92106

93-
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
107+
Please [open an issue](https://github.com/mxenabled/mx-platform-java/issues) or [submit a pull request.](https://github.com/mxenabled/mx-platform-java/pulls)

docs/EnhanceTransactionResponse.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
Name | Type | Description | Notes
99
------------ | ------------- | ------------- | -------------
1010
**amount** | **BigDecimal** | | [optional]
11+
**categorizedBy** | **Integer** | | [optional]
1112
**category** | **String** | | [optional]
13+
**categoryGuid** | **String** | | [optional]
14+
**describedBy** | **Integer** | | [optional]
1215
**description** | **String** | | [optional]
16+
**extendedTransactionType** | **String** | | [optional]
1317
**id** | **String** | | [optional]
1418
**isBillPay** | **Boolean** | | [optional]
1519
**isDirectDeposit** | **Boolean** | | [optional]
@@ -19,8 +23,11 @@ Name | Type | Description | Notes
1923
**isInternational** | **Boolean** | | [optional]
2024
**isOverdraftFee** | **Boolean** | | [optional]
2125
**isPayrollAdvance** | **Boolean** | | [optional]
26+
**isSubscription** | **Boolean** | | [optional]
27+
**memo** | **String** | | [optional]
2228
**merchantCategoryCode** | **Integer** | | [optional]
2329
**merchantGuid** | **String** | | [optional]
30+
**merchantLocationGuid** | **String** | | [optional]
2431
**originalDescription** | **String** | | [optional]
2532
**type** | **String** | | [optional]
2633

docs/EnhanceTransactionsRequest.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Name | Type | Description | Notes
99
------------ | ------------- | ------------- | -------------
1010
**amount** | **BigDecimal** | | [optional]
1111
**description** | **String** | |
12+
**extendedTransactionType** | **String** | | [optional]
1213
**id** | **String** | |
14+
**memo** | **String** | | [optional]
1315
**merchantCategoryCode** | **Integer** | | [optional]
1416
**type** | **String** | | [optional]
1517

docs/TransactionResponse.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ Name | Type | Description | Notes
1111
**accountId** | **String** | | [optional]
1212
**amount** | **BigDecimal** | | [optional]
1313
**category** | **String** | | [optional]
14+
**categoryGuid** | **String** | | [optional]
1415
**checkNumberString** | **String** | | [optional]
1516
**createdAt** | **String** | | [optional]
1617
**currencyCode** | **String** | | [optional]
1718
**date** | **String** | | [optional]
1819
**description** | **String** | | [optional]
20+
**extendedTransactionType** | **String** | | [optional]
1921
**guid** | **String** | | [optional]
2022
**id** | **String** | | [optional]
2123
**isBillPay** | **Boolean** | | [optional]

openapi/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiPackage: "com.mx.client.mx-platform-api"
22
artifactDescription: "A Java library for the MX Platform API"
33
artifactId: "mx-platform-java"
44
artifactUrl: "https://github.com/mxenabled/mx-platform-java"
5-
artifactVersion: 0.3.3
5+
artifactVersion: 0.3.4
66
developerEmail: "devexperience@mx.com"
77
developerName: "MX"
88
developerOrganization: "MX Technologies Inc."

openapi/templates/README.mustache

Lines changed: 50 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-java/issues) to report issues using the MX Platform API Java Library.*
1+
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-java/issues) to report issues using the MX Platform Java library.*
22

3-
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech).*
3+
# MX Platform Java
44

5-
# MX Platform Java - v{{{artifactVersion}}}
5+
The [MX Platform API](https://www.mx.com/products/platform-api) is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
66

7-
{{{appDescriptionWithNewLines}}}
7+
## Documentation
88

9-
{{#infoUrl}}
10-
Please [visit]({{{infoUrl}}}) for more information.
11-
{{/infoUrl}}
9+
Examples for the API endpoints can be found [here.](https://docs.mx.com/api)
1210

1311
## Requirements
1412

1513
Building the API client library requires:
1614

17-
1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+
18-
2. Maven
19-
20-
### Documentation
21-
22-
See the [documentation](https://docs.mx.com/api).
15+
- Java 1.7+
16+
- Maven
2317

2418
## Installation
2519

@@ -48,106 +42,66 @@ Add this dependency to your project's POM:
4842

4943
You can find the MX Platform Java Library in the [Maven Central Repository](https://search.maven.org/search?q=mx-platform-java).
5044

51-
{{#jersey2}}
52-
## Usage
53-
54-
To add a HTTP proxy for the API client, use `ClientConfig`:
55-
```java
56-
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
57-
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
58-
import org.glassfish.jersey.client.ClientConfig;
59-
import org.glassfish.jersey.client.ClientProperties;
60-
import {{{invokerPackage}}}.*;
61-
import {{{package}}}.{{{classname}}};
62-
63-
...
64-
65-
ApiClient defaultClient = Configuration.getDefaultApiClient();
66-
ClientConfig clientConfig = defaultClient.getClientConfig();
67-
clientConfig.connectorProvider(new ApacheConnectorProvider());
68-
clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here");
69-
clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username");
70-
clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password");
71-
defaultClient.setClientConfig(clientConfig);
72-
73-
{{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
74-
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
75-
```
76-
77-
{{/jersey2}}
7845
## Getting Started
7946

8047
In order to make requests, you will need to [sign up](https://dashboard.mx.com/sign_up) for the MX Platform API and get a `Client ID` and `API Key`.
8148

82-
Please follow the [installation](#installation) instruction and execute the following Java code:
49+
Please follow the [installation](#installation) procedure and then run the following code to create your first User:
8350

8451
```java
85-
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
86-
import {{{invokerPackage}}}.*;
87-
import {{{invokerPackage}}}.auth.*;
88-
import {{{modelPackage}}}.*;
89-
import {{{package}}}.{{{classname}}};
90-
91-
public class {{{classname}}}Example {
92-
52+
import com.mx.client.ApiClient;
53+
import com.mx.client.ApiException;
54+
import com.mx.client.Configuration;
55+
import com.mx.client.auth.*;
56+
import com.mx.client.model.*;
57+
import com.mx.client.mx_platform_api.MxPlatformApi;
58+
59+
public class Example {
9360
public static void main(String[] args) {
61+
// Configure environment. https://int-api.mx.com for development, https://api.mx.com for production
9462
ApiClient defaultClient = Configuration.getDefaultApiClient();
95-
defaultClient.setBasePath("{{{basePath}}}");
96-
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
97-
// Configure HTTP basic authorization: {{{name}}}
98-
HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
99-
{{{name}}}.setUsername("YOUR USERNAME");
100-
{{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}}
101-
// Configure HTTP bearer authorization: {{{name}}}
102-
HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}");
103-
{{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
104-
// Configure API key authorization: {{{name}}}
105-
ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
106-
{{{name}}}.setApiKey("YOUR API KEY");
107-
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
108-
//{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
109-
// Configure OAuth2 access token for authorization: {{{name}}}
110-
OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
111-
{{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}}
112-
// Configure HTTP signature authorization: {{{name}}}
113-
HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}");
114-
// All the HTTP signature parameters below should be customized to your environment.
115-
// Configure the keyId
116-
{{{name}}}.setKeyId("YOUR KEY ID");
117-
// Configure the signature algorithm
118-
{{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019);
119-
// Configure the specific cryptographic algorithm
120-
{{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256);
121-
// Configure the cryptographic algorithm parameters, if applicable
122-
{{{name}}}.setAlgorithmParameterSpec(null);
123-
// Set the cryptographic digest algorithm.
124-
{{{name}}}.setDigestAlgorithm("SHA-256");
125-
// Set the HTTP headers that should be included in the HTTP signature.
126-
{{{name}}}.setHeaders(Arrays.asList("date", "host"));
127-
// Set the private key used to sign the HTTP messages
128-
{{{name}}}.setPrivateKey();{{/isHttpSignature}}
129-
{{/authMethods}}
130-
{{/hasAuthMethods}}
131-
132-
{{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
133-
{{#allParams}}
134-
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
135-
{{/allParams}}
63+
defaultClient.setBasePath("https://int-api.mx.com");
64+
65+
// Configure with your Client ID/API Key from https://dashboard.mx.com
66+
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
67+
basicAuth.setUsername("Your Client ID");
68+
basicAuth.setPassword("Your API Key");
69+
70+
MxPlatformApi apiInstance = new MxPlatformApi(defaultClient);
71+
72+
UserCreateRequest userCreateRequest = new UserCreateRequest();
73+
userCreateRequest.setMetadata("Creating a user!");
74+
75+
UserCreateRequestBody userCreateRequestBody = new UserCreateRequestBody();
76+
userCreateRequestBody.setUser(userCreateRequest);
77+
13678
try {
137-
{{#returnType}}{{{.}}} response = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
138-
System.out.println(response);{{/returnType}}
79+
UserResponseBody response = apiInstance.createUser(userCreateRequestBody);
80+
System.out.println(response);
13981
} catch (ApiException e) {
140-
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
82+
System.err.println("Exception when calling MxPlatformApi#createUser");
14183
System.err.println("Status code: " + e.getCode());
14284
System.err.println("Reason: " + e.getResponseBody());
14385
System.err.println("Response headers: " + e.getResponseHeaders());
14486
e.printStackTrace();
14587
}
14688
}
14789
}
148-
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
14990
```
15091

151-
## Recommendation
92+
## Development
93+
94+
This project was generated by the [OpenAPI Generator](https://openapi-generator.tech). To generate this library, verify you have the latest version of the `openapi-generator-cli` found [here.](https://github.com/OpenAPITools/openapi-generator#17---npm)
95+
96+
Running the following command in this repo's directory will generate this library using the [MX Platform API OpenAPI spec](https://github.com/mxenabled/openapi/blob/master/openapi/mx_platform_api_beta.yml) with our [configuration and templates.](https://github.com/mxenabled/mx-platform-ruby/tree/master/openapi)
97+
```shell
98+
openapi-generator-cli generate \
99+
-i https://raw.githubusercontent.com/mxenabled/openapi/master/openapi/mx_platform_api_beta.yml \
100+
-g java \
101+
-c ./openapi/config.yml \
102+
-t ./openapi/templates
103+
```
104+
105+
## Contributing
152106

153-
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
107+
Please [open an issue](https://github.com/mxenabled/mx-platform-java/issues) or [submit a pull request.](https://github.com/mxenabled/mx-platform-java/pulls)

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
55
<artifactId>mx-platform-java</artifactId>
66
<packaging>jar</packaging>
77
<name>mx-platform-java</name>
8-
<version>0.3.3</version>
8+
<version>0.3.4</version>
99
<url>https://github.com/mxenabled/mx-platform-java</url>
1010
<description>A Java library for the MX Platform API</description>
1111
<scm>

src/main/java/com/mx/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private void init() {
125125
json = new JSON();
126126

127127
// Set default User-Agent.
128-
setUserAgent("OpenAPI-Generator/0.3.3/java");
128+
setUserAgent("OpenAPI-Generator/0.3.4/java");
129129

130130
authentications = new HashMap<String, Authentication>();
131131
}

0 commit comments

Comments
 (0)