Skip to content

Commit 3112a22

Browse files
Java generator improvements (#68)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 367de6a commit 3112a22

File tree

1,137 files changed

+8854
-7789
lines changed

Some content is hidden

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

1,137 files changed

+8854
-7789
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Publish to maven
5656
run: |
57-
./gradlew publish
57+
./gradlew publish
5858
env:
5959
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
6060
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

LICENSE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Last updated: April 21, 2022
2+
3+
Merge SDK & Code Snippets License
4+
5+
Merge makes available to Customers various software development kits ("SDKs") and code snippets ("Snippets") (together, the "Merge Assets") to assist with Merge Integrations and making connections to their Customer Application. Merge Assets are deemed Software under the MSA (defined below). All terms applicable to Software under the MSA apply with equal force and effect to the Merge Assets under this Merge SDK and Code Snippets License ("License").
6+
7+
"Customer" means a person or entity that uses any of the Merge Assets. By using any Merge Asset, Customer agrees to the terms of this License.
8+
9+
"MSA" for the purpose of this License means: (a) for Merge "Launch" Customers, the Subscriber Agreement (available at: https://merge.dev/subscriber-agreement); and (b) for Merge "Growth" and/or "Expand" Customers, Merge's Master Services Agreement (available at https://merge.dev/msa), unless Merge and Customer have entered into a separate written agreement governing the Customer's use of the Service. Customer's use of any Merge Asset will be governed by the applicable MSA as well as the additional terms of this License. Capitalized terms used but not defined herein shall have the meaning as set forth in the MSA. In the event of any inconsistency between the terms of the MSA and this License, the terms of the MSA will prevail.
10+
11+
Merge reserves the right to modify or update this License in its sole discretion, the effective date of such updates and/or modifications will be the earlier of: (i) 30 days from the date of such update or modification; or (ii) Customer's continued use of any Merge Asset.
12+
13+
SDK and Snippets License. Customer's right to access and use the Service under Section 1 of the MSA is extended to include use of the Merge Assets but solely during the Term and subject to the terms of the MSA.
14+
Use with the Service Only. Customer may use the Merge Assets but only in connections with the Service and Merge Integrations. Any other use of the Merge Assets requires Merge's prior written consent.
15+
Limitations. Customer's use of the Merge Assets may be subject to bandwidth limitations that Merge may impose from time to time during the Subscription. Merge will make commercially reasonable efforts to notify Customer of such limitations in advance via the location where Customer gained access to the applicable Merge Asset(s).
16+
Merge Assets & Intellectual Property Rights. Any modifications or derivatives (together, "Asset Derivatives") made by Customer to the Merge Assets are deemed "works made for hire" as that term is defined in the United States Copyright Act and are the sole property of Merge. To the extent that ownership of any Asset Derivative does not by operation of law vest in Merge, Customer hereby assigns to Merge all right, title and interest in and to the Asset Derivative, including all related intellectual property rights. Asset Derivatives will be governed by the terms of this License.

build.gradle

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ repositories {
1313

1414
dependencies {
1515
api 'com.squareup.okhttp3:okhttp:4.12.0'
16-
api 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
17-
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.3'
18-
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3'
16+
api 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
17+
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'
18+
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
1919
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
2020
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
2121
}
@@ -24,31 +24,61 @@ dependencies {
2424
sourceCompatibility = 1.8
2525
targetCompatibility = 1.8
2626

27+
tasks.withType(Javadoc) {
28+
failOnError false
29+
options.addStringOption('Xdoclint:none', '-quiet')
30+
}
31+
2732
spotless {
2833
java {
2934
palantirJavaFormat()
3035
}
3136
}
3237

38+
3339
java {
3440
withSourcesJar()
3541
withJavadocJar()
3642
}
3743

44+
45+
group = 'dev.merge'
46+
47+
version = '1.1.0'
48+
49+
jar {
50+
dependsOn(":generatePomFileForMavenPublication")
51+
archiveBaseName = "merge-java-client"
52+
}
53+
54+
sourcesJar {
55+
archiveBaseName = "merge-java-client"
56+
}
57+
58+
javadocJar {
59+
archiveBaseName = "merge-java-client"
60+
}
61+
3862
test {
3963
useJUnitPlatform()
4064
testLogging {
4165
showStandardStreams = true
4266
}
4367
}
68+
4469
publishing {
4570
publications {
4671
maven(MavenPublication) {
4772
groupId = 'dev.merge'
4873
artifactId = 'merge-java-client'
49-
version = '1.0.18'
74+
version = '1.1.0'
5075
from components.java
5176
pom {
77+
licenses {
78+
license {
79+
name = 'CustomLicense{filename: LICENSE}'
80+
}
81+
}
5282
scm {
5383
connection = 'scm:git:git://github.com/merge-api/merge-java-client.git'
5484
developerConnection = 'scm:git:git://github.com/merge-api/merge-java-client.git'

gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
rootProject.name = 'merge-java-client'
2+
13
include 'sample-app'

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,44 @@
1616
public class MergeApiClient {
1717
protected final ClientOptions clientOptions;
1818

19-
protected final Supplier<AtsClient> atsClient;
20-
2119
protected final Supplier<CrmClient> crmClient;
2220

23-
protected final Supplier<HrisClient> hrisClient;
21+
protected final Supplier<AtsClient> atsClient;
2422

2523
protected final Supplier<FilestorageClient> filestorageClient;
2624

25+
protected final Supplier<HrisClient> hrisClient;
26+
2727
protected final Supplier<TicketingClient> ticketingClient;
2828

2929
protected final Supplier<AccountingClient> accountingClient;
3030

3131
public MergeApiClient(ClientOptions clientOptions) {
3232
this.clientOptions = clientOptions;
33-
this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions));
3433
this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions));
35-
this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions));
34+
this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions));
3635
this.filestorageClient = Suppliers.memoize(() -> new FilestorageClient(clientOptions));
36+
this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions));
3737
this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions));
3838
this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions));
3939
}
4040

41-
public AtsClient ats() {
42-
return this.atsClient.get();
43-
}
44-
4541
public CrmClient crm() {
4642
return this.crmClient.get();
4743
}
4844

49-
public HrisClient hris() {
50-
return this.hrisClient.get();
45+
public AtsClient ats() {
46+
return this.atsClient.get();
5147
}
5248

5349
public FilestorageClient filestorage() {
5450
return this.filestorageClient.get();
5551
}
5652

53+
public HrisClient hris() {
54+
return this.hrisClient.get();
55+
}
56+
5757
public TicketingClient ticketing() {
5858
return this.ticketingClient.get();
5959
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ public MergeApiClientBuilder url(String url) {
4141
return this;
4242
}
4343

44+
/**
45+
* Sets the timeout (in seconds) for the client
46+
*/
47+
public MergeApiClientBuilder timeout(int timeout) {
48+
this.clientOptionsBuilder.timeout(timeout);
49+
return this;
50+
}
51+
4452
public MergeApiClient build() {
4553
if (apiKey == null) {
4654
throw new RuntimeException("Please provide apiKey");

0 commit comments

Comments
 (0)