square-connect
Version:
JavaScript client library for the Square Connect v2 API
124 lines (103 loc) • 3.9 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 ShiftWorkday = require('./ShiftWorkday');
var TimeRange = require('./TimeRange');
/**
* The ShiftFilter model module.
* @module model/ShiftFilter
*/
/**
* Constructs a new <code>ShiftFilter</code>.
* Defines a filter used in a search for `Shift` records. `AND` logic is used by Square's servers to apply each filter property specified.
* @alias module:model/ShiftFilter
* @class
* @param locationIds {Array.<String>} Fetch shifts for the specified location.
* @param teamMemberIds {Array.<String>} Fetch shifts for the specified team members. Replaced `employee_ids` at version \"2020-08-26\"
*/
var exports = function(locationIds, teamMemberIds) {
var _this = this;
_this['location_ids'] = locationIds;
_this['team_member_ids'] = teamMemberIds;
};
/**
* Constructs a <code>ShiftFilter</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/ShiftFilter} obj Optional instance to populate.
* @return {module:model/ShiftFilter} The populated <code>ShiftFilter</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('location_ids')) {
obj['location_ids'] = ApiClient.convertToType(data['location_ids'], ['String']);
}
if (data.hasOwnProperty('employee_ids')) {
obj['employee_ids'] = ApiClient.convertToType(data['employee_ids'], ['String']);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('start')) {
obj['start'] = TimeRange.constructFromObject(data['start']);
}
if (data.hasOwnProperty('end')) {
obj['end'] = TimeRange.constructFromObject(data['end']);
}
if (data.hasOwnProperty('workday')) {
obj['workday'] = ShiftWorkday.constructFromObject(data['workday']);
}
if (data.hasOwnProperty('team_member_ids')) {
obj['team_member_ids'] = ApiClient.convertToType(data['team_member_ids'], ['String']);
}
}
return obj;
}
/**
* Fetch shifts for the specified location.
* @member {Array.<String>} location_ids
*/
exports.prototype['location_ids'] = undefined;
/**
* Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead
* @member {Array.<String>} employee_ids
*/
exports.prototype['employee_ids'] = undefined;
/**
* Fetch a `Shift` instance by `Shift.status`. See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values
* @member {String} status
*/
exports.prototype['status'] = undefined;
/**
* Fetch `Shift`s that start in the time range - Inclusive.
* @member {module:model/TimeRange} start
*/
exports.prototype['start'] = undefined;
/**
* Fetch the `Shift`s that end in the time range - Inclusive.
* @member {module:model/TimeRange} end
*/
exports.prototype['end'] = undefined;
/**
* Fetch the `Shift`s based on workday date range.
* @member {module:model/ShiftWorkday} workday
*/
exports.prototype['workday'] = undefined;
/**
* Fetch shifts for the specified team members. Replaced `employee_ids` at version \"2020-08-26\"
* @member {Array.<String>} team_member_ids
*/
exports.prototype['team_member_ids'] = undefined;
module.exports = exports;