square-connect
Version:
JavaScript client library for the Square Connect v2 API
86 lines (67 loc) • 2.39 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 Availability model module.
* Note: This model is in beta.
* @module model/Availability
*/
/**
* Constructs a new <code>Availability</code>.
* Describes a slot available for booking, encapsulating appointment segments, the location and starting time.
* @alias module:model/Availability
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Availability</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/Availability} obj Optional instance to populate.
* @return {module:model/Availability} The populated <code>Availability</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
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('appointment_segments')) {
obj['appointment_segments'] = ApiClient.convertToType(data['appointment_segments'], [AppointmentSegment]);
}
}
return obj;
}
/**
* The RFC-3339 timestamp specifying the beginning time of the slot available for booking.
* @member {String} start_at
*/
exports.prototype['start_at'] = undefined;
/**
* The ID of the location available for booking.
* @member {String} location_id
*/
exports.prototype['location_id'] = undefined;
/**
* The list of appointment segments available for booking
* @member {Array.<module:model/AppointmentSegment>} appointment_segments
*/
exports.prototype['appointment_segments'] = undefined;
module.exports = exports;