import { get, map } from 'lodash'; import { KeyValue } from './key-value'; export class SeamsHttpResponse { errorId: string; errorMessage: string; isSuccess: boolean; responseObject: number; seamsErrorCodes: KeyValue[]; constructor(data: unknown) { this.errorId = get(data, 'errorId'); this.errorMessage = get(data, 'errorMessage'); this.isSuccess = get(data, 'isSuccess'); this.responseObject = get(data, 'responseObject'); this.seamsErrorCodes = map(get(data, 'seamsErrorCodes'), (i: unknown) => new KeyValue(i)); } }