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 @@ -96,6 +96,13 @@ ObjectNode createAgentEngineSessionConfigToVertex(JsonNode fromObject, ObjectNod
Common.getValueByPath(fromObject, new String[] {"labels"}));
}

if (Common.getValueByPath(fromObject, new String[] {"sessionId"}) != null) {
Common.setValueByPath(
parentObject,
new String[] {"_query", "sessionId"},
Common.getValueByPath(fromObject, new String[] {"sessionId"}));
}

return toObject;
}

Expand Down Expand Up @@ -259,6 +266,13 @@ ObjectNode updateAgentEngineSessionConfigToVertex(JsonNode fromObject, ObjectNod
Common.getValueByPath(fromObject, new String[] {"labels"}));
}

if (Common.getValueByPath(fromObject, new String[] {"sessionId"}) != null) {
Common.setValueByPath(
parentObject,
new String[] {"_query", "sessionId"},
Common.getValueByPath(fromObject, new String[] {"sessionId"}));
}

if (Common.getValueByPath(fromObject, new String[] {"updateMask"}) != null) {
Common.setValueByPath(
parentObject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public abstract class CreateAgentEngineSessionConfig extends JsonSerializable {
@JsonProperty("labels")
public abstract Optional<Map<String, String>> labels();

/**
* Optional. The user defined ID to use for session, which will become the final component of the
* session resource name. If not provided, Vertex AI will generate a value for this ID. This value
* may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a
* letter, and the last character must be a letter or number.
*/
@JsonProperty("sessionId")
public abstract Optional<String> sessionId();

/** Instantiates a builder for CreateAgentEngineSessionConfig. */
@ExcludeFromGeneratedCoverageReport
public static Builder builder() {
Expand Down Expand Up @@ -226,6 +235,27 @@ public Builder clearLabels() {
return labels(Optional.empty());
}

/**
* Setter for sessionId.
*
* <p>sessionId: Optional. The user defined ID to use for session, which will become the final
* component of the session resource name. If not provided, Vertex AI will generate a value for
* this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The
* first character must be a letter, and the last character must be a letter or number.
*/
@JsonProperty("sessionId")
public abstract Builder sessionId(String sessionId);

@ExcludeFromGeneratedCoverageReport
abstract Builder sessionId(Optional<String> sessionId);

/** Clears the value of sessionId field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearSessionId() {
return sessionId(Optional.empty());
}

public abstract CreateAgentEngineSessionConfig build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public abstract class UpdateAgentEngineSessionConfig extends JsonSerializable {
@JsonProperty("labels")
public abstract Optional<Map<String, String>> labels();

/**
* Optional. The user defined ID to use for session, which will become the final component of the
* session resource name. If not provided, Vertex AI will generate a value for this ID. This value
* may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a
* letter, and the last character must be a letter or number.
*/
@JsonProperty("sessionId")
public abstract Optional<String> sessionId();

/**
* The update mask to apply. For the `FieldMask` definition, see
* https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.
Expand Down Expand Up @@ -237,6 +246,27 @@ public Builder clearLabels() {
return labels(Optional.empty());
}

/**
* Setter for sessionId.
*
* <p>sessionId: Optional. The user defined ID to use for session, which will become the final
* component of the session resource name. If not provided, Vertex AI will generate a value for
* this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The
* first character must be a letter, and the last character must be a letter or number.
*/
@JsonProperty("sessionId")
public abstract Builder sessionId(String sessionId);

@ExcludeFromGeneratedCoverageReport
abstract Builder sessionId(Optional<String> sessionId);

/** Clears the value of sessionId field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearSessionId() {
return sessionId(Optional.empty());
}

/**
* Setter for updateMask.
*
Expand Down
Loading