/* 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 { mapValues } from '../runtime'; import type { PartialUser } from './PartialUser'; import { PartialUserFromJSON, PartialUserFromJSONTyped, PartialUserToJSON, PartialUserToJSONTyped, } from './PartialUser'; import type { PolicyBehaviorEnum } from './PolicyBehaviorEnum'; import { PolicyBehaviorEnumFromJSON, PolicyBehaviorEnumFromJSONTyped, PolicyBehaviorEnumToJSON, PolicyBehaviorEnumToJSONTyped, } from './PolicyBehaviorEnum'; /** * Mixin to validate that a valid enterprise license * exists before allowing to save the object * @export * @interface Agent */ export interface Agent { /** * * @type {number} * @memberof Agent */ readonly pk: number; /** * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. * @type {string} * @memberof Agent */ username: string; /** * User's display name. * @type {string} * @memberof Agent */ name: string; /** * Designates whether this user should be treated as active. Unselect this instead of deleting accounts. * @type {boolean} * @memberof Agent */ isActive?: boolean; /** * * @type {Date} * @memberof Agent */ lastLogin?: Date | null; /** * * @type {string} * @memberof Agent */ email?: string; /** * * @type {{ [key: string]: any; }} * @memberof Agent */ attributes?: { [key: string]: any; }; /** * * @type {string} * @memberof Agent */ readonly uid: string; /** * * @type {string} * @memberof Agent */ readonly uuid: string; /** * * @type {boolean} * @memberof Agent */ expiring?: boolean; /** * * @type {Date} * @memberof Agent */ expires?: Date | null; /** * * @type {PartialUser} * @memberof Agent */ readonly parent: PartialUser; /** * * @type {PolicyBehaviorEnum} * @memberof Agent */ readonly policyBehavior: PolicyBehaviorEnum; /** * Identifier of the agent's API token, so its key can be retrieved/copied later. * @type {string} * @memberof Agent */ readonly tokenIdentifier: string | null; } /** * Check if a given object implements the Agent interface. */ export function instanceOfAgent(value: object): value is Agent { if (!('pk' in value) || value['pk'] === undefined) return false; if (!('username' in value) || value['username'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('uid' in value) || value['uid'] === undefined) return false; if (!('uuid' in value) || value['uuid'] === undefined) return false; if (!('parent' in value) || value['parent'] === undefined) return false; if (!('policyBehavior' in value) || value['policyBehavior'] === undefined) return false; if (!('tokenIdentifier' in value) || value['tokenIdentifier'] === undefined) return false; return true; } export function AgentFromJSON(json: any): Agent { return AgentFromJSONTyped(json, false); } export function AgentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Agent { if (json == null) { return json; } return { 'pk': json['pk'], 'username': json['username'], 'name': json['name'], 'isActive': json['is_active'] == null ? undefined : json['is_active'], 'lastLogin': json['last_login'] == null ? undefined : (new Date(json['last_login'])), 'email': json['email'] == null ? undefined : json['email'], 'attributes': json['attributes'] == null ? undefined : json['attributes'], 'uid': json['uid'], 'uuid': json['uuid'], 'expiring': json['expiring'] == null ? undefined : json['expiring'], 'expires': json['expires'] == null ? undefined : (new Date(json['expires'])), 'parent': PartialUserFromJSON(json['parent']), 'policyBehavior': PolicyBehaviorEnumFromJSON(json['policy_behavior']), 'tokenIdentifier': json['token_identifier'], }; } export function AgentToJSON(json: any): Agent { return AgentToJSONTyped(json, false); } export function AgentToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'username': value['username'], 'name': value['name'], 'is_active': value['isActive'], 'last_login': value['lastLogin'] == null ? value['lastLogin'] : value['lastLogin'].toISOString(), 'email': value['email'], 'attributes': value['attributes'], 'expiring': value['expiring'], 'expires': value['expires'] == null ? value['expires'] : value['expires'].toISOString(), }; }