@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
91 lines (80 loc) • 2.62 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.22
* 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 WebSourceParams
*/
export interface WebSourceParams {
/**
* The queries to use for the web search. This is a list of strings.
* @type {Array<string>}
* @memberof WebSourceParams
*/
queries: Array<string>;
/**
*
* @type {Array<string>}
* @memberof WebSourceParams
*/
domains?: Array<string> | null;
/**
* If true, the web search will only return results that have a known publication date and are within the lookback period.
* @type {boolean}
* @memberof WebSourceParams
*/
strict?: boolean;
/**
* The number of hours back to accept for the web search. If not provided, no lookback will be applied.
* @type {number}
* @memberof WebSourceParams
*/
lookback?: number;
}
/**
* Check if a given object implements the WebSourceParams interface.
*/
export function instanceOfWebSourceParams(value: object): value is WebSourceParams {
if (!('queries' in value) || value['queries'] === undefined) return false;
return true;
}
export function WebSourceParamsFromJSON(json: any): WebSourceParams {
return WebSourceParamsFromJSONTyped(json, false);
}
export function WebSourceParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebSourceParams {
if (json == null) {
return json;
}
return {
'queries': json['queries'],
'domains': json['domains'] == null ? undefined : json['domains'],
'strict': json['strict'] == null ? undefined : json['strict'],
'lookback': json['lookback'] == null ? undefined : json['lookback'],
};
}
export function WebSourceParamsToJSON(json: any): WebSourceParams {
return WebSourceParamsToJSONTyped(json, false);
}
export function WebSourceParamsToJSONTyped(value?: WebSourceParams | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'queries': value['queries'],
'domains': value['domains'],
'strict': value['strict'],
'lookback': value['lookback'],
};
}