export type AviationAccountReportingObligationFirstYearDTO = {commencementDate: string, reason: string}; export type CreateApiV10AviationAccountsIdRegistryReportingFirstYearArgs = {id: number, body: AviationAccountReportingObligationFirstYearDTO}; export type CreateApiV10AviationAccountsIdRegistryReportingFirstYearOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Validate and update the first year of reporting obligation for an aviation account * * POST /v1.0/aviation/accounts/{id}/registry-reporting-first-year */ export const createApiV10AviationAccountsIdRegistryReportingFirstYear = async (args: CreateApiV10AviationAccountsIdRegistryReportingFirstYearArgs, options?: CreateApiV10AviationAccountsIdRegistryReportingFirstYearOptions) => { const {baseUrl = "http://localhost:8080/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1.0/aviation/accounts/${encodeURIComponent(String(args.id))}/registry-reporting-first-year${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };