square-connect
Version:
JavaScript client library for the Square Connect v2 API
85 lines (66 loc) • 2.54 kB
JavaScript
/**
* 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 Order = require('./Order');
/**
* The CreateOrderRequest model module.
* @module model/CreateOrderRequest
*/
/**
* Constructs a new <code>CreateOrderRequest</code>.
*
* @alias module:model/CreateOrderRequest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>CreateOrderRequest</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/CreateOrderRequest} obj Optional instance to populate.
* @return {module:model/CreateOrderRequest} The populated <code>CreateOrderRequest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('order')) {
obj['order'] = Order.constructFromObject(data['order']);
}
if (data.hasOwnProperty('location_id')) {
obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
}
if (data.hasOwnProperty('idempotency_key')) {
obj['idempotency_key'] = ApiClient.convertToType(data['idempotency_key'], 'String');
}
}
return obj;
}
/**
* The order to create. If this field is set, then the only other top-level field that can be set is the idempotency_key.
* @member {module:model/Order} order
*/
exports.prototype['order'] = undefined;
/**
* The ID of the business location to associate the order with.
* @member {String} location_id
*/
exports.prototype['location_id'] = undefined;
/**
* A value you specify that uniquely identifies this order among orders you've created. If you're unsure whether a particular order was created successfully, you can reattempt it with the same idempotency key without worrying about creating duplicate orders. See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information.
* @member {String} idempotency_key
*/
exports.prototype['idempotency_key'] = undefined;
module.exports = exports;