rsm-membership-service-client
Version:
Our awesome TypeScript-Fetch clients for the Membership Service.
912 lines (911 loc) • 39.5 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.7.0.0 (NJsonSchema v10.1.24.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
// ReSharper disable InconsistentNaming
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
exports.ApiException = exports.EmployeeApiResponse = exports.Employee = exports.ClientApiResponse = exports.ApiError = exports.Client = exports.MembershipServiceClient = void 0;
var MembershipServiceClient = /** @class */ (function () {
function MembershipServiceClient(baseUrl, http) {
this.jsonParseReviver = undefined;
this.http = http ? http : window;
this.baseUrl = baseUrl ? baseUrl : "https://localhost:44389";
}
/**
* @return Success
*/
MembershipServiceClient.prototype.getClientById = function (id) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Client/{id}";
if (id === undefined || id === null)
throw new Error("The parameter 'id' must be defined.");
url_ = url_.replace("{id}", encodeURIComponent("" + id));
url_ = url_.replace(/[?&]$/, "");
var options_ = {
method: "GET",
headers: {
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processGetClientById(_response);
});
};
MembershipServiceClient.prototype.processGetClientById = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = ClientApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 404) {
return response.text().then(function (_responseText) {
var result404 = null;
var resultData404 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result404 = ClientApiResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = ClientApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @param clientNumber (optional)
* @return Success
*/
MembershipServiceClient.prototype.getClientByNumber = function (clientNumber) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Client?";
if (clientNumber === null)
throw new Error("The parameter 'clientNumber' cannot be null.");
else if (clientNumber !== undefined)
url_ += "clientNumber=" + encodeURIComponent("" + clientNumber) + "&";
url_ = url_.replace(/[?&]$/, "");
var options_ = {
method: "GET",
headers: {
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processGetClientByNumber(_response);
});
};
MembershipServiceClient.prototype.processGetClientByNumber = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = ClientApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 404) {
return response.text().then(function (_responseText) {
var result404 = null;
var resultData404 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result404 = ClientApiResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = ClientApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @param body (optional)
* @return Success
*/
MembershipServiceClient.prototype.createClient = function (body) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Client";
url_ = url_.replace(/[?&]$/, "");
var content_ = JSON.stringify(body);
var options_ = {
body: content_,
method: "POST",
headers: {
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true",
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processCreateClient(_response);
});
};
MembershipServiceClient.prototype.processCreateClient = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 201) {
return response.text().then(function (_responseText) {
var result201 = null;
var resultData201 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result201 = ClientApiResponse.fromJS(resultData201);
return result201;
});
}
else if (status === 400) {
return response.text().then(function (_responseText) {
var result400 = null;
var resultData400 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result400 = ClientApiResponse.fromJS(resultData400);
return throwException("Bad Request", status, _responseText, _headers, result400);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = ClientApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @param body (optional)
* @return Success
*/
MembershipServiceClient.prototype.updateClient = function (body) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Client";
url_ = url_.replace(/[?&]$/, "");
var content_ = JSON.stringify(body);
var options_ = {
body: content_,
method: "PUT",
headers: {
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true",
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processUpdateClient(_response);
});
};
MembershipServiceClient.prototype.processUpdateClient = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = ClientApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 400) {
return response.text().then(function (_responseText) {
var result400 = null;
var resultData400 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result400 = ClientApiResponse.fromJS(resultData400);
return throwException("Bad Request", status, _responseText, _headers, result400);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = ClientApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @return Success
*/
MembershipServiceClient.prototype.getEmployeeById = function (id) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Employee/{id}";
if (id === undefined || id === null)
throw new Error("The parameter 'id' must be defined.");
url_ = url_.replace("{id}", encodeURIComponent("" + id));
url_ = url_.replace(/[?&]$/, "");
var options_ = {
method: "GET",
headers: {
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processGetEmployeeById(_response);
});
};
MembershipServiceClient.prototype.processGetEmployeeById = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = EmployeeApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 404) {
return response.text().then(function (_responseText) {
var result404 = null;
var resultData404 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result404 = EmployeeApiResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = EmployeeApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @param employeeId (optional)
* @return Success
*/
MembershipServiceClient.prototype.getEmployeeByEmployeeId = function (employeeId) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Employee?";
if (employeeId !== undefined && employeeId !== null)
url_ += "employeeId=" + encodeURIComponent("" + employeeId) + "&";
url_ = url_.replace(/[?&]$/, "");
var options_ = {
method: "GET",
headers: {
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processGetEmployeeByEmployeeId(_response);
});
};
MembershipServiceClient.prototype.processGetEmployeeByEmployeeId = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = EmployeeApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 404) {
return response.text().then(function (_responseText) {
var result404 = null;
var resultData404 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result404 = EmployeeApiResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = EmployeeApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @param body (optional)
* @return Success
*/
MembershipServiceClient.prototype.createEmployee = function (body) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Employee";
url_ = url_.replace(/[?&]$/, "");
var content_ = JSON.stringify(body);
var options_ = {
body: content_,
method: "POST",
headers: {
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true",
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processCreateEmployee(_response);
});
};
MembershipServiceClient.prototype.processCreateEmployee = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 201) {
return response.text().then(function (_responseText) {
var result201 = null;
var resultData201 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result201 = EmployeeApiResponse.fromJS(resultData201);
return result201;
});
}
else if (status === 400) {
return response.text().then(function (_responseText) {
var result400 = null;
var resultData400 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result400 = EmployeeApiResponse.fromJS(resultData400);
return throwException("Bad Request", status, _responseText, _headers, result400);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = EmployeeApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @param body (optional)
* @return Success
*/
MembershipServiceClient.prototype.updateEmployee = function (body) {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Employee";
url_ = url_.replace(/[?&]$/, "");
var content_ = JSON.stringify(body);
var options_ = {
body: content_,
method: "PUT",
headers: {
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true",
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processUpdateEmployee(_response);
});
};
MembershipServiceClient.prototype.processUpdateEmployee = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = EmployeeApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 400) {
return response.text().then(function (_responseText) {
var result400 = null;
var resultData400 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result400 = EmployeeApiResponse.fromJS(resultData400);
return throwException("Bad Request", status, _responseText, _headers, result400);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = EmployeeApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
/**
* @return Success
*/
MembershipServiceClient.prototype.searchClients = function () {
var _this = this;
var url_ = this.baseUrl + "/api/v1/Search/clients";
url_ = url_.replace(/[?&]$/, "");
var options_ = {
method: "GET",
headers: {
Accept: "application/json"
}
};
return this.http.fetch(url_, options_).then(function (_response) {
return _this.processSearchClients(_response);
});
};
MembershipServiceClient.prototype.processSearchClients = function (response) {
var _this = this;
var status = response.status;
var _headers = {};
if (response.headers && response.headers.forEach) {
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
}
if (status === 200) {
return response.text().then(function (_responseText) {
var result200 = null;
var resultData200 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result200 = ClientApiResponse.fromJS(resultData200);
return result200;
});
}
else if (status === 404) {
return response.text().then(function (_responseText) {
var result404 = null;
var resultData404 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result404 = ClientApiResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);
});
}
else if (status === 500) {
return response.text().then(function (_responseText) {
var result500 = null;
var resultData500 = _responseText === ""
? null
: JSON.parse(_responseText, _this.jsonParseReviver);
result500 = ClientApiResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
});
}
else if (status !== 200 && status !== 204) {
return response.text().then(function (_responseText) {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve(null);
};
return MembershipServiceClient;
}());
exports.MembershipServiceClient = MembershipServiceClient;
var Client = /** @class */ (function () {
function Client(data) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
this[property] = data[property];
}
}
}
Client.prototype.init = function (_data) {
if (_data) {
this.id = _data["id"] !== undefined ? _data["id"] : null;
this.clientNumber =
_data["clientNumber"] !== undefined ? _data["clientNumber"] : null;
this.name = _data["name"] !== undefined ? _data["name"] : null;
this.masterClientNumber =
_data["masterClientNumber"] !== undefined
? _data["masterClientNumber"]
: null;
this.masterClientName =
_data["masterClientName"] !== undefined
? _data["masterClientName"]
: null;
this.partnerNumber =
_data["partnerNumber"] !== undefined
? _data["partnerNumber"]
: null;
this.partnerName =
_data["partnerName"] !== undefined ? _data["partnerName"] : null;
this.formOfOrganizationId =
_data["formOfOrganizationId"] !== undefined
? _data["formOfOrganizationId"]
: null;
this.formOfOrganizationDescription =
_data["formOfOrganizationDescription"] !== undefined
? _data["formOfOrganizationDescription"]
: null;
this.prefix = _data["prefix"] !== undefined ? _data["prefix"] : null;
this.firstName =
_data["firstName"] !== undefined ? _data["firstName"] : null;
this.middleName =
_data["middleName"] !== undefined ? _data["middleName"] : null;
this.lastName =
_data["lastName"] !== undefined ? _data["lastName"] : null;
this.suffix = _data["suffix"] !== undefined ? _data["suffix"] : null;
this.statusId =
_data["statusId"] !== undefined ? _data["statusId"] : null;
this.statusDescription =
_data["statusDescription"] !== undefined
? _data["statusDescription"]
: null;
this.officeName =
_data["officeName"] !== undefined ? _data["officeName"] : null;
}
};
Client.fromJS = function (data) {
data = typeof data === "object" ? data : {};
var result = new Client();
result.init(data);
return result;
};
Client.prototype.toJSON = function (data) {
data = typeof data === "object" ? data : {};
data["id"] = this.id !== undefined ? this.id : null;
data["clientNumber"] =
this.clientNumber !== undefined ? this.clientNumber : null;
data["name"] = this.name !== undefined ? this.name : null;
data["masterClientNumber"] =
this.masterClientNumber !== undefined
? this.masterClientNumber
: null;
data["masterClientName"] =
this.masterClientName !== undefined ? this.masterClientName : null;
data["partnerNumber"] =
this.partnerNumber !== undefined ? this.partnerNumber : null;
data["partnerName"] =
this.partnerName !== undefined ? this.partnerName : null;
data["formOfOrganizationId"] =
this.formOfOrganizationId !== undefined
? this.formOfOrganizationId
: null;
data["formOfOrganizationDescription"] =
this.formOfOrganizationDescription !== undefined
? this.formOfOrganizationDescription
: null;
data["prefix"] = this.prefix !== undefined ? this.prefix : null;
data["firstName"] =
this.firstName !== undefined ? this.firstName : null;
data["middleName"] =
this.middleName !== undefined ? this.middleName : null;
data["lastName"] = this.lastName !== undefined ? this.lastName : null;
data["suffix"] = this.suffix !== undefined ? this.suffix : null;
data["statusId"] = this.statusId !== undefined ? this.statusId : null;
data["statusDescription"] =
this.statusDescription !== undefined ? this.statusDescription : null;
data["officeName"] =
this.officeName !== undefined ? this.officeName : null;
return data;
};
return Client;
}());
exports.Client = Client;
var ApiError = /** @class */ (function () {
function ApiError(data) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
this[property] = data[property];
}
}
}
ApiError.prototype.init = function (_data) {
if (_data) {
this.isError =
_data["isError"] !== undefined ? _data["isError"] : null;
this.exceptionMessage =
_data["exceptionMessage"] !== undefined
? _data["exceptionMessage"]
: null;
this.details =
_data["details"] !== undefined ? _data["details"] : null;
}
};
ApiError.fromJS = function (data) {
data = typeof data === "object" ? data : {};
var result = new ApiError();
result.init(data);
return result;
};
ApiError.prototype.toJSON = function (data) {
data = typeof data === "object" ? data : {};
data["isError"] = this.isError !== undefined ? this.isError : null;
data["exceptionMessage"] =
this.exceptionMessage !== undefined ? this.exceptionMessage : null;
data["details"] = this.details !== undefined ? this.details : null;
return data;
};
return ApiError;
}());
exports.ApiError = ApiError;
var ClientApiResponse = /** @class */ (function () {
function ClientApiResponse(data) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
this[property] = data[property];
}
}
}
ClientApiResponse.prototype.init = function (_data) {
if (_data) {
this.statusCode =
_data["statusCode"] !== undefined ? _data["statusCode"] : null;
this.message =
_data["message"] !== undefined ? _data["message"] : null;
this.data = _data["data"] ? Client.fromJS(_data["data"]) : null;
this.error = _data["error"] ? ApiError.fromJS(_data["error"]) : null;
}
};
ClientApiResponse.fromJS = function (data) {
data = typeof data === "object" ? data : {};
var result = new ClientApiResponse();
result.init(data);
return result;
};
ClientApiResponse.prototype.toJSON = function (data) {
data = typeof data === "object" ? data : {};
data["statusCode"] =
this.statusCode !== undefined ? this.statusCode : null;
data["message"] = this.message !== undefined ? this.message : null;
data["data"] = this.data ? this.data.toJSON() : null;
data["error"] = this.error ? this.error.toJSON() : null;
return data;
};
return ClientApiResponse;
}());
exports.ClientApiResponse = ClientApiResponse;
var Employee = /** @class */ (function () {
function Employee(data) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
this[property] = data[property];
}
}
}
Employee.prototype.init = function (_data) {
if (_data) {
this.id = _data["id"] !== undefined ? _data["id"] : null;
this.employeeId =
_data["employeeId"] !== undefined ? _data["employeeId"] : null;
this.empId = _data["empId"] !== undefined ? _data["empId"] : null;
this.firstName =
_data["firstName"] !== undefined ? _data["firstName"] : null;
this.lastName =
_data["lastName"] !== undefined ? _data["lastName"] : null;
this.lineOfBusinessId =
_data["lineOfBusinessId"] !== undefined
? _data["lineOfBusinessId"]
: null;
this.emplStatus =
_data["emplStatus"] !== undefined ? _data["emplStatus"] : null;
this.jobfunctionDescr =
_data["jobfunctionDescr"] !== undefined
? _data["jobfunctionDescr"]
: null;
this.workEmail =
_data["workEmail"] !== undefined ? _data["workEmail"] : null;
}
};
Employee.fromJS = function (data) {
data = typeof data === "object" ? data : {};
var result = new Employee();
result.init(data);
return result;
};
Employee.prototype.toJSON = function (data) {
data = typeof data === "object" ? data : {};
data["id"] = this.id !== undefined ? this.id : null;
data["employeeId"] =
this.employeeId !== undefined ? this.employeeId : null;
data["empId"] = this.empId !== undefined ? this.empId : null;
data["firstName"] =
this.firstName !== undefined ? this.firstName : null;
data["lastName"] = this.lastName !== undefined ? this.lastName : null;
data["lineOfBusinessId"] =
this.lineOfBusinessId !== undefined ? this.lineOfBusinessId : null;
data["emplStatus"] =
this.emplStatus !== undefined ? this.emplStatus : null;
data["jobfunctionDescr"] =
this.jobfunctionDescr !== undefined ? this.jobfunctionDescr : null;
data["workEmail"] =
this.workEmail !== undefined ? this.workEmail : null;
return data;
};
return Employee;
}());
exports.Employee = Employee;
var EmployeeApiResponse = /** @class */ (function () {
function EmployeeApiResponse(data) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
this[property] = data[property];
}
}
}
EmployeeApiResponse.prototype.init = function (_data) {
if (_data) {
this.statusCode =
_data["statusCode"] !== undefined ? _data["statusCode"] : null;
this.message =
_data["message"] !== undefined ? _data["message"] : null;
this.data = _data["data"] ? Employee.fromJS(_data["data"]) : null;
this.error = _data["error"] ? ApiError.fromJS(_data["error"]) : null;
}
};
EmployeeApiResponse.fromJS = function (data) {
data = typeof data === "object" ? data : {};
var result = new EmployeeApiResponse();
result.init(data);
return result;
};
EmployeeApiResponse.prototype.toJSON = function (data) {
data = typeof data === "object" ? data : {};
data["statusCode"] =
this.statusCode !== undefined ? this.statusCode : null;
data["message"] = this.message !== undefined ? this.message : null;
data["data"] = this.data ? this.data.toJSON() : null;
data["error"] = this.error ? this.error.toJSON() : null;
return data;
};
return EmployeeApiResponse;
}());
exports.EmployeeApiResponse = EmployeeApiResponse;
var ApiException = /** @class */ (function (_super) {
__extends(ApiException, _super);
function ApiException(message, status, response, headers, result) {
var _this = _super.call(this) || this;
_this.isApiException = true;
_this.message = message;
_this.status = status;
_this.response = response;
_this.headers = headers;
_this.result = result;
return _this;
}
ApiException.isApiException = function (obj) {
return obj.isApiException === true;
};
return ApiException;
}(Error));
exports.ApiException = ApiException;
function throwException(message, status, response, headers, result) {
if (result !== null && result !== undefined)
throw result;
else
throw new ApiException(message, status, response, headers, null);
}