Skip to content

Commit

Permalink
Release 0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jul 16, 2024
1 parent 575d7b6 commit 4f0d760
Show file tree
Hide file tree
Showing 38 changed files with 1,367 additions and 66 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.flatfile'
artifactId = 'flatfile-java'
version = '0.0.12'
version = '0.0.13'
from components.java
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/flatfile/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private ClientOptions(
"X-Fern-SDK-Name",
"com.flatfile.fern:api-sdk",
"X-Fern-SDK-Version",
"0.0.12",
"0.0.13",
"X-Fern-Language",
"JAVA"));
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public AgentResponse create(CreateAgentsRequest request, RequestOptions requestO
}
}

public AgentResponse get(AgentId agentId) {
return get(agentId, GetAgentRequest.builder().build());
}

public AgentResponse get(AgentId agentId, GetAgentRequest request) {
return get(agentId, request, null);
}
Expand All @@ -117,7 +121,10 @@ public AgentResponse get(AgentId agentId, GetAgentRequest request, RequestOption
.newBuilder()
.addPathSegments("agents")
.addPathSegment(agentId.toString());
httpUrl.addQueryParameter("environmentId", request.getEnvironmentId().toString());
if (request.getEnvironmentId().isPresent()) {
httpUrl.addQueryParameter(
"environmentId", request.getEnvironmentId().get().toString());
}
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,29 @@
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.flatfile.api.core.ObjectMappers;
import com.flatfile.api.resources.commons.types.EnvironmentId;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonDeserialize(builder = GetAgentRequest.Builder.class)
public final class GetAgentRequest {
private final EnvironmentId environmentId;
private final Optional<EnvironmentId> environmentId;

private final Map<String, Object> additionalProperties;

private GetAgentRequest(EnvironmentId environmentId, Map<String, Object> additionalProperties) {
private GetAgentRequest(Optional<EnvironmentId> environmentId, Map<String, Object> additionalProperties) {
this.environmentId = environmentId;
this.additionalProperties = additionalProperties;
}

@JsonProperty("environmentId")
public EnvironmentId getEnvironmentId() {
public Optional<EnvironmentId> getEnvironmentId() {
return environmentId;
}

Expand Down Expand Up @@ -58,43 +60,35 @@ public String toString() {
return ObjectMappers.stringify(this);
}

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

public interface EnvironmentIdStage {
_FinalStage environmentId(EnvironmentId environmentId);

Builder from(GetAgentRequest other);
}

public interface _FinalStage {
GetAgentRequest build();
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements EnvironmentIdStage, _FinalStage {
private EnvironmentId environmentId;
public static final class Builder {
private Optional<EnvironmentId> environmentId = Optional.empty();

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

private Builder() {}

@java.lang.Override
public Builder from(GetAgentRequest other) {
environmentId(other.getEnvironmentId());
return this;
}

@java.lang.Override
@JsonSetter("environmentId")
public _FinalStage environmentId(EnvironmentId environmentId) {
@JsonSetter(value = "environmentId", nulls = Nulls.SKIP)
public Builder environmentId(Optional<EnvironmentId> environmentId) {
this.environmentId = environmentId;
return this;
}

@java.lang.Override
public Builder environmentId(EnvironmentId environmentId) {
this.environmentId = Optional.of(environmentId);
return this;
}

public GetAgentRequest build() {
return new GetAgentRequest(environmentId, additionalProperties);
}
Expand Down
131 changes: 125 additions & 6 deletions src/main/java/com/flatfile/api/resources/agents/types/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.flatfile.api.core.ObjectMappers;
import com.flatfile.api.resources.commons.types.AccountId;
import com.flatfile.api.resources.commons.types.AgentId;
import com.flatfile.api.resources.commons.types.EnvironmentId;
import com.flatfile.api.resources.events.types.EventTopic;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -33,6 +36,14 @@ public final class Agent implements IAgentConfig {

private final AgentId id;

private final OffsetDateTime createdAt;

private final OffsetDateTime updatedAt;

private final AccountId accountId;

private final EnvironmentId environmentId;

private final Map<String, Object> additionalProperties;

private Agent(
Expand All @@ -41,12 +52,20 @@ private Agent(
Optional<String> source,
Optional<String> slug,
AgentId id,
OffsetDateTime createdAt,
OffsetDateTime updatedAt,
AccountId accountId,
EnvironmentId environmentId,
Map<String, Object> additionalProperties) {
this.topics = topics;
this.compiler = compiler;
this.source = source;
this.slug = slug;
this.id = id;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
this.accountId = accountId;
this.environmentId = environmentId;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -91,6 +110,26 @@ public AgentId getId() {
return id;
}

@JsonProperty("createdAt")
public OffsetDateTime getCreatedAt() {
return createdAt;
}

@JsonProperty("updatedAt")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}

@JsonProperty("accountId")
public AccountId getAccountId() {
return accountId;
}

@JsonProperty("environmentId")
public EnvironmentId getEnvironmentId() {
return environmentId;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -107,12 +146,25 @@ private boolean equalTo(Agent other) {
&& compiler.equals(other.compiler)
&& source.equals(other.source)
&& slug.equals(other.slug)
&& id.equals(other.id);
&& id.equals(other.id)
&& createdAt.equals(other.createdAt)
&& updatedAt.equals(other.updatedAt)
&& accountId.equals(other.accountId)
&& environmentId.equals(other.environmentId);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.topics, this.compiler, this.source, this.slug, this.id);
return Objects.hash(
this.topics,
this.compiler,
this.source,
this.slug,
this.id,
this.createdAt,
this.updatedAt,
this.accountId,
this.environmentId);
}

@java.lang.Override
Expand All @@ -125,11 +177,27 @@ public static IdStage builder() {
}

public interface IdStage {
_FinalStage id(AgentId id);
CreatedAtStage id(AgentId id);

Builder from(Agent other);
}

public interface CreatedAtStage {
UpdatedAtStage createdAt(OffsetDateTime createdAt);
}

public interface UpdatedAtStage {
AccountIdStage updatedAt(OffsetDateTime updatedAt);
}

public interface AccountIdStage {
EnvironmentIdStage accountId(AccountId accountId);
}

public interface EnvironmentIdStage {
_FinalStage environmentId(EnvironmentId environmentId);
}

public interface _FinalStage {
Agent build();

Expand All @@ -151,9 +219,18 @@ public interface _FinalStage {
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements IdStage, _FinalStage {
public static final class Builder
implements IdStage, CreatedAtStage, UpdatedAtStage, AccountIdStage, EnvironmentIdStage, _FinalStage {
private AgentId id;

private OffsetDateTime createdAt;

private OffsetDateTime updatedAt;

private AccountId accountId;

private EnvironmentId environmentId;

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

private Optional<String> source = Optional.empty();
Expand All @@ -174,16 +251,48 @@ public Builder from(Agent other) {
source(other.getSource());
slug(other.getSlug());
id(other.getId());
createdAt(other.getCreatedAt());
updatedAt(other.getUpdatedAt());
accountId(other.getAccountId());
environmentId(other.getEnvironmentId());
return this;
}

@java.lang.Override
@JsonSetter("id")
public _FinalStage id(AgentId id) {
public CreatedAtStage id(AgentId id) {
this.id = id;
return this;
}

@java.lang.Override
@JsonSetter("createdAt")
public UpdatedAtStage createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}

@java.lang.Override
@JsonSetter("updatedAt")
public AccountIdStage updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}

@java.lang.Override
@JsonSetter("accountId")
public EnvironmentIdStage accountId(AccountId accountId) {
this.accountId = accountId;
return this;
}

@java.lang.Override
@JsonSetter("environmentId")
public _FinalStage environmentId(EnvironmentId environmentId) {
this.environmentId = environmentId;
return this;
}

/**
* <p>The slug of the agent</p>
* @return Reference to {@code this} so that method calls can be chained together.
Expand Down Expand Up @@ -254,7 +363,17 @@ public _FinalStage topics(Optional<List<EventTopic>> topics) {

@java.lang.Override
public Agent build() {
return new Agent(topics, compiler, source, slug, id, additionalProperties);
return new Agent(
topics,
compiler,
source,
slug,
id,
createdAt,
updatedAt,
accountId,
environmentId,
additionalProperties);
}
}
}
Loading

0 comments on commit 4f0d760

Please sign in to comment.