UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

103 lines (82 loc) 3.65 kB
/** * Square Connect API * Client library for accessing the Square Connect APIs * * OpenAPI spec version: 2.0 * Contact: developers@squareup.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 2.3.0-SNAPSHOT * */ var ApiClient = require('../ApiClient'); var Address = require('./Address'); /** * The OrderFulfillmentRecipient model module. * @module model/OrderFulfillmentRecipient */ /** * Constructs a new <code>OrderFulfillmentRecipient</code>. * Contains information on the recipient of a fulfillment. * @alias module:model/OrderFulfillmentRecipient * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>OrderFulfillmentRecipient</code> from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. * @param {module:model/OrderFulfillmentRecipient} obj Optional instance to populate. * @return {module:model/OrderFulfillmentRecipient} The populated <code>OrderFulfillmentRecipient</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('customer_id')) { obj['customer_id'] = ApiClient.convertToType(data['customer_id'], 'String'); } if (data.hasOwnProperty('display_name')) { obj['display_name'] = ApiClient.convertToType(data['display_name'], 'String'); } if (data.hasOwnProperty('email_address')) { obj['email_address'] = ApiClient.convertToType(data['email_address'], 'String'); } if (data.hasOwnProperty('phone_number')) { obj['phone_number'] = ApiClient.convertToType(data['phone_number'], 'String'); } if (data.hasOwnProperty('address')) { obj['address'] = Address.constructFromObject(data['address']); } } return obj; } /** * The Customer ID of the customer associated with the fulfillment. If `customer_id` is provided, the fulfillment recipient's `display_name`, `email_address`, and `phone_number` are automatically populated from the targeted customer profile. If these fields are set in the request, the request values will override the information from the customer profile. If the targeted customer profile does not contain the necessary information and these fields are left unset, the request will result in an error. * @member {String} customer_id */ exports.prototype['customer_id'] = undefined; /** * The display name of the fulfillment recipient. If provided, overrides the value pulled from the customer profile indicated by `customer_id`. * @member {String} display_name */ exports.prototype['display_name'] = undefined; /** * The email address of the fulfillment recipient. If provided, overrides the value pulled from the customer profile indicated by `customer_id`. * @member {String} email_address */ exports.prototype['email_address'] = undefined; /** * The phone number of the fulfillment recipient. If provided, overrides the value pulled from the customer profile indicated by `customer_id`. * @member {String} phone_number */ exports.prototype['phone_number'] = undefined; /** * The address of the fulfillment recipient. If provided, overrides the value pulled from the customer profile indicated by `customer_id`. * @member {module:model/Address} address */ exports.prototype['address'] = undefined; module.exports = exports;