import {Identifier} from './Identifiers'; import {ApiV3} from './lib/ApiV3'; import { ConsentUpdate, GetConsentResponse, GetReachabilityResponse, IdentifierMetadata, IdentifierMetadataResponse, ReachabilityUpdate } from './Types'; import {ODPClient} from './index'; import {getConsent, updateConsent} from './Identifiers/consent'; import {getMetadata, updateMetadata} from './Identifiers/identifiers'; import {getReachability, updateReachability} from './Identifiers/reachability'; export class IdentifierApi implements Identifier { public constructor(private client: ODPClient){ } public getConsent(identifierName: string, identifierValue: string): Promise> { return getConsent(this.client.v3Api, identifierName, identifierValue); } public getMetadata = ( identifierFieldName: string, identifierValue: string ): Promise> => getMetadata( this.client.v3Api, identifierFieldName, identifierValue ); public getReachability = ( identifierName: string, value: string ): Promise> => getReachability(this.client.v3Api, identifierName, value); public updateConsent = ( updates: ConsentUpdate | ConsentUpdate[] ): Promise> => updateConsent(this.client.v3Api, updates); public updateMetadata = ( updates: IdentifierMetadata | IdentifierMetadata[] ): Promise> => updateMetadata(this.client.v3Api, updates); public updateReachability = ( updates: ReachabilityUpdate | ReachabilityUpdate[] ): Promise> => updateReachability(this.client.v3Api, updates); }