/* tslint:disable */
/* eslint-disable */
/**
 * elkar-app
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.1.0
 * 
 *
 * 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';
/**
 * 
 * @export
 * @interface ApiKeyOutput
 */
export interface ApiKeyOutput {
    /**
     * 
     * @type {string}
     * @memberof ApiKeyOutput
     */
    agentId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ApiKeyOutput
     */
    apiKey?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof ApiKeyOutput
     */
    createdAt: Date;
    /**
     * 
     * @type {string}
     * @memberof ApiKeyOutput
     */
    createdBy?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof ApiKeyOutput
     */
    expiresAt?: Date | null;
    /**
     * 
     * @type {string}
     * @memberof ApiKeyOutput
     */
    id: string;
    /**
     * 
     * @type {string}
     * @memberof ApiKeyOutput
     */
    name: string;
}

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

export function ApiKeyOutputFromJSON(json: any): ApiKeyOutput {
    return ApiKeyOutputFromJSONTyped(json, false);
}

export function ApiKeyOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKeyOutput {
    if (json == null) {
        return json;
    }
    return {
        
        'agentId': json['agent_id'] == null ? undefined : json['agent_id'],
        'apiKey': json['api_key'] == null ? undefined : json['api_key'],
        'createdAt': (new Date(json['created_at'])),
        'createdBy': json['created_by'] == null ? undefined : json['created_by'],
        'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
        'id': json['id'],
        'name': json['name'],
    };
}

export function ApiKeyOutputToJSON(json: any): ApiKeyOutput {
    return ApiKeyOutputToJSONTyped(json, false);
}

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

    return {
        
        'agent_id': value['agentId'],
        'api_key': value['apiKey'],
        'created_at': ((value['createdAt']).toISOString()),
        'created_by': value['createdBy'],
        'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt'] as any).toISOString()),
        'id': value['id'],
        'name': value['name'],
    };
}

