@planet-a/affinity-node
Version:
API wrapper for the affinity.co API
97 lines (96 loc) • 6.74 kB
TypeScript
import { BaseAPIRequestFactory } from './baseapi.js';
import { Configuration } from '../configuration.js';
import { RequestContext, ResponseContext, HttpInfo } from '../http/http.js';
import { FieldMetadataPaged } from '../models/FieldMetadataPaged.js';
import { ListEntryPaged } from '../models/ListEntryPaged.js';
import { ListPaged } from '../models/ListPaged.js';
import { Person } from '../models/Person.js';
import { PersonPaged } from '../models/PersonPaged.js';
/**
* no description
*/
export declare class PersonsApiRequestFactory extends BaseAPIRequestFactory {
/**
* Paginate through Persons in Affinity. Returns basic information and non-list-specific field data on each Person. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/persons/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Persons will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the \"Export All People directory\" [permission](#section/Getting-Started/Permissions).
* Get all Persons
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
* @param ids People IDs
* @param fieldIds Field IDs for which to return field data
* @param fieldTypes Field Types for which to return field data
*/
getV2Persons(cursor?: string, limit?: number, ids?: Array<number>, fieldIds?: Array<string>, fieldTypes?: Array<'enriched' | 'global' | 'relationship-intelligence'>, _options?: Configuration): Promise<RequestContext>;
/**
* Returns metadata on non-list-specific Person Fields. Use the returned Field IDs to request field data from the GET `/v2/persons` and GET `/v2/persons/{id}` endpoints.
* Get metadata on Person Fields
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
*/
getV2PersonsFields(cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
/**
* Returns basic information and non-list-specific field data on the requested Person. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/persons/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Persons will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the \"Export All People directory\" [permission](#section/Getting-Started/Permissions).
* Get a single Person
* @param id Person ID
* @param fieldIds Field IDs for which to return field data
* @param fieldTypes Field Types for which to return field data
*/
getV2PersonsId(id: number, fieldIds?: Array<string>, fieldTypes?: Array<'enriched' | 'global' | 'relationship-intelligence'>, _options?: Configuration): Promise<RequestContext>;
/**
* Paginate through the List Entries (AKA rows) for the given Person across all Lists. Each List Entry includes field data for the Person, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom. Requires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).
* Get a Person\'s List Entries
* @param id Persons ID
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
*/
getV2PersonsIdListEntries(id: number, cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
/**
* Returns metadata for all the Lists on which the given Person appears.
* Get a Person\'s Lists
* @param id Persons ID
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
*/
getV2PersonsIdLists(id: number, cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
}
export declare class PersonsApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getV2Persons
* @throws ApiException if the response code was not in [200, 299]
*/
getV2PersonsWithHttpInfo(response: ResponseContext): Promise<HttpInfo<PersonPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getV2PersonsFields
* @throws ApiException if the response code was not in [200, 299]
*/
getV2PersonsFieldsWithHttpInfo(response: ResponseContext): Promise<HttpInfo<FieldMetadataPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getV2PersonsId
* @throws ApiException if the response code was not in [200, 299]
*/
getV2PersonsIdWithHttpInfo(response: ResponseContext): Promise<HttpInfo<Person>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getV2PersonsIdListEntries
* @throws ApiException if the response code was not in [200, 299]
*/
getV2PersonsIdListEntriesWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListEntryPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getV2PersonsIdLists
* @throws ApiException if the response code was not in [200, 299]
*/
getV2PersonsIdListsWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListPaged>>;
}