square-connect
Version:
JavaScript client library for the Square Connect v2 API
158 lines (131 loc) • 5.13 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 AppointmentSegment = require('./AppointmentSegment');
/**
* The Booking model module.
* Note: This model is in beta.
* @module model/Booking
*/
/**
* Constructs a new <code>Booking</code>.
* Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service at a given location to a requesting customer in one or more appointment segments.
* @alias module:model/Booking
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Booking</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/Booking} obj Optional instance to populate.
* @return {module:model/Booking} The populated <code>Booking</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('version')) {
obj['version'] = ApiClient.convertToType(data['version'], 'Number');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String');
}
if (data.hasOwnProperty('updated_at')) {
obj['updated_at'] = ApiClient.convertToType(data['updated_at'], 'String');
}
if (data.hasOwnProperty('start_at')) {
obj['start_at'] = ApiClient.convertToType(data['start_at'], 'String');
}
if (data.hasOwnProperty('location_id')) {
obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
}
if (data.hasOwnProperty('customer_id')) {
obj['customer_id'] = ApiClient.convertToType(data['customer_id'], 'String');
}
if (data.hasOwnProperty('customer_note')) {
obj['customer_note'] = ApiClient.convertToType(data['customer_note'], 'String');
}
if (data.hasOwnProperty('seller_note')) {
obj['seller_note'] = ApiClient.convertToType(data['seller_note'], 'String');
}
if (data.hasOwnProperty('appointment_segments')) {
obj['appointment_segments'] = ApiClient.convertToType(data['appointment_segments'], [AppointmentSegment]);
}
}
return obj;
}
/**
* A unique ID of this object representing a booking.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* The revision number for the booking used for optimistic concurrency.
* @member {Number} version
*/
exports.prototype['version'] = undefined;
/**
* The status of the booking, describing where the booking stands with respect to the booking state machine. See [BookingStatus](#type-bookingstatus) for possible values
* @member {String} status
*/
exports.prototype['status'] = undefined;
/**
* The timestamp specifying the creation time of this booking.
* @member {String} created_at
*/
exports.prototype['created_at'] = undefined;
/**
* The timestamp specifying the most recent update time of this booking.
* @member {String} updated_at
*/
exports.prototype['updated_at'] = undefined;
/**
* The timestamp specifying the starting time of this booking.
* @member {String} start_at
*/
exports.prototype['start_at'] = undefined;
/**
* The ID of the `Location` object representing the location where the booked service is provided.
* @member {String} location_id
*/
exports.prototype['location_id'] = undefined;
/**
* The ID of the `Customer` object representing the customer attending this booking
* @member {String} customer_id
*/
exports.prototype['customer_id'] = undefined;
/**
* The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant `CatalogObject` instance.
* @member {String} customer_note
*/
exports.prototype['customer_note'] = undefined;
/**
* The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific `CatalogObject` instance. This field should not be visible to customers.
* @member {String} seller_note
*/
exports.prototype['seller_note'] = undefined;
/**
* A list of appointment segments for this booking.
* @member {Array.<module:model/AppointmentSegment>} appointment_segments
*/
exports.prototype['appointment_segments'] = undefined;
module.exports = exports;