export type SentDmServicesEndpointsCustomerAPIv3BrandsCampaignsRequestsDeleteBrandCampaignRequest = {sandbox?: boolean | undefined}; export type DeleteApiV3ProfilesProfileIdCampaignsCampaignIdArgs = {profileId: string, campaignId: string, 'x-profile-id'?: string | undefined, body: SentDmServicesEndpointsCustomerAPIv3BrandsCampaignsRequestsDeleteBrandCampaignRequest}; export type DeleteApiV3ProfilesProfileIdCampaignsCampaignIdOptions = {baseUrl?: string | undefined, CustomerApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a campaign * * DELETE /v3/profiles/{profileId}/campaigns/{campaignId} * * Also accepts auth: BearerAuth */ export const deleteApiV3ProfilesProfileIdCampaignsCampaignId = async (args: DeleteApiV3ProfilesProfileIdCampaignsCampaignIdArgs, options?: DeleteApiV3ProfilesProfileIdCampaignsCampaignIdOptions) => { const {baseUrl = "https://api.sent.dm", fetch: fetchFn = fetch, CustomerApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-profile-id'] != null) headers.set("x-profile-id", String(args['x-profile-id'])) if (CustomerApiKey !== undefined) headers.set("x-api-key", CustomerApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/profiles/${encodeURIComponent(String(args.profileId))}/campaigns/${encodeURIComponent(String(args.campaignId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };