Skip to content
Merged
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
145 changes: 145 additions & 0 deletions src/converters/_sandboxsnapshots_converters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

// Code generated by the Google Gen AI SDK generator DO NOT EDIT.

import * as common from '@google/genai/vertex_internal';
import * as types from '../types.js';

export function createAgentEngineSandboxSnapshotConfigToVertex(
fromObject: types.CreateAgentEngineSandboxSnapshotConfig,
parentObject: Record<string, unknown>,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromDisplayName = common.getValueByPath(fromObject, ['displayName']);
if (parentObject !== undefined && fromDisplayName != null) {
common.setValueByPath(parentObject, ['displayName'], fromDisplayName);
}

const fromOwner = common.getValueByPath(fromObject, ['owner']);
if (parentObject !== undefined && fromOwner != null) {
common.setValueByPath(parentObject, ['owner'], fromOwner);
}

const fromTtl = common.getValueByPath(fromObject, ['ttl']);
if (parentObject !== undefined && fromTtl != null) {
common.setValueByPath(parentObject, ['ttl'], fromTtl);
}

return toObject;
}

export function createSandboxEnvironmentSnapshotRequestParametersToVertex(
fromObject: types.CreateSandboxEnvironmentSnapshotRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromSourceSandboxEnvironmentName = common.getValueByPath(fromObject, [
'sourceSandboxEnvironmentName',
]);
if (fromSourceSandboxEnvironmentName != null) {
common.setValueByPath(
toObject,
['_url', 'name'],
fromSourceSandboxEnvironmentName,
);
}

const fromConfig = common.getValueByPath(fromObject, ['config']);
if (fromConfig != null) {
createAgentEngineSandboxSnapshotConfigToVertex(fromConfig, toObject);
}

return toObject;
}

export function deleteSandboxEnvironmentSnapshotRequestParametersToVertex(
fromObject: types.DeleteSandboxEnvironmentSnapshotRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

return toObject;
}

export function getAgentEngineSandboxSnapshotOperationParametersToVertex(
fromObject: types.GetAgentEngineSandboxSnapshotOperationParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromOperationName = common.getValueByPath(fromObject, [
'operationName',
]);
if (fromOperationName != null) {
common.setValueByPath(
toObject,
['_url', 'operationName'],
fromOperationName,
);
}

return toObject;
}

export function getSandboxEnvironmentSnapshotRequestParametersToVertex(
fromObject: types.GetSandboxEnvironmentSnapshotRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

return toObject;
}

export function listSandboxEnvironmentSnapshotsConfigToVertex(
fromObject: types.ListSandboxEnvironmentSnapshotsConfig,
parentObject: Record<string, unknown>,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromPageSize = common.getValueByPath(fromObject, ['pageSize']);
if (parentObject !== undefined && fromPageSize != null) {
common.setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
}

const fromPageToken = common.getValueByPath(fromObject, ['pageToken']);
if (parentObject !== undefined && fromPageToken != null) {
common.setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
}

const fromFilter = common.getValueByPath(fromObject, ['filter']);
if (parentObject !== undefined && fromFilter != null) {
common.setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
}

return toObject;
}

export function listSandboxEnvironmentSnapshotsRequestParametersToVertex(
fromObject: types.ListSandboxEnvironmentSnapshotsRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

const fromConfig = common.getValueByPath(fromObject, ['config']);
if (fromConfig != null) {
listSandboxEnvironmentSnapshotsConfigToVertex(fromConfig, toObject);
}

return toObject;
}
162 changes: 162 additions & 0 deletions src/converters/_sandboxtemplates_converters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

// Code generated by the Google Gen AI SDK generator DO NOT EDIT.

import * as common from '@google/genai/vertex_internal';
import * as types from '../types.js';

export function createSandboxEnvironmentTemplateConfigToVertex(
fromObject: types.CreateSandboxEnvironmentTemplateConfig,
parentObject: Record<string, unknown>,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromCustomContainerEnvironment = common.getValueByPath(fromObject, [
'customContainerEnvironment',
]);
if (parentObject !== undefined && fromCustomContainerEnvironment != null) {
common.setValueByPath(
parentObject,
['customContainerEnvironment'],
fromCustomContainerEnvironment,
);
}

const fromDefaultContainerEnvironment = common.getValueByPath(fromObject, [
'defaultContainerEnvironment',
]);
if (parentObject !== undefined && fromDefaultContainerEnvironment != null) {
common.setValueByPath(
parentObject,
['defaultContainerEnvironment'],
fromDefaultContainerEnvironment,
);
}

const fromEgressControlConfig = common.getValueByPath(fromObject, [
'egressControlConfig',
]);
if (parentObject !== undefined && fromEgressControlConfig != null) {
common.setValueByPath(
parentObject,
['egressControlConfig'],
fromEgressControlConfig,
);
}

return toObject;
}

export function createSandboxEnvironmentTemplateRequestParametersToVertex(
fromObject: types.CreateSandboxEnvironmentTemplateRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

const fromDisplayName = common.getValueByPath(fromObject, ['displayName']);
if (fromDisplayName != null) {
common.setValueByPath(toObject, ['displayName'], fromDisplayName);
}

const fromConfig = common.getValueByPath(fromObject, ['config']);
if (fromConfig != null) {
createSandboxEnvironmentTemplateConfigToVertex(fromConfig, toObject);
}

return toObject;
}

export function deleteSandboxEnvironmentTemplateRequestParametersToVertex(
fromObject: types.DeleteSandboxEnvironmentTemplateRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

return toObject;
}

export function getSandboxEnvironmentTemplateOperationParametersToVertex(
fromObject: types.GetSandboxEnvironmentTemplateOperationParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromOperationName = common.getValueByPath(fromObject, [
'operationName',
]);
if (fromOperationName != null) {
common.setValueByPath(
toObject,
['_url', 'operationName'],
fromOperationName,
);
}

return toObject;
}

export function getSandboxEnvironmentTemplateRequestParametersToVertex(
fromObject: types.GetSandboxEnvironmentTemplateRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

return toObject;
}

export function listSandboxEnvironmentTemplatesConfigToVertex(
fromObject: types.ListSandboxEnvironmentTemplatesConfig,
parentObject: Record<string, unknown>,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromPageSize = common.getValueByPath(fromObject, ['pageSize']);
if (parentObject !== undefined && fromPageSize != null) {
common.setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
}

const fromPageToken = common.getValueByPath(fromObject, ['pageToken']);
if (parentObject !== undefined && fromPageToken != null) {
common.setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
}

const fromFilter = common.getValueByPath(fromObject, ['filter']);
if (parentObject !== undefined && fromFilter != null) {
common.setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
}

return toObject;
}

export function listSandboxEnvironmentTemplatesRequestParametersToVertex(
fromObject: types.ListSandboxEnvironmentTemplatesRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

const fromConfig = common.getValueByPath(fromObject, ['config']);
if (fromConfig != null) {
listSandboxEnvironmentTemplatesConfigToVertex(fromConfig, toObject);
}

return toObject;
}
7 changes: 7 additions & 0 deletions src/sandboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
import * as common from '@google/genai/vertex_internal';
import {ApiClient, BaseModule} from '@google/genai/vertex_internal';
import * as converters from './converters/_sandboxes_converters.js';
import {SandboxSnapshots} from './sandboxsnapshots.js';
import {SandboxTemplates} from './sandboxtemplates.js';
import * as types from './types.js';

export class Sandboxes extends BaseModule {
public readonly templates: SandboxTemplates;
public readonly snapshots: SandboxSnapshots;

constructor(private readonly apiClient: ApiClient) {
super();
this.templates = new SandboxTemplates(apiClient);
this.snapshots = new SandboxSnapshots(apiClient);
}

async createInternal(
Expand Down
Loading
Loading