export type DataTransferMeterIntegration = {chargePointIdentity: string, timeoutSeconds: number}; export type DeleteApiApiV1EnergySitesSiteIdNodesNodeIdMetersDataTransferArgs = {siteId: number, nodeId: number, body: DataTransferMeterIntegration}; export type DeleteApiApiV1EnergySitesSiteIdNodesNodeIdMetersDataTransferOptions = {baseUrl?: string | undefined, BearerAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a data transfer meter integration * * DELETE /api/v1/energy/sites/{siteId}/nodes/{nodeId}/meters/data-transfer */ export const deleteApiApiV1EnergySitesSiteIdNodesNodeIdMetersDataTransfer = async (args: DeleteApiApiV1EnergySitesSiteIdNodesNodeIdMetersDataTransferArgs, options?: DeleteApiApiV1EnergySitesSiteIdNodesNodeIdMetersDataTransferOptions) => { const {baseUrl = "https://partner-api.monta.com", fetch: fetchFn = fetch, BearerAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAccessToken !== undefined) headers.set('authorization', `Bearer ${BearerAccessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/energy/sites/${encodeURIComponent(String(args.siteId))}/nodes/${encodeURIComponent(String(args.nodeId))}/meters/data-transfer${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 };