export type DeleteApiUserprofilesUserprofilesIdDynamicTargetingKeysDynamicTargetingKeysIdArgs = {userprofilesId: string, dynamicTargetingKeysId: string, name: string, objectType: 'OBJECT_ADVERTISER' | 'OBJECT_AD' | 'OBJECT_CREATIVE' | 'OBJECT_PLACEMENT'}; export type DeleteApiUserprofilesUserprofilesIdDynamicTargetingKeysDynamicTargetingKeysIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes an existing dynamic targeting key. * * DELETE /userprofiles/{userprofilesId}/dynamicTargetingKeys/{dynamicTargetingKeysId} */ export const deleteApiUserprofilesUserprofilesIdDynamicTargetingKeysDynamicTargetingKeysId = async (args: DeleteApiUserprofilesUserprofilesIdDynamicTargetingKeysDynamicTargetingKeysIdArgs, options?: DeleteApiUserprofilesUserprofilesIdDynamicTargetingKeysDynamicTargetingKeysIdOptions) => { const {baseUrl = "https://dfareporting.googleapis.com/dfareporting/v5", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.name != null) query.append("name", String(args.name)) if (args.objectType != null) query.append("objectType", String(args.objectType)) 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))}/dynamicTargetingKeys/${encodeURIComponent(String(args.dynamicTargetingKeysId))}${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 };