Skip to content

Commit 817d76b

Browse files
hkt74copybara-github
authored andcommitted
fix: missing display name when uploading blob to file search store
PiperOrigin-RevId: 833853197
1 parent a9a4458 commit 817d76b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

sdk-samples/file_search_stores.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ async function uploadBlobToFileSearchStore(fileSearchStoreName: string) {
6767
file: BLOB,
6868
config: {
6969
customMetadata: [{key: 'author', stringValue: 'foo'}],
70+
displayName: 'a blob name',
7071
},
7172
});
7273
while (!op.done) {

src/_api_client.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {Auth} from './_auth.js';
88
import * as common from './_common.js';
99
import {Downloader} from './_downloader.js';
1010
import {Uploader} from './_uploader.js';
11+
import {uploadToFileSearchStoreConfigToMldev} from './converters/_filesearchstores_converters.js';
1112
import {ApiError} from './errors.js';
1213
import * as types from './types.js';
1314

@@ -726,11 +727,8 @@ export class ApiClient {
726727
const path = `upload/v1beta/${fileSearchStoreName}:uploadToFileSearchStore`;
727728
const fileName = this.getFileName(file);
728729
const body: Record<string, unknown> = {};
729-
if (config?.customMetadata) {
730-
body['customMetadata'] = config.customMetadata;
731-
}
732-
if (config?.chunkingConfig) {
733-
body['chunkingConfig'] = config.chunkingConfig;
730+
if (config != null) {
731+
uploadToFileSearchStoreConfigToMldev(config, body);
734732
}
735733
const uploadUrl = await this.fetchUploadUrl(
736734
path,

0 commit comments

Comments
 (0)