You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Google Cloud Retail: updateMask values must be snake_case despite being camelCase on the Product Interface #3187
I think this is still an issue. However it executes okay with the API but the SDK throws an error.
async function updateMinInstances(
functionName: string,
functionRegion: string,
minInstances: number
): Promise<void> {
const name = `projects/${PROJECT_ID}/locations/${functionRegion}/functions/${functionName}`;
try {
const request: protos.google.cloud.functions.v1.IUpdateFunctionRequest = {
function: {
name,
minInstances,
maxInstances: null // Setting maxInstances to null (or omitting it) effectively removes the limit.
},
// Corrected the updateMask to be an object with a 'paths' array.
updateMask: {
paths: ['min_instances', 'max_instances']
}
};
// Make the API call to update the function
const [operation] = await client.updateFunction(request);
const [response] = await operation.promise();
console.log(
`Successfully updated minInstances to ${minInstances} for function: ${functionName}`,
response
);
} catch (error) {
// We cast the error to be able to access its message property.
console.error(`Error updating function ${functionName}: ${(error as Error).message}`, error);
}
}
Activity
tmk1991 commentedon Aug 10, 2025
I think this is still an issue. However it executes okay with the API but the SDK throws an error.