/* tslint:disable */
/* eslint-disable */
/**
 * Hexiosec Transfer API
 * API description for Hexiosec Transfer  ## Testing Requests  Endpoints that require authentication will use your session cookie from the main application if an API key is not provided. This is fine for testing GET requests, however POST/DELETE requests will require a CSRF token when using a session cookie. It is not possible to provide a CSRF token from this page, and so an API key must be used.
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: support@hexiosec.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import { InviteSummaryResponseFromJSON, InviteSummaryResponseToJSON, } from './InviteSummaryResponse.js';
import { UserSummaryResponseFromJSON, UserSummaryResponseToJSON, } from './UserSummaryResponse.js';
/**
 * Check if a given object implements the FileResponse interface.
 */
export function instanceOfFileResponse(value) {
    if (!('id' in value) || value['id'] === undefined)
        return false;
    if (!('publicId' in value) || value['publicId'] === undefined)
        return false;
    if (!('userId' in value) || value['userId'] === undefined)
        return false;
    if (!('description' in value) || value['description'] === undefined)
        return false;
    if (!('flags' in value) || value['flags'] === undefined)
        return false;
    if (!('count' in value) || value['count'] === undefined)
        return false;
    if (!('created' in value) || value['created'] === undefined)
        return false;
    if (!('size' in value) || value['size'] === undefined)
        return false;
    if (!('state' in value) || value['state'] === undefined)
        return false;
    return true;
}
export function FileResponseFromJSON(json) {
    return FileResponseFromJSONTyped(json, false);
}
export function FileResponseFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        id: json['id'],
        publicId: json['public_id'],
        userId: json['user_id'],
        description: json['description'],
        flags: json['flags'],
        count: json['count'],
        created: new Date(json['created']),
        exp: json['exp'] == null ? undefined : new Date(json['exp']),
        max: json['max'] == null ? undefined : json['max'],
        salt: json['salt'] == null ? undefined : json['salt'],
        nonce: json['nonce'] == null ? undefined : json['nonce'],
        publicKey: json['public_key'] == null ? undefined : json['public_key'],
        size: json['size'],
        state: json['state'],
        recipients: json['recipients'] == null ? undefined : json['recipients'],
        user: json['user'] == null ? undefined : UserSummaryResponseFromJSON(json['user']),
        invite: json['invite'] == null ? undefined : InviteSummaryResponseFromJSON(json['invite']),
    };
}
export function FileResponseToJSON(json) {
    return FileResponseToJSONTyped(json, false);
}
export function FileResponseToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        id: value['id'],
        public_id: value['publicId'],
        user_id: value['userId'],
        description: value['description'],
        flags: value['flags'],
        count: value['count'],
        created: value['created'].toISOString(),
        exp: value['exp'] == null ? undefined : value['exp'].toISOString(),
        max: value['max'],
        salt: value['salt'],
        nonce: value['nonce'],
        public_key: value['publicKey'],
        size: value['size'],
        state: value['state'],
        recipients: value['recipients'],
        user: UserSummaryResponseToJSON(value['user']),
        invite: InviteSummaryResponseToJSON(value['invite']),
    };
}
