Skip to content

Commit 3136409

Browse files
Release 1.7.0
1 parent 7450264 commit 3136409

10 files changed

Lines changed: 843 additions & 30 deletions

File tree

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.6.3'
49+
version = '1.7.0'
5050
from components.java
5151
pom {
5252
licenses {

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

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import com.polytomic.api.core.ClientOptions;
88
import com.polytomic.api.core.ObjectMappers;
99
import com.polytomic.api.core.RequestOptions;
10+
import com.polytomic.api.resources.bulksync.executions.requests.ExecutionsListStatusRequest;
1011
import com.polytomic.api.types.BulkSyncExecutionEnvelope;
12+
import com.polytomic.api.types.ListBulkSyncExecutionStatusEnvelope;
1113
import com.polytomic.api.types.ListBulkSyncExecutionsEnvelope;
1214
import java.io.IOException;
1315
import okhttp3.Headers;
@@ -24,6 +26,54 @@ public ExecutionsClient(ClientOptions clientOptions) {
2426
this.clientOptions = clientOptions;
2527
}
2628

29+
public ListBulkSyncExecutionStatusEnvelope listStatus() {
30+
return listStatus(ExecutionsListStatusRequest.builder().build());
31+
}
32+
33+
public ListBulkSyncExecutionStatusEnvelope listStatus(ExecutionsListStatusRequest request) {
34+
return listStatus(request, null);
35+
}
36+
37+
public ListBulkSyncExecutionStatusEnvelope listStatus(
38+
ExecutionsListStatusRequest request, RequestOptions requestOptions) {
39+
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
40+
.newBuilder()
41+
.addPathSegments("api/bulk/syncs/status");
42+
if (request.getAll().isPresent()) {
43+
httpUrl.addQueryParameter("all", request.getAll().get().toString());
44+
}
45+
if (request.getActive().isPresent()) {
46+
httpUrl.addQueryParameter("active", request.getActive().get().toString());
47+
}
48+
if (request.getSyncId().isPresent()) {
49+
httpUrl.addQueryParameter("sync_id", request.getSyncId().get());
50+
}
51+
Request.Builder _requestBuilder = new Request.Builder()
52+
.url(httpUrl.build())
53+
.method("GET", null)
54+
.headers(Headers.of(clientOptions.headers(requestOptions)))
55+
.addHeader("Content-Type", "application/json");
56+
Request okhttpRequest = _requestBuilder.build();
57+
try {
58+
OkHttpClient client = clientOptions.httpClient();
59+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
60+
client = clientOptions.httpClientWithTimeout(requestOptions);
61+
}
62+
Response response = client.newCall(okhttpRequest).execute();
63+
ResponseBody responseBody = response.body();
64+
if (response.isSuccessful()) {
65+
return ObjectMappers.JSON_MAPPER.readValue(
66+
responseBody.string(), ListBulkSyncExecutionStatusEnvelope.class);
67+
}
68+
throw new ApiError(
69+
response.code(),
70+
ObjectMappers.JSON_MAPPER.readValue(
71+
responseBody != null ? responseBody.string() : "{}", Object.class));
72+
} catch (IOException e) {
73+
throw new RuntimeException(e);
74+
}
75+
}
76+
2777
public ListBulkSyncExecutionsEnvelope list(String id) {
2878
return list(id, null);
2979
}
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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 = ExecutionsListStatusRequest.Builder.class)
22+
public final class ExecutionsListStatusRequest {
23+
private final Optional<Boolean> all;
24+
25+
private final Optional<Boolean> active;
26+
27+
private final Optional<String> syncId;
28+
29+
private final Map<String, Object> additionalProperties;
30+
31+
private ExecutionsListStatusRequest(
32+
Optional<Boolean> all,
33+
Optional<Boolean> active,
34+
Optional<String> syncId,
35+
Map<String, Object> additionalProperties) {
36+
this.all = all;
37+
this.active = active;
38+
this.syncId = syncId;
39+
this.additionalProperties = additionalProperties;
40+
}
41+
42+
/**
43+
* @return Return the execution status of all syncs in the organization
44+
*/
45+
@JsonProperty("all")
46+
public Optional<Boolean> getAll() {
47+
return all;
48+
}
49+
50+
/**
51+
* @return Return the execution status of all active syncs in the organization
52+
*/
53+
@JsonProperty("active")
54+
public Optional<Boolean> getActive() {
55+
return active;
56+
}
57+
58+
/**
59+
* @return Return the execution status of the specified sync; this may be supplied multiple times.
60+
*/
61+
@JsonProperty("sync_id")
62+
public Optional<String> getSyncId() {
63+
return syncId;
64+
}
65+
66+
@java.lang.Override
67+
public boolean equals(Object other) {
68+
if (this == other) return true;
69+
return other instanceof ExecutionsListStatusRequest && equalTo((ExecutionsListStatusRequest) other);
70+
}
71+
72+
@JsonAnyGetter
73+
public Map<String, Object> getAdditionalProperties() {
74+
return this.additionalProperties;
75+
}
76+
77+
private boolean equalTo(ExecutionsListStatusRequest other) {
78+
return all.equals(other.all) && active.equals(other.active) && syncId.equals(other.syncId);
79+
}
80+
81+
@java.lang.Override
82+
public int hashCode() {
83+
return Objects.hash(this.all, this.active, this.syncId);
84+
}
85+
86+
@java.lang.Override
87+
public String toString() {
88+
return ObjectMappers.stringify(this);
89+
}
90+
91+
public static Builder builder() {
92+
return new Builder();
93+
}
94+
95+
@JsonIgnoreProperties(ignoreUnknown = true)
96+
public static final class Builder {
97+
private Optional<Boolean> all = Optional.empty();
98+
99+
private Optional<Boolean> active = Optional.empty();
100+
101+
private Optional<String> syncId = Optional.empty();
102+
103+
@JsonAnySetter
104+
private Map<String, Object> additionalProperties = new HashMap<>();
105+
106+
private Builder() {}
107+
108+
public Builder from(ExecutionsListStatusRequest other) {
109+
all(other.getAll());
110+
active(other.getActive());
111+
syncId(other.getSyncId());
112+
return this;
113+
}
114+
115+
@JsonSetter(value = "all", nulls = Nulls.SKIP)
116+
public Builder all(Optional<Boolean> all) {
117+
this.all = all;
118+
return this;
119+
}
120+
121+
public Builder all(Boolean all) {
122+
this.all = Optional.of(all);
123+
return this;
124+
}
125+
126+
@JsonSetter(value = "active", nulls = Nulls.SKIP)
127+
public Builder active(Optional<Boolean> active) {
128+
this.active = active;
129+
return this;
130+
}
131+
132+
public Builder active(Boolean active) {
133+
this.active = Optional.of(active);
134+
return this;
135+
}
136+
137+
@JsonSetter(value = "sync_id", nulls = Nulls.SKIP)
138+
public Builder syncId(Optional<String> syncId) {
139+
this.syncId = syncId;
140+
return this;
141+
}
142+
143+
public Builder syncId(String syncId) {
144+
this.syncId = Optional.of(syncId);
145+
return this;
146+
}
147+
148+
public ExecutionsListStatusRequest build() {
149+
return new ExecutionsListStatusRequest(all, active, syncId, additionalProperties);
150+
}
151+
}
152+
}

src/main/java/com/polytomic/api/resources/modelsync/requests/CreateModelSyncRequest.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public Optional<Enrichment> getEnricher() {
106106
return enricher;
107107
}
108108

109+
/**
110+
* @return Fields to sync from source to target.
111+
*/
109112
@JsonProperty("fields")
110113
public List<ModelSyncField> getFields() {
111114
return fields;
@@ -142,15 +145,15 @@ public Optional<String> getOrganizationId() {
142145
}
143146

144147
/**
145-
* @return Values to set as sync target fields.
148+
* @return Values to set in the target unconditionally.
146149
*/
147150
@JsonProperty("override_fields")
148151
public Optional<List<ModelSyncField>> getOverrideFields() {
149152
return overrideFields;
150153
}
151154

152155
/**
153-
* @return Conditional value replacement for field mappings.
156+
* @return Conditional value replacement for fields.
154157
*/
155158
@JsonProperty("overrides")
156159
public Optional<List<Override>> getOverrides() {
@@ -415,7 +418,7 @@ public _FinalStage policies(Optional<List<String>> policies) {
415418
}
416419

417420
/**
418-
* <p>Conditional value replacement for field mappings.</p>
421+
* <p>Conditional value replacement for fields.</p>
419422
* @return Reference to {@code this} so that method calls can be chained together.
420423
*/
421424
@java.lang.Override
@@ -432,7 +435,7 @@ public _FinalStage overrides(Optional<List<Override>> overrides) {
432435
}
433436

434437
/**
435-
* <p>Values to set as sync target fields.</p>
438+
* <p>Values to set in the target unconditionally.</p>
436439
* @return Reference to {@code this} so that method calls can be chained together.
437440
*/
438441
@java.lang.Override
@@ -500,12 +503,20 @@ public _FinalStage filterLogic(Optional<String> filterLogic) {
500503
return this;
501504
}
502505

506+
/**
507+
* <p>Fields to sync from source to target.</p>
508+
* @return Reference to {@code this} so that method calls can be chained together.
509+
*/
503510
@java.lang.Override
504511
public _FinalStage addAllFields(List<ModelSyncField> fields) {
505512
this.fields.addAll(fields);
506513
return this;
507514
}
508515

516+
/**
517+
* <p>Fields to sync from source to target.</p>
518+
* @return Reference to {@code this} so that method calls can be chained together.
519+
*/
509520
@java.lang.Override
510521
public _FinalStage addFields(ModelSyncField fields) {
511522
this.fields.add(fields);

src/main/java/com/polytomic/api/resources/modelsync/requests/UpdateModelSyncRequest.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public Optional<Enrichment> getEnricher() {
106106
return enricher;
107107
}
108108

109+
/**
110+
* @return Fields to sync from source to target.
111+
*/
109112
@JsonProperty("fields")
110113
public List<ModelSyncField> getFields() {
111114
return fields;
@@ -142,15 +145,15 @@ public Optional<String> getOrganizationId() {
142145
}
143146

144147
/**
145-
* @return Values to set as sync target fields.
148+
* @return Values to set in the target unconditionally.
146149
*/
147150
@JsonProperty("override_fields")
148151
public Optional<List<ModelSyncField>> getOverrideFields() {
149152
return overrideFields;
150153
}
151154

152155
/**
153-
* @return Conditional value replacement for field mappings.
156+
* @return Conditional value replacement for fields.
154157
*/
155158
@JsonProperty("overrides")
156159
public Optional<List<Override>> getOverrides() {
@@ -415,7 +418,7 @@ public _FinalStage policies(Optional<List<String>> policies) {
415418
}
416419

417420
/**
418-
* <p>Conditional value replacement for field mappings.</p>
421+
* <p>Conditional value replacement for fields.</p>
419422
* @return Reference to {@code this} so that method calls can be chained together.
420423
*/
421424
@java.lang.Override
@@ -432,7 +435,7 @@ public _FinalStage overrides(Optional<List<Override>> overrides) {
432435
}
433436

434437
/**
435-
* <p>Values to set as sync target fields.</p>
438+
* <p>Values to set in the target unconditionally.</p>
436439
* @return Reference to {@code this} so that method calls can be chained together.
437440
*/
438441
@java.lang.Override
@@ -500,12 +503,20 @@ public _FinalStage filterLogic(Optional<String> filterLogic) {
500503
return this;
501504
}
502505

506+
/**
507+
* <p>Fields to sync from source to target.</p>
508+
* @return Reference to {@code this} so that method calls can be chained together.
509+
*/
503510
@java.lang.Override
504511
public _FinalStage addAllFields(List<ModelSyncField> fields) {
505512
this.fields.addAll(fields);
506513
return this;
507514
}
508515

516+
/**
517+
* <p>Fields to sync from source to target.</p>
518+
* @return Reference to {@code this} so that method calls can be chained together.
519+
*/
509520
@java.lang.Override
510521
public _FinalStage addFields(ModelSyncField fields) {
511522
this.fields.add(fields);

0 commit comments

Comments
 (0)