//native
type Segment = {
token: string;
baseUrl: string;
};
/**
* Remove Profiles Warehouse from Space
* Deletes an existing Profiles Warehouse.
• When called, this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the audit trail.
*/
export async function main(
auth: Segment,
spaceId: string,
warehouseId: string,
) {
const url = new URL(
`${auth.baseUrl}/spaces/${spaceId}/profiles-warehouses/${warehouseId}`,
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 235 days ago