/* tslint:disable */
/* eslint-disable */
/**
* Squad API
* API for managing Squad resources
*
* The version of the OpenAPI document: 4.8.0
* Contact: help@meetsquad.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.js';
/**
* Trustpilot integration configuration in API response (sanitized)
* @export
* @interface TrustpilotResponseConfig
*/
export interface TrustpilotResponseConfig {
/**
* Whether the Trustpilot integration is active
* @type {boolean}
* @memberof TrustpilotResponseConfig
*/
active: boolean;
/**
* Domain of the business on Trustpilot
* @type {string}
* @memberof TrustpilotResponseConfig
*/
domain: string;
/**
* Name of the business (extracted from domain or first review)
* @type {string}
* @memberof TrustpilotResponseConfig
*/
businessName: string;
/**
* User ID who created this integration
* @type {string}
* @memberof TrustpilotResponseConfig
*/
createdBy: string;
/**
* Total number of reviews read so far
* @type {number}
* @memberof TrustpilotResponseConfig
*/
totalReviewsRead: number;
/**
* ID of the last review that was read (rank_absolute as string)
* @type {string}
* @memberof TrustpilotResponseConfig
*/
lastReadReviewsId: string | null;
/**
* Number of reviews in the last sync
* @type {number}
* @memberof TrustpilotResponseConfig
*/
lastReviewCount: number;
/**
* Unix timestamp of the last review read
* @type {number}
* @memberof TrustpilotResponseConfig
*/
lastReadReviewsDate: number | null;
/**
* Unix timestamp of the last sync run
* @type {number}
* @memberof TrustpilotResponseConfig
*/
lastRunDate: number | null;
}
/**
* Check if a given object implements the TrustpilotResponseConfig interface.
*/
export function instanceOfTrustpilotResponseConfig(value: object): value is TrustpilotResponseConfig {
if (!('active' in value) || value['active'] === undefined) return false;
if (!('domain' in value) || value['domain'] === undefined) return false;
if (!('businessName' in value) || value['businessName'] === undefined) return false;
if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
if (!('totalReviewsRead' in value) || value['totalReviewsRead'] === undefined) return false;
if (!('lastReadReviewsId' in value) || value['lastReadReviewsId'] === undefined) return false;
if (!('lastReviewCount' in value) || value['lastReviewCount'] === undefined) return false;
if (!('lastReadReviewsDate' in value) || value['lastReadReviewsDate'] === undefined) return false;
if (!('lastRunDate' in value) || value['lastRunDate'] === undefined) return false;
return true;
}
export function TrustpilotResponseConfigFromJSON(json: any): TrustpilotResponseConfig {
return TrustpilotResponseConfigFromJSONTyped(json, false);
}
export function TrustpilotResponseConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrustpilotResponseConfig {
if (json == null) {
return json;
}
return {
'active': json['active'],
'domain': json['domain'],
'businessName': json['business_name'],
'createdBy': json['created_by'],
'totalReviewsRead': json['total_reviews_read'],
'lastReadReviewsId': json['last_read_reviews_id'],
'lastReviewCount': json['last_review_count'],
'lastReadReviewsDate': json['last_read_reviews_date'],
'lastRunDate': json['last_run_date'],
};
}
export function TrustpilotResponseConfigToJSON(json: any): TrustpilotResponseConfig {
return TrustpilotResponseConfigToJSONTyped(json, false);
}
export function TrustpilotResponseConfigToJSONTyped(value?: TrustpilotResponseConfig | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'active': value['active'],
'domain': value['domain'],
'business_name': value['businessName'],
'created_by': value['createdBy'],
'total_reviews_read': value['totalReviewsRead'],
'last_read_reviews_id': value['lastReadReviewsId'],
'last_review_count': value['lastReviewCount'],
'last_read_reviews_date': value['lastReadReviewsDate'],
'last_run_date': value['lastRunDate'],
};
}