@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
184 lines (173 loc) • 5.09 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';
/**
*
* @export
* @interface AlertResponse
*/
export interface AlertResponse {
/**
*
* @type {string}
* @memberof AlertResponse
*/
id: string;
/**
*
* @type {Date}
* @memberof AlertResponse
*/
createdAt?: Date | null;
/**
*
* @type {Date}
* @memberof AlertResponse
*/
updatedAt?: Date | null;
/**
*
* @type {Date}
* @memberof AlertResponse
*/
expiresAt?: Date | null;
/**
*
* @type {string}
* @memberof AlertResponse
*/
userId: string;
/**
*
* @type {string}
* @memberof AlertResponse
*/
query?: string | null;
/**
*
* @type {string}
* @memberof AlertResponse
*/
cron: string;
/**
*
* @type {string}
* @memberof AlertResponse
*/
model: string | null;
/**
*
* @type {string}
* @memberof AlertResponse
*/
shareLink?: string | null;
/**
*
* @type {Array<{ [key: string]: any; } | null>}
* @memberof AlertResponse
*/
sources: Array<{ [key: string]: any; } | null>;
/**
*
* @type {{ [key: string]: any; }}
* @memberof AlertResponse
*/
report?: { [key: string]: any; } | null;
/**
*
* @type {Array<{ [key: string]: any; } | null>}
* @memberof AlertResponse
*/
triggers: Array<{ [key: string]: any; } | null>;
/**
*
* @type {boolean}
* @memberof AlertResponse
*/
alwaysTrigger?: boolean;
/**
*
* @type {boolean}
* @memberof AlertResponse
*/
repeat?: boolean;
/**
*
* @type {boolean}
* @memberof AlertResponse
*/
active?: boolean;
}
/**
* Check if a given object implements the AlertResponse interface.
*/
export function instanceOfAlertResponse(value: object): value is AlertResponse {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('userId' in value) || value['userId'] === undefined) return false;
if (!('cron' in value) || value['cron'] === undefined) return false;
if (!('model' in value) || value['model'] === undefined) return false;
if (!('sources' in value) || value['sources'] === undefined) return false;
if (!('triggers' in value) || value['triggers'] === undefined) return false;
return true;
}
export function AlertResponseFromJSON(json: any): AlertResponse {
return AlertResponseFromJSONTyped(json, false);
}
export function AlertResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlertResponse {
if (json == null) {
return json;
}
return {
'id': json['id'],
'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
'userId': json['user_id'],
'query': json['query'] == null ? undefined : json['query'],
'cron': json['cron'],
'model': json['model'],
'shareLink': json['share_link'] == null ? undefined : json['share_link'],
'sources': json['sources'],
'report': json['report'] == null ? undefined : json['report'],
'triggers': json['triggers'],
'alwaysTrigger': json['always_trigger'] == null ? undefined : json['always_trigger'],
'repeat': json['repeat'] == null ? undefined : json['repeat'],
'active': json['active'] == null ? undefined : json['active'],
};
}
export function AlertResponseToJSON(json: any): AlertResponse {
return AlertResponseToJSONTyped(json, false);
}
export function AlertResponseToJSONTyped(value?: AlertResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'created_at': value['createdAt'] == null ? undefined : ((value['createdAt'] as any).toISOString()),
'updated_at': value['updatedAt'] == null ? undefined : ((value['updatedAt'] as any).toISOString()),
'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt'] as any).toISOString()),
'user_id': value['userId'],
'query': value['query'],
'cron': value['cron'],
'model': value['model'],
'share_link': value['shareLink'],
'sources': value['sources'],
'report': value['report'],
'triggers': value['triggers'],
'always_trigger': value['alwaysTrigger'],
'repeat': value['repeat'],
'active': value['active'],
};
}