/* tslint:disable */
/* eslint-disable */
/**
 * OpenAPI Petstore
 * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
 *
 * The version of the OpenAPI document: 1.0.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 { exists, mapValues } from '../runtime';
/**
 * Contains all the info about a pet part
 * @export
 * @interface Part
 */
export interface Part {
    /**
     * Unique identifier from the database
     * @type {number}
     * @memberof Part
     */
    id: number;
    /**
     * Name of the part
     * @type {string}
     * @memberof Part
     */
    name: string;
}

/**
 * Check if a given object implements the Part interface.
 */
export function instanceOfPart(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "id" in value;
    isInstance = isInstance && "name" in value;

    return isInstance;
}

export function PartFromJSON(json: any): Part {
    return PartFromJSONTyped(json, false);
}

export function PartFromJSONTyped(json: any, ignoreDiscriminator: boolean): Part {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'id': json['id'],
        'name': json['name'],
    };
}

export function PartToJSON(value?: Part | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'id': value.id,
        'name': value.name,
    };
}

