@datenkraft/bb-organization-structure-api-ts-client
Version:
The organization-structure API TS Client enables you to work with the organization-structure API
410 lines (409 loc) • 24.1 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Backbone Organization Structure API
* - alpha: Currently developed API version. Subject to major changes. - beta: A semi-stable early access version. New features can be added. Breaking changes are possible. - stable: The API is recommended for use in production. [Changelog](https://organization-structure-api.steve.niceshops.com/v2/docs/changelog.html) All data is transferred in UTF-8 encoding.\\ The API uses stateless HTTP. No cookies have to be kept.\\ Authentication via OAuth2 client credentials flow. [Privacy Policy](https://www.niceshops.com/en/dienstleistungen/data-privacy-policy) [Backbone Organization Structure API PHP client @Packagist](https://packagist.org/packages/datenkraft/bb-organization-structure-api-php-client)
*
* The version of the OpenAPI document: v2.beta
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IdentityApi = exports.IdentityApiFactory = exports.IdentityApiFp = exports.IdentityApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// URLSearchParams not necessarily used
// @ts-ignore
const url_1 = require("url");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* IdentityApi - axios parameter creator
* @export
*/
const IdentityApiAxiosParamCreator = function (configuration) {
return {
/**
* Get an Identity by identityId
* @summary Get an Identity by identityId
* @param {string} identityId Identity Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIdentity: (identityId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'identityId' is not null or undefined
(0, common_1.assertParamExists)('getIdentity', 'identityId', identityId);
const localVarPath = `/identity/{identityId}`
.replace(`{${"identityId"}}`, encodeURIComponent(String(identityId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication oAuthAuthorization required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration);
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Get a list of Identities
* @summary Get a list of Identities
* @param {number} [page] The page to read. Default is the first page.
* @param {number} [pageSize] The maximum size per page is 100. Default is 100.
* @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance.
* @param {string} [filterEmail] Email filter
* @param {boolean} [filterIsActive] A filter to only return identities that are active or not.
* @param {string} [filterProjectId] A filter to only return identities assigned to a specific project.
* @param {string} [filterSearch] A filter to search for identities. Usage: - Provide a search term to filter results. - The search term filters the response for identities where the email contains the search term. - The search is not case sensitive.
* @param {'external' | 'internal'} [filterOrigin] A filter to only return identities that are of the given origin.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIdentityCollection: (page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/identity`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication oAuthAuthorization required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration);
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
if (paginationMode !== undefined) {
localVarQueryParameter['paginationMode'] = paginationMode;
}
if (filterEmail !== undefined) {
localVarQueryParameter['filter[email]'] = filterEmail;
}
if (filterIsActive !== undefined) {
localVarQueryParameter['filter[isActive]'] = filterIsActive;
}
if (filterProjectId !== undefined) {
localVarQueryParameter['filter[projectId]'] = filterProjectId;
}
if (filterSearch !== undefined) {
localVarQueryParameter['filter[search]'] = filterSearch;
}
if (filterOrigin !== undefined) {
localVarQueryParameter['filter[origin]'] = filterOrigin;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Update one or more fields of an Identity
* @summary Update an Identity
* @param {string} identityId Identity Id
* @param {PatchIdentity} patchIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchIdentity: (identityId, patchIdentity, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'identityId' is not null or undefined
(0, common_1.assertParamExists)('patchIdentity', 'identityId', identityId);
// verify required parameter 'patchIdentity' is not null or undefined
(0, common_1.assertParamExists)('patchIdentity', 'patchIdentity', patchIdentity);
const localVarPath = `/identity/{identityId}`
.replace(`{${"identityId"}}`, encodeURIComponent(String(identityId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication oAuthAuthorization required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration);
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(patchIdentity, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Post a new Identity
* @summary Post a new Identity
* @param {NewIdentity} newIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postIdentity: (newIdentity, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'newIdentity' is not null or undefined
(0, common_1.assertParamExists)('postIdentity', 'newIdentity', newIdentity);
const localVarPath = `/identity`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication oAuthAuthorization required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration);
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(newIdentity, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.IdentityApiAxiosParamCreator = IdentityApiAxiosParamCreator;
/**
* IdentityApi - functional programming interface
* @export
*/
const IdentityApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.IdentityApiAxiosParamCreator)(configuration);
return {
/**
* Get an Identity by identityId
* @summary Get an Identity by identityId
* @param {string} identityId Identity Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIdentity(identityId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getIdentity(identityId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Get a list of Identities
* @summary Get a list of Identities
* @param {number} [page] The page to read. Default is the first page.
* @param {number} [pageSize] The maximum size per page is 100. Default is 100.
* @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance.
* @param {string} [filterEmail] Email filter
* @param {boolean} [filterIsActive] A filter to only return identities that are active or not.
* @param {string} [filterProjectId] A filter to only return identities assigned to a specific project.
* @param {string} [filterSearch] A filter to search for identities. Usage: - Provide a search term to filter results. - The search term filters the response for identities where the email contains the search term. - The search is not case sensitive.
* @param {'external' | 'internal'} [filterOrigin] A filter to only return identities that are of the given origin.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIdentityCollection(page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getIdentityCollection(page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Update one or more fields of an Identity
* @summary Update an Identity
* @param {string} identityId Identity Id
* @param {PatchIdentity} patchIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchIdentity(identityId, patchIdentity, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.patchIdentity(identityId, patchIdentity, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Post a new Identity
* @summary Post a new Identity
* @param {NewIdentity} newIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postIdentity(newIdentity, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.postIdentity(newIdentity, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
};
};
exports.IdentityApiFp = IdentityApiFp;
/**
* IdentityApi - factory interface
* @export
*/
const IdentityApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.IdentityApiFp)(configuration);
return {
/**
* Get an Identity by identityId
* @summary Get an Identity by identityId
* @param {string} identityId Identity Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIdentity(identityId, options) {
return localVarFp.getIdentity(identityId, options).then((request) => request(axios, basePath));
},
/**
* Get a list of Identities
* @summary Get a list of Identities
* @param {number} [page] The page to read. Default is the first page.
* @param {number} [pageSize] The maximum size per page is 100. Default is 100.
* @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance.
* @param {string} [filterEmail] Email filter
* @param {boolean} [filterIsActive] A filter to only return identities that are active or not.
* @param {string} [filterProjectId] A filter to only return identities assigned to a specific project.
* @param {string} [filterSearch] A filter to search for identities. Usage: - Provide a search term to filter results. - The search term filters the response for identities where the email contains the search term. - The search is not case sensitive.
* @param {'external' | 'internal'} [filterOrigin] A filter to only return identities that are of the given origin.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIdentityCollection(page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options) {
return localVarFp.getIdentityCollection(page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options).then((request) => request(axios, basePath));
},
/**
* Update one or more fields of an Identity
* @summary Update an Identity
* @param {string} identityId Identity Id
* @param {PatchIdentity} patchIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchIdentity(identityId, patchIdentity, options) {
return localVarFp.patchIdentity(identityId, patchIdentity, options).then((request) => request(axios, basePath));
},
/**
* Post a new Identity
* @summary Post a new Identity
* @param {NewIdentity} newIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postIdentity(newIdentity, options) {
return localVarFp.postIdentity(newIdentity, options).then((request) => request(axios, basePath));
},
};
};
exports.IdentityApiFactory = IdentityApiFactory;
/**
* IdentityApi - object-oriented interface
* @export
* @class IdentityApi
* @extends {BaseAPI}
*/
class IdentityApi extends base_1.BaseAPI {
/**
* Get an Identity by identityId
* @summary Get an Identity by identityId
* @param {string} identityId Identity Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof IdentityApi
*/
getIdentity(identityId, options) {
return (0, exports.IdentityApiFp)(this.configuration).getIdentity(identityId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get a list of Identities
* @summary Get a list of Identities
* @param {number} [page] The page to read. Default is the first page.
* @param {number} [pageSize] The maximum size per page is 100. Default is 100.
* @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance.
* @param {string} [filterEmail] Email filter
* @param {boolean} [filterIsActive] A filter to only return identities that are active or not.
* @param {string} [filterProjectId] A filter to only return identities assigned to a specific project.
* @param {string} [filterSearch] A filter to search for identities. Usage: - Provide a search term to filter results. - The search term filters the response for identities where the email contains the search term. - The search is not case sensitive.
* @param {'external' | 'internal'} [filterOrigin] A filter to only return identities that are of the given origin.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof IdentityApi
*/
getIdentityCollection(page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options) {
return (0, exports.IdentityApiFp)(this.configuration).getIdentityCollection(page, pageSize, paginationMode, filterEmail, filterIsActive, filterProjectId, filterSearch, filterOrigin, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update one or more fields of an Identity
* @summary Update an Identity
* @param {string} identityId Identity Id
* @param {PatchIdentity} patchIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof IdentityApi
*/
patchIdentity(identityId, patchIdentity, options) {
return (0, exports.IdentityApiFp)(this.configuration).patchIdentity(identityId, patchIdentity, options).then((request) => request(this.axios, this.basePath));
}
/**
* Post a new Identity
* @summary Post a new Identity
* @param {NewIdentity} newIdentity
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof IdentityApi
*/
postIdentity(newIdentity, options) {
return (0, exports.IdentityApiFp)(this.configuration).postIdentity(newIdentity, options).then((request) => request(this.axios, this.basePath));
}
}
exports.IdentityApi = IdentityApi;