UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

77 lines (60 loc) 2.48 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'); /** * The PublishInvoiceRequest model module. * Note: This model is in beta. * @module model/PublishInvoiceRequest */ /** * Constructs a new <code>PublishInvoiceRequest</code>. * Describes a &#x60;PublishInvoice&#x60; request. * @alias module:model/PublishInvoiceRequest * @class * @param version {Number} The version of the `Invoice` to publish. This must match the current version of the invoice, otherwise the request is rejected. */ var exports = function(version) { var _this = this; _this['version'] = version; }; /** * Constructs a <code>PublishInvoiceRequest</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/PublishInvoiceRequest} obj Optional instance to populate. * @return {module:model/PublishInvoiceRequest} The populated <code>PublishInvoiceRequest</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('version')) { obj['version'] = ApiClient.convertToType(data['version'], 'Number'); } if (data.hasOwnProperty('idempotency_key')) { obj['idempotency_key'] = ApiClient.convertToType(data['idempotency_key'], 'String'); } } return obj; } /** * The version of the `Invoice` to publish. This must match the current version of the invoice, otherwise the request is rejected. * @member {Number} version */ exports.prototype['version'] = undefined; /** * A unique string that identifies the `PublishInvoice` request. If you do not provide `idempotency_key` (or provide an empty string as the value), the endpoint treats each request as independent. For more information, see [Idempotency](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). * @member {String} idempotency_key */ exports.prototype['idempotency_key'] = undefined; module.exports = exports;