UNPKG

omnisend-node-sdk

Version:

🔹 Typesafe Omnisend API SDK for Node.js

51 lines (50 loc) • 2.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Contacts = void 0; const http_client_1 = require("../http-client"); class Contacts { constructor(http) { /** * @description `contactID` - contact's ID in our system * * @tags Contacts * @name GetContacts * @summary Get contact's info * @request GET:/contacts/{contactID} * @secure */ this.getContacts = (contactId, params = {}) => this.http.request(Object.assign({ path: `/contacts/${contactId}`, method: "GET", secure: true, format: "json" }, params)); /** * @description Update existing contact. Pass only fields you want to update. `contactID` - contact's ID in our system You can update contact: * by `contactID` in endpoint path. Example: `PATCH` [https://api.omnisend.com/v3/contacts/696969](https://api.omnisend.com/v3/contacts/696969) **Note:** - You can update any field, except `email` (`identifiers.id` value for type `email`). - `Phone` (`identifiers.id` value for type `phone`) will be added/updated **only** if it isn't assigned to another contact. * * @tags Contacts * @name PatchContactsContactId * @summary Update contact * @request PATCH:/contacts/{contactID} * @secure */ this.patchContactsContactId = (contactId, data, params = {}) => this.http.request(Object.assign({ path: `/contacts/${contactId}`, method: "PATCH", body: data, secure: true, type: http_client_1.ContentType.Json, format: "json" }, params)); /** * No description * * @tags Contacts * @name ListContacts * @summary List contacts * @request GET:/contacts * @secure */ this.listContacts = (query, params = {}) => this.http.request(Object.assign({ path: `/contacts`, method: "GET", query, secure: true, format: "json" }, params)); /** * @description Create new contact. * * @tags Contacts * @name PostContacts * @summary Create contact * @request POST:/contacts * @secure */ this.postContacts = (data, params = {}) => this.http.request(Object.assign({ path: `/contacts`, method: "POST", body: data, secure: true, type: http_client_1.ContentType.Json, format: "json" }, params)); this.http = http; } } exports.Contacts = Contacts;