export type DataStoreField = {name?: string | undefined, path?: (string | null) | undefined, classification?: (string | null) | undefined}; export type PatchApiV1DataDiscoveryDataStoresDataStoreIdFieldsFieldIdArgs = {dataStoreId: string, fieldId: string, body: DataStoreField}; export type PatchApiV1DataDiscoveryDataStoresDataStoreIdFieldsFieldIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Data Store Field * * PATCH /v1/data-discovery/data-stores/{dataStoreId}/fields/{fieldId} */ export const patchApiV1DataDiscoveryDataStoresDataStoreIdFieldsFieldId = async (args: PatchApiV1DataDiscoveryDataStoresDataStoreIdFieldsFieldIdArgs, options?: PatchApiV1DataDiscoveryDataStoresDataStoreIdFieldsFieldIdOptions) => { 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))}/fields/${encodeURIComponent(String(args.fieldId))}${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 };