/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.0-rc1
 * 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';
/**
 * Stripped down user serializer to show relevant users for groups
 * @export
 * @interface GroupMemberRequest
 */
export interface GroupMemberRequest {
    /**
     * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
     * @type {string}
     * @memberof GroupMemberRequest
     */
    username: string;
    /**
     * User's display name.
     * @type {string}
     * @memberof GroupMemberRequest
     */
    name: string;
    /**
     * Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
     * @type {boolean}
     * @memberof GroupMemberRequest
     */
    isActive?: boolean;
    /**
     * 
     * @type {Date}
     * @memberof GroupMemberRequest
     */
    lastLogin?: Date | null;
    /**
     * 
     * @type {string}
     * @memberof GroupMemberRequest
     */
    email?: string;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof GroupMemberRequest
     */
    attributes?: { [key: string]: any; };
}

/**
 * Check if a given object implements the GroupMemberRequest interface.
 */
export function instanceOfGroupMemberRequest(value: object): value is GroupMemberRequest {
    if (!('username' in value) || value['username'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    return true;
}

export function GroupMemberRequestFromJSON(json: any): GroupMemberRequest {
    return GroupMemberRequestFromJSONTyped(json, false);
}

export function GroupMemberRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupMemberRequest {
    if (json == null) {
        return json;
    }
    return {
        
        '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'],
    };
}

export function GroupMemberRequestToJSON(json: any): GroupMemberRequest {
    return GroupMemberRequestToJSONTyped(json, false);
}

export function GroupMemberRequestToJSONTyped(value?: GroupMemberRequest | 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 ? null : ((value['lastLogin'] as any)?.toISOString()),
        'email': value['email'],
        'attributes': value['attributes'],
    };
}

