Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
* <p>Request for `CreateEnvironment`.
*/
public class CreateEnvironmentRequest {
/**
* Optional. The source environment to copy/fork from.
* Format: `environments/{environment_id}` or `{environment_id}`.
* When specified, `sources` and `env` must be empty.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("from_environment")
private String fromEnvironment;

/**
* Network configuration for the environment.
*/
Expand All @@ -53,14 +62,25 @@ public class CreateEnvironmentRequest {

@JsonCreator
public CreateEnvironmentRequest(
@JsonProperty("from_environment") @Nullable String fromEnvironment,
@JsonProperty("network") @Nullable CreateEnvironmentRequestNetworkUnion network,
@JsonProperty("sources") @Nullable List<Source> sources) {
this.fromEnvironment = fromEnvironment;
this.network = network;
this.sources = sources;
}

public CreateEnvironmentRequest() {
this(null, null);
this(null, null, null);
}

/**
* Optional. The source environment to copy/fork from.
* Format: `environments/{environment_id}` or `{environment_id}`.
* When specified, `sources` and `env` must be empty.
*/
public Optional<String> fromEnvironment() {
return Optional.ofNullable(this.fromEnvironment);
}

/**
Expand All @@ -82,6 +102,17 @@ public static Builder builder() {
}


/**
* Optional. The source environment to copy/fork from.
* Format: `environments/{environment_id}` or `{environment_id}`.
* When specified, `sources` and `env` must be empty.
*/
public CreateEnvironmentRequest withFromEnvironment(@Nullable String fromEnvironment) {
this.fromEnvironment = fromEnvironment;
return this;
}


/**
* Network configuration for the environment.
*/
Expand Down Expand Up @@ -110,26 +141,30 @@ public boolean equals(java.lang.Object o) {
}
CreateEnvironmentRequest other = (CreateEnvironmentRequest) o;
return
Utils.enhancedDeepEquals(this.fromEnvironment, other.fromEnvironment) &&
Utils.enhancedDeepEquals(this.network, other.network) &&
Utils.enhancedDeepEquals(this.sources, other.sources);
}

@Override
public int hashCode() {
return Utils.enhancedHash(
network, sources);
fromEnvironment, network, sources);
}

@Override
public String toString() {
return Utils.toString(CreateEnvironmentRequest.class,
"fromEnvironment", fromEnvironment,
"network", network,
"sources", sources);
}

@SuppressWarnings("UnusedReturnValue")
public final static class Builder {

private String fromEnvironment;

private CreateEnvironmentRequestNetworkUnion network;

private List<Source> sources;
Expand All @@ -138,6 +173,16 @@ private Builder() {
// force use of static builder() method
}

/**
* Optional. The source environment to copy/fork from.
* Format: `environments/{environment_id}` or `{environment_id}`.
* When specified, `sources` and `env` must be empty.
*/
public Builder fromEnvironment(@Nullable String fromEnvironment) {
this.fromEnvironment = fromEnvironment;
return this;
}

/**
* Network configuration for the environment.
*/
Expand All @@ -156,7 +201,7 @@ public Builder sources(@Nullable List<Source> sources) {

public CreateEnvironmentRequest build() {
return new CreateEnvironmentRequest(
network, sources);
fromEnvironment, network, sources);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@


public class FunctionResultDelta implements StepDeltaData {
/**
* Required. ID to match the ID from the function call block.
*/
@JsonProperty("call_id")
private String callId;


@JsonInclude(Include.NON_ABSENT)
@JsonProperty("is_error")
Expand All @@ -61,12 +55,9 @@ public class FunctionResultDelta implements StepDeltaData {

@JsonCreator
public FunctionResultDelta(
@JsonProperty("call_id") @Nonnull String callId,
@JsonProperty("is_error") @Nullable Boolean isError,
@JsonProperty("name") @Nullable String name,
@JsonProperty("result") @Nonnull FunctionResultDeltaResultUnion result) {
this.callId = Optional.ofNullable(callId)
.orElseThrow(() -> new IllegalArgumentException("callId cannot be null"));
this.isError = isError;
this.name = name;
this.result = Optional.ofNullable(result)
Expand All @@ -75,17 +66,8 @@ public FunctionResultDelta(
}

public FunctionResultDelta(
@Nonnull String callId,
@Nonnull FunctionResultDeltaResultUnion result) {
this(callId, null, null,
result);
}

/**
* Required. ID to match the ID from the function call block.
*/
public Optional<String> callId() {
return Optional.ofNullable(this.callId);
this(null, null, result);
}

public Optional<Boolean> isError() {
Expand All @@ -110,15 +92,6 @@ public static Builder builder() {
}


/**
* Required. ID to match the ID from the function call block.
*/
public FunctionResultDelta withCallId(@Nonnull String callId) {
this.callId = Utils.checkNotNull(callId, "callId");
return this;
}


public FunctionResultDelta withIsError(@Nullable Boolean isError) {
this.isError = isError;
return this;
Expand Down Expand Up @@ -147,7 +120,6 @@ public boolean equals(java.lang.Object o) {
}
FunctionResultDelta other = (FunctionResultDelta) o;
return
Utils.enhancedDeepEquals(this.callId, other.callId) &&
Utils.enhancedDeepEquals(this.isError, other.isError) &&
Utils.enhancedDeepEquals(this.name, other.name) &&
Utils.enhancedDeepEquals(this.result, other.result) &&
Expand All @@ -157,14 +129,13 @@ public boolean equals(java.lang.Object o) {
@Override
public int hashCode() {
return Utils.enhancedHash(
callId, isError, name,
result, type);
isError, name, result,
type);
}

@Override
public String toString() {
return Utils.toString(FunctionResultDelta.class,
"callId", callId,
"isError", isError,
"name", name,
"result", result,
Expand All @@ -174,8 +145,6 @@ public String toString() {
@SuppressWarnings("UnusedReturnValue")
public final static class Builder {

private String callId;

private Boolean isError;

private String name;
Expand All @@ -186,14 +155,6 @@ private Builder() {
// force use of static builder() method
}

/**
* Required. ID to match the ID from the function call block.
*/
public Builder callId(@Nonnull String callId) {
this.callId = Utils.checkNotNull(callId, "callId");
return this;
}

public Builder isError(@Nullable Boolean isError) {
this.isError = isError;
return this;
Expand All @@ -211,8 +172,7 @@ public Builder result(@Nonnull FunctionResultDeltaResultUnion result) {

public FunctionResultDelta build() {
return new FunctionResultDelta(
callId, isError, name,
result);
isError, name, result);
}


Expand Down
32 changes: 16 additions & 16 deletions src/main/java/com/google/genai/gaos/models/triggers/Trigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public class Trigger {
private OffsetDateTime lastRunTime;

/**
* Optional. The maximum number of consecutive failures allowed before
* the trigger is automatically paused (status becomes ERROR).
* Optional. The maximum number of consecutive failures allowed before the
* trigger is automatically paused (status becomes ERROR).
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("max_consecutive_failures")
Expand All @@ -133,8 +133,8 @@ public class Trigger {
private String previousInteractionId;

/**
* Required. The cron schedule on which the trigger should run.
* Standard cron format.
* Required. The cron schedule on which the trigger should run. Standard cron
* format.
*/
@JsonProperty("schedule")
private String schedule;
Expand Down Expand Up @@ -288,8 +288,8 @@ public Optional<OffsetDateTime> lastRunTime() {
}

/**
* Optional. The maximum number of consecutive failures allowed before
* the trigger is automatically paused (status becomes ERROR).
* Optional. The maximum number of consecutive failures allowed before the
* trigger is automatically paused (status becomes ERROR).
*/
public Optional<Integer> maxConsecutiveFailures() {
return Optional.ofNullable(this.maxConsecutiveFailures);
Expand All @@ -310,8 +310,8 @@ public Optional<String> previousInteractionId() {
}

/**
* Required. The cron schedule on which the trigger should run.
* Standard cron format.
* Required. The cron schedule on which the trigger should run. Standard cron
* format.
*/
public Optional<String> schedule() {
return Optional.ofNullable(this.schedule);
Expand Down Expand Up @@ -437,8 +437,8 @@ public Trigger withLastRunTime(@Nullable OffsetDateTime lastRunTime) {


/**
* Optional. The maximum number of consecutive failures allowed before
* the trigger is automatically paused (status becomes ERROR).
* Optional. The maximum number of consecutive failures allowed before the
* trigger is automatically paused (status becomes ERROR).
*/
public Trigger withMaxConsecutiveFailures(@Nullable Integer maxConsecutiveFailures) {
this.maxConsecutiveFailures = maxConsecutiveFailures;
Expand All @@ -465,8 +465,8 @@ public Trigger withPreviousInteractionId(@Nullable String previousInteractionId)


/**
* Required. The cron schedule on which the trigger should run.
* Standard cron format.
* Required. The cron schedule on which the trigger should run. Standard cron
* format.
*/
public Trigger withSchedule(@Nonnull String schedule) {
this.schedule = Utils.checkNotNull(schedule, "schedule");
Expand Down Expand Up @@ -688,8 +688,8 @@ public Builder lastRunTime(@Nullable OffsetDateTime lastRunTime) {
}

/**
* Optional. The maximum number of consecutive failures allowed before
* the trigger is automatically paused (status becomes ERROR).
* Optional. The maximum number of consecutive failures allowed before the
* trigger is automatically paused (status becomes ERROR).
*/
public Builder maxConsecutiveFailures(@Nullable Integer maxConsecutiveFailures) {
this.maxConsecutiveFailures = maxConsecutiveFailures;
Expand All @@ -713,8 +713,8 @@ public Builder previousInteractionId(@Nullable String previousInteractionId) {
}

/**
* Required. The cron schedule on which the trigger should run.
* Standard cron format.
* Required. The cron schedule on which the trigger should run. Standard cron
* format.
*/
public Builder schedule(@Nonnull String schedule) {
this.schedule = Utils.checkNotNull(schedule, "schedule");
Expand Down
Loading