Skip to content

Commit 3444fe9

Browse files
CRM, Accounting, and HRIS API update (#20)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent b0f21c7 commit 3444fe9

File tree

70 files changed

+5536
-80
lines changed

Some content is hidden

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

70 files changed

+5536
-80
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ publishing {
4040
maven(MavenPublication) {
4141
groupId = 'dev.merge'
4242
artifactId = 'merge-java-client'
43-
version = '0.1.5'
43+
version = '0.1.6'
4444
from components.java
4545
}
4646
}

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

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

2020
protected final Supplier<FilestorageClient> filestorageClient;
2121

22-
protected final Supplier<TicketingClient> ticketingClient;
23-
2422
protected final Supplier<HrisClient> hrisClient;
2523

24+
protected final Supplier<TicketingClient> ticketingClient;
25+
2626
protected final Supplier<AccountingClient> accountingClient;
2727

2828
public MergeApiClient(ClientOptions clientOptions) {
2929
this.clientOptions = clientOptions;
3030
this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions));
3131
this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions));
3232
this.filestorageClient = Suppliers.memoize(() -> new FilestorageClient(clientOptions));
33-
this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions));
3433
this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions));
34+
this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions));
3535
this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions));
3636
}
3737

@@ -47,14 +47,14 @@ public FilestorageClient filestorage() {
4747
return this.filestorageClient.get();
4848
}
4949

50-
public TicketingClient ticketing() {
51-
return this.ticketingClient.get();
52-
}
53-
5450
public HrisClient hris() {
5551
return this.hrisClient.get();
5652
}
5753

54+
public TicketingClient ticketing() {
55+
return this.ticketingClient.get();
56+
}
57+
5858
public AccountingClient accounting() {
5959
return this.accountingClient.get();
6060
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private ClientOptions(
2323
this.headers = new HashMap<>();
2424
this.headers.putAll(headers);
2525
this.headers.putAll(Map.of(
26-
"X-Fern-SDK-Name", "com.merge.fern:api-sdk", "X-Fern-SDK-Version", "0.1.5", "X-Fern-Language", "JAVA"));
26+
"X-Fern-SDK-Name", "com.merge.fern:api-sdk", "X-Fern-SDK-Version", "0.1.6", "X-Fern-Language", "JAVA"));
2727
this.headerSuppliers = headerSuppliers;
2828
this.httpClient = httpClient;
2929
;

src/main/java/com/merge/api/resources/accounting/contacts/ContactsClient.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public PaginatedContactList list(ContactsListRequest request, RequestOptions req
6363
_httpUrl.addQueryParameter(
6464
"include_remote_data", request.getIncludeRemoteData().get().toString());
6565
}
66+
if (request.getIsCustomer().isPresent()) {
67+
_httpUrl.addQueryParameter("is_customer", request.getIsCustomer().get());
68+
}
69+
if (request.getIsSupplier().isPresent()) {
70+
_httpUrl.addQueryParameter("is_supplier", request.getIsSupplier().get());
71+
}
6672
if (request.getModifiedAfter().isPresent()) {
6773
_httpUrl.addQueryParameter(
6874
"modified_after", request.getModifiedAfter().get().toString());

src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsListRequest.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public final class ContactsListRequest {
2929

3030
private final Optional<Boolean> includeRemoteData;
3131

32+
private final Optional<String> isCustomer;
33+
34+
private final Optional<String> isSupplier;
35+
3236
private final Optional<OffsetDateTime> modifiedAfter;
3337

3438
private final Optional<OffsetDateTime> modifiedBefore;
@@ -49,6 +53,8 @@ private ContactsListRequest(
4953
Optional<ContactsListRequestExpand> expand,
5054
Optional<Boolean> includeDeletedData,
5155
Optional<Boolean> includeRemoteData,
56+
Optional<String> isCustomer,
57+
Optional<String> isSupplier,
5258
Optional<OffsetDateTime> modifiedAfter,
5359
Optional<OffsetDateTime> modifiedBefore,
5460
Optional<Integer> pageSize,
@@ -62,6 +68,8 @@ private ContactsListRequest(
6268
this.expand = expand;
6369
this.includeDeletedData = includeDeletedData;
6470
this.includeRemoteData = includeRemoteData;
71+
this.isCustomer = isCustomer;
72+
this.isSupplier = isSupplier;
6573
this.modifiedAfter = modifiedAfter;
6674
this.modifiedBefore = modifiedBefore;
6775
this.pageSize = pageSize;
@@ -126,6 +134,22 @@ public Optional<Boolean> getIncludeRemoteData() {
126134
return includeRemoteData;
127135
}
128136

137+
/**
138+
* @return If provided, will only return Contacts that are denoted as customers.
139+
*/
140+
@JsonProperty("is_customer")
141+
public Optional<String> getIsCustomer() {
142+
return isCustomer;
143+
}
144+
145+
/**
146+
* @return If provided, will only return Contacts that are denoted as suppliers.
147+
*/
148+
@JsonProperty("is_supplier")
149+
public Optional<String> getIsSupplier() {
150+
return isSupplier;
151+
}
152+
129153
/**
130154
* @return If provided, only objects synced by Merge after this date time will be returned.
131155
*/
@@ -188,6 +212,8 @@ private boolean equalTo(ContactsListRequest other) {
188212
&& expand.equals(other.expand)
189213
&& includeDeletedData.equals(other.includeDeletedData)
190214
&& includeRemoteData.equals(other.includeRemoteData)
215+
&& isCustomer.equals(other.isCustomer)
216+
&& isSupplier.equals(other.isSupplier)
191217
&& modifiedAfter.equals(other.modifiedAfter)
192218
&& modifiedBefore.equals(other.modifiedBefore)
193219
&& pageSize.equals(other.pageSize)
@@ -206,6 +232,8 @@ public int hashCode() {
206232
this.expand,
207233
this.includeDeletedData,
208234
this.includeRemoteData,
235+
this.isCustomer,
236+
this.isSupplier,
209237
this.modifiedAfter,
210238
this.modifiedBefore,
211239
this.pageSize,
@@ -239,6 +267,10 @@ public static final class Builder {
239267

240268
private Optional<Boolean> includeRemoteData = Optional.empty();
241269

270+
private Optional<String> isCustomer = Optional.empty();
271+
272+
private Optional<String> isSupplier = Optional.empty();
273+
242274
private Optional<OffsetDateTime> modifiedAfter = Optional.empty();
243275

244276
private Optional<OffsetDateTime> modifiedBefore = Optional.empty();
@@ -261,6 +293,8 @@ public Builder from(ContactsListRequest other) {
261293
expand(other.getExpand());
262294
includeDeletedData(other.getIncludeDeletedData());
263295
includeRemoteData(other.getIncludeRemoteData());
296+
isCustomer(other.getIsCustomer());
297+
isSupplier(other.getIsSupplier());
264298
modifiedAfter(other.getModifiedAfter());
265299
modifiedBefore(other.getModifiedBefore());
266300
pageSize(other.getPageSize());
@@ -347,6 +381,28 @@ public Builder includeRemoteData(Boolean includeRemoteData) {
347381
return this;
348382
}
349383

384+
@JsonSetter(value = "is_customer", nulls = Nulls.SKIP)
385+
public Builder isCustomer(Optional<String> isCustomer) {
386+
this.isCustomer = isCustomer;
387+
return this;
388+
}
389+
390+
public Builder isCustomer(String isCustomer) {
391+
this.isCustomer = Optional.of(isCustomer);
392+
return this;
393+
}
394+
395+
@JsonSetter(value = "is_supplier", nulls = Nulls.SKIP)
396+
public Builder isSupplier(Optional<String> isSupplier) {
397+
this.isSupplier = isSupplier;
398+
return this;
399+
}
400+
401+
public Builder isSupplier(String isSupplier) {
402+
this.isSupplier = Optional.of(isSupplier);
403+
return this;
404+
}
405+
350406
@JsonSetter(value = "modified_after", nulls = Nulls.SKIP)
351407
public Builder modifiedAfter(Optional<OffsetDateTime> modifiedAfter) {
352408
this.modifiedAfter = modifiedAfter;
@@ -422,6 +478,8 @@ public ContactsListRequest build() {
422478
expand,
423479
includeDeletedData,
424480
includeRemoteData,
481+
isCustomer,
482+
isSupplier,
425483
modifiedAfter,
426484
modifiedBefore,
427485
pageSize,

src/main/java/com/merge/api/resources/accounting/types/CreditNote.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public final class CreditNote {
5151

5252
private final Optional<Boolean> remoteWasDeleted;
5353

54+
private final Optional<List<CreditNoteApplyLine>> appliedToLines;
55+
5456
private final Optional<OffsetDateTime> modifiedAt;
5557

5658
private final Optional<Map<String, JsonNode>> fieldMappings;
@@ -75,6 +77,7 @@ private CreditNote(
7577
Optional<OffsetDateTime> remoteUpdatedAt,
7678
Optional<List<Optional<CreditNotePaymentsItem>>> payments,
7779
Optional<Boolean> remoteWasDeleted,
80+
Optional<List<CreditNoteApplyLine>> appliedToLines,
7881
Optional<OffsetDateTime> modifiedAt,
7982
Optional<Map<String, JsonNode>> fieldMappings,
8083
Optional<List<RemoteData>> remoteData) {
@@ -95,6 +98,7 @@ private CreditNote(
9598
this.remoteUpdatedAt = remoteUpdatedAt;
9699
this.payments = payments;
97100
this.remoteWasDeleted = remoteWasDeleted;
101+
this.appliedToLines = appliedToLines;
98102
this.modifiedAt = modifiedAt;
99103
this.fieldMappings = fieldMappings;
100104
this.remoteData = remoteData;
@@ -540,6 +544,11 @@ public Optional<Boolean> getRemoteWasDeleted() {
540544
return remoteWasDeleted;
541545
}
542546

547+
@JsonProperty("applied_to_lines")
548+
public Optional<List<CreditNoteApplyLine>> getAppliedToLines() {
549+
return appliedToLines;
550+
}
551+
543552
/**
544553
* @return This is the datetime that this object was last updated by Merge
545554
*/
@@ -582,6 +591,7 @@ private boolean equalTo(CreditNote other) {
582591
&& remoteUpdatedAt.equals(other.remoteUpdatedAt)
583592
&& payments.equals(other.payments)
584593
&& remoteWasDeleted.equals(other.remoteWasDeleted)
594+
&& appliedToLines.equals(other.appliedToLines)
585595
&& modifiedAt.equals(other.modifiedAt)
586596
&& fieldMappings.equals(other.fieldMappings)
587597
&& remoteData.equals(other.remoteData);
@@ -607,6 +617,7 @@ public int hashCode() {
607617
this.remoteUpdatedAt,
608618
this.payments,
609619
this.remoteWasDeleted,
620+
this.appliedToLines,
610621
this.modifiedAt,
611622
this.fieldMappings,
612623
this.remoteData);
@@ -657,6 +668,8 @@ public static final class Builder {
657668

658669
private Optional<Boolean> remoteWasDeleted = Optional.empty();
659670

671+
private Optional<List<CreditNoteApplyLine>> appliedToLines = Optional.empty();
672+
660673
private Optional<OffsetDateTime> modifiedAt = Optional.empty();
661674

662675
private Optional<Map<String, JsonNode>> fieldMappings = Optional.empty();
@@ -683,6 +696,7 @@ public Builder from(CreditNote other) {
683696
remoteUpdatedAt(other.getRemoteUpdatedAt());
684697
payments(other.getPayments());
685698
remoteWasDeleted(other.getRemoteWasDeleted());
699+
appliedToLines(other.getAppliedToLines());
686700
modifiedAt(other.getModifiedAt());
687701
fieldMappings(other.getFieldMappings());
688702
remoteData(other.getRemoteData());
@@ -877,6 +891,17 @@ public Builder remoteWasDeleted(Boolean remoteWasDeleted) {
877891
return this;
878892
}
879893

894+
@JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP)
895+
public Builder appliedToLines(Optional<List<CreditNoteApplyLine>> appliedToLines) {
896+
this.appliedToLines = appliedToLines;
897+
return this;
898+
}
899+
900+
public Builder appliedToLines(List<CreditNoteApplyLine> appliedToLines) {
901+
this.appliedToLines = Optional.of(appliedToLines);
902+
return this;
903+
}
904+
880905
@JsonSetter(value = "modified_at", nulls = Nulls.SKIP)
881906
public Builder modifiedAt(Optional<OffsetDateTime> modifiedAt) {
882907
this.modifiedAt = modifiedAt;
@@ -929,6 +954,7 @@ public CreditNote build() {
929954
remoteUpdatedAt,
930955
payments,
931956
remoteWasDeleted,
957+
appliedToLines,
932958
modifiedAt,
933959
fieldMappings,
934960
remoteData);

0 commit comments

Comments
 (0)