/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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.
 */

/**
 *
 * @export
 * @interface UserServiceAccountResponse
 */
export interface UserServiceAccountResponse {
    /**
     *
     * @type {string}
     * @memberof UserServiceAccountResponse
     */
    username: string;
    /**
     *
     * @type {string}
     * @memberof UserServiceAccountResponse
     */
    token: string;
    /**
     *
     * @type {string}
     * @memberof UserServiceAccountResponse
     */
    userUid: string;
    /**
     *
     * @type {number}
     * @memberof UserServiceAccountResponse
     */
    userPk: number;
    /**
     *
     * @type {string}
     * @memberof UserServiceAccountResponse
     */
    groupPk?: string;
}

/**
 * Check if a given object implements the UserServiceAccountResponse interface.
 */
export function instanceOfUserServiceAccountResponse(
    value: object,
): value is UserServiceAccountResponse {
    if (!("username" in value) || value["username"] === undefined) return false;
    if (!("token" in value) || value["token"] === undefined) return false;
    if (!("userUid" in value) || value["userUid"] === undefined) return false;
    if (!("userPk" in value) || value["userPk"] === undefined) return false;
    return true;
}

export function UserServiceAccountResponseFromJSON(json: any): UserServiceAccountResponse {
    return UserServiceAccountResponseFromJSONTyped(json, false);
}

export function UserServiceAccountResponseFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): UserServiceAccountResponse {
    if (json == null) {
        return json;
    }
    return {
        username: json["username"],
        token: json["token"],
        userUid: json["user_uid"],
        userPk: json["user_pk"],
        groupPk: json["group_pk"] == null ? undefined : json["group_pk"],
    };
}

export function UserServiceAccountResponseToJSON(json: any): UserServiceAccountResponse {
    return UserServiceAccountResponseToJSONTyped(json, false);
}

export function UserServiceAccountResponseToJSONTyped(
    value?: UserServiceAccountResponse | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        username: value["username"],
        token: value["token"],
        user_uid: value["userUid"],
        user_pk: value["userPk"],
        group_pk: value["groupPk"],
    };
}
