/* 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 { OrganizationWebhookEventEnum, transformOrganizationWebhookEventEnumToJSON, transformJSONToOrganizationWebhookEventEnum } from './organization-webhook-event-enum'; import { User, transformUserToJSON, transformJSONToUser } from './user'; import { WebhookHealthEnum, transformWebhookHealthEnumToJSON, transformJSONToWebhookHealthEnum } from './webhook-health-enum'; import { WebhookStatusEnum, transformWebhookStatusEnumToJSON, transformJSONToWebhookStatusEnum } from './webhook-status-enum'; import { ZeplinApplication, transformZeplinApplicationToJSON, transformJSONToZeplinApplication } from './zeplin-application'; export const transformOrganizationWebhookToJSON = function (value: OrganizationWebhook): any { return { id: value.id, url: value.url, name: value.name, status: transformWebhookStatusEnumToJSON(value.status), url_health: transformWebhookHealthEnumToJSON(value.urlHealth), created: value.created, updated: value.updated, created_by: transformUserToJSON(value.createdBy), updated_by: transformUserToJSON(value.updatedBy), zeplin_app: value.zeplinApp && transformZeplinApplicationToJSON(value.zeplinApp), events: [...value.events].map(transformOrganizationWebhookEventEnumToJSON), project_ids: [...value.projectIds], styleguide_ids: [...value.styleguideIds] } } export const transformJSONToOrganizationWebhook = function (value: any): OrganizationWebhook { return { id: value.id, url: value.url, name: value.name, status: transformJSONToWebhookStatusEnum(value.status), urlHealth: transformJSONToWebhookHealthEnum(value.url_health), created: value.created, updated: value.updated, createdBy: transformJSONToUser(value.created_by), updatedBy: transformJSONToUser(value.updated_by), zeplinApp: value.zeplin_app && transformJSONToZeplinApplication(value.zeplin_app), events: new Set(value.events.map(transformJSONToOrganizationWebhookEventEnum)), projectIds: new Set(value.project_ids), styleguideIds: new Set(value.styleguide_ids) } } /** * * @export * @interface OrganizationWebhook */ export interface OrganizationWebhook { /** * The unique id of the webhook * @type {string} * @memberof OrganizationWebhook */ id: string; /** * The URL of the webhook * @type {string} * @memberof OrganizationWebhook */ url: string; /** * The name of the webhook * @type {string} * @memberof OrganizationWebhook */ name?: string; /** * * @type {WebhookStatusEnum} * @memberof OrganizationWebhook */ status: WebhookStatusEnum; /** * * @type {WebhookHealthEnum} * @memberof OrganizationWebhook */ urlHealth: WebhookHealthEnum; /** * The unix timestamp when the webhook was created * @type {number} * @memberof OrganizationWebhook */ created: number; /** * The unix timestamp when the webhook was updated * @type {number} * @memberof OrganizationWebhook */ updated: number; /** * * @type {User} * @memberof OrganizationWebhook */ createdBy: User; /** * * @type {User} * @memberof OrganizationWebhook */ updatedBy: User; /** * * @type {ZeplinApplication} * @memberof OrganizationWebhook */ zeplinApp?: ZeplinApplication; /** * The events of the webhook * @type {Set} * @memberof OrganizationWebhook */ events: Set; /** * The project ids of the webhooks. Note: `*` wildcard denotes all project_ids * @type {Set} * @memberof OrganizationWebhook */ projectIds: Set; /** * The styleguide ids of the webhooks. Note: `*` wildcard denotes all styleguide_ids * @type {Set} * @memberof OrganizationWebhook */ styleguideIds: Set; }