wallee
Version:
TypeScript/JavaScript client for wallee
337 lines (324 loc) • 18.7 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Wallee AG TypeScript SDK
*
* This library allows to interact with the Wallee AG payment service.
*
* Copyright owner: Wallee AG
* Website: https://en.wallee.com
* Developer email: ecosystem-team@wallee.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationUsersRolesService = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
const ServiceApiUtils_1 = require("../utils/ServiceApiUtils");
/**
*
*/
class ApplicationUsersRolesService extends runtime.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* Unassign a role from an application user for an account
*/
deleteApplicationUsersUserIdAccountRolesRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling deleteApplicationUsersUserIdAccountRoles().');
}
if (requestParameters['roleId'] == null) {
throw new runtime.RequiredError('roleId', 'Required parameter "roleId" was null or undefined when calling deleteApplicationUsersUserIdAccountRoles().');
}
if (requestParameters['account'] == null) {
throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling deleteApplicationUsersUserIdAccountRoles().');
}
const queryParameters = {};
if (requestParameters['roleId'] != null) {
queryParameters['roleId'] = requestParameters['roleId'];
}
const headerParameters = {};
if (requestParameters['account'] != null) {
headerParameters['Account'] = String(requestParameters['account']);
}
const method = 'DELETE';
const path = `/application-users/{userId}/account-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/application-users/{userId}/account-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Unassign a role from an application user for an account
*/
deleteApplicationUsersUserIdAccountRoles(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.deleteApplicationUsersUserIdAccountRolesRaw(requestParameters, initOverrides);
});
}
/**
* Unassign a role from an application user for a space
*/
deleteApplicationUsersUserIdSpaceRolesRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling deleteApplicationUsersUserIdSpaceRoles().');
}
if (requestParameters['roleId'] == null) {
throw new runtime.RequiredError('roleId', 'Required parameter "roleId" was null or undefined when calling deleteApplicationUsersUserIdSpaceRoles().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling deleteApplicationUsersUserIdSpaceRoles().');
}
const queryParameters = {};
if (requestParameters['roleId'] != null) {
queryParameters['roleId'] = requestParameters['roleId'];
}
const headerParameters = {};
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'DELETE';
const path = `/application-users/{userId}/space-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/application-users/{userId}/space-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Unassign a role from an application user for a space
*/
deleteApplicationUsersUserIdSpaceRoles(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.deleteApplicationUsersUserIdSpaceRolesRaw(requestParameters, initOverrides);
});
}
/**
* List all roles of an application user for an account
*/
getApplicationUsersUserIdAccountRolesRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling getApplicationUsersUserIdAccountRoles().');
}
if (requestParameters['account'] == null) {
throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling getApplicationUsersUserIdAccountRoles().');
}
const queryParameters = {};
const headerParameters = {};
if (requestParameters['account'] != null) {
headerParameters['Account'] = String(requestParameters['account']);
}
const method = 'GET';
const path = `/application-users/{userId}/account-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/application-users/{userId}/account-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserAccountRoleListResponseFromJSON)(jsonValue));
});
}
/**
* List all roles of an application user for an account
*/
getApplicationUsersUserIdAccountRoles(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.getApplicationUsersUserIdAccountRolesRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* List all roles of an application user for a space
*/
getApplicationUsersUserIdSpaceRolesRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling getApplicationUsersUserIdSpaceRoles().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getApplicationUsersUserIdSpaceRoles().');
}
const queryParameters = {};
const headerParameters = {};
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'GET';
const path = `/application-users/{userId}/space-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/application-users/{userId}/space-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserSpaceRoleListResponseFromJSON)(jsonValue));
});
}
/**
* List all roles of an application user for a space
*/
getApplicationUsersUserIdSpaceRoles(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.getApplicationUsersUserIdSpaceRolesRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Assign a role to an application user for an account
*/
postApplicationUsersUserIdAccountRolesRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling postApplicationUsersUserIdAccountRoles().');
}
if (requestParameters['roleId'] == null) {
throw new runtime.RequiredError('roleId', 'Required parameter "roleId" was null or undefined when calling postApplicationUsersUserIdAccountRoles().');
}
if (requestParameters['account'] == null) {
throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling postApplicationUsersUserIdAccountRoles().');
}
const queryParameters = {};
if (requestParameters['roleId'] != null) {
queryParameters['roleId'] = requestParameters['roleId'];
}
if (requestParameters['appliesOnSubAccount'] != null) {
queryParameters['appliesOnSubAccount'] = requestParameters['appliesOnSubAccount'];
}
const headerParameters = {};
if (requestParameters['account'] != null) {
headerParameters['Account'] = String(requestParameters['account']);
}
const method = 'POST';
const path = `/application-users/{userId}/account-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/application-users/{userId}/account-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserAccountRoleFromJSON)(jsonValue));
});
}
/**
* Assign a role to an application user for an account
*/
postApplicationUsersUserIdAccountRoles(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postApplicationUsersUserIdAccountRolesRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Assign a role to an application user for a space
*/
postApplicationUsersUserIdSpaceRolesRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling postApplicationUsersUserIdSpaceRoles().');
}
if (requestParameters['roleId'] == null) {
throw new runtime.RequiredError('roleId', 'Required parameter "roleId" was null or undefined when calling postApplicationUsersUserIdSpaceRoles().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postApplicationUsersUserIdSpaceRoles().');
}
const queryParameters = {};
if (requestParameters['roleId'] != null) {
queryParameters['roleId'] = requestParameters['roleId'];
}
const headerParameters = {};
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'POST';
const path = `/application-users/{userId}/space-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/application-users/{userId}/space-roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserSpaceRoleFromJSON)(jsonValue));
});
}
/**
* Assign a role to an application user for a space
*/
postApplicationUsersUserIdSpaceRoles(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postApplicationUsersUserIdSpaceRolesRaw(requestParameters, initOverrides);
return yield response.value();
});
}
}
exports.ApplicationUsersRolesService = ApplicationUsersRolesService;