Skip to content

Commit 768959e

Browse files
July Merge API Sync (#56)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Rohan Konnur <[email protected]>
1 parent fb7ca1d commit 768959e

File tree

267 files changed

+5072
-1534
lines changed

Some content is hidden

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

267 files changed

+5072
-1534
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ publishing {
4646
maven(MavenPublication) {
4747
groupId = 'dev.merge'
4848
artifactId = 'merge-java-client'
49-
version = '1.0.14'
49+
version = '1.0.15'
5050
from components.java
5151
pom {
5252
scm {

src/main/java/com/merge/api/MergeApiClient.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public class MergeApiClient {
1818

1919
protected final Supplier<AtsClient> atsClient;
2020

21-
protected final Supplier<CrmClient> crmClient;
22-
2321
protected final Supplier<FilestorageClient> filestorageClient;
2422

23+
protected final Supplier<CrmClient> crmClient;
24+
2525
protected final Supplier<HrisClient> hrisClient;
2626

2727
protected final Supplier<TicketingClient> ticketingClient;
@@ -31,8 +31,8 @@ public class MergeApiClient {
3131
public MergeApiClient(ClientOptions clientOptions) {
3232
this.clientOptions = clientOptions;
3333
this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions));
34-
this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions));
3534
this.filestorageClient = Suppliers.memoize(() -> new FilestorageClient(clientOptions));
35+
this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions));
3636
this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions));
3737
this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions));
3838
this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions));
@@ -42,14 +42,14 @@ public AtsClient ats() {
4242
return this.atsClient.get();
4343
}
4444

45-
public CrmClient crm() {
46-
return this.crmClient.get();
47-
}
48-
4945
public FilestorageClient filestorage() {
5046
return this.filestorageClient.get();
5147
}
5248

49+
public CrmClient crm() {
50+
return this.crmClient.get();
51+
}
52+
5353
public HrisClient hris() {
5454
return this.hrisClient.get();
5555
}
Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
1-
/**
2-
* This file was auto-generated by Fern from our API Definition.
3-
*/
4-
package com.merge.api.core;
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
package com.merge.api.core;
55

6-
public final class ApiError extends RuntimeException {
7-
private final int statusCode;
6+
/**
7+
* This exception type will be thrown for any non-2XX API responses.
8+
*/
9+
public class ApiError extends MergeException {
10+
/**
11+
* The error code of the response that triggered the exception.
12+
*/
13+
private final int statusCode;
814

9-
private final Object body;
15+
/**
16+
* The body of the response that triggered the exception.
17+
*/
18+
private final Object body;
1019

11-
public ApiError(int statusCode, Object body) {
12-
this.statusCode = statusCode;
13-
this.body = body;
14-
}
20+
public ApiError(String message, int statusCode, Object body) {
21+
super(message);
22+
this.statusCode = statusCode;
23+
this.body = body;
24+
}
1525

16-
public int statusCode() {
17-
return this.statusCode;
18-
}
26+
/**
27+
* @return the statusCode
28+
*/
29+
public int statusCode() {
30+
return this.statusCode;
31+
}
1932

20-
public Object body() {
21-
return this.body;
22-
}
33+
/**
34+
* @return the body
35+
*/
36+
public Object body() {
37+
return this.body;
38+
}
2339

24-
@java.lang.Override
25-
public String toString() {
26-
return "ApiError{" + "statusCode: " + statusCode + ", body: " + body + "}";
27-
}
28-
}
40+
@java.lang.Override
41+
public String toString() {
42+
return "ApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}";
43+
}
44+
}

src/main/java/com/merge/api/core/ClientOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private ClientOptions(
3030
{
3131
put("X-Fern-Language", "JAVA");
3232
put("X-Fern-SDK-Name", "com.merge.fern:api-sdk");
33-
put("X-Fern-SDK-Version", "v1.0.13");
33+
put("X-Fern-SDK-Version", "1.0.15");
3434
}
3535
});
3636
this.headerSuppliers = headerSuppliers;

src/main/java/com/merge/api/core/MergeApiApiError.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
/**
22
* This file was auto-generated by Fern from our API Definition.
3+
*
4+
* NOTE: Do NOT use this class. `ApiError` is the class that should
5+
* be used. This class is just included for backwards compatibility
6+
* purposes.
37
*/
48
package com.merge.api.core;
59

610
/**
11+
* @Deprecated
712
* This exception type will be thrown for any non-2XX API responses.
813
*/
9-
public class MergeApiApiError extends MergeApiError {
14+
public class MergeApiApiError extends MergeException {
1015
/**
1116
* The error code of the response that triggered the exception.
1217
*/
@@ -42,4 +47,4 @@ public String toString() {
4247
return "MergeApiApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body
4348
+ "}";
4449
}
45-
}
50+
}

src/main/java/com/merge/api/core/MergeApiError.java renamed to src/main/java/com/merge/api/core/MergeException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
/**
77
* This class serves as the base exception for all errors in the SDK.
88
*/
9-
public class MergeApiError extends RuntimeException {
10-
public MergeApiError(String message) {
9+
public class MergeException extends RuntimeException {
10+
public MergeException(String message) {
1111
super(message);
1212
}
1313

14-
public MergeApiError(String message, Exception e) {
14+
public MergeException(String message, Exception e) {
1515
super(message, e);
1616
}
1717
}

src/main/java/com/merge/api/resources/accounting/accountdetails/AccountDetailsClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44
package com.merge.api.resources.accounting.accountdetails;
55

6+
import com.merge.api.core.ApiError;
67
import com.merge.api.core.ClientOptions;
7-
import com.merge.api.core.MergeApiApiError;
8-
import com.merge.api.core.MergeApiError;
8+
import com.merge.api.core.MergeException;
99
import com.merge.api.core.ObjectMappers;
1010
import com.merge.api.core.RequestOptions;
1111
import com.merge.api.resources.accounting.types.AccountDetails;
@@ -55,12 +55,12 @@ public AccountDetails retrieve(RequestOptions requestOptions) {
5555
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class);
5656
}
5757
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
58-
throw new MergeApiApiError(
58+
throw new ApiError(
5959
"Error with status code " + response.code(),
6060
response.code(),
6161
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
6262
} catch (IOException e) {
63-
throw new MergeApiError("Network error executing HTTP request", e);
63+
throw new MergeException("Network error executing HTTP request", e);
6464
}
6565
}
6666
}

src/main/java/com/merge/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44
package com.merge.api.resources.accounting.accountingperiods;
55

6+
import com.merge.api.core.ApiError;
67
import com.merge.api.core.ClientOptions;
7-
import com.merge.api.core.MergeApiApiError;
8-
import com.merge.api.core.MergeApiError;
8+
import com.merge.api.core.MergeException;
99
import com.merge.api.core.ObjectMappers;
1010
import com.merge.api.core.RequestOptions;
1111
import com.merge.api.resources.accounting.accountingperiods.requests.AccountingPeriodsListRequest;
@@ -79,12 +79,12 @@ public PaginatedAccountingPeriodList list(AccountingPeriodsListRequest request,
7979
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountingPeriodList.class);
8080
}
8181
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
82-
throw new MergeApiApiError(
82+
throw new ApiError(
8383
"Error with status code " + response.code(),
8484
response.code(),
8585
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
8686
} catch (IOException e) {
87-
throw new MergeApiError("Network error executing HTTP request", e);
87+
throw new MergeException("Network error executing HTTP request", e);
8888
}
8989
}
9090

@@ -131,12 +131,12 @@ public AccountingPeriod retrieve(
131131
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPeriod.class);
132132
}
133133
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
134-
throw new MergeApiApiError(
134+
throw new ApiError(
135135
"Error with status code " + response.code(),
136136
response.code(),
137137
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
138138
} catch (IOException e) {
139-
throw new MergeApiError("Network error executing HTTP request", e);
139+
throw new MergeException("Network error executing HTTP request", e);
140140
}
141141
}
142142
}

src/main/java/com/merge/api/resources/accounting/accounts/AccountsClient.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
*/
44
package com.merge.api.resources.accounting.accounts;
55

6+
import com.merge.api.core.ApiError;
67
import com.merge.api.core.ClientOptions;
78
import com.merge.api.core.MediaTypes;
8-
import com.merge.api.core.MergeApiApiError;
9-
import com.merge.api.core.MergeApiError;
9+
import com.merge.api.core.MergeException;
1010
import com.merge.api.core.ObjectMappers;
1111
import com.merge.api.core.RequestOptions;
1212
import com.merge.api.resources.accounting.accounts.requests.AccountEndpointRequest;
@@ -119,12 +119,12 @@ public PaginatedAccountList list(AccountsListRequest request, RequestOptions req
119119
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class);
120120
}
121121
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
122-
throw new MergeApiApiError(
122+
throw new ApiError(
123123
"Error with status code " + response.code(),
124124
response.code(),
125125
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
126126
} catch (IOException e) {
127-
throw new MergeApiError("Network error executing HTTP request", e);
127+
throw new MergeException("Network error executing HTTP request", e);
128128
}
129129
}
130130

@@ -174,12 +174,12 @@ public AccountResponse create(AccountEndpointRequest request, RequestOptions req
174174
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountResponse.class);
175175
}
176176
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
177-
throw new MergeApiApiError(
177+
throw new ApiError(
178178
"Error with status code " + response.code(),
179179
response.code(),
180180
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
181181
} catch (IOException e) {
182-
throw new MergeApiError("Network error executing HTTP request", e);
182+
throw new MergeException("Network error executing HTTP request", e);
183183
}
184184
}
185185

@@ -236,12 +236,12 @@ public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptio
236236
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class);
237237
}
238238
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
239-
throw new MergeApiApiError(
239+
throw new ApiError(
240240
"Error with status code " + response.code(),
241241
response.code(),
242242
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
243243
} catch (IOException e) {
244-
throw new MergeApiError("Network error executing HTTP request", e);
244+
throw new MergeException("Network error executing HTTP request", e);
245245
}
246246
}
247247

@@ -276,12 +276,12 @@ public MetaResponse metaPostRetrieve(RequestOptions requestOptions) {
276276
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class);
277277
}
278278
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
279-
throw new MergeApiApiError(
279+
throw new ApiError(
280280
"Error with status code " + response.code(),
281281
response.code(),
282282
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
283283
} catch (IOException e) {
284-
throw new MergeApiError("Network error executing HTTP request", e);
284+
throw new MergeException("Network error executing HTTP request", e);
285285
}
286286
}
287287
}

src/main/java/com/merge/api/resources/accounting/accounttoken/AccountTokenClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44
package com.merge.api.resources.accounting.accounttoken;
55

6+
import com.merge.api.core.ApiError;
67
import com.merge.api.core.ClientOptions;
7-
import com.merge.api.core.MergeApiApiError;
8-
import com.merge.api.core.MergeApiError;
8+
import com.merge.api.core.MergeException;
99
import com.merge.api.core.ObjectMappers;
1010
import com.merge.api.core.RequestOptions;
1111
import com.merge.api.resources.accounting.types.AccountToken;
@@ -56,12 +56,12 @@ public AccountToken retrieve(String publicToken, RequestOptions requestOptions)
5656
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class);
5757
}
5858
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
59-
throw new MergeApiApiError(
59+
throw new ApiError(
6060
"Error with status code " + response.code(),
6161
response.code(),
6262
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
6363
} catch (IOException e) {
64-
throw new MergeApiError("Network error executing HTTP request", e);
64+
throw new MergeException("Network error executing HTTP request", e);
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)