@cognigy/rest-api-client
Version:
Cognigy REST-Client
38 lines • 3.61 kB
JavaScript
import { __rest } from "tslib";
import { GenericAPIFn } from "../GenericAPIFn";
import { stringifyQuery } from "../shared/helper/rest/query";
export function ManagementAPIGroup_2_0(instance) {
const self = instance;
return {
readVendor: (options) => GenericAPIFn("/new/management/v2.0/vendor", "GET", self)(undefined, options),
getBillingInformation: (args, options) => GenericAPIFn(`/new/management/v2.0/billing?${stringifyQuery(args)}`, "GET", self)(undefined, options),
getPreAggregatedBillingInformation: (args, options) => GenericAPIFn(`/new/management/v3.0/billing?${stringifyQuery(args)}`, "GET", self)(undefined, options),
indexOrganisations: (args, options) => GenericAPIFn(`/new/management/v2.0/organisations?${stringifyQuery(args)}`, "GET", self)(undefined, options),
readOrganisation: ({ organisationId }, options) => GenericAPIFn(`/new/management/v2.0/organisations/${organisationId}`, "GET", self)(undefined, options),
createOrganisation: (args, options) => GenericAPIFn("/new/management/v2.0/organisations", "POST", self)(args, options),
updateOrganisation: (_a, options) => {
var { organisationId } = _a, args = __rest(_a, ["organisationId"]);
return GenericAPIFn(`/new/management/v2.0/organisations/${organisationId}`, "PATCH", self)(args, options);
},
deleteOrganisation: (_a, options) => {
var { organisationId, verificationToken } = _a, args = __rest(_a, ["organisationId", "verificationToken"]);
return GenericAPIFn(`/new/management/v2.0/organisations/${organisationId}?verificationToken=${verificationToken}`, "DELETE", self)(args, options);
},
enforcePasswordPolicy: ({ organisationId }, options) => GenericAPIFn(`/new/management/v2.0/organisations/${organisationId}/enforcepasswordpolicy`, "POST", self)(undefined, options),
indexUsersManagement: (args, options) => GenericAPIFn(`/new/management/v2.0/users?${stringifyQuery(args)}`, "GET", self)(args, options),
createUserManagement: (args, options) => GenericAPIFn("/new/management/v2.0/users", "POST", self)(args, options),
readUserManagement: ({ userId }, options) => GenericAPIFn(`/new/management/v2.0/users/${userId}`, "GET", self)(undefined, options),
updateUserManagement: (_a, options) => {
var { userId } = _a, args = __rest(_a, ["userId"]);
return GenericAPIFn(`/new/management/v2.0/users/${userId}`, "PATCH", self)(args, options);
},
deleteUserManagement: ({ userId }, options) => GenericAPIFn(`/new/management/v2.0/users/${userId}`, "DELETE", self)(undefined, options),
impersonateUserManagement: ({ userId }, options) => GenericAPIFn(`/new/management/v2.0/users/${userId}/impersonate`, "POST", self)(undefined, options),
createApiKeyManagement: ({ organisationId }, options) => GenericAPIFn(`/new/management/v2.0/organisations/${organisationId}/apikeys`, "POST", self)(undefined, options),
createSystemMessage: (args, options) => GenericAPIFn("/new/management/v2.0/system/createsystemmessage", "POST", self)(args, options),
setSystemLicenseManagement: (args, options) => GenericAPIFn("/new/management/v2.0/system/license", "POST", self)(args, options),
getSystemLicenseManagement: (args, options) => GenericAPIFn("/new/management/v2.0/system/license", "GET", self)(args, options),
generateAuthenticationToken: (args, options) => GenericAPIFn("/new/management/auth/token", "POST", self)(args, options)
};
}
//# sourceMappingURL=ManagementAPIGroup_2_0.js.map