export type Module = {type?: string | undefined, id?: string | undefined, attributes?: ({createdBy?: string | undefined, createdDate?: string | undefined, description?: string | undefined, downloadQuantity?: number | undefined, name?: string | undefined, provider?: string | undefined, registryPath?: string | undefined, source?: string | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined, versions?: Array> | undefined}) | undefined, relationships?: ({organization?: ({id?: string | undefined, type?: 'organization' | undefined}) | undefined, ssh?: ({id?: string | undefined, type?: 'ssh' | undefined}) | undefined, vcs?: ({id?: string | undefined, type?: 'vcs' | undefined}) | undefined}) | undefined}; export type PatchApiOrganizationOrganizationIdModuleModuleIdArgs = {body: {data?: Module | undefined}}; export type PatchApiOrganizationOrganizationIdModuleModuleIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type module * * PATCH /organization/{organizationId}/module/{moduleId} */ export const patchApiOrganizationOrganizationIdModuleModuleId = async (args: PatchApiOrganizationOrganizationIdModuleModuleIdArgs, options: PatchApiOrganizationOrganizationIdModuleModuleIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") const url = `${baseUrl.replace(/\/+$/, '')}/organization/${encodeURIComponent(String(args.organizationId))}/module/${encodeURIComponent(String(args.moduleId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };