/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.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 { mapValues } from '../runtime';
/**
 * 
 * @export
 * @interface CodeResponse
 */
export interface CodeResponse {
    /**
     * 
     * @type {string}
     * @memberof CodeResponse
     */
    code: string | null;
    /**
     * 
     * @type {string}
     * @memberof CodeResponse
     */
    state?: string | null;
}

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

export function CodeResponseFromJSON(json: any): CodeResponse {
    return CodeResponseFromJSONTyped(json, false);
}

export function CodeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CodeResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'code': json['code'],
        'state': json['state'] == null ? undefined : json['state'],
    };
}

export function CodeResponseToJSON(json: any): CodeResponse {
    return CodeResponseToJSONTyped(json, false);
}

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

    return {
        
        'code': value['code'],
        'state': value['state'],
    };
}

