square-connect
Version:
JavaScript client library for the Square Connect v2 API
194 lines (163 loc) • 7 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 OrderFulfillmentRecipient = require('./OrderFulfillmentRecipient');
/**
* The OrderFulfillmentShipmentDetails model module.
* Note: This model is in beta.
* @module model/OrderFulfillmentShipmentDetails
*/
/**
* Constructs a new <code>OrderFulfillmentShipmentDetails</code>.
* Contains details necessary to fulfill a shipment order.
* @alias module:model/OrderFulfillmentShipmentDetails
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>OrderFulfillmentShipmentDetails</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/OrderFulfillmentShipmentDetails} obj Optional instance to populate.
* @return {module:model/OrderFulfillmentShipmentDetails} The populated <code>OrderFulfillmentShipmentDetails</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('recipient')) {
obj['recipient'] = OrderFulfillmentRecipient.constructFromObject(data['recipient']);
}
if (data.hasOwnProperty('carrier')) {
obj['carrier'] = ApiClient.convertToType(data['carrier'], 'String');
}
if (data.hasOwnProperty('shipping_note')) {
obj['shipping_note'] = ApiClient.convertToType(data['shipping_note'], 'String');
}
if (data.hasOwnProperty('shipping_type')) {
obj['shipping_type'] = ApiClient.convertToType(data['shipping_type'], 'String');
}
if (data.hasOwnProperty('tracking_number')) {
obj['tracking_number'] = ApiClient.convertToType(data['tracking_number'], 'String');
}
if (data.hasOwnProperty('tracking_url')) {
obj['tracking_url'] = ApiClient.convertToType(data['tracking_url'], 'String');
}
if (data.hasOwnProperty('placed_at')) {
obj['placed_at'] = ApiClient.convertToType(data['placed_at'], 'String');
}
if (data.hasOwnProperty('in_progress_at')) {
obj['in_progress_at'] = ApiClient.convertToType(data['in_progress_at'], 'String');
}
if (data.hasOwnProperty('packaged_at')) {
obj['packaged_at'] = ApiClient.convertToType(data['packaged_at'], 'String');
}
if (data.hasOwnProperty('expected_shipped_at')) {
obj['expected_shipped_at'] = ApiClient.convertToType(data['expected_shipped_at'], 'String');
}
if (data.hasOwnProperty('shipped_at')) {
obj['shipped_at'] = ApiClient.convertToType(data['shipped_at'], 'String');
}
if (data.hasOwnProperty('canceled_at')) {
obj['canceled_at'] = ApiClient.convertToType(data['canceled_at'], 'String');
}
if (data.hasOwnProperty('cancel_reason')) {
obj['cancel_reason'] = ApiClient.convertToType(data['cancel_reason'], 'String');
}
if (data.hasOwnProperty('failed_at')) {
obj['failed_at'] = ApiClient.convertToType(data['failed_at'], 'String');
}
if (data.hasOwnProperty('failure_reason')) {
obj['failure_reason'] = ApiClient.convertToType(data['failure_reason'], 'String');
}
}
return obj;
}
/**
* Information on the person meant to receive this shipment fulfillment.
* @member {module:model/OrderFulfillmentRecipient} recipient
*/
exports.prototype['recipient'] = undefined;
/**
* The shipping carrier being used to ship this fulfillment e.g. UPS, FedEx, USPS, etc.
* @member {String} carrier
*/
exports.prototype['carrier'] = undefined;
/**
* A note with additional information for the shipping carrier.
* @member {String} shipping_note
*/
exports.prototype['shipping_note'] = undefined;
/**
* A description of the type of shipping product purchased from the carrier. e.g. First Class, Priority, Express
* @member {String} shipping_type
*/
exports.prototype['shipping_type'] = undefined;
/**
* The reference number provided by the carrier to track the shipment's progress.
* @member {String} tracking_number
*/
exports.prototype['tracking_number'] = undefined;
/**
* A link to the tracking webpage on the carrier's website.
* @member {String} tracking_url
*/
exports.prototype['tracking_url'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating when the shipment was requested. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} placed_at
*/
exports.prototype['placed_at'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating when this fulfillment was moved to the `RESERVED` state. Indicates that preparation of this shipment has begun. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} in_progress_at
*/
exports.prototype['in_progress_at'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating when this fulfillment was moved to the `PREPARED` state. Indicates that the fulfillment is packaged. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} packaged_at
*/
exports.prototype['packaged_at'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating when the shipment is expected to be delivered to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} expected_shipped_at
*/
exports.prototype['expected_shipped_at'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating when this fulfillment was moved to the `COMPLETED`state. Indicates that the fulfillment has been given to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} shipped_at
*/
exports.prototype['shipped_at'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating the shipment was canceled. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} canceled_at
*/
exports.prototype['canceled_at'] = undefined;
/**
* A description of why the shipment was canceled.
* @member {String} cancel_reason
*/
exports.prototype['cancel_reason'] = undefined;
/**
* The [timestamp](#workingwithdates) indicating when the shipment failed to be completed. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
* @member {String} failed_at
*/
exports.prototype['failed_at'] = undefined;
/**
* A description of why the shipment failed to be completed.
* @member {String} failure_reason
*/
exports.prototype['failure_reason'] = undefined;
module.exports = exports;