export type ShipmentAttributeDefinition = {name?: string | undefined}; export type CreateApiApiV4ShipmentattributedefinitionsArgs = {body: ShipmentAttributeDefinition}; export type CreateApiApiV4ShipmentattributedefinitionsOptions = {baseUrl?: string | undefined, oAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a predefined attribute. You must be a organization admin to perform this operation. * * POST /api/v4/shipmentattributedefinitions */ export const createApiApiV4Shipmentattributedefinitions = async (args: CreateApiApiV4ShipmentattributedefinitionsArgs, options?: CreateApiApiV4ShipmentattributedefinitionsOptions) => { const {baseUrl = "https://na12.api.project44.com", fetch: fetchFn = fetch, oAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (oAuth2 !== undefined) headers.set('authorization', `Bearer ${oAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v4/shipmentattributedefinitions${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 res.blob() };