/* tslint:disable */ /* eslint-disable */ /** * Boat Public API v1 * Public JSON API for creating, operating, prompting, observing, and exposing Boat sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1. * * 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 { mapValues } from '../runtime'; import type { WebhookEventType } from './WebhookEventType'; import { WebhookEventTypeFromJSON, WebhookEventTypeFromJSONTyped, WebhookEventTypeToJSON, WebhookEventTypeToJSONTyped, } from './WebhookEventType'; /** * * @export * @interface Webhook */ export interface Webhook { /** * * @type {string} * @memberof Webhook */ id: string; /** * * @type {string} * @memberof Webhook */ name: string | null; /** * Public HTTPS endpoint on port 443. * @type {string} * @memberof Webhook */ url: string; /** * * @type {Set} * @memberof Webhook */ events: Set; /** * * @type {Date} * @memberof Webhook */ createdAt: Date; /** * * @type {Date} * @memberof Webhook */ updatedAt: Date; } /** * Check if a given object implements the Webhook interface. */ export function instanceOfWebhook(value: object): value is Webhook { if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('url' in value) || value['url'] === undefined) return false; if (!('events' in value) || value['events'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; } export function WebhookFromJSON(json: any): Webhook { return WebhookFromJSONTyped(json, false); } export function WebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): Webhook { if (json == null) { return json; } return { 'id': json['id'], 'name': json['name'], 'url': json['url'], 'events': (new Set((json['events'] as Array).map(WebhookEventTypeFromJSON))), 'createdAt': (new Date(json['createdAt'])), 'updatedAt': (new Date(json['updatedAt'])), }; } export function WebhookToJSON(json: any): Webhook { return WebhookToJSONTyped(json, false); } export function WebhookToJSONTyped(value?: Webhook | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'name': value['name'], 'url': value['url'], 'events': (Array.from(value['events'] as Set).map(WebhookEventTypeToJSON)), 'createdAt': value['createdAt'].toISOString(), 'updatedAt': value['updatedAt'].toISOString(), }; }