square-connect
Version:
JavaScript client library for the Square Connect v2 API
105 lines (86 loc) • 3.19 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 Money = require('./Money');
/**
* The JobAssignment model module.
* @module model/JobAssignment
*/
/**
* Constructs a new <code>JobAssignment</code>.
* An object describing a job that a team member is assigned to.
* @alias module:model/JobAssignment
* @class
* @param jobTitle {String} The title of the job.
* @param payType {String} The current pay type for the job assignment used to calculate the pay amount in a pay period. See [JobAssignmentPayType](#type-jobassignmentpaytype) for possible values
*/
var exports = function(jobTitle, payType) {
var _this = this;
_this['job_title'] = jobTitle;
_this['pay_type'] = payType;
};
/**
* Constructs a <code>JobAssignment</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/JobAssignment} obj Optional instance to populate.
* @return {module:model/JobAssignment} The populated <code>JobAssignment</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('job_title')) {
obj['job_title'] = ApiClient.convertToType(data['job_title'], 'String');
}
if (data.hasOwnProperty('pay_type')) {
obj['pay_type'] = ApiClient.convertToType(data['pay_type'], 'String');
}
if (data.hasOwnProperty('hourly_rate')) {
obj['hourly_rate'] = Money.constructFromObject(data['hourly_rate']);
}
if (data.hasOwnProperty('annual_rate')) {
obj['annual_rate'] = Money.constructFromObject(data['annual_rate']);
}
if (data.hasOwnProperty('weekly_hours')) {
obj['weekly_hours'] = ApiClient.convertToType(data['weekly_hours'], 'Number');
}
}
return obj;
}
/**
* The title of the job.
* @member {String} job_title
*/
exports.prototype['job_title'] = undefined;
/**
* The current pay type for the job assignment used to calculate the pay amount in a pay period. See [JobAssignmentPayType](#type-jobassignmentpaytype) for possible values
* @member {String} pay_type
*/
exports.prototype['pay_type'] = undefined;
/**
* The hourly pay rate of the job.
* @member {module:model/Money} hourly_rate
*/
exports.prototype['hourly_rate'] = undefined;
/**
* The total pay amount for a 12 month period on the job. Set if the job `PayType` is `SALARY`.
* @member {module:model/Money} annual_rate
*/
exports.prototype['annual_rate'] = undefined;
/**
* The planned hours per week for the job. Set if the job `PayType` is `SALARY`.
* @member {Number} weekly_hours
*/
exports.prototype['weekly_hours'] = undefined;
module.exports = exports;