UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

98 lines (82 loc) 3.5 kB
/** * 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'); /** * The AppointmentSegment model module. * Note: This model is in beta. * @module model/AppointmentSegment */ /** * Constructs a new <code>AppointmentSegment</code>. * Defines an appointment segment of a booking. * @alias module:model/AppointmentSegment * @class * @param durationMinutes {Number} The time span in minutes of an appointment segment. * @param serviceVariationId {String} The ID of the `CatalogItemVariation` object representing the service booked in this segment. * @param teamMemberId {String} The ID of the `TeamMember` object representing the team member booked in this segment. * @param serviceVariationVersion {Number} The current version of the item variation representing the service booked in this segment. */ var exports = function(durationMinutes, serviceVariationId, teamMemberId, serviceVariationVersion) { var _this = this; _this['duration_minutes'] = durationMinutes; _this['service_variation_id'] = serviceVariationId; _this['team_member_id'] = teamMemberId; _this['service_variation_version'] = serviceVariationVersion; }; /** * Constructs a <code>AppointmentSegment</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/AppointmentSegment} obj Optional instance to populate. * @return {module:model/AppointmentSegment} The populated <code>AppointmentSegment</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('duration_minutes')) { obj['duration_minutes'] = ApiClient.convertToType(data['duration_minutes'], 'Number'); } if (data.hasOwnProperty('service_variation_id')) { obj['service_variation_id'] = ApiClient.convertToType(data['service_variation_id'], 'String'); } if (data.hasOwnProperty('team_member_id')) { obj['team_member_id'] = ApiClient.convertToType(data['team_member_id'], 'String'); } if (data.hasOwnProperty('service_variation_version')) { obj['service_variation_version'] = ApiClient.convertToType(data['service_variation_version'], 'Number'); } } return obj; } /** * The time span in minutes of an appointment segment. * @member {Number} duration_minutes */ exports.prototype['duration_minutes'] = undefined; /** * The ID of the `CatalogItemVariation` object representing the service booked in this segment. * @member {String} service_variation_id */ exports.prototype['service_variation_id'] = undefined; /** * The ID of the `TeamMember` object representing the team member booked in this segment. * @member {String} team_member_id */ exports.prototype['team_member_id'] = undefined; /** * The current version of the item variation representing the service booked in this segment. * @member {Number} service_variation_version */ exports.prototype['service_variation_version'] = undefined; module.exports = exports;