UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

77 lines (60 loc) 2.01 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'); var Shift = require('./Shift'); /** * The CreateShiftRequest model module. * @module model/CreateShiftRequest */ /** * Constructs a new <code>CreateShiftRequest</code>. * Represents a request to create a &#x60;Shift&#x60; * @alias module:model/CreateShiftRequest * @class * @param shift {module:model/Shift} The `Shift` to be created */ var exports = function(shift) { var _this = this; _this['shift'] = shift; }; /** * Constructs a <code>CreateShiftRequest</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/CreateShiftRequest} obj Optional instance to populate. * @return {module:model/CreateShiftRequest} The populated <code>CreateShiftRequest</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('idempotency_key')) { obj['idempotency_key'] = ApiClient.convertToType(data['idempotency_key'], 'String'); } if (data.hasOwnProperty('shift')) { obj['shift'] = Shift.constructFromObject(data['shift']); } } return obj; } /** * Unique string value to insure the idempotency of the operation. * @member {String} idempotency_key */ exports.prototype['idempotency_key'] = undefined; /** * The `Shift` to be created * @member {module:model/Shift} shift */ exports.prototype['shift'] = undefined; module.exports = exports;