square-connect
Version:
JavaScript client library for the Square Connect v2 API
180 lines (151 loc) • 7.43 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 BusinessAppointmentSettingsAlignmentTime = require('./BusinessAppointmentSettingsAlignmentTime');
var BusinessAppointmentSettingsBookingLocationType = require('./BusinessAppointmentSettingsBookingLocationType');
var BusinessAppointmentSettingsCancellationPolicy = require('./BusinessAppointmentSettingsCancellationPolicy');
var BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = require('./BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType');
var Money = require('./Money');
/**
* The BusinessAppointmentSettings model module.
* Note: This model is in beta.
* @module model/BusinessAppointmentSettings
*/
/**
* Constructs a new <code>BusinessAppointmentSettings</code>.
* The service appointment settings, including where and how the service is provided.
* @alias module:model/BusinessAppointmentSettings
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>BusinessAppointmentSettings</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/BusinessAppointmentSettings} obj Optional instance to populate.
* @return {module:model/BusinessAppointmentSettings} The populated <code>BusinessAppointmentSettings</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('location_types')) {
obj['location_types'] = ApiClient.convertToType(data['location_types'], [BusinessAppointmentSettingsBookingLocationType]);
}
if (data.hasOwnProperty('alignment_time')) {
obj['alignment_time'] = BusinessAppointmentSettingsAlignmentTime.constructFromObject(data['alignment_time']);
}
if (data.hasOwnProperty('min_booking_lead_time_seconds')) {
obj['min_booking_lead_time_seconds'] = ApiClient.convertToType(data['min_booking_lead_time_seconds'], 'Number');
}
if (data.hasOwnProperty('max_booking_lead_time_seconds')) {
obj['max_booking_lead_time_seconds'] = ApiClient.convertToType(data['max_booking_lead_time_seconds'], 'Number');
}
if (data.hasOwnProperty('any_team_member_booking_enabled')) {
obj['any_team_member_booking_enabled'] = ApiClient.convertToType(data['any_team_member_booking_enabled'], 'Boolean');
}
if (data.hasOwnProperty('multiple_service_booking_enabled')) {
obj['multiple_service_booking_enabled'] = ApiClient.convertToType(data['multiple_service_booking_enabled'], 'Boolean');
}
if (data.hasOwnProperty('max_appointments_per_day_limit_type')) {
obj['max_appointments_per_day_limit_type'] = BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.constructFromObject(data['max_appointments_per_day_limit_type']);
}
if (data.hasOwnProperty('max_appointments_per_day_limit')) {
obj['max_appointments_per_day_limit'] = ApiClient.convertToType(data['max_appointments_per_day_limit'], 'Number');
}
if (data.hasOwnProperty('cancellation_window_seconds')) {
obj['cancellation_window_seconds'] = ApiClient.convertToType(data['cancellation_window_seconds'], 'Number');
}
if (data.hasOwnProperty('cancellation_fee_money')) {
obj['cancellation_fee_money'] = Money.constructFromObject(data['cancellation_fee_money']);
}
if (data.hasOwnProperty('cancellation_policy')) {
obj['cancellation_policy'] = BusinessAppointmentSettingsCancellationPolicy.constructFromObject(data['cancellation_policy']);
}
if (data.hasOwnProperty('cancellation_policy_text')) {
obj['cancellation_policy_text'] = ApiClient.convertToType(data['cancellation_policy_text'], 'String');
}
if (data.hasOwnProperty('skip_booking_flow_staff_selection')) {
obj['skip_booking_flow_staff_selection'] = ApiClient.convertToType(data['skip_booking_flow_staff_selection'], 'Boolean');
}
}
return obj;
}
/**
* Types of the location allowed for bookings.
* @member {Array.<module:model/BusinessAppointmentSettingsBookingLocationType>} location_types
*/
exports.prototype['location_types'] = undefined;
/**
* The time unit of the service duration for bookings.
* @member {module:model/BusinessAppointmentSettingsAlignmentTime} alignment_time
*/
exports.prototype['alignment_time'] = undefined;
/**
* The minimum lead time in seconds before a service can be booked. Bookings must be created at least this far ahead of the booking's starting time.
* @member {Number} min_booking_lead_time_seconds
*/
exports.prototype['min_booking_lead_time_seconds'] = undefined;
/**
* The maximum lead time in seconds before a service can be booked. Bookings must be created at most this far ahead of the booking's starting time.
* @member {Number} max_booking_lead_time_seconds
*/
exports.prototype['max_booking_lead_time_seconds'] = undefined;
/**
* Indicates whether a customer can choose from all available time slots and have a staff member assigned automatically (`true`) or not (`false`).
* @member {Boolean} any_team_member_booking_enabled
*/
exports.prototype['any_team_member_booking_enabled'] = undefined;
/**
* Indicates whether a customer can book multiple services in a single online booking.
* @member {Boolean} multiple_service_booking_enabled
*/
exports.prototype['multiple_service_booking_enabled'] = undefined;
/**
* Indicates whether the daily appointment limit applies to team members or to business locations.
* @member {module:model/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType} max_appointments_per_day_limit_type
*/
exports.prototype['max_appointments_per_day_limit_type'] = undefined;
/**
* The maximum number of daily appointments per team member or per location.
* @member {Number} max_appointments_per_day_limit
*/
exports.prototype['max_appointments_per_day_limit'] = undefined;
/**
* The cut-off time in seconds for allowing clients to cancel or reschedule an appointment.
* @member {Number} cancellation_window_seconds
*/
exports.prototype['cancellation_window_seconds'] = undefined;
/**
* The flat-fee ammount charged for a no-show booking.
* @member {module:model/Money} cancellation_fee_money
*/
exports.prototype['cancellation_fee_money'] = undefined;
/**
* The cancellation policy adopted by the seller.
* @member {module:model/BusinessAppointmentSettingsCancellationPolicy} cancellation_policy
*/
exports.prototype['cancellation_policy'] = undefined;
/**
* The free-form text of the seller's cancellation policy.
* @member {String} cancellation_policy_text
*/
exports.prototype['cancellation_policy_text'] = undefined;
/**
* Indicates whether customers has an assigned staff member (`true`) or can select s staff member of their choice (`false`).
* @member {Boolean} skip_booking_flow_staff_selection
*/
exports.prototype['skip_booking_flow_staff_selection'] = undefined;
module.exports = exports;