/* tslint:disable */ /* eslint-disable */ /** * authentik * Making authentication simple. * * The version of the OpenAPI document: 2026.8.0-rc7 * Contact: hello@goauthentik.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { type Agent, AgentFromJSON, AgentToJSON, } from '../models/Agent'; import { type AgentCreateRequest, AgentCreateRequestFromJSON, AgentCreateRequestToJSON, } from '../models/AgentCreateRequest'; import { type AgentCreated, AgentCreatedFromJSON, AgentCreatedToJSON, } from '../models/AgentCreated'; import { type AgentRequest, AgentRequestFromJSON, AgentRequestToJSON, } from '../models/AgentRequest'; import { type GenericError, GenericErrorFromJSON, GenericErrorToJSON, } from '../models/GenericError'; import { type PaginatedAgentList, PaginatedAgentListFromJSON, PaginatedAgentListToJSON, } from '../models/PaginatedAgentList'; import { type PatchedAgentRequest, PatchedAgentRequestFromJSON, PatchedAgentRequestToJSON, } from '../models/PatchedAgentRequest'; import { type ValidationError, ValidationErrorFromJSON, ValidationErrorToJSON, } from '../models/ValidationError'; export interface AgentsAgentsCreateRequest { agentCreateRequest?: AgentCreateRequest; } export interface AgentsAgentsDestroyRequest { id: number; } export interface AgentsAgentsListRequest { ordering?: string; page?: number; pageSize?: number; parent?: number; search?: string; } export interface AgentsAgentsPartialUpdateRequest { id: number; patchedAgentRequest?: PatchedAgentRequest; } export interface AgentsAgentsRetrieveRequest { id: number; } export interface AgentsAgentsUpdateRequest { id: number; agentRequest: AgentRequest; } /** * */ export class AgentsApi extends runtime.BaseAPI { /** * Creates request options for agentsAgentsCreate without sending the request */ async agentsAgentsCreateRequestOpts(requestParameters: AgentsAgentsCreateRequest): Promise { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("authentik", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/agents/agents/`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: AgentCreateRequestToJSON(requestParameters['agentCreateRequest']), }; } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsCreateRaw(requestParameters: AgentsAgentsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.agentsAgentsCreateRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AgentCreatedFromJSON(jsonValue)); } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsCreate(requestParameters: AgentsAgentsCreateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.agentsAgentsCreateRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for agentsAgentsDestroy without sending the request */ async agentsAgentsDestroyRequestOpts(requestParameters: AgentsAgentsDestroyRequest): Promise { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling agentsAgentsDestroy().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("authentik", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/agents/agents/{id}/`; urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id']))); return { path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }; } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsDestroyRaw(requestParameters: AgentsAgentsDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.agentsAgentsDestroyRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.VoidApiResponse(response); } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsDestroy(requestParameters: AgentsAgentsDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.agentsAgentsDestroyRaw(requestParameters, initOverrides); } /** * Creates request options for agentsAgentsList without sending the request */ async agentsAgentsListRequestOpts(requestParameters: AgentsAgentsListRequest): Promise { const queryParameters: any = {}; if (requestParameters['ordering'] != null) { queryParameters['ordering'] = requestParameters['ordering']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } if (requestParameters['pageSize'] != null) { queryParameters['page_size'] = requestParameters['pageSize']; } if (requestParameters['parent'] != null) { queryParameters['parent'] = requestParameters['parent']; } if (requestParameters['search'] != null) { queryParameters['search'] = requestParameters['search']; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("authentik", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/agents/agents/`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsListRaw(requestParameters: AgentsAgentsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.agentsAgentsListRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedAgentListFromJSON(jsonValue)); } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsList(requestParameters: AgentsAgentsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.agentsAgentsListRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for agentsAgentsPartialUpdate without sending the request */ async agentsAgentsPartialUpdateRequestOpts(requestParameters: AgentsAgentsPartialUpdateRequest): Promise { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling agentsAgentsPartialUpdate().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("authentik", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/agents/agents/{id}/`; urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id']))); return { path: urlPath, method: 'PATCH', headers: headerParameters, query: queryParameters, body: PatchedAgentRequestToJSON(requestParameters['patchedAgentRequest']), }; } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsPartialUpdateRaw(requestParameters: AgentsAgentsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.agentsAgentsPartialUpdateRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AgentFromJSON(jsonValue)); } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsPartialUpdate(requestParameters: AgentsAgentsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.agentsAgentsPartialUpdateRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for agentsAgentsRetrieve without sending the request */ async agentsAgentsRetrieveRequestOpts(requestParameters: AgentsAgentsRetrieveRequest): Promise { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling agentsAgentsRetrieve().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("authentik", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/agents/agents/{id}/`; urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id']))); return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsRetrieveRaw(requestParameters: AgentsAgentsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.agentsAgentsRetrieveRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AgentFromJSON(jsonValue)); } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsRetrieve(requestParameters: AgentsAgentsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.agentsAgentsRetrieveRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for agentsAgentsUpdate without sending the request */ async agentsAgentsUpdateRequestOpts(requestParameters: AgentsAgentsUpdateRequest): Promise { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling agentsAgentsUpdate().' ); } if (requestParameters['agentRequest'] == null) { throw new runtime.RequiredError( 'agentRequest', 'Required parameter "agentRequest" was null or undefined when calling agentsAgentsUpdate().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("authentik", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/agents/agents/{id}/`; urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id']))); return { path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: AgentRequestToJSON(requestParameters['agentRequest']), }; } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsUpdateRaw(requestParameters: AgentsAgentsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.agentsAgentsUpdateRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AgentFromJSON(jsonValue)); } /** * Admin-provisioned delegate identities. An admin creates a Agent for a given parent user, then grants it access the same way as any other User -- ordinary PolicyBindings pointed at whatever it needs. */ async agentsAgentsUpdate(requestParameters: AgentsAgentsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.agentsAgentsUpdateRaw(requestParameters, initOverrides); return await response.value(); } }