export type OrganisationGroupLocationRequestDto = {latitude: string, longitude: string, radius: number, comment?: string | undefined}; export type CreateApiV2OrganisationGroupsGroupIdLocationsArgs = {groupId: number, body: OrganisationGroupLocationRequestDto}; export type CreateApiV2OrganisationGroupsGroupIdLocationsOptions = {baseUrl?: string | undefined, OAuth2ClientCredentials?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create group location * * POST /v2/organisation/groups/{groupId}/locations */ export const createApiV2OrganisationGroupsGroupIdLocations = async (args: CreateApiV2OrganisationGroupsGroupIdLocationsArgs, options?: CreateApiV2OrganisationGroupsGroupIdLocationsOptions) => { const {baseUrl = "https://api.quinyx.com", fetch: fetchFn = fetch, OAuth2ClientCredentials} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (OAuth2ClientCredentials !== undefined) headers.set('authorization', `Bearer ${OAuth2ClientCredentials}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/organisation/groups/${encodeURIComponent(String(args.groupId))}/locations${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() };