Skip to content

Commit

Permalink
Release 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
polytomic-sdk-bot committed Jul 2, 2024
1 parent 7450264 commit 3136409
Show file tree
Hide file tree
Showing 10 changed files with 843 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.polytomic'
artifactId = 'polytomic-java'
version = '1.6.3'
version = '1.7.0'
from components.java
pom {
licenses {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/polytomic/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private ClientOptions(
{
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.polytomic.fern:api-sdk");
put("X-Fern-SDK-Version", "1.6.3");
put("X-Fern-SDK-Version", "1.7.0");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import com.polytomic.api.core.ClientOptions;
import com.polytomic.api.core.ObjectMappers;
import com.polytomic.api.core.RequestOptions;
import com.polytomic.api.resources.bulksync.executions.requests.ExecutionsListStatusRequest;
import com.polytomic.api.types.BulkSyncExecutionEnvelope;
import com.polytomic.api.types.ListBulkSyncExecutionStatusEnvelope;
import com.polytomic.api.types.ListBulkSyncExecutionsEnvelope;
import java.io.IOException;
import okhttp3.Headers;
Expand All @@ -24,6 +26,54 @@ public ExecutionsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}

public ListBulkSyncExecutionStatusEnvelope listStatus() {
return listStatus(ExecutionsListStatusRequest.builder().build());
}

public ListBulkSyncExecutionStatusEnvelope listStatus(ExecutionsListStatusRequest request) {
return listStatus(request, null);
}

public ListBulkSyncExecutionStatusEnvelope listStatus(
ExecutionsListStatusRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("api/bulk/syncs/status");
if (request.getAll().isPresent()) {
httpUrl.addQueryParameter("all", request.getAll().get().toString());
}
if (request.getActive().isPresent()) {
httpUrl.addQueryParameter("active", request.getActive().get().toString());
}
if (request.getSyncId().isPresent()) {
httpUrl.addQueryParameter("sync_id", request.getSyncId().get());
}
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
Request okhttpRequest = _requestBuilder.build();
try {
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
Response response = client.newCall(okhttpRequest).execute();
ResponseBody responseBody = response.body();
if (response.isSuccessful()) {
return ObjectMappers.JSON_MAPPER.readValue(
responseBody.string(), ListBulkSyncExecutionStatusEnvelope.class);
}
throw new ApiError(
response.code(),
ObjectMappers.JSON_MAPPER.readValue(
responseBody != null ? responseBody.string() : "{}", Object.class));
} catch (IOException e) {
throw new RuntimeException(e);
}
}

public ListBulkSyncExecutionsEnvelope list(String id) {
return list(id, null);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.polytomic.api.resources.bulksync.executions.requests;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.polytomic.api.core.ObjectMappers;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonDeserialize(builder = ExecutionsListStatusRequest.Builder.class)
public final class ExecutionsListStatusRequest {
private final Optional<Boolean> all;

private final Optional<Boolean> active;

private final Optional<String> syncId;

private final Map<String, Object> additionalProperties;

private ExecutionsListStatusRequest(
Optional<Boolean> all,
Optional<Boolean> active,
Optional<String> syncId,
Map<String, Object> additionalProperties) {
this.all = all;
this.active = active;
this.syncId = syncId;
this.additionalProperties = additionalProperties;
}

/**
* @return Return the execution status of all syncs in the organization
*/
@JsonProperty("all")
public Optional<Boolean> getAll() {
return all;
}

/**
* @return Return the execution status of all active syncs in the organization
*/
@JsonProperty("active")
public Optional<Boolean> getActive() {
return active;
}

/**
* @return Return the execution status of the specified sync; this may be supplied multiple times.
*/
@JsonProperty("sync_id")
public Optional<String> getSyncId() {
return syncId;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof ExecutionsListStatusRequest && equalTo((ExecutionsListStatusRequest) other);
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

private boolean equalTo(ExecutionsListStatusRequest other) {
return all.equals(other.all) && active.equals(other.active) && syncId.equals(other.syncId);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.all, this.active, this.syncId);
}

@java.lang.Override
public String toString() {
return ObjectMappers.stringify(this);
}

public static Builder builder() {
return new Builder();
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
private Optional<Boolean> all = Optional.empty();

private Optional<Boolean> active = Optional.empty();

private Optional<String> syncId = Optional.empty();

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

private Builder() {}

public Builder from(ExecutionsListStatusRequest other) {
all(other.getAll());
active(other.getActive());
syncId(other.getSyncId());
return this;
}

@JsonSetter(value = "all", nulls = Nulls.SKIP)
public Builder all(Optional<Boolean> all) {
this.all = all;
return this;
}

public Builder all(Boolean all) {
this.all = Optional.of(all);
return this;
}

@JsonSetter(value = "active", nulls = Nulls.SKIP)
public Builder active(Optional<Boolean> active) {
this.active = active;
return this;
}

public Builder active(Boolean active) {
this.active = Optional.of(active);
return this;
}

@JsonSetter(value = "sync_id", nulls = Nulls.SKIP)
public Builder syncId(Optional<String> syncId) {
this.syncId = syncId;
return this;
}

public Builder syncId(String syncId) {
this.syncId = Optional.of(syncId);
return this;
}

public ExecutionsListStatusRequest build() {
return new ExecutionsListStatusRequest(all, active, syncId, additionalProperties);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public Optional<Enrichment> getEnricher() {
return enricher;
}

/**
* @return Fields to sync from source to target.
*/
@JsonProperty("fields")
public List<ModelSyncField> getFields() {
return fields;
Expand Down Expand Up @@ -142,15 +145,15 @@ public Optional<String> getOrganizationId() {
}

/**
* @return Values to set as sync target fields.
* @return Values to set in the target unconditionally.
*/
@JsonProperty("override_fields")
public Optional<List<ModelSyncField>> getOverrideFields() {
return overrideFields;
}

/**
* @return Conditional value replacement for field mappings.
* @return Conditional value replacement for fields.
*/
@JsonProperty("overrides")
public Optional<List<Override>> getOverrides() {
Expand Down Expand Up @@ -415,7 +418,7 @@ public _FinalStage policies(Optional<List<String>> policies) {
}

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

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

/**
* <p>Fields to sync from source to target.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage addAllFields(List<ModelSyncField> fields) {
this.fields.addAll(fields);
return this;
}

/**
* <p>Fields to sync from source to target.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage addFields(ModelSyncField fields) {
this.fields.add(fields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public Optional<Enrichment> getEnricher() {
return enricher;
}

/**
* @return Fields to sync from source to target.
*/
@JsonProperty("fields")
public List<ModelSyncField> getFields() {
return fields;
Expand Down Expand Up @@ -142,15 +145,15 @@ public Optional<String> getOrganizationId() {
}

/**
* @return Values to set as sync target fields.
* @return Values to set in the target unconditionally.
*/
@JsonProperty("override_fields")
public Optional<List<ModelSyncField>> getOverrideFields() {
return overrideFields;
}

/**
* @return Conditional value replacement for field mappings.
* @return Conditional value replacement for fields.
*/
@JsonProperty("overrides")
public Optional<List<Override>> getOverrides() {
Expand Down Expand Up @@ -415,7 +418,7 @@ public _FinalStage policies(Optional<List<String>> policies) {
}

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

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

/**
* <p>Fields to sync from source to target.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage addAllFields(List<ModelSyncField> fields) {
this.fields.addAll(fields);
return this;
}

/**
* <p>Fields to sync from source to target.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage addFields(ModelSyncField fields) {
this.fields.add(fields);
Expand Down
Loading

0 comments on commit 3136409

Please sign in to comment.