export type Globalvar = {type?: string | undefined, id?: string | undefined, attributes?: ({category?: ('TERRAFORM' | 'ENV') | undefined, description?: string | undefined, hcl?: boolean | undefined, key?: string | undefined, sensitive?: boolean | undefined, value?: string | undefined}) | undefined, relationships?: ({organization?: ({id?: string | undefined, type?: 'organization' | undefined}) | undefined}) | undefined}; export type PatchApiOrganizationOrganizationIdGlobalvarGlobalvarIdArgs = {body: {data?: Globalvar | undefined}}; export type PatchApiOrganizationOrganizationIdGlobalvarGlobalvarIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type globalvar * * PATCH /organization/{organizationId}/globalvar/{globalvarId} */ export const patchApiOrganizationOrganizationIdGlobalvarGlobalvarId = async (args: PatchApiOrganizationOrganizationIdGlobalvarGlobalvarIdArgs, options: PatchApiOrganizationOrganizationIdGlobalvarGlobalvarIdOptions) => { 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))}/globalvar/${encodeURIComponent(String(args.globalvarId))}${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 };