/* tslint:disable */ /* eslint-disable */ /** * Zeplin API * Access your resources in Zeplin * * Contact: support@zeplin.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { ComponentSectionReference, transformComponentSectionReferenceToJSON, transformJSONToComponentSectionReference } from './component-section-reference'; import { ComponentVariantProperty, transformComponentVariantPropertyToJSON, transformJSONToComponentVariantProperty } from './component-variant-property'; import { ComponentVersion, transformComponentVersionToJSON, transformJSONToComponentVersion } from './component-version'; import { ResourceSource, transformResourceSourceToJSON, transformJSONToResourceSource } from './resource-source'; import { SnapshotImage, transformSnapshotImageToJSON, transformJSONToSnapshotImage } from './snapshot-image'; export const transformComponentToJSON = function (value: Component): any { return { id: value.id, name: value.name, description: value.description, image: transformSnapshotImageToJSON(value.image), created: value.created, updated: value.updated, section: value.section && transformComponentSectionReferenceToJSON(value.section), variant_properties: value.variantProperties && value.variantProperties.map(transformComponentVariantPropertyToJSON), source: value.source && transformResourceSourceToJSON(value.source), latest_version: value.latestVersion && transformComponentVersionToJSON(value.latestVersion) } } export const transformJSONToComponent = function (value: any): Component { return { id: value.id, name: value.name, description: value.description, image: transformJSONToSnapshotImage(value.image), created: value.created, updated: value.updated, section: value.section && transformJSONToComponentSectionReference(value.section), variantProperties: value.variant_properties && value.variant_properties.map(transformJSONToComponentVariantProperty), source: value.source && transformJSONToResourceSource(value.source), latestVersion: value.latest_version && transformJSONToComponentVersion(value.latest_version) } } /** * * @export * @interface Component */ export interface Component { /** * The unique id of the component * @type {string} * @memberof Component */ id: string; /** * The name of the component * @type {string} * @memberof Component */ name: string; /** * The description of the component * @type {string} * @memberof Component */ description?: string; /** * * @type {SnapshotImage} * @memberof Component */ image: SnapshotImage; /** * The unix timestamp when the component was created * @type {number} * @memberof Component */ created: number; /** * The unix timestamp when the component was updated * @type {number} * @memberof Component */ updated?: number; /** * * @type {ComponentSectionReference} * @memberof Component */ section?: ComponentSectionReference; /** * Variant properties of the component * @type {Array} * @memberof Component */ variantProperties?: Array; /** * * @type {ResourceSource} * @memberof Component */ source?: ResourceSource; /** * * @type {ComponentVersion} * @memberof Component */ latestVersion?: ComponentVersion; }