Skip to content

Commit 9f20557

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Add support for wait for operation complete for sandbox sub-modules
PiperOrigin-RevId: 908889456
1 parent adf4388 commit 9f20557

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

src/converters/_sandboxes_converters.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,33 @@ export function createAgentEngineSandboxConfigToVertex(
3030
common.setValueByPath(parentObject, ['ttl'], fromTtl);
3131
}
3232

33+
const fromSandboxEnvironmentTemplate = common.getValueByPath(fromObject, [
34+
'sandboxEnvironmentTemplate',
35+
]);
36+
if (parentObject !== undefined && fromSandboxEnvironmentTemplate != null) {
37+
common.setValueByPath(
38+
parentObject,
39+
['sandboxEnvironmentTemplate'],
40+
fromSandboxEnvironmentTemplate,
41+
);
42+
}
43+
44+
const fromSandboxEnvironmentSnapshot = common.getValueByPath(fromObject, [
45+
'sandboxEnvironmentSnapshot',
46+
]);
47+
if (parentObject !== undefined && fromSandboxEnvironmentSnapshot != null) {
48+
common.setValueByPath(
49+
parentObject,
50+
['sandboxEnvironmentSnapshot'],
51+
fromSandboxEnvironmentSnapshot,
52+
);
53+
}
54+
55+
const fromOwner = common.getValueByPath(fromObject, ['owner']);
56+
if (parentObject !== undefined && fromOwner != null) {
57+
common.setValueByPath(parentObject, ['owner'], fromOwner);
58+
}
59+
3360
return toObject;
3461
}
3562

src/types/common.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,14 @@ export declare interface CreateAgentEngineSandboxConfig {
19161916
waitForCompletion?: boolean;
19171917
/** The TTL for this resource. The expiration time is computed: now + TTL. */
19181918
ttl?: string;
1919+
/** The name of the sandbox environment template to create the sandbox from. The sandbox environment template should be in the format:
1920+
projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template} */
1921+
sandboxEnvironmentTemplate?: string;
1922+
/** The name of the sandbox environment snapshot to restore the sandbox from. The sandbox environment snapshot should be in the format:
1923+
projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot} */
1924+
sandboxEnvironmentSnapshot?: string;
1925+
/** Owner information for this sandbox environment. A sandbox can only be restored from a snapshot belonging to the same owner. */
1926+
owner?: string;
19191927
}
19201928

19211929
/** Parameters for creating Agent Engine Sandboxes. */

0 commit comments

Comments
 (0)