Skip to content

Commit d926e32

Browse files
committed
Release 1.11.2
1 parent eb9fa51 commit d926e32

21 files changed

Lines changed: 1851 additions & 227 deletions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Polytomic.
3+
Copyright (c) 2025 Polytomic.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

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 = 'com.polytomic'
4848
artifactId = 'polytomic-java'
49-
version = '1.10.1'
49+
version = '1.11.2'
5050
from components.java
5151
pom {
5252
licenses {

src/main/java/com/polytomic/api/Polytomic.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public class Polytomic {
4545

4646
protected final Supplier<UsersClient> usersClient;
4747

48-
protected final Supplier<PermissionsClient> permissionsClient;
49-
5048
protected final Supplier<WebhooksClient> webhooksClient;
5149

50+
protected final Supplier<PermissionsClient> permissionsClient;
51+
5252
public Polytomic(ClientOptions clientOptions) {
5353
this.clientOptions = clientOptions;
5454
this.bulkSyncClient = Suppliers.memoize(() -> new BulkSyncClient(clientOptions));
@@ -62,8 +62,8 @@ public Polytomic(ClientOptions clientOptions) {
6262
this.identityClient = Suppliers.memoize(() -> new IdentityClient(clientOptions));
6363
this.organizationClient = Suppliers.memoize(() -> new OrganizationClient(clientOptions));
6464
this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions));
65-
this.permissionsClient = Suppliers.memoize(() -> new PermissionsClient(clientOptions));
6665
this.webhooksClient = Suppliers.memoize(() -> new WebhooksClient(clientOptions));
66+
this.permissionsClient = Suppliers.memoize(() -> new PermissionsClient(clientOptions));
6767
}
6868

6969
public BulkSyncClient bulkSync() {
@@ -110,14 +110,14 @@ public UsersClient users() {
110110
return this.usersClient.get();
111111
}
112112

113-
public PermissionsClient permissions() {
114-
return this.permissionsClient.get();
115-
}
116-
117113
public WebhooksClient webhooks() {
118114
return this.webhooksClient.get();
119115
}
120116

117+
public PermissionsClient permissions() {
118+
return this.permissionsClient.get();
119+
}
120+
121121
public static PolytomicBuilder builder() {
122122
return new PolytomicBuilder();
123123
}

src/main/java/com/polytomic/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.polytomic.fern:api-sdk");
33-
put("X-Fern-SDK-Version", "1.10.1");
33+
put("X-Fern-SDK-Version", "1.11.2");
3434
}
3535
});
3636
this.headerSuppliers = headerSuppliers;

src/main/java/com/polytomic/api/resources/bulksync/requests/StartBulkSyncRequest.java

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.fasterxml.jackson.annotation.Nulls;
1313
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
1414
import com.polytomic.api.core.ObjectMappers;
15+
import com.polytomic.api.types.BulkFetchMode;
1516
import java.util.HashMap;
1617
import java.util.List;
1718
import java.util.Map;
@@ -21,6 +22,8 @@
2122
@JsonInclude(JsonInclude.Include.NON_EMPTY)
2223
@JsonDeserialize(builder = StartBulkSyncRequest.Builder.class)
2324
public final class StartBulkSyncRequest {
25+
private final Optional<BulkFetchMode> fetchMode;
26+
2427
private final Optional<Boolean> resync;
2528

2629
private final Optional<List<String>> schemas;
@@ -30,16 +33,23 @@ public final class StartBulkSyncRequest {
3033
private final Map<String, Object> additionalProperties;
3134

3235
private StartBulkSyncRequest(
36+
Optional<BulkFetchMode> fetchMode,
3337
Optional<Boolean> resync,
3438
Optional<List<String>> schemas,
3539
Optional<Boolean> test,
3640
Map<String, Object> additionalProperties) {
41+
this.fetchMode = fetchMode;
3742
this.resync = resync;
3843
this.schemas = schemas;
3944
this.test = test;
4045
this.additionalProperties = additionalProperties;
4146
}
4247

48+
@JsonProperty("fetch_mode")
49+
public Optional<BulkFetchMode> getFetchMode() {
50+
return fetchMode;
51+
}
52+
4353
@JsonProperty("resync")
4454
public Optional<Boolean> getResync() {
4555
return resync;
@@ -67,12 +77,15 @@ public Map<String, Object> getAdditionalProperties() {
6777
}
6878

6979
private boolean equalTo(StartBulkSyncRequest other) {
70-
return resync.equals(other.resync) && schemas.equals(other.schemas) && test.equals(other.test);
80+
return fetchMode.equals(other.fetchMode)
81+
&& resync.equals(other.resync)
82+
&& schemas.equals(other.schemas)
83+
&& test.equals(other.test);
7184
}
7285

7386
@java.lang.Override
7487
public int hashCode() {
75-
return Objects.hash(this.resync, this.schemas, this.test);
88+
return Objects.hash(this.fetchMode, this.resync, this.schemas, this.test);
7689
}
7790

7891
@java.lang.Override
@@ -86,6 +99,8 @@ public static Builder builder() {
8699

87100
@JsonIgnoreProperties(ignoreUnknown = true)
88101
public static final class Builder {
102+
private Optional<BulkFetchMode> fetchMode = Optional.empty();
103+
89104
private Optional<Boolean> resync = Optional.empty();
90105

91106
private Optional<List<String>> schemas = Optional.empty();
@@ -98,12 +113,24 @@ public static final class Builder {
98113
private Builder() {}
99114

100115
public Builder from(StartBulkSyncRequest other) {
116+
fetchMode(other.getFetchMode());
101117
resync(other.getResync());
102118
schemas(other.getSchemas());
103119
test(other.getTest());
104120
return this;
105121
}
106122

123+
@JsonSetter(value = "fetch_mode", nulls = Nulls.SKIP)
124+
public Builder fetchMode(Optional<BulkFetchMode> fetchMode) {
125+
this.fetchMode = fetchMode;
126+
return this;
127+
}
128+
129+
public Builder fetchMode(BulkFetchMode fetchMode) {
130+
this.fetchMode = Optional.of(fetchMode);
131+
return this;
132+
}
133+
107134
@JsonSetter(value = "resync", nulls = Nulls.SKIP)
108135
public Builder resync(Optional<Boolean> resync) {
109136
this.resync = resync;
@@ -138,7 +165,7 @@ public Builder test(Boolean test) {
138165
}
139166

140167
public StartBulkSyncRequest build() {
141-
return new StartBulkSyncRequest(resync, schemas, test, additionalProperties);
168+
return new StartBulkSyncRequest(fetchMode, resync, schemas, test, additionalProperties);
142169
}
143170
}
144171
}

src/main/java/com/polytomic/api/resources/connections/ConnectionsClient.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.polytomic.api.types.ConnectionResponseEnvelope;
1919
import com.polytomic.api.types.ConnectionTypeResponseEnvelope;
2020
import com.polytomic.api.types.CreateConnectionResponseEnvelope;
21+
import com.polytomic.api.types.JsonschemaSchema;
2122
import java.io.IOException;
2223
import okhttp3.Headers;
2324
import okhttp3.HttpUrl;
@@ -68,6 +69,41 @@ public ConnectionTypeResponseEnvelope getTypes(RequestOptions requestOptions) {
6869
}
6970
}
7071

72+
public JsonschemaSchema getConnectionTypeSchema(String id) {
73+
return getConnectionTypeSchema(id, null);
74+
}
75+
76+
public JsonschemaSchema getConnectionTypeSchema(String id, RequestOptions requestOptions) {
77+
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
78+
.newBuilder()
79+
.addPathSegments("api/connection_types")
80+
.addPathSegment(id)
81+
.build();
82+
Request okhttpRequest = new Request.Builder()
83+
.url(httpUrl)
84+
.method("GET", null)
85+
.headers(Headers.of(clientOptions.headers(requestOptions)))
86+
.addHeader("Content-Type", "application/json")
87+
.build();
88+
try {
89+
OkHttpClient client = clientOptions.httpClient();
90+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
91+
client = clientOptions.httpClientWithTimeout(requestOptions);
92+
}
93+
Response response = client.newCall(okhttpRequest).execute();
94+
ResponseBody responseBody = response.body();
95+
if (response.isSuccessful()) {
96+
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JsonschemaSchema.class);
97+
}
98+
throw new ApiError(
99+
response.code(),
100+
ObjectMappers.JSON_MAPPER.readValue(
101+
responseBody != null ? responseBody.string() : "{}", Object.class));
102+
} catch (IOException e) {
103+
throw new RuntimeException(e);
104+
}
105+
}
106+
71107
public ConnectionListResponseEnvelope list() {
72108
return list(null);
73109
}

src/main/java/com/polytomic/api/resources/organization/OrganizationClient.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public OrganizationClient(ClientOptions clientOptions) {
3131
/**
3232
* <blockquote>
3333
* 🚧 Requires partner key
34-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
34+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
3535
* </blockquote>
3636
*/
3737
public OrganizationsEnvelope list() {
@@ -41,7 +41,7 @@ public OrganizationsEnvelope list() {
4141
/**
4242
* <blockquote>
4343
* 🚧 Requires partner key
44-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
44+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
4545
* </blockquote>
4646
*/
4747
public OrganizationsEnvelope list(RequestOptions requestOptions) {
@@ -77,7 +77,7 @@ public OrganizationsEnvelope list(RequestOptions requestOptions) {
7777
/**
7878
* <blockquote>
7979
* 🚧 Requires partner key
80-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
80+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
8181
* </blockquote>
8282
*/
8383
public OrganizationEnvelope create(CreateOrganizationRequestSchema request) {
@@ -87,7 +87,7 @@ public OrganizationEnvelope create(CreateOrganizationRequestSchema request) {
8787
/**
8888
* <blockquote>
8989
* 🚧 Requires partner key
90-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
90+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
9191
* </blockquote>
9292
*/
9393
public OrganizationEnvelope create(CreateOrganizationRequestSchema request, RequestOptions requestOptions) {
@@ -130,7 +130,7 @@ public OrganizationEnvelope create(CreateOrganizationRequestSchema request, Requ
130130
/**
131131
* <blockquote>
132132
* 🚧 Requires partner key
133-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
133+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
134134
* </blockquote>
135135
*/
136136
public OrganizationEnvelope get(String id) {
@@ -140,7 +140,7 @@ public OrganizationEnvelope get(String id) {
140140
/**
141141
* <blockquote>
142142
* 🚧 Requires partner key
143-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
143+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
144144
* </blockquote>
145145
*/
146146
public OrganizationEnvelope get(String id, RequestOptions requestOptions) {
@@ -177,7 +177,7 @@ public OrganizationEnvelope get(String id, RequestOptions requestOptions) {
177177
/**
178178
* <blockquote>
179179
* 🚧 Requires partner key
180-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
180+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
181181
* </blockquote>
182182
*/
183183
public OrganizationEnvelope update(String id, UpdateOrganizationRequestSchema request) {
@@ -187,7 +187,7 @@ public OrganizationEnvelope update(String id, UpdateOrganizationRequestSchema re
187187
/**
188188
* <blockquote>
189189
* 🚧 Requires partner key
190-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
190+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
191191
* </blockquote>
192192
*/
193193
public OrganizationEnvelope update(
@@ -232,7 +232,7 @@ public OrganizationEnvelope update(
232232
/**
233233
* <blockquote>
234234
* 🚧 Requires partner key
235-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
235+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
236236
* </blockquote>
237237
*/
238238
public void remove(String id) {
@@ -242,7 +242,7 @@ public void remove(String id) {
242242
/**
243243
* <blockquote>
244244
* 🚧 Requires partner key
245-
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys">partner keys</a></p>
245+
* <p>Organization endpoints are only accessible using <a href="https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys">partner keys</a>.</p>
246246
* </blockquote>
247247
*/
248248
public void remove(String id, RequestOptions requestOptions) {

0 commit comments

Comments
 (0)