export type CreateApiAgentPoolsAgentPoolActionsEnableMtlsEnforcementArgs = {agent_pool: string}; export type CreateApiAgentPoolsAgentPoolActionsEnableMtlsEnforcementOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable mTLS Enforcement for an Agent Pool * * POST /agent-pools/{agent_pool}/actions/enable-mtls-enforcement */ export const createApiAgentPoolsAgentPoolActionsEnableMtlsEnforcement = async (args: CreateApiAgentPoolsAgentPoolActionsEnableMtlsEnforcementArgs, options?: CreateApiAgentPoolsAgentPoolActionsEnableMtlsEnforcementOptions) => { const {baseUrl = "https://example.scalr.io/api/iacp/v3", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKey !== undefined) headers.set('authorization', `Bearer ${APIKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/agent-pools/${encodeURIComponent(String(args.agent_pool))}/actions/enable-mtls-enforcement${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };