Skip to content

Commit a5ea8c9

Browse files
IvanLHcopybara-github
authored andcommitted
chore: Regenerated types
PiperOrigin-RevId: 797016694
1 parent dd0a033 commit a5ea8c9

File tree

4 files changed

+145
-146
lines changed

4 files changed

+145
-146
lines changed

api-report/genai-node.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ export interface GetOperationParameters {
13231323
operationName: string;
13241324
}
13251325

1326-
// @public
1326+
// @public (undocumented)
13271327
export interface GetTuningJobConfig {
13281328
abortSignal?: AbortSignal;
13291329
httpOptions?: HttpOptions;
@@ -2015,7 +2015,7 @@ export interface LiveServerSessionResumptionUpdate {
20152015
resumable?: boolean;
20162016
}
20172017

2018-
// @public (undocumented)
2018+
// @public
20192019
export interface LiveServerSetupComplete {
20202020
sessionId?: string;
20212021
}

api-report/genai-web.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ export interface GetOperationParameters {
13231323
operationName: string;
13241324
}
13251325

1326-
// @public
1326+
// @public (undocumented)
13271327
export interface GetTuningJobConfig {
13281328
abortSignal?: AbortSignal;
13291329
httpOptions?: HttpOptions;
@@ -2015,7 +2015,7 @@ export interface LiveServerSessionResumptionUpdate {
20152015
resumable?: boolean;
20162016
}
20172017

2018-
// @public (undocumented)
2018+
// @public
20192019
export interface LiveServerSetupComplete {
20202020
sessionId?: string;
20212021
}

api-report/genai.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ export interface GetOperationParameters {
13231323
operationName: string;
13241324
}
13251325

1326-
// @public
1326+
// @public (undocumented)
13271327
export interface GetTuningJobConfig {
13281328
abortSignal?: AbortSignal;
13291329
httpOptions?: HttpOptions;
@@ -2015,7 +2015,7 @@ export interface LiveServerSessionResumptionUpdate {
20152015
resumable?: boolean;
20162016
}
20172017

2018-
// @public (undocumented)
2018+
// @public
20192019
export interface LiveServerSetupComplete {
20202020
sessionId?: string;
20212021
}

src/types.ts

Lines changed: 139 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,8 +3490,135 @@ export class GenerateVideosResponse {
34903490
raiMediaFilteredReasons?: string[];
34913491
}
34923492

3493-
/** Optional parameters for tunings.get method. */
3494-
export declare interface GetTuningJobConfig {
3493+
/** A long-running operation. */
3494+
export declare interface Operation<T> {
3495+
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
3496+
name?: string;
3497+
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
3498+
metadata?: Record<string, unknown>;
3499+
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
3500+
done?: boolean;
3501+
/** The error result of the operation in case of failure or cancellation. */
3502+
error?: Record<string, unknown>;
3503+
/** The response if the operation is successful. */
3504+
response?: T;
3505+
/**
3506+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
3507+
* @internal
3508+
*/
3509+
_fromAPIResponse({
3510+
apiResponse,
3511+
isVertexAI,
3512+
}: OperationFromAPIResponseParameters): Operation<T>;
3513+
}
3514+
3515+
/** A video generation operation. */
3516+
export class GenerateVideosOperation
3517+
implements Operation<GenerateVideosResponse>
3518+
{
3519+
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
3520+
name?: string;
3521+
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
3522+
metadata?: Record<string, unknown>;
3523+
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
3524+
done?: boolean;
3525+
/** The error result of the operation in case of failure or cancellation. */
3526+
error?: Record<string, unknown>;
3527+
/** The generated videos. */
3528+
response?: GenerateVideosResponse;
3529+
/** The full HTTP response. */
3530+
sdkHttpResponse?: HttpResponse;
3531+
/**
3532+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
3533+
* @internal
3534+
*/
3535+
_fromAPIResponse({
3536+
apiResponse,
3537+
isVertexAI,
3538+
}: OperationFromAPIResponseParameters): Operation<GenerateVideosResponse> {
3539+
const operation = new GenerateVideosOperation();
3540+
operation.name = apiResponse['name'] as string | undefined;
3541+
operation.metadata = apiResponse['metadata'] as
3542+
| Record<string, unknown>
3543+
| undefined;
3544+
operation.done = apiResponse['done'] as boolean | undefined;
3545+
operation.error = apiResponse['error'] as
3546+
| Record<string, unknown>
3547+
| undefined;
3548+
3549+
if (isVertexAI) {
3550+
const response = apiResponse['response'] as
3551+
| Record<string, unknown>
3552+
| undefined;
3553+
if (response) {
3554+
const operationResponse = new GenerateVideosResponse();
3555+
const responseVideos = response['videos'] as
3556+
| Array<Record<string, unknown>>
3557+
| undefined;
3558+
operationResponse.generatedVideos = responseVideos?.map(
3559+
(generatedVideo) => {
3560+
return {
3561+
video: {
3562+
uri: generatedVideo['gcsUri'] as string | undefined,
3563+
videoBytes: generatedVideo['bytesBase64Encoded']
3564+
? tBytes(generatedVideo['bytesBase64Encoded'] as string)
3565+
: undefined,
3566+
mimeType: generatedVideo['mimeType'] as string | undefined,
3567+
} as Video,
3568+
} as GeneratedVideo;
3569+
},
3570+
);
3571+
operationResponse.raiMediaFilteredCount = response[
3572+
'raiMediaFilteredCount'
3573+
] as number | undefined;
3574+
operationResponse.raiMediaFilteredReasons = response[
3575+
'raiMediaFilteredReasons'
3576+
] as string[] | undefined;
3577+
operation.response = operationResponse;
3578+
}
3579+
} else {
3580+
const response = apiResponse['response'] as
3581+
| Record<string, unknown>
3582+
| undefined;
3583+
if (response) {
3584+
const operationResponse = new GenerateVideosResponse();
3585+
const generatedVideoResponse = response['generateVideoResponse'] as
3586+
| Record<string, unknown>
3587+
| undefined;
3588+
const responseVideos = generatedVideoResponse?.['generatedSamples'] as
3589+
| Array<Record<string, unknown>>
3590+
| undefined;
3591+
operationResponse.generatedVideos = responseVideos?.map(
3592+
(generatedVideo) => {
3593+
const video = generatedVideo['video'] as
3594+
| Record<string, unknown>
3595+
| undefined;
3596+
return {
3597+
video: {
3598+
uri: video?.['uri'] as string | undefined,
3599+
videoBytes: video?.['encodedVideo']
3600+
? tBytes(video?.['encodedVideo'] as string)
3601+
: undefined,
3602+
mimeType: generatedVideo['encoding'] as string | undefined,
3603+
} as Video,
3604+
} as GeneratedVideo;
3605+
},
3606+
);
3607+
operationResponse.raiMediaFilteredCount = generatedVideoResponse?.[
3608+
'raiMediaFilteredCount'
3609+
] as number | undefined;
3610+
operationResponse.raiMediaFilteredReasons = generatedVideoResponse?.[
3611+
'raiMediaFilteredReasons'
3612+
] as string[] | undefined;
3613+
operation.response = operationResponse;
3614+
}
3615+
}
3616+
return operation;
3617+
}
3618+
}
3619+
3620+
export /** Optional parameters for tunings.get method. */
3621+
declare interface GetTuningJobConfig {
34953622
/** Used to override HTTP request options. */
34963623
httpOptions?: HttpOptions;
34973624
/** Abort signal which can be used to cancel the request.
@@ -4854,8 +4981,8 @@ export class SubjectReferenceImage {
48544981
}
48554982
}
48564983

4857-
export /** Sent in response to a `LiveGenerateContentSetup` message from the client. */
4858-
declare interface LiveServerSetupComplete {
4984+
/** Sent in response to a `LiveGenerateContentSetup` message from the client. */
4985+
export declare interface LiveServerSetupComplete {
48594986
/** The session id of the live session. */
48604987
sessionId?: string;
48614988
}
@@ -5057,14 +5184,6 @@ export class LiveServerMessage {
50575184
}
50585185
}
50595186

5060-
/** Parameters for the get method of the operations module. */
5061-
export declare interface OperationGetParameters<T, U extends Operation<T>> {
5062-
/** The operation to be retrieved. */
5063-
operation: U;
5064-
/** Used to override the default configuration. */
5065-
config?: GetOperationConfig;
5066-
}
5067-
50685187
/** Parameters of the fromAPIResponse method of the Operation class. */
50695188
export declare interface OperationFromAPIResponseParameters {
50705189
/** The API response to be converted to an Operation. */
@@ -5073,134 +5192,6 @@ export declare interface OperationFromAPIResponseParameters {
50735192
isVertexAI: boolean;
50745193
}
50755194

5076-
/** A long-running operation. */
5077-
export declare interface Operation<T> {
5078-
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
5079-
name?: string;
5080-
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
5081-
metadata?: Record<string, unknown>;
5082-
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
5083-
done?: boolean;
5084-
/** The error result of the operation in case of failure or cancellation. */
5085-
error?: Record<string, unknown>;
5086-
/** The response if the operation is successful. */
5087-
response?: T;
5088-
/**
5089-
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
5090-
* @internal
5091-
*/
5092-
_fromAPIResponse({
5093-
apiResponse,
5094-
isVertexAI,
5095-
}: OperationFromAPIResponseParameters): Operation<T>;
5096-
}
5097-
5098-
/** A video generation long-running operation. */
5099-
export class GenerateVideosOperation
5100-
implements Operation<GenerateVideosResponse>
5101-
{
5102-
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
5103-
name?: string;
5104-
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
5105-
metadata?: Record<string, unknown>;
5106-
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
5107-
done?: boolean;
5108-
/** The error result of the operation in case of failure or cancellation. */
5109-
error?: Record<string, unknown>;
5110-
/** The response if the operation is successful. */
5111-
response?: GenerateVideosResponse;
5112-
/** The full HTTP response. */
5113-
sdkHttpResponse?: HttpResponse;
5114-
5115-
/**
5116-
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
5117-
* @internal
5118-
*/
5119-
_fromAPIResponse({
5120-
apiResponse,
5121-
isVertexAI,
5122-
}: OperationFromAPIResponseParameters): Operation<GenerateVideosResponse> {
5123-
const operation = new GenerateVideosOperation();
5124-
operation.name = apiResponse['name'] as string | undefined;
5125-
operation.metadata = apiResponse['metadata'] as
5126-
| Record<string, unknown>
5127-
| undefined;
5128-
operation.done = apiResponse['done'] as boolean | undefined;
5129-
operation.error = apiResponse['error'] as
5130-
| Record<string, unknown>
5131-
| undefined;
5132-
5133-
if (isVertexAI) {
5134-
const response = apiResponse['response'] as
5135-
| Record<string, unknown>
5136-
| undefined;
5137-
if (response) {
5138-
const operationResponse = new GenerateVideosResponse();
5139-
const responseVideos = response['videos'] as
5140-
| Array<Record<string, unknown>>
5141-
| undefined;
5142-
operationResponse.generatedVideos = responseVideos?.map(
5143-
(generatedVideo) => {
5144-
return {
5145-
video: {
5146-
uri: generatedVideo['gcsUri'] as string | undefined,
5147-
videoBytes: generatedVideo['bytesBase64Encoded']
5148-
? tBytes(generatedVideo['bytesBase64Encoded'] as string)
5149-
: undefined,
5150-
mimeType: generatedVideo['mimeType'] as string | undefined,
5151-
} as Video,
5152-
} as GeneratedVideo;
5153-
},
5154-
);
5155-
operationResponse.raiMediaFilteredCount = response[
5156-
'raiMediaFilteredCount'
5157-
] as number | undefined;
5158-
operationResponse.raiMediaFilteredReasons = response[
5159-
'raiMediaFilteredReasons'
5160-
] as string[] | undefined;
5161-
operation.response = operationResponse;
5162-
}
5163-
} else {
5164-
const response = apiResponse['response'] as
5165-
| Record<string, unknown>
5166-
| undefined;
5167-
if (response) {
5168-
const operationResponse = new GenerateVideosResponse();
5169-
const generatedVideoResponse = response['generateVideoResponse'] as
5170-
| Record<string, unknown>
5171-
| undefined;
5172-
const responseVideos = generatedVideoResponse?.['generatedSamples'] as
5173-
| Array<Record<string, unknown>>
5174-
| undefined;
5175-
operationResponse.generatedVideos = responseVideos?.map(
5176-
(generatedVideo) => {
5177-
const video = generatedVideo['video'] as
5178-
| Record<string, unknown>
5179-
| undefined;
5180-
return {
5181-
video: {
5182-
uri: video?.['uri'] as string | undefined,
5183-
videoBytes: video?.['encodedVideo']
5184-
? tBytes(video?.['encodedVideo'] as string)
5185-
: undefined,
5186-
mimeType: generatedVideo['encoding'] as string | undefined,
5187-
} as Video,
5188-
} as GeneratedVideo;
5189-
},
5190-
);
5191-
operationResponse.raiMediaFilteredCount = generatedVideoResponse?.[
5192-
'raiMediaFilteredCount'
5193-
] as number | undefined;
5194-
operationResponse.raiMediaFilteredReasons = generatedVideoResponse?.[
5195-
'raiMediaFilteredReasons'
5196-
] as string[] | undefined;
5197-
operation.response = operationResponse;
5198-
}
5199-
}
5200-
return operation;
5201-
}
5202-
}
5203-
52045195
/** Configures automatic detection of activity. */
52055196
export declare interface AutomaticActivityDetection {
52065197
/** If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals. */
@@ -5874,6 +5865,14 @@ export declare interface CreateAuthTokenParameters {
58745865
config?: CreateAuthTokenConfig;
58755866
}
58765867

5868+
/** Parameters for the get method of the operations module. */
5869+
export declare interface OperationGetParameters<T, U extends Operation<T>> {
5870+
/** Used to override the default configuration. */
5871+
config?: GetOperationConfig;
5872+
/** The operation to be retrieved. */
5873+
operation: U;
5874+
}
5875+
58775876
/** Supervised fine-tuning job creation parameters - optional fields. */
58785877
export declare interface CreateTuningJobParameters {
58795878
/** The base model that is being tuned, e.g., "gemini-2.5-flash". */

0 commit comments

Comments
 (0)