@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
93 lines (78 loc) • 2.19 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.19.10
* Contact: contact@emergentmethods.ai
*
* 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 { WebhookParams } from './WebhookParams';
import {
WebhookParamsFromJSON,
WebhookParamsFromJSONTyped,
WebhookParamsToJSON,
WebhookParamsToJSONTyped,
} from './WebhookParams';
/**
*
* @export
* @interface WebhookAction
*/
export interface WebhookAction {
/**
*
* @type {string}
* @memberof WebhookAction
*/
action?: WebhookActionActionEnum;
/**
*
* @type {WebhookParams}
* @memberof WebhookAction
*/
params: WebhookParams;
}
/**
* @export
*/
export const WebhookActionActionEnum = {
Webhook: 'webhook'
} as const;
export type WebhookActionActionEnum = typeof WebhookActionActionEnum[keyof typeof WebhookActionActionEnum];
/**
* Check if a given object implements the WebhookAction interface.
*/
export function instanceOfWebhookAction(value: object): value is WebhookAction {
if (!('params' in value) || value['params'] === undefined) return false;
return true;
}
export function WebhookActionFromJSON(json: any): WebhookAction {
return WebhookActionFromJSONTyped(json, false);
}
export function WebhookActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookAction {
if (json == null) {
return json;
}
return {
'action': json['action'] == null ? undefined : json['action'],
'params': WebhookParamsFromJSON(json['params']),
};
}
export function WebhookActionToJSON(json: any): WebhookAction {
return WebhookActionToJSONTyped(json, false);
}
export function WebhookActionToJSONTyped(value?: WebhookAction | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'action': value['action'],
'params': WebhookParamsToJSON(value['params']),
};
}