Skip to content

Commit 03e5104

Browse files
Release 1.13.0
1 parent d926e32 commit 03e5104

83 files changed

Lines changed: 7247 additions & 393 deletions

File tree

Some content is hidden

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

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) 2025 Polytomic.
3+
Copyright (c) 2026 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.11.2'
49+
version = '1.13.0'
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
@@ -29,12 +29,12 @@ public class Polytomic {
2929

3030
protected final Supplier<QueryRunnerClient> queryRunnerClient;
3131

32+
protected final Supplier<SchemasClient> schemasClient;
33+
3234
protected final Supplier<ModelsClient> modelsClient;
3335

3436
protected final Supplier<ModelSyncClient> modelSyncClient;
3537

36-
protected final Supplier<SchemasClient> schemasClient;
37-
3838
protected final Supplier<EventsClient> eventsClient;
3939

4040
protected final Supplier<JobsClient> jobsClient;
@@ -54,9 +54,9 @@ public Polytomic(ClientOptions clientOptions) {
5454
this.bulkSyncClient = Suppliers.memoize(() -> new BulkSyncClient(clientOptions));
5555
this.connectionsClient = Suppliers.memoize(() -> new ConnectionsClient(clientOptions));
5656
this.queryRunnerClient = Suppliers.memoize(() -> new QueryRunnerClient(clientOptions));
57+
this.schemasClient = Suppliers.memoize(() -> new SchemasClient(clientOptions));
5758
this.modelsClient = Suppliers.memoize(() -> new ModelsClient(clientOptions));
5859
this.modelSyncClient = Suppliers.memoize(() -> new ModelSyncClient(clientOptions));
59-
this.schemasClient = Suppliers.memoize(() -> new SchemasClient(clientOptions));
6060
this.eventsClient = Suppliers.memoize(() -> new EventsClient(clientOptions));
6161
this.jobsClient = Suppliers.memoize(() -> new JobsClient(clientOptions));
6262
this.identityClient = Suppliers.memoize(() -> new IdentityClient(clientOptions));
@@ -78,6 +78,10 @@ public QueryRunnerClient queryRunner() {
7878
return this.queryRunnerClient.get();
7979
}
8080

81+
public SchemasClient schemas() {
82+
return this.schemasClient.get();
83+
}
84+
8185
public ModelsClient models() {
8286
return this.modelsClient.get();
8387
}
@@ -86,10 +90,6 @@ public ModelSyncClient modelSync() {
8690
return this.modelSyncClient.get();
8791
}
8892

89-
public SchemasClient schemas() {
90-
return this.schemasClient.get();
91-
}
92-
9393
public EventsClient events() {
9494
return this.eventsClient.get();
9595
}

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.11.2");
33+
put("X-Fern-SDK-Version", "1.13.0");
3434
}
3535
});
3636
this.headerSuppliers = headerSuppliers;

src/main/java/com/polytomic/api/resources/bulksync/BulkSyncClient.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import com.polytomic.api.resources.bulksync.requests.CreateBulkSyncRequest;
1818
import com.polytomic.api.resources.bulksync.requests.StartBulkSyncRequest;
1919
import com.polytomic.api.resources.bulksync.requests.UpdateBulkSyncRequest;
20+
import com.polytomic.api.resources.bulksync.schedules.SchedulesClient;
2021
import com.polytomic.api.resources.bulksync.schemas.SchemasClient;
2122
import com.polytomic.api.types.ActivateSyncEnvelope;
2223
import com.polytomic.api.types.ActivateSyncInput;
@@ -43,10 +44,13 @@ public class BulkSyncClient {
4344

4445
protected final Supplier<SchemasClient> schemasClient;
4546

47+
protected final Supplier<SchedulesClient> schedulesClient;
48+
4649
public BulkSyncClient(ClientOptions clientOptions) {
4750
this.clientOptions = clientOptions;
4851
this.executionsClient = Suppliers.memoize(() -> new ExecutionsClient(clientOptions));
4952
this.schemasClient = Suppliers.memoize(() -> new SchemasClient(clientOptions));
53+
this.schedulesClient = Suppliers.memoize(() -> new SchedulesClient(clientOptions));
5054
}
5155

5256
public BulkSyncListEnvelope list() {
@@ -89,10 +93,54 @@ public BulkSyncListEnvelope list(BulkSyncListRequest request, RequestOptions req
8993
}
9094
}
9195

96+
/**
97+
* Create a new Bulk Sync from a source to a destination (data warehouse, database, or cloud storage bucket like S3).
98+
* <p>Bulk Syncs are used for the ELT pattern (Extract, Load, and Transform), where you want to sync un-transformed data to your data warehouses, databases, or cloud storage buckets like S3.</p>
99+
* <p>All of the functionality described in <a href="https://docs.polytomic.com/docs/bulk-syncs">the product
100+
* documentation</a> is configurable via
101+
* the API.</p>
102+
* <p>Sample code examples:</p>
103+
* <ul>
104+
* <li><a href="https://apidocs.polytomic.com/guides/code-examples/bulk-sync-elt-from-salesforce-to-s-3">Bulk sync (ELT) from Salesforce to S3</a></li>
105+
* <li><a href="https://apidocs.polytomic.com/guides/code-examples/bulk-sync-elt-from-salesforce-to-snowflake">Bulk sync (ELT) from Salesforce to Snowflake</a></li>
106+
* <li><a href="https://apidocs.polytomic.com/guides/code-examples/bulk-sync-elt-from-hub-spot-to-postgre-sql">Bulk sync (ELT) from HubSpot to PostgreSQL</a></li>
107+
* </ul>
108+
* <h2>Connection specific configuration</h2>
109+
* <p>The <code>destination_configuration</code> is integration-specific configuration for the
110+
* selected bulk sync destination. This includes settings such as the output schema
111+
* and is required when creating a new sync.</p>
112+
* <p>The <code>source_configuration</code> is optional. It allows configuration for how
113+
* Polytomic reads data from the source connection. This will not be available for
114+
* integrations that do not support additional configuration.</p>
115+
* <p>Consult the <a href="https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/overview">connection configurations</a>
116+
* to see configurations for particular integrations (for example, <a href="https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/connections/postgre-sql#source-1">here</a> is the available source configuration for the PostgreSQL bulk sync source).</p>
117+
*/
92118
public BulkSyncResponseEnvelope create(CreateBulkSyncRequest request) {
93119
return create(request, null);
94120
}
95121

122+
/**
123+
* Create a new Bulk Sync from a source to a destination (data warehouse, database, or cloud storage bucket like S3).
124+
* <p>Bulk Syncs are used for the ELT pattern (Extract, Load, and Transform), where you want to sync un-transformed data to your data warehouses, databases, or cloud storage buckets like S3.</p>
125+
* <p>All of the functionality described in <a href="https://docs.polytomic.com/docs/bulk-syncs">the product
126+
* documentation</a> is configurable via
127+
* the API.</p>
128+
* <p>Sample code examples:</p>
129+
* <ul>
130+
* <li><a href="https://apidocs.polytomic.com/guides/code-examples/bulk-sync-elt-from-salesforce-to-s-3">Bulk sync (ELT) from Salesforce to S3</a></li>
131+
* <li><a href="https://apidocs.polytomic.com/guides/code-examples/bulk-sync-elt-from-salesforce-to-snowflake">Bulk sync (ELT) from Salesforce to Snowflake</a></li>
132+
* <li><a href="https://apidocs.polytomic.com/guides/code-examples/bulk-sync-elt-from-hub-spot-to-postgre-sql">Bulk sync (ELT) from HubSpot to PostgreSQL</a></li>
133+
* </ul>
134+
* <h2>Connection specific configuration</h2>
135+
* <p>The <code>destination_configuration</code> is integration-specific configuration for the
136+
* selected bulk sync destination. This includes settings such as the output schema
137+
* and is required when creating a new sync.</p>
138+
* <p>The <code>source_configuration</code> is optional. It allows configuration for how
139+
* Polytomic reads data from the source connection. This will not be available for
140+
* integrations that do not support additional configuration.</p>
141+
* <p>Consult the <a href="https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/overview">connection configurations</a>
142+
* to see configurations for particular integrations (for example, <a href="https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/connections/postgre-sql#source-1">here</a> is the available source configuration for the PostgreSQL bulk sync source).</p>
143+
*/
96144
public BulkSyncResponseEnvelope create(CreateBulkSyncRequest request, RequestOptions requestOptions) {
97145
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
98146
.newBuilder()
@@ -480,4 +528,8 @@ public ExecutionsClient executions() {
480528
public SchemasClient schemas() {
481529
return this.schemasClient.get();
482530
}
531+
532+
public SchedulesClient schedules() {
533+
return this.schedulesClient.get();
534+
}
483535
}

src/main/java/com/polytomic/api/resources/bulksync/executions/ExecutionsClient.java

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.polytomic.api.core.ObjectMappers;
99
import com.polytomic.api.core.RequestOptions;
1010
import com.polytomic.api.resources.bulksync.executions.requests.ExecutionsExportLogsRequest;
11+
import com.polytomic.api.resources.bulksync.executions.requests.ExecutionsListRequest;
1112
import com.polytomic.api.resources.bulksync.executions.requests.ExecutionsListStatusRequest;
1213
import com.polytomic.api.types.BulkSyncExecutionEnvelope;
1314
import com.polytomic.api.types.ListBulkSyncExecutionStatusEnvelope;
@@ -79,22 +80,39 @@ public ListBulkSyncExecutionStatusEnvelope listStatus(
7980
}
8081

8182
public ListBulkSyncExecutionsEnvelope list(String id) {
82-
return list(id, null);
83+
return list(id, ExecutionsListRequest.builder().build());
8384
}
8485

85-
public ListBulkSyncExecutionsEnvelope list(String id, RequestOptions requestOptions) {
86-
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
86+
public ListBulkSyncExecutionsEnvelope list(String id, ExecutionsListRequest request) {
87+
return list(id, request, null);
88+
}
89+
90+
public ListBulkSyncExecutionsEnvelope list(
91+
String id, ExecutionsListRequest request, RequestOptions requestOptions) {
92+
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
8793
.newBuilder()
8894
.addPathSegments("api/bulk/syncs")
8995
.addPathSegment(id)
90-
.addPathSegments("executions")
91-
.build();
92-
Request okhttpRequest = new Request.Builder()
93-
.url(httpUrl)
96+
.addPathSegments("executions");
97+
if (request.getPageToken().isPresent()) {
98+
httpUrl.addQueryParameter("page_token", request.getPageToken().get());
99+
}
100+
if (request.getOnlyTerminal().isPresent()) {
101+
httpUrl.addQueryParameter(
102+
"only_terminal", request.getOnlyTerminal().get().toString());
103+
}
104+
if (request.getAscending().isPresent()) {
105+
httpUrl.addQueryParameter("ascending", request.getAscending().get().toString());
106+
}
107+
if (request.getLimit().isPresent()) {
108+
httpUrl.addQueryParameter("limit", request.getLimit().get().toString());
109+
}
110+
Request.Builder _requestBuilder = new Request.Builder()
111+
.url(httpUrl.build())
94112
.method("GET", null)
95113
.headers(Headers.of(clientOptions.headers(requestOptions)))
96-
.addHeader("Content-Type", "application/json")
97-
.build();
114+
.addHeader("Content-Type", "application/json");
115+
Request okhttpRequest = _requestBuilder.build();
98116
try {
99117
OkHttpClient client = clientOptions.httpClient();
100118
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
package com.polytomic.api.resources.bulksync.executions.requests;
5+
6+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
7+
import com.fasterxml.jackson.annotation.JsonAnySetter;
8+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9+
import com.fasterxml.jackson.annotation.JsonInclude;
10+
import com.fasterxml.jackson.annotation.JsonProperty;
11+
import com.fasterxml.jackson.annotation.JsonSetter;
12+
import com.fasterxml.jackson.annotation.Nulls;
13+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
14+
import com.polytomic.api.core.ObjectMappers;
15+
import java.util.HashMap;
16+
import java.util.Map;
17+
import java.util.Objects;
18+
import java.util.Optional;
19+
20+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
21+
@JsonDeserialize(builder = ExecutionsListRequest.Builder.class)
22+
public final class ExecutionsListRequest {
23+
private final Optional<String> pageToken;
24+
25+
private final Optional<Boolean> onlyTerminal;
26+
27+
private final Optional<Boolean> ascending;
28+
29+
private final Optional<Integer> limit;
30+
31+
private final Map<String, Object> additionalProperties;
32+
33+
private ExecutionsListRequest(
34+
Optional<String> pageToken,
35+
Optional<Boolean> onlyTerminal,
36+
Optional<Boolean> ascending,
37+
Optional<Integer> limit,
38+
Map<String, Object> additionalProperties) {
39+
this.pageToken = pageToken;
40+
this.onlyTerminal = onlyTerminal;
41+
this.ascending = ascending;
42+
this.limit = limit;
43+
this.additionalProperties = additionalProperties;
44+
}
45+
46+
@JsonProperty("page_token")
47+
public Optional<String> getPageToken() {
48+
return pageToken;
49+
}
50+
51+
@JsonProperty("only_terminal")
52+
public Optional<Boolean> getOnlyTerminal() {
53+
return onlyTerminal;
54+
}
55+
56+
@JsonProperty("ascending")
57+
public Optional<Boolean> getAscending() {
58+
return ascending;
59+
}
60+
61+
@JsonProperty("limit")
62+
public Optional<Integer> getLimit() {
63+
return limit;
64+
}
65+
66+
@java.lang.Override
67+
public boolean equals(Object other) {
68+
if (this == other) return true;
69+
return other instanceof ExecutionsListRequest && equalTo((ExecutionsListRequest) other);
70+
}
71+
72+
@JsonAnyGetter
73+
public Map<String, Object> getAdditionalProperties() {
74+
return this.additionalProperties;
75+
}
76+
77+
private boolean equalTo(ExecutionsListRequest other) {
78+
return pageToken.equals(other.pageToken)
79+
&& onlyTerminal.equals(other.onlyTerminal)
80+
&& ascending.equals(other.ascending)
81+
&& limit.equals(other.limit);
82+
}
83+
84+
@java.lang.Override
85+
public int hashCode() {
86+
return Objects.hash(this.pageToken, this.onlyTerminal, this.ascending, this.limit);
87+
}
88+
89+
@java.lang.Override
90+
public String toString() {
91+
return ObjectMappers.stringify(this);
92+
}
93+
94+
public static Builder builder() {
95+
return new Builder();
96+
}
97+
98+
@JsonIgnoreProperties(ignoreUnknown = true)
99+
public static final class Builder {
100+
private Optional<String> pageToken = Optional.empty();
101+
102+
private Optional<Boolean> onlyTerminal = Optional.empty();
103+
104+
private Optional<Boolean> ascending = Optional.empty();
105+
106+
private Optional<Integer> limit = Optional.empty();
107+
108+
@JsonAnySetter
109+
private Map<String, Object> additionalProperties = new HashMap<>();
110+
111+
private Builder() {}
112+
113+
public Builder from(ExecutionsListRequest other) {
114+
pageToken(other.getPageToken());
115+
onlyTerminal(other.getOnlyTerminal());
116+
ascending(other.getAscending());
117+
limit(other.getLimit());
118+
return this;
119+
}
120+
121+
@JsonSetter(value = "page_token", nulls = Nulls.SKIP)
122+
public Builder pageToken(Optional<String> pageToken) {
123+
this.pageToken = pageToken;
124+
return this;
125+
}
126+
127+
public Builder pageToken(String pageToken) {
128+
this.pageToken = Optional.of(pageToken);
129+
return this;
130+
}
131+
132+
@JsonSetter(value = "only_terminal", nulls = Nulls.SKIP)
133+
public Builder onlyTerminal(Optional<Boolean> onlyTerminal) {
134+
this.onlyTerminal = onlyTerminal;
135+
return this;
136+
}
137+
138+
public Builder onlyTerminal(Boolean onlyTerminal) {
139+
this.onlyTerminal = Optional.of(onlyTerminal);
140+
return this;
141+
}
142+
143+
@JsonSetter(value = "ascending", nulls = Nulls.SKIP)
144+
public Builder ascending(Optional<Boolean> ascending) {
145+
this.ascending = ascending;
146+
return this;
147+
}
148+
149+
public Builder ascending(Boolean ascending) {
150+
this.ascending = Optional.of(ascending);
151+
return this;
152+
}
153+
154+
@JsonSetter(value = "limit", nulls = Nulls.SKIP)
155+
public Builder limit(Optional<Integer> limit) {
156+
this.limit = limit;
157+
return this;
158+
}
159+
160+
public Builder limit(Integer limit) {
161+
this.limit = Optional.of(limit);
162+
return this;
163+
}
164+
165+
public ExecutionsListRequest build() {
166+
return new ExecutionsListRequest(pageToken, onlyTerminal, ascending, limit, additionalProperties);
167+
}
168+
}
169+
}

0 commit comments

Comments
 (0)