@kinde-oss/kinde-nodejs-sdk
Version:
Kinde Nodejs SDK allows integrate with Express server using middleware, helpers function
633 lines (604 loc) • 36.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _AddOrganizationUsersRequest = _interopRequireDefault(require("../model/AddOrganizationUsersRequest"));
var _AddOrganizationUsersResponse = _interopRequireDefault(require("../model/AddOrganizationUsersResponse"));
var _CreateOrganizationRequest = _interopRequireDefault(require("../model/CreateOrganizationRequest"));
var _CreateOrganizationResponse = _interopRequireDefault(require("../model/CreateOrganizationResponse"));
var _CreateOrganizationUserRoleRequest = _interopRequireDefault(require("../model/CreateOrganizationUserRoleRequest"));
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
var _GetOrganizationsResponse = _interopRequireDefault(require("../model/GetOrganizationsResponse"));
var _GetOrganizationsUserRolesResponse = _interopRequireDefault(require("../model/GetOrganizationsUserRolesResponse"));
var _GetOrganizationsUsersResponse = _interopRequireDefault(require("../model/GetOrganizationsUsersResponse"));
var _Organization = _interopRequireDefault(require("../model/Organization"));
var _RemoveOrganizationUsersResponse = _interopRequireDefault(require("../model/RemoveOrganizationUsersResponse"));
var _SuccessResponse = _interopRequireDefault(require("../model/SuccessResponse"));
var _UpdateOrganizationRequest = _interopRequireDefault(require("../model/UpdateOrganizationRequest"));
var _UpdateOrganizationUsersRequest = _interopRequireDefault(require("../model/UpdateOrganizationUsersRequest"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
* Kinde Management API
* Provides endpoints to manage your Kinde Businesses
*
* The version of the OpenAPI document: 1
* Contact: support@kinde.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* Organizations service.
* @module api/OrganizationsApi
* @version 1
*/
var OrganizationsApi = /*#__PURE__*/function () {
/**
* Constructs a new OrganizationsApi.
* @alias module:api/OrganizationsApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function OrganizationsApi(apiClient) {
_classCallCheck(this, OrganizationsApi);
this.apiClient = apiClient || _ApiClient["default"].instance;
}
/**
* Callback function to receive the result of the addOrganizationUsers operation.
* @callback module:api/OrganizationsApi~addOrganizationUsersCallback
* @param {String} error Error message, if any.
* @param {module:model/AddOrganizationUsersResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Add Organization Users
* Add existing users to an organization.
* @param {String} orgCode The organization's code.
* @param {Object} opts Optional parameters
* @param {module:model/AddOrganizationUsersRequest} opts.addOrganizationUsersRequest
* @param {module:api/OrganizationsApi~addOrganizationUsersCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/AddOrganizationUsersResponse}
*/
_createClass(OrganizationsApi, [{
key: "addOrganizationUsers",
value: function addOrganizationUsers(orgCode, opts, callback) {
opts = opts || {};
var postBody = opts['addOrganizationUsersRequest'];
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling addOrganizationUsers");
}
var pathParams = {
'org_code': orgCode
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = ['application/json'];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _AddOrganizationUsersResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the createOrganization operation.
* @callback module:api/OrganizationsApi~createOrganizationCallback
* @param {String} error Error message, if any.
* @param {module:model/CreateOrganizationResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Create Organization
* Create an organization.
* @param {Object} opts Optional parameters
* @param {module:model/CreateOrganizationRequest} opts.createOrganizationRequest Organization details.
* @param {module:api/OrganizationsApi~createOrganizationCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/CreateOrganizationResponse}
*/
}, {
key: "createOrganization",
value: function createOrganization(opts, callback) {
opts = opts || {};
var postBody = opts['createOrganizationRequest'];
var pathParams = {};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = ['application/json'];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _CreateOrganizationResponse["default"];
return this.apiClient.callApi('/api/v1/organization', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the createOrganizationUserRole operation.
* @callback module:api/OrganizationsApi~createOrganizationUserRoleCallback
* @param {String} error Error message, if any.
* @param {module:model/SuccessResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Add Organization User Role
* Add role to an organization user.
* @param {String} orgCode The organization's code.
* @param {String} userId The user's id.
* @param {module:model/CreateOrganizationUserRoleRequest} createOrganizationUserRoleRequest Role details.
* @param {module:api/OrganizationsApi~createOrganizationUserRoleCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SuccessResponse}
*/
}, {
key: "createOrganizationUserRole",
value: function createOrganizationUserRole(orgCode, userId, createOrganizationUserRoleRequest, callback) {
var postBody = createOrganizationUserRoleRequest;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling createOrganizationUserRole");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling createOrganizationUserRole");
}
// verify the required parameter 'createOrganizationUserRoleRequest' is set
if (createOrganizationUserRoleRequest === undefined || createOrganizationUserRoleRequest === null) {
throw new Error("Missing the required parameter 'createOrganizationUserRoleRequest' when calling createOrganizationUserRole");
}
var pathParams = {
'org_code': orgCode,
'user_id': userId
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = ['application/json'];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _SuccessResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users/{user_id}/roles', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the deleteOrganizationFeatureFlagOverride operation.
* @callback module:api/OrganizationsApi~deleteOrganizationFeatureFlagOverrideCallback
* @param {String} error Error message, if any.
* @param {module:model/SuccessResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Delete organization feature flag override
* Delete organization feature flag override.
* @param {String} orgCode The identifier for the organization.
* @param {String} featureFlagKey The identifier for the feature flag.
* @param {module:api/OrganizationsApi~deleteOrganizationFeatureFlagOverrideCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SuccessResponse}
*/
}, {
key: "deleteOrganizationFeatureFlagOverride",
value: function deleteOrganizationFeatureFlagOverride(orgCode, featureFlagKey, callback) {
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling deleteOrganizationFeatureFlagOverride");
}
// verify the required parameter 'featureFlagKey' is set
if (featureFlagKey === undefined || featureFlagKey === null) {
throw new Error("Missing the required parameter 'featureFlagKey' when calling deleteOrganizationFeatureFlagOverride");
}
var pathParams = {
'org_code': orgCode,
'feature_flag_key': featureFlagKey
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _SuccessResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the deleteOrganizationFeatureFlagOverrides operation.
* @callback module:api/OrganizationsApi~deleteOrganizationFeatureFlagOverridesCallback
* @param {String} error Error message, if any.
* @param {module:model/SuccessResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Delete all organization feature flag overrides
* Delete all organization feature flag overrides.
* @param {String} orgCode The identifier for the organization.
* @param {module:api/OrganizationsApi~deleteOrganizationFeatureFlagOverridesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SuccessResponse}
*/
}, {
key: "deleteOrganizationFeatureFlagOverrides",
value: function deleteOrganizationFeatureFlagOverrides(orgCode, callback) {
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling deleteOrganizationFeatureFlagOverrides");
}
var pathParams = {
'org_code': orgCode
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _SuccessResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/feature_flags', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the deleteOrganizationUserRole operation.
* @callback module:api/OrganizationsApi~deleteOrganizationUserRoleCallback
* @param {String} error Error message, if any.
* @param {module:model/SuccessResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Delete Organization User Role
* Delete role for an organization user.
* @param {String} orgCode The organization's code.
* @param {String} userId The user's id.
* @param {String} roleId The role id.
* @param {module:api/OrganizationsApi~deleteOrganizationUserRoleCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SuccessResponse}
*/
}, {
key: "deleteOrganizationUserRole",
value: function deleteOrganizationUserRole(orgCode, userId, roleId, callback) {
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling deleteOrganizationUserRole");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling deleteOrganizationUserRole");
}
// verify the required parameter 'roleId' is set
if (roleId === undefined || roleId === null) {
throw new Error("Missing the required parameter 'roleId' when calling deleteOrganizationUserRole");
}
var pathParams = {
'org_code': orgCode,
'user_id': userId,
'role_id': roleId
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _SuccessResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getOrganization operation.
* @callback module:api/OrganizationsApi~getOrganizationCallback
* @param {String} error Error message, if any.
* @param {module:model/Organization} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get Organization
* Gets an organization given the organization's code.
* @param {Object} opts Optional parameters
* @param {String} opts.code The organization's code.
* @param {module:api/OrganizationsApi~getOrganizationCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Organization}
*/
}, {
key: "getOrganization",
value: function getOrganization(opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {};
var queryParams = {
'code': opts['code']
};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _Organization["default"];
return this.apiClient.callApi('/api/v1/organization', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getOrganizationUserRoles operation.
* @callback module:api/OrganizationsApi~getOrganizationUserRolesCallback
* @param {String} error Error message, if any.
* @param {module:model/GetOrganizationsUserRolesResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List Organization User Roles
* Get roles for an organization user.
* @param {String} orgCode The organization's code.
* @param {String} userId The user's id.
* @param {module:api/OrganizationsApi~getOrganizationUserRolesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/GetOrganizationsUserRolesResponse}
*/
}, {
key: "getOrganizationUserRoles",
value: function getOrganizationUserRoles(orgCode, userId, callback) {
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling getOrganizationUserRoles");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling getOrganizationUserRoles");
}
var pathParams = {
'org_code': orgCode,
'user_id': userId
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _GetOrganizationsUserRolesResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users/{user_id}/roles', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getOrganizationUsers operation.
* @callback module:api/OrganizationsApi~getOrganizationUsersCallback
* @param {String} error Error message, if any.
* @param {module:model/GetOrganizationsUsersResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List Organization Users
* Get users in an organization.
* @param {String} orgCode The organization's code.
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.sort Field and order to sort the result by.
* @param {Number} opts.pageSize Number of results per page. Defaults to 10 if parameter not sent.
* @param {String} opts.nextToken A string to get the next page of results if there are more results.
* @param {String} opts.permissions Filter by user permissions
* @param {module:api/OrganizationsApi~getOrganizationUsersCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/GetOrganizationsUsersResponse}
*/
}, {
key: "getOrganizationUsers",
value: function getOrganizationUsers(orgCode, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling getOrganizationUsers");
}
var pathParams = {
'org_code': orgCode
};
var queryParams = {
'sort': opts['sort'],
'page_size': opts['pageSize'],
'next_token': opts['nextToken'],
'permissions': opts['permissions']
};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _GetOrganizationsUsersResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getOrganizations operation.
* @callback module:api/OrganizationsApi~getOrganizationsCallback
* @param {String} error Error message, if any.
* @param {module:model/GetOrganizationsResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List Organizations
* Get a list of organizations.
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.sort Field and order to sort the result by.
* @param {Number} opts.pageSize Number of results per page. Defaults to 10 if parameter not sent.
* @param {String} opts.nextToken A string to get the next page of results if there are more results.
* @param {module:api/OrganizationsApi~getOrganizationsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/GetOrganizationsResponse}
*/
}, {
key: "getOrganizations",
value: function getOrganizations(opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {};
var queryParams = {
'sort': opts['sort'],
'page_size': opts['pageSize'],
'next_token': opts['nextToken']
};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _GetOrganizationsResponse["default"];
return this.apiClient.callApi('/api/v1/organizations', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the removeOrganizationUser operation.
* @callback module:api/OrganizationsApi~removeOrganizationUserCallback
* @param {String} error Error message, if any.
* @param {module:model/SuccessResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Remove Organization User
* Remove user from an organization.
* @param {String} orgCode The organization's code.
* @param {String} userId The user's id.
* @param {module:api/OrganizationsApi~removeOrganizationUserCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SuccessResponse}
*/
}, {
key: "removeOrganizationUser",
value: function removeOrganizationUser(orgCode, userId, callback) {
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling removeOrganizationUser");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling removeOrganizationUser");
}
var pathParams = {
'org_code': orgCode,
'user_id': userId
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _SuccessResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users/{user_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the updateOrganization operation.
* @callback module:api/OrganizationsApi~updateOrganizationCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Update Organization
* Update an organization.
* @param {String} orgCode The identifier for the organization.
* @param {Object} opts Optional parameters
* @param {module:model/UpdateOrganizationRequest} opts.updateOrganizationRequest Organization details.
* @param {module:api/OrganizationsApi~updateOrganizationCallback} callback The callback function, accepting three arguments: error, data, response
*/
}, {
key: "updateOrganization",
value: function updateOrganization(orgCode, opts, callback) {
opts = opts || {};
var postBody = opts['updateOrganizationRequest'];
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling updateOrganization");
}
var pathParams = {
'org_code': orgCode
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = ['application/json'];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = null;
return this.apiClient.callApi('/api/v1/organizations/{org_code}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the updateOrganizationFeatureFlagOverride operation.
* @callback module:api/OrganizationsApi~updateOrganizationFeatureFlagOverrideCallback
* @param {String} error Error message, if any.
* @param {module:model/SuccessResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Update organization feature flag override
* Update organization feature flag override.
* @param {String} orgCode The identifier for the organization
* @param {String} featureFlagKey The identifier for the feature flag
* @param {String} value Override value
* @param {module:api/OrganizationsApi~updateOrganizationFeatureFlagOverrideCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SuccessResponse}
*/
}, {
key: "updateOrganizationFeatureFlagOverride",
value: function updateOrganizationFeatureFlagOverride(orgCode, featureFlagKey, value, callback) {
var postBody = null;
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling updateOrganizationFeatureFlagOverride");
}
// verify the required parameter 'featureFlagKey' is set
if (featureFlagKey === undefined || featureFlagKey === null) {
throw new Error("Missing the required parameter 'featureFlagKey' when calling updateOrganizationFeatureFlagOverride");
}
// verify the required parameter 'value' is set
if (value === undefined || value === null) {
throw new Error("Missing the required parameter 'value' when calling updateOrganizationFeatureFlagOverride");
}
var pathParams = {
'org_code': orgCode,
'feature_flag_key': featureFlagKey
};
var queryParams = {
'value': value
};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = [];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _SuccessResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the updateOrganizationUsers operation.
* @callback module:api/OrganizationsApi~updateOrganizationUsersCallback
* @param {String} error Error message, if any.
* @param {module:model/RemoveOrganizationUsersResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Update organization users
* Update users that belong to an organization.
* @param {String} orgCode The organization's code.
* @param {Object} opts Optional parameters
* @param {module:model/UpdateOrganizationUsersRequest} opts.updateOrganizationUsersRequest
* @param {module:api/OrganizationsApi~updateOrganizationUsersCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RemoveOrganizationUsersResponse}
*/
}, {
key: "updateOrganizationUsers",
value: function updateOrganizationUsers(orgCode, opts, callback) {
opts = opts || {};
var postBody = opts['updateOrganizationUsersRequest'];
// verify the required parameter 'orgCode' is set
if (orgCode === undefined || orgCode === null) {
throw new Error("Missing the required parameter 'orgCode' when calling updateOrganizationUsers");
}
var pathParams = {
'org_code': orgCode
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['kindeBearerAuth'];
var contentTypes = ['application/json'];
var accepts = ['application/json', 'application/json; charset=utf-8'];
var returnType = _RemoveOrganizationUsersResponse["default"];
return this.apiClient.callApi('/api/v1/organizations/{org_code}/users', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
}]);
return OrganizationsApi;
}();
exports["default"] = OrganizationsApi;