square-connect
Version:
JavaScript client library for the Square Connect v2 API
77 lines (60 loc) • 2.28 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 CustomerGroup = require('./CustomerGroup');
/**
* The CreateCustomerGroupRequest model module.
* @module model/CreateCustomerGroupRequest
*/
/**
* Constructs a new <code>CreateCustomerGroupRequest</code>.
* Defines the body parameters that can be provided in a request to the [CreateCustomerGroup](#endpoint-createcustomegroup) endpoint.
* @alias module:model/CreateCustomerGroupRequest
* @class
* @param group {module:model/CustomerGroup} The customer group to create.
*/
var exports = function(group) {
var _this = this;
_this['group'] = group;
};
/**
* Constructs a <code>CreateCustomerGroupRequest</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/CreateCustomerGroupRequest} obj Optional instance to populate.
* @return {module:model/CreateCustomerGroupRequest} The populated <code>CreateCustomerGroupRequest</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('group')) {
obj['group'] = CustomerGroup.constructFromObject(data['group']);
}
}
return obj;
}
/**
* The idempotency key for the request. See the [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) guide for more information.
* @member {String} idempotency_key
*/
exports.prototype['idempotency_key'] = undefined;
/**
* The customer group to create.
* @member {module:model/CustomerGroup} group
*/
exports.prototype['group'] = undefined;
module.exports = exports;