export type DeleteApiUserprofilesUserprofilesIdCreativeFieldsCreativeFieldsIdCreativeFieldValuesCreativeFieldValuesIdArgs = {userprofilesId: string, creativeFieldsId: string, creativeFieldValuesId: string}; export type DeleteApiUserprofilesUserprofilesIdCreativeFieldsCreativeFieldsIdCreativeFieldValuesCreativeFieldValuesIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes an existing creative field value. * * DELETE /userprofiles/{userprofilesId}/creativeFields/{creativeFieldsId}/creativeFieldValues/{creativeFieldValuesId} */ export const deleteApiUserprofilesUserprofilesIdCreativeFieldsCreativeFieldsIdCreativeFieldValuesCreativeFieldValuesId = async (args: DeleteApiUserprofilesUserprofilesIdCreativeFieldsCreativeFieldsIdCreativeFieldValuesCreativeFieldValuesIdArgs, options?: DeleteApiUserprofilesUserprofilesIdCreativeFieldsCreativeFieldsIdCreativeFieldValuesCreativeFieldValuesIdOptions) => { const {baseUrl = "https://dfareporting.googleapis.com/dfareporting/v5", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/userprofiles/${encodeURIComponent(String(args.userprofilesId))}/creativeFields/${encodeURIComponent(String(args.creativeFieldsId))}/creativeFieldValues/${encodeURIComponent(String(args.creativeFieldValuesId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };