square-connect
Version:
JavaScript client library for the Square Connect v2 API
97 lines (78 loc) • 3.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 SegmentFilter = require('./SegmentFilter');
var TimeRange = require('./TimeRange');
/**
* The SearchAvailabilityFilter model module.
* Note: This model is in beta.
* @module model/SearchAvailabilityFilter
*/
/**
* Constructs a new <code>SearchAvailabilityFilter</code>.
* A query filter to search for availabilities by.
* @alias module:model/SearchAvailabilityFilter
* @class
* @param startAtRange {module:model/TimeRange} The query expression to search for availabilities matching the specified range of starting times. The range must be at least 24 hours and at most 31 days in length.
*/
var exports = function(startAtRange) {
var _this = this;
_this['start_at_range'] = startAtRange;
};
/**
* Constructs a <code>SearchAvailabilityFilter</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/SearchAvailabilityFilter} obj Optional instance to populate.
* @return {module:model/SearchAvailabilityFilter} The populated <code>SearchAvailabilityFilter</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('start_at_range')) {
obj['start_at_range'] = TimeRange.constructFromObject(data['start_at_range']);
}
if (data.hasOwnProperty('location_id')) {
obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
}
if (data.hasOwnProperty('segment_filters')) {
obj['segment_filters'] = ApiClient.convertToType(data['segment_filters'], [SegmentFilter]);
}
if (data.hasOwnProperty('booking_id')) {
obj['booking_id'] = ApiClient.convertToType(data['booking_id'], 'String');
}
}
return obj;
}
/**
* The query expression to search for availabilities matching the specified range of starting times. The range must be at least 24 hours and at most 31 days in length.
* @member {module:model/TimeRange} start_at_range
*/
exports.prototype['start_at_range'] = undefined;
/**
* The query expression to search for availabilities matching the specified seller location IDs. This query expression is not applicable when `booking_id` is present.
* @member {String} location_id
*/
exports.prototype['location_id'] = undefined;
/**
* The list of segment filters to apply. A query with `n` segment filters returns availabilities with `n` segments per availability. It is not applicable when `booking_id` is present.
* @member {Array.<module:model/SegmentFilter>} segment_filters
*/
exports.prototype['segment_filters'] = undefined;
/**
* The query expression to search for availabilities for an existing booking by matching the specified `booking_id` value. This is commonly used to reschedule an appointment. If this expression is specified, the `location_id` and `segment_filters` expressions are not allowed.
* @member {String} booking_id
*/
exports.prototype['booking_id'] = undefined;
module.exports = exports;