export type DataStoreOwner = {email: string, primary?: boolean | undefined} | {[key: string]: unknown}; export type DataStorePurposesOfProcessing = {name: string, processingPurposeId?: (string | null) | undefined} | {[key: string]: unknown}; export type DataStoreLabels = {name: string, labelId?: (string | null) | undefined} | {[key: string]: unknown}; export type DataStoreUpdate = {name?: string | undefined, description?: (string | null) | undefined, alias?: (string | null) | undefined, countryIso?: (string | null) | undefined, owners?: Array | undefined, purposesOfProcessing?: (Array | null) | undefined, labels?: (Array | null) | undefined, metadata?: (Record | null) | undefined} | {[key: string]: unknown}; export type PatchApiV1DataDiscoveryDataStoresDataStoreIdArgs = {dataStoreId: string, body: DataStoreUpdate}; export type PatchApiV1DataDiscoveryDataStoresDataStoreIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an existing data store * * PATCH /v1/data-discovery/data-stores/{dataStoreId} */ export const patchApiV1DataDiscoveryDataStoresDataStoreId = async (args: PatchApiV1DataDiscoveryDataStoresDataStoreIdArgs, options?: PatchApiV1DataDiscoveryDataStoresDataStoreIdOptions) => { const {baseUrl = "https://api.osano.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("x-osano-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/data-discovery/data-stores/${encodeURIComponent(String(args.dataStoreId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };