export type DeleteApiV1OrganizationsOrganizationIdPackagesPackageIdArgs = {organization_id: string, package_id: string, 'X-Request-Id'?: string | undefined, Authorization?: string | undefined}; export type DeleteApiV1OrganizationsOrganizationIdPackagesPackageIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * SoftDelete a Package by ID * * DELETE /v1/organizations/{organization_id}/packages/{package_id} */ export const deleteApiV1OrganizationsOrganizationIdPackagesPackageId = async (args: DeleteApiV1OrganizationsOrganizationIdPackagesPackageIdArgs, options?: DeleteApiV1OrganizationsOrganizationIdPackagesPackageIdOptions) => { const {baseUrl = "https://identity.sandbox.lerian.net", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.organization_id))}/packages/${encodeURIComponent(String(args.package_id))}${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 };