diff --git a/scripts/mk/crc-frontend.mk b/scripts/mk/crc-frontend.mk index 5ea8a50..89a7aea 100644 --- a/scripts/mk/crc-frontend.mk +++ b/scripts/mk/crc-frontend.mk @@ -39,7 +39,7 @@ run:$(NODE_BIN)/fec ## Execute frontend .PHONY: generate-api generate-api: $(NODE_BIN)/openapi-generator-cli $(NODE_BIN)/prettier $(PUBLIC_OPENAPI) ## Generate the API client from openapi specification - @rm -rf "$(APIDIR)/idmsvc" + @rm -rf "$(APIDIR)/idmsvc" "$(APIDIR)/rbac" # Generate idmsvc API client TS_POST_PROCESS_FILE="node_modules/.bin/prettier --write" \ @@ -51,6 +51,19 @@ generate-api: $(NODE_BIN)/openapi-generator-cli $(NODE_BIN)/prettier $(PUBLIC_OP "$(APIDIR)/idmsvc/git_push.sh" \ "$(APIDIR)/idmsvc/.gitignore" + # Generate rbac API client + TS_POST_PROCESS_FILE="node_modules/.bin/prettier --write" \ + npm run openapi-generator-cli -- generate --enable-post-process-file \ + -i "https://raw.githubusercontent.com/RedHatInsights/insights-rbac/v1.2.0/docs/source/specs/openapi.json" \ + -g typescript-axios -o $(APIDIR)/rbac + @rm -rf \ + "$(APIDIR)/rbac/.gitignore" \ + "$(APIDIR)/rbac/.npmignore" \ + "$(APIDIR)/rbac/git_push.sh" \ + "$(APIDIR)/rbac/.gitignore" + + + .PHONY: update-api update-api: git submodule update --init --remote diff --git a/src/Api/rbac/.openapi-generator-ignore b/src/Api/rbac/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/Api/rbac/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/Api/rbac/.openapi-generator/FILES b/src/Api/rbac/.openapi-generator/FILES new file mode 100644 index 0000000..16b445e --- /dev/null +++ b/src/Api/rbac/.openapi-generator/FILES @@ -0,0 +1,9 @@ +.gitignore +.npmignore +.openapi-generator-ignore +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts diff --git a/src/Api/rbac/.openapi-generator/VERSION b/src/Api/rbac/.openapi-generator/VERSION new file mode 100644 index 0000000..cd802a1 --- /dev/null +++ b/src/Api/rbac/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/src/Api/rbac/api.ts b/src/Api/rbac/api.ts new file mode 100644 index 0000000..615fe5c --- /dev/null +++ b/src/Api/rbac/api.ts @@ -0,0 +1,6203 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Role Based Access Control + * The API for Role Based Access Control. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; + +/** + * + * @export + * @interface Access + */ +export interface Access { + /** + * + * @type {string} + * @memberof Access + */ + permission: string; + /** + * + * @type {Array} + * @memberof Access + */ + resourceDefinitions: Array; +} +/** + * + * @export + * @interface AccessPagination + */ +export interface AccessPagination { + /** + * + * @type {PaginationMeta} + * @memberof AccessPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof AccessPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof AccessPagination + */ + data: Array; +} +/** + * + * @export + * @interface AccessPaginationAllOf + */ +export interface AccessPaginationAllOf { + /** + * + * @type {Array} + * @memberof AccessPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface AddRoleToGroup200Response + */ +export interface AddRoleToGroup200Response { + /** + * + * @type {Array} + * @memberof AddRoleToGroup200Response + */ + data: Array; +} +/** + * + * @export + * @interface AdditionalGroup + */ +export interface AdditionalGroup { + /** + * + * @type {string} + * @memberof AdditionalGroup + */ + name?: string; + /** + * + * @type {string} + * @memberof AdditionalGroup + */ + description?: string; + /** + * + * @type {string} + * @memberof AdditionalGroup + */ + uuid?: string; +} +/** + * + * @export + * @interface CrossAccountRequest + */ +export interface CrossAccountRequest { + /** + * + * @type {string} + * @memberof CrossAccountRequest + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequest + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequest + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequest + */ + created?: string; + /** + * + * @type {any} + * @memberof CrossAccountRequest + */ + start_date?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequest + */ + end_date?: any; +} +/** + * + * @export + * @interface CrossAccountRequestByAccount + */ +export interface CrossAccountRequestByAccount { + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + created?: string; + /** + * + * @type {any} + * @memberof CrossAccountRequestByAccount + */ + start_date?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequestByAccount + */ + end_date?: any; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + first_name?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + last_name?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccount + */ + email?: string; +} +/** + * + * @export + * @interface CrossAccountRequestByAccountAllOf + */ +export interface CrossAccountRequestByAccountAllOf { + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccountAllOf + */ + first_name?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccountAllOf + */ + last_name?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByAccountAllOf + */ + email?: string; +} +/** + * + * @export + * @interface CrossAccountRequestByUserId + */ +export interface CrossAccountRequestByUserId { + /** + * + * @type {string} + * @memberof CrossAccountRequestByUserId + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByUserId + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByUserId + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestByUserId + */ + created?: string; + /** + * + * @type {any} + * @memberof CrossAccountRequestByUserId + */ + start_date?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequestByUserId + */ + end_date?: any; + /** + * + * @type {string} + * @memberof CrossAccountRequestByUserId + */ + user_id?: string; +} +/** + * + * @export + * @interface CrossAccountRequestByUserIdAllOf + */ +export interface CrossAccountRequestByUserIdAllOf { + /** + * + * @type {string} + * @memberof CrossAccountRequestByUserIdAllOf + */ + user_id?: string; +} +/** + * @type CrossAccountRequestDetail + * @export + */ +export type CrossAccountRequestDetail = CrossAccountRequestDetailByAccount | CrossAccountRequestDetailByUseId; + +/** + * + * @export + * @interface CrossAccountRequestDetailByAccount + */ +export interface CrossAccountRequestDetailByAccount { + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByAccount + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByAccount + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByAccount + */ + start_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByAccount + */ + end_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByAccount + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByAccount + */ + created?: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestDetailByAccount + */ + roles?: Array; + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByAccount + */ + first_name?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByAccount + */ + last_name?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByAccount + */ + email?: any; +} +/** + * + * @export + * @interface CrossAccountRequestDetailByAccountAllOf + */ +export interface CrossAccountRequestDetailByAccountAllOf { + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByAccountAllOf + */ + first_name?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByAccountAllOf + */ + last_name?: any; + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByAccountAllOf + */ + email?: any; +} +/** + * + * @export + * @interface CrossAccountRequestDetailByUseId + */ +export interface CrossAccountRequestDetailByUseId { + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByUseId + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByUseId + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByUseId + */ + start_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByUseId + */ + end_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByUseId + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestDetailByUseId + */ + created?: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestDetailByUseId + */ + roles?: Array; + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByUseId + */ + user_id?: any; +} +/** + * + * @export + * @interface CrossAccountRequestDetailByUseIdAllOf + */ +export interface CrossAccountRequestDetailByUseIdAllOf { + /** + * + * @type {any} + * @memberof CrossAccountRequestDetailByUseIdAllOf + */ + user_id?: any; +} +/** + * + * @export + * @interface CrossAccountRequestIn + */ +export interface CrossAccountRequestIn { + /** + * + * @type {string} + * @memberof CrossAccountRequestIn + */ + target_account: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestIn + */ + start_date: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestIn + */ + end_date: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestIn + */ + roles: Array; +} +/** + * + * @export + * @interface CrossAccountRequestOut + */ +export interface CrossAccountRequestOut { + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + start_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + end_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + created?: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestOut + */ + roles?: Array; + /** + * + * @type {string} + * @memberof CrossAccountRequestOut + */ + user_id?: string; +} +/** + * + * @export + * @interface CrossAccountRequestPagination + */ +export interface CrossAccountRequestPagination { + /** + * + * @type {PaginationMeta} + * @memberof CrossAccountRequestPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof CrossAccountRequestPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof CrossAccountRequestPagination + */ + data: Array; +} +/** + * + * @export + * @interface CrossAccountRequestPaginationAllOf + */ +export interface CrossAccountRequestPaginationAllOf { + /** + * + * @type {Array} + * @memberof CrossAccountRequestPaginationAllOf + */ + data: Array; +} +/** + * @type CrossAccountRequestPaginationAllOfDataInner + * @export + */ +export type CrossAccountRequestPaginationAllOfDataInner = CrossAccountRequestByAccount | CrossAccountRequestByUserId; + +/** + * + * @export + * @interface CrossAccountRequestPatch + */ +export interface CrossAccountRequestPatch { + /** + * + * @type {string} + * @memberof CrossAccountRequestPatch + */ + start_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestPatch + */ + end_date?: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestPatch + */ + roles?: Array; + /** + * + * @type {string} + * @memberof CrossAccountRequestPatch + */ + status?: CrossAccountRequestPatchStatusEnum; +} + +export const CrossAccountRequestPatchStatusEnum = { + Pending: 'pending', + Approved: 'approved', + Expired: 'expired', + Cancelled: 'cancelled', + Denied: 'denied', +} as const; + +export type CrossAccountRequestPatchStatusEnum = (typeof CrossAccountRequestPatchStatusEnum)[keyof typeof CrossAccountRequestPatchStatusEnum]; + +/** + * + * @export + * @interface CrossAccountRequestUpdateIn + */ +export interface CrossAccountRequestUpdateIn { + /** + * + * @type {string} + * @memberof CrossAccountRequestUpdateIn + */ + start_date: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestUpdateIn + */ + end_date: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestUpdateIn + */ + roles: Array; + /** + * + * @type {string} + * @memberof CrossAccountRequestUpdateIn + */ + status?: CrossAccountRequestUpdateInStatusEnum; +} + +export const CrossAccountRequestUpdateInStatusEnum = { + Pending: 'pending', + Approved: 'approved', + Expired: 'expired', + Cancelled: 'cancelled', + Denied: 'denied', +} as const; + +export type CrossAccountRequestUpdateInStatusEnum = + (typeof CrossAccountRequestUpdateInStatusEnum)[keyof typeof CrossAccountRequestUpdateInStatusEnum]; + +/** + * + * @export + * @interface CrossAccountRequestWithRoles + */ +export interface CrossAccountRequestWithRoles { + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRoles + */ + request_id?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRoles + */ + target_account?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRoles + */ + start_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRoles + */ + end_date?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRoles + */ + status?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRoles + */ + created?: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestWithRoles + */ + roles?: Array; +} +/** + * + * @export + * @interface CrossAccountRequestWithRolesRolesInner + */ +export interface CrossAccountRequestWithRolesRolesInner { + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRolesRolesInner + */ + display_name?: string; + /** + * + * @type {string} + * @memberof CrossAccountRequestWithRolesRolesInner + */ + description?: string; + /** + * + * @type {Array} + * @memberof CrossAccountRequestWithRolesRolesInner + */ + permissions?: Array; +} +/** + * + * @export + * @interface Error403 + */ +export interface Error403 { + /** + * + * @type {Array} + * @memberof Error403 + */ + errors: Array; +} +/** + * + * @export + * @interface Error403ErrorsInner + */ +export interface Error403ErrorsInner { + /** + * + * @type {string} + * @memberof Error403ErrorsInner + */ + detail?: string; + /** + * + * @type {string} + * @memberof Error403ErrorsInner + */ + source?: string; + /** + * + * @type {string} + * @memberof Error403ErrorsInner + */ + status?: string; +} +/** + * + * @export + * @interface ErrorErrorsInner + */ +export interface ErrorErrorsInner { + /** + * + * @type {string} + * @memberof ErrorErrorsInner + */ + detail?: string; + /** + * + * @type {string} + * @memberof ErrorErrorsInner + */ + status?: string; +} +/** + * + * @export + * @interface Group + */ +export interface Group { + /** + * + * @type {string} + * @memberof Group + */ + name: string; + /** + * + * @type {string} + * @memberof Group + */ + description?: string; +} +/** + * + * @export + * @interface GroupOut + */ +export interface GroupOut { + /** + * + * @type {string} + * @memberof GroupOut + */ + name: string; + /** + * + * @type {string} + * @memberof GroupOut + */ + description?: string; + /** + * + * @type {string} + * @memberof GroupOut + */ + uuid: string; + /** + * + * @type {string} + * @memberof GroupOut + */ + created: string; + /** + * + * @type {string} + * @memberof GroupOut + */ + modified: string; + /** + * + * @type {number} + * @memberof GroupOut + */ + principalCount?: number; + /** + * + * @type {number} + * @memberof GroupOut + */ + roleCount?: number; + /** + * + * @type {boolean} + * @memberof GroupOut + */ + system?: boolean; + /** + * + * @type {boolean} + * @memberof GroupOut + */ + platform_default?: boolean; +} +/** + * + * @export + * @interface GroupOutAllOf + */ +export interface GroupOutAllOf { + /** + * + * @type {number} + * @memberof GroupOutAllOf + */ + principalCount?: number; + /** + * + * @type {number} + * @memberof GroupOutAllOf + */ + roleCount?: number; + /** + * + * @type {boolean} + * @memberof GroupOutAllOf + */ + system?: boolean; + /** + * + * @type {boolean} + * @memberof GroupOutAllOf + */ + platform_default?: boolean; +} +/** + * + * @export + * @interface GroupPagination + */ +export interface GroupPagination { + /** + * + * @type {PaginationMeta} + * @memberof GroupPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof GroupPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof GroupPagination + */ + data: Array; +} +/** + * + * @export + * @interface GroupPaginationAllOf + */ +export interface GroupPaginationAllOf { + /** + * + * @type {Array} + * @memberof GroupPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface GroupPrincipalIn + */ +export interface GroupPrincipalIn { + /** + * + * @type {Array} + * @memberof GroupPrincipalIn + */ + principals: Array; +} +/** + * + * @export + * @interface GroupRoleIn + */ +export interface GroupRoleIn { + /** + * + * @type {Array} + * @memberof GroupRoleIn + */ + roles: Array; +} +/** + * + * @export + * @interface GroupRolesPagination + */ +export interface GroupRolesPagination { + /** + * + * @type {PaginationMeta} + * @memberof GroupRolesPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof GroupRolesPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof GroupRolesPagination + */ + data: Array; +} +/** + * + * @export + * @interface GroupRolesPaginationAllOf + */ +export interface GroupRolesPaginationAllOf { + /** + * + * @type {Array} + * @memberof GroupRolesPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface GroupWithPrincipals + */ +export interface GroupWithPrincipals { + /** + * + * @type {string} + * @memberof GroupWithPrincipals + */ + name: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipals + */ + description?: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipals + */ + uuid: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipals + */ + created: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipals + */ + modified: string; + /** + * + * @type {Array} + * @memberof GroupWithPrincipals + */ + principals: Array; +} +/** + * + * @export + * @interface GroupWithPrincipalsAllOf + */ +export interface GroupWithPrincipalsAllOf { + /** + * + * @type {Array} + * @memberof GroupWithPrincipalsAllOf + */ + principals: Array; +} +/** + * + * @export + * @interface GroupWithPrincipalsAndRoles + */ +export interface GroupWithPrincipalsAndRoles { + /** + * + * @type {string} + * @memberof GroupWithPrincipalsAndRoles + */ + name: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipalsAndRoles + */ + description?: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipalsAndRoles + */ + uuid: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipalsAndRoles + */ + created: string; + /** + * + * @type {string} + * @memberof GroupWithPrincipalsAndRoles + */ + modified: string; + /** + * + * @type {Array} + * @memberof GroupWithPrincipalsAndRoles + */ + principals: Array; + /** + * + * @type {Array} + * @memberof GroupWithPrincipalsAndRoles + */ + roles: Array; +} +/** + * + * @export + * @interface GroupWithPrincipalsAndRolesAllOf + */ +export interface GroupWithPrincipalsAndRolesAllOf { + /** + * + * @type {Array} + * @memberof GroupWithPrincipalsAndRolesAllOf + */ + principals: Array; + /** + * + * @type {Array} + * @memberof GroupWithPrincipalsAndRolesAllOf + */ + roles: Array; +} +/** + * + * @export + * @interface ListPagination + */ +export interface ListPagination { + /** + * + * @type {PaginationMeta} + * @memberof ListPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof ListPagination + */ + links?: PaginationLinks; +} +/** + * + * @export + * @interface ModelError + */ +export interface ModelError { + /** + * + * @type {Array} + * @memberof ModelError + */ + errors: Array; +} +/** + * + * @export + * @interface PaginationLinks + */ +export interface PaginationLinks { + /** + * + * @type {string} + * @memberof PaginationLinks + */ + first?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + previous?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + next?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + last?: string; +} +/** + * + * @export + * @interface PaginationMeta + */ +export interface PaginationMeta { + /** + * + * @type {number} + * @memberof PaginationMeta + */ + count?: number; +} +/** + * + * @export + * @interface Permission + */ +export interface Permission { + /** + * + * @type {string} + * @memberof Permission + */ + application?: string; + /** + * + * @type {string} + * @memberof Permission + */ + resource_type?: string; + /** + * + * @type {string} + * @memberof Permission + */ + verb?: string; + /** + * + * @type {string} + * @memberof Permission + */ + permission?: string; + /** + * + * @type {string} + * @memberof Permission + */ + description?: string; +} +/** + * + * @export + * @interface PermissionOptionsPagination + */ +export interface PermissionOptionsPagination { + /** + * + * @type {PaginationMeta} + * @memberof PermissionOptionsPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof PermissionOptionsPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof PermissionOptionsPagination + */ + data: Array; +} +/** + * + * @export + * @interface PermissionOptionsPaginationAllOf + */ +export interface PermissionOptionsPaginationAllOf { + /** + * + * @type {Array} + * @memberof PermissionOptionsPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface PermissionPagination + */ +export interface PermissionPagination { + /** + * + * @type {PaginationMeta} + * @memberof PermissionPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof PermissionPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof PermissionPagination + */ + data: Array; +} +/** + * + * @export + * @interface PermissionPaginationAllOf + */ +export interface PermissionPaginationAllOf { + /** + * + * @type {Array} + * @memberof PermissionPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface Policy + */ +export interface Policy { + /** + * + * @type {string} + * @memberof Policy + */ + name: string; + /** + * + * @type {string} + * @memberof Policy + */ + description?: string; +} +/** + * + * @export + * @interface PolicyExtended + */ +export interface PolicyExtended { + /** + * + * @type {string} + * @memberof PolicyExtended + */ + name: string; + /** + * + * @type {string} + * @memberof PolicyExtended + */ + description?: string; + /** + * + * @type {string} + * @memberof PolicyExtended + */ + uuid: string; + /** + * + * @type {string} + * @memberof PolicyExtended + */ + created: string; + /** + * + * @type {string} + * @memberof PolicyExtended + */ + modified: string; + /** + * + * @type {GroupOut} + * @memberof PolicyExtended + */ + group: GroupOut; + /** + * + * @type {Array} + * @memberof PolicyExtended + */ + roles: Array; +} +/** + * + * @export + * @interface PolicyExtendedAllOf + */ +export interface PolicyExtendedAllOf { + /** + * + * @type {GroupOut} + * @memberof PolicyExtendedAllOf + */ + group: GroupOut; + /** + * + * @type {Array} + * @memberof PolicyExtendedAllOf + */ + roles: Array; +} +/** + * + * @export + * @interface PolicyIn + */ +export interface PolicyIn { + /** + * + * @type {string} + * @memberof PolicyIn + */ + name: string; + /** + * + * @type {string} + * @memberof PolicyIn + */ + description?: string; + /** + * + * @type {string} + * @memberof PolicyIn + */ + group: string; + /** + * + * @type {Array} + * @memberof PolicyIn + */ + roles: Array; +} +/** + * + * @export + * @interface PolicyInAllOf + */ +export interface PolicyInAllOf { + /** + * + * @type {string} + * @memberof PolicyInAllOf + */ + group: string; + /** + * + * @type {Array} + * @memberof PolicyInAllOf + */ + roles: Array; +} +/** + * + * @export + * @interface PolicyPagination + */ +export interface PolicyPagination { + /** + * + * @type {PaginationMeta} + * @memberof PolicyPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof PolicyPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof PolicyPagination + */ + data: Array; +} +/** + * + * @export + * @interface PolicyPaginationAllOf + */ +export interface PolicyPaginationAllOf { + /** + * + * @type {Array} + * @memberof PolicyPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface Principal + */ +export interface Principal { + /** + * + * @type {string} + * @memberof Principal + */ + username: string; + /** + * + * @type {string} + * @memberof Principal + */ + email: string; + /** + * + * @type {string} + * @memberof Principal + */ + first_name?: string; + /** + * + * @type {string} + * @memberof Principal + */ + last_name?: string; + /** + * + * @type {boolean} + * @memberof Principal + */ + is_active?: boolean; + /** + * + * @type {boolean} + * @memberof Principal + */ + is_org_admin?: boolean; +} +/** + * + * @export + * @interface PrincipalIn + */ +export interface PrincipalIn { + /** + * + * @type {string} + * @memberof PrincipalIn + */ + username: string; +} +/** + * + * @export + * @interface PrincipalOut + */ +export interface PrincipalOut { + /** + * + * @type {string} + * @memberof PrincipalOut + */ + username: string; + /** + * + * @type {string} + * @memberof PrincipalOut + */ + email: string; + /** + * + * @type {string} + * @memberof PrincipalOut + */ + first_name?: string; + /** + * + * @type {string} + * @memberof PrincipalOut + */ + last_name?: string; + /** + * + * @type {boolean} + * @memberof PrincipalOut + */ + is_active?: boolean; + /** + * + * @type {boolean} + * @memberof PrincipalOut + */ + is_org_admin?: boolean; + /** + * + * @type {string} + * @memberof PrincipalOut + */ + uuid: string; +} +/** + * + * @export + * @interface PrincipalPagination + */ +export interface PrincipalPagination { + /** + * + * @type {PaginationMeta} + * @memberof PrincipalPagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof PrincipalPagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof PrincipalPagination + */ + data: Array; +} +/** + * + * @export + * @interface PrincipalPaginationAllOf + */ +export interface PrincipalPaginationAllOf { + /** + * + * @type {Array} + * @memberof PrincipalPaginationAllOf + */ + data: Array; +} +/** + * + * @export + * @interface ResourceDefinition + */ +export interface ResourceDefinition { + /** + * + * @type {ResourceDefinitionFilter} + * @memberof ResourceDefinition + */ + attributeFilter: ResourceDefinitionFilter; +} +/** + * + * @export + * @interface ResourceDefinitionFilter + */ +export interface ResourceDefinitionFilter { + /** + * + * @type {string} + * @memberof ResourceDefinitionFilter + */ + key: string; + /** + * + * @type {string} + * @memberof ResourceDefinitionFilter + */ + operation: ResourceDefinitionFilterOperationEnum; + /** + * + * @type {string} + * @memberof ResourceDefinitionFilter + */ + value: string; +} + +export const ResourceDefinitionFilterOperationEnum = { + Equal: 'equal', + In: 'in', +} as const; + +export type ResourceDefinitionFilterOperationEnum = + (typeof ResourceDefinitionFilterOperationEnum)[keyof typeof ResourceDefinitionFilterOperationEnum]; + +/** + * + * @export + * @interface Role + */ +export interface Role { + /** + * + * @type {string} + * @memberof Role + */ + name: string; + /** + * + * @type {string} + * @memberof Role + */ + display_name?: string; + /** + * + * @type {string} + * @memberof Role + */ + description?: string; +} +/** + * + * @export + * @interface RoleIn + */ +export interface RoleIn { + /** + * + * @type {string} + * @memberof RoleIn + */ + name: string; + /** + * + * @type {string} + * @memberof RoleIn + */ + display_name?: string; + /** + * + * @type {string} + * @memberof RoleIn + */ + description?: string; + /** + * + * @type {Array} + * @memberof RoleIn + */ + access: Array; +} +/** + * + * @export + * @interface RoleInAllOf + */ +export interface RoleInAllOf { + /** + * + * @type {Array} + * @memberof RoleInAllOf + */ + access: Array; +} +/** + * + * @export + * @interface RoleOut + */ +export interface RoleOut { + /** + * + * @type {string} + * @memberof RoleOut + */ + name: string; + /** + * + * @type {string} + * @memberof RoleOut + */ + display_name?: string; + /** + * + * @type {string} + * @memberof RoleOut + */ + description?: string; + /** + * + * @type {string} + * @memberof RoleOut + */ + uuid: string; + /** + * + * @type {string} + * @memberof RoleOut + */ + created: string; + /** + * + * @type {string} + * @memberof RoleOut + */ + modified: string; + /** + * + * @type {number} + * @memberof RoleOut + */ + policyCount?: number; + /** + * + * @type {number} + * @memberof RoleOut + */ + accessCount?: number; + /** + * + * @type {Array} + * @memberof RoleOut + */ + applications?: Array; + /** + * + * @type {boolean} + * @memberof RoleOut + */ + system?: boolean; + /** + * + * @type {boolean} + * @memberof RoleOut + */ + platform_default?: boolean; +} +/** + * + * @export + * @interface RoleOutAllOf + */ +export interface RoleOutAllOf { + /** + * + * @type {number} + * @memberof RoleOutAllOf + */ + policyCount?: number; + /** + * + * @type {number} + * @memberof RoleOutAllOf + */ + accessCount?: number; + /** + * + * @type {Array} + * @memberof RoleOutAllOf + */ + applications?: Array; + /** + * + * @type {boolean} + * @memberof RoleOutAllOf + */ + system?: boolean; + /** + * + * @type {boolean} + * @memberof RoleOutAllOf + */ + platform_default?: boolean; +} +/** + * + * @export + * @interface RoleOutDynamic + */ +export interface RoleOutDynamic { + /** + * + * @type {string} + * @memberof RoleOutDynamic + */ + name: string; + /** + * + * @type {string} + * @memberof RoleOutDynamic + */ + display_name?: string; + /** + * + * @type {string} + * @memberof RoleOutDynamic + */ + description?: string; + /** + * + * @type {string} + * @memberof RoleOutDynamic + */ + uuid: string; + /** + * + * @type {string} + * @memberof RoleOutDynamic + */ + created: string; + /** + * + * @type {string} + * @memberof RoleOutDynamic + */ + modified: string; + /** + * + * @type {number} + * @memberof RoleOutDynamic + */ + policyCount: number; + /** + * + * @type {number} + * @memberof RoleOutDynamic + */ + accessCount: number; + /** + * + * @type {Array} + * @memberof RoleOutDynamic + */ + applications: Array; + /** + * + * @type {boolean} + * @memberof RoleOutDynamic + */ + system: boolean; + /** + * + * @type {boolean} + * @memberof RoleOutDynamic + */ + platform_default: boolean; + /** + * + * @type {number} + * @memberof RoleOutDynamic + */ + groups_in_count?: number; + /** + * + * @type {Array} + * @memberof RoleOutDynamic + */ + groups_in?: Array; +} +/** + * + * @export + * @interface RoleOutDynamicAllOf + */ +export interface RoleOutDynamicAllOf { + /** + * + * @type {number} + * @memberof RoleOutDynamicAllOf + */ + policyCount: number; + /** + * + * @type {number} + * @memberof RoleOutDynamicAllOf + */ + accessCount: number; + /** + * + * @type {Array} + * @memberof RoleOutDynamicAllOf + */ + applications: Array; + /** + * + * @type {boolean} + * @memberof RoleOutDynamicAllOf + */ + system: boolean; + /** + * + * @type {boolean} + * @memberof RoleOutDynamicAllOf + */ + platform_default: boolean; + /** + * + * @type {number} + * @memberof RoleOutDynamicAllOf + */ + groups_in_count?: number; + /** + * + * @type {Array} + * @memberof RoleOutDynamicAllOf + */ + groups_in?: Array; +} +/** + * + * @export + * @interface RolePagination + */ +export interface RolePagination { + /** + * + * @type {PaginationMeta} + * @memberof RolePagination + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof RolePagination + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof RolePagination + */ + data: Array; +} +/** + * + * @export + * @interface RolePaginationDynamic + */ +export interface RolePaginationDynamic { + /** + * + * @type {PaginationMeta} + * @memberof RolePaginationDynamic + */ + meta?: PaginationMeta; + /** + * + * @type {PaginationLinks} + * @memberof RolePaginationDynamic + */ + links?: PaginationLinks; + /** + * + * @type {Array} + * @memberof RolePaginationDynamic + */ + data: Array; +} +/** + * + * @export + * @interface RolePaginationDynamicAllOf + */ +export interface RolePaginationDynamicAllOf { + /** + * + * @type {Array} + * @memberof RolePaginationDynamicAllOf + */ + data: Array; +} +/** + * + * @export + * @interface RolePatch + */ +export interface RolePatch { + /** + * + * @type {string} + * @memberof RolePatch + */ + name?: string; + /** + * + * @type {string} + * @memberof RolePatch + */ + display_name?: string; + /** + * + * @type {string} + * @memberof RolePatch + */ + description?: string; +} +/** + * + * @export + * @interface RoleWithAccess + */ +export interface RoleWithAccess { + /** + * + * @type {string} + * @memberof RoleWithAccess + */ + name: string; + /** + * + * @type {string} + * @memberof RoleWithAccess + */ + display_name?: string; + /** + * + * @type {string} + * @memberof RoleWithAccess + */ + description?: string; + /** + * + * @type {string} + * @memberof RoleWithAccess + */ + uuid: string; + /** + * + * @type {string} + * @memberof RoleWithAccess + */ + created: string; + /** + * + * @type {string} + * @memberof RoleWithAccess + */ + modified: string; + /** + * + * @type {number} + * @memberof RoleWithAccess + */ + policyCount?: number; + /** + * + * @type {number} + * @memberof RoleWithAccess + */ + accessCount?: number; + /** + * + * @type {Array} + * @memberof RoleWithAccess + */ + applications?: Array; + /** + * + * @type {boolean} + * @memberof RoleWithAccess + */ + system?: boolean; + /** + * + * @type {boolean} + * @memberof RoleWithAccess + */ + platform_default?: boolean; + /** + * + * @type {Array} + * @memberof RoleWithAccess + */ + access: Array; +} +/** + * + * @export + * @interface Status + */ +export interface Status { + /** + * + * @type {number} + * @memberof Status + */ + api_version: number; + /** + * + * @type {string} + * @memberof Status + */ + commit?: string; +} +/** + * + * @export + * @interface Timestamped + */ +export interface Timestamped { + /** + * + * @type {string} + * @memberof Timestamped + */ + created: string; + /** + * + * @type {string} + * @memberof Timestamped + */ + modified: string; +} +/** + * + * @export + * @interface UUID + */ +export interface UUID { + /** + * + * @type {string} + * @memberof UUID + */ + uuid: string; +} + +/** + * AccessApi - axios parameter creator + * @export + */ +export const AccessApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Access responses are sorted in ascending order by an ID internal to the database + * @summary Get the permitted access for a principal in the tenant (defaults to principal from the identity header) + * @param {string} application The application name(s) to obtain access for the principal. This is an exact match. When no application is supplied, all permissions for the principal are returned. You may also use a comma-separated list to match on multiple applications. + * @param {string} [username] Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {'application' | 'resource_type' | 'verb'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPrincipalAccess: async ( + application: string, + username?: string, + orderBy?: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'application' is not null or undefined + assertParamExists('getPrincipalAccess', 'application', application); + const localVarPath = `/access/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (application !== undefined) { + localVarQueryParameter['application'] = application; + } + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * AccessApi - functional programming interface + * @export + */ +export const AccessApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = AccessApiAxiosParamCreator(configuration); + return { + /** + * Access responses are sorted in ascending order by an ID internal to the database + * @summary Get the permitted access for a principal in the tenant (defaults to principal from the identity header) + * @param {string} application The application name(s) to obtain access for the principal. This is an exact match. When no application is supplied, all permissions for the principal are returned. You may also use a comma-separated list to match on multiple applications. + * @param {string} [username] Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {'application' | 'resource_type' | 'verb'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPrincipalAccess( + application: string, + username?: string, + orderBy?: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPrincipalAccess(application, username, orderBy, limit, offset, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * AccessApi - factory interface + * @export + */ +export const AccessApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AccessApiFp(configuration); + return { + /** + * Access responses are sorted in ascending order by an ID internal to the database + * @summary Get the permitted access for a principal in the tenant (defaults to principal from the identity header) + * @param {string} application The application name(s) to obtain access for the principal. This is an exact match. When no application is supplied, all permissions for the principal are returned. You may also use a comma-separated list to match on multiple applications. + * @param {string} [username] Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {'application' | 'resource_type' | 'verb'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPrincipalAccess( + application: string, + username?: string, + orderBy?: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + options?: any + ): AxiosPromise { + return localVarFp.getPrincipalAccess(application, username, orderBy, limit, offset, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * AccessApi - object-oriented interface + * @export + * @class AccessApi + * @extends {BaseAPI} + */ +export class AccessApi extends BaseAPI { + /** + * Access responses are sorted in ascending order by an ID internal to the database + * @summary Get the permitted access for a principal in the tenant (defaults to principal from the identity header) + * @param {string} application The application name(s) to obtain access for the principal. This is an exact match. When no application is supplied, all permissions for the principal are returned. You may also use a comma-separated list to match on multiple applications. + * @param {string} [username] Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {'application' | 'resource_type' | 'verb'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccessApi + */ + public getPrincipalAccess( + application: string, + username?: string, + orderBy?: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + options?: AxiosRequestConfig + ) { + return AccessApiFp(this.configuration) + .getPrincipalAccess(application, username, orderBy, limit, offset, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * CrossAccountRequestApi - axios parameter creator + * @export + */ +export const CrossAccountRequestApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create a cross account request + * @param {CrossAccountRequestIn} crossAccountRequestIn CrossAccountRequest to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createCrossAccountRequests: async (crossAccountRequestIn: CrossAccountRequestIn, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'crossAccountRequestIn' is not null or undefined + assertParamExists('createCrossAccountRequests', 'crossAccountRequestIn', crossAccountRequestIn); + const localVarPath = `/cross-account-requests/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(crossAccountRequestIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a cross account request + * @param {string} uuid ID of cross account request to get + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCrossAccountRequest: async ( + uuid: string, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('getCrossAccountRequest', 'uuid', uuid); + const localVarPath = `/cross-account-requests/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (queryBy !== undefined) { + localVarQueryParameter['query_by'] = queryBy; + } + + if (account !== undefined) { + localVarQueryParameter['account'] = account; + } + + if (approvedOnly !== undefined) { + localVarQueryParameter['approved_only'] = approvedOnly; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by created_at + * @summary List the cross account requests for a user or account + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {'pending' | 'approved' | 'denied' | 'cancelled' | 'expired'} [status] Parameter for filtering resource based on status. + * @param {'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status'} [orderBy] Parameter for ordering by field. For inverse ordering, use \'-\', e.g. ?order_by=-start_date. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listCrossAccountRequests: async ( + limit?: number, + offset?: number, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + status?: 'pending' | 'approved' | 'denied' | 'cancelled' | 'expired', + orderBy?: 'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status', + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/cross-account-requests/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (queryBy !== undefined) { + localVarQueryParameter['query_by'] = queryBy; + } + + if (account !== undefined) { + localVarQueryParameter['account'] = account; + } + + if (approvedOnly !== undefined) { + localVarQueryParameter['approved_only'] = approvedOnly; + } + + if (status !== undefined) { + localVarQueryParameter['status'] = status; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestPatch} crossAccountRequestPatch Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchCrossAccountRequest: async ( + uuid: string, + crossAccountRequestPatch: CrossAccountRequestPatch, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('patchCrossAccountRequest', 'uuid', uuid); + // verify required parameter 'crossAccountRequestPatch' is not null or undefined + assertParamExists('patchCrossAccountRequest', 'crossAccountRequestPatch', crossAccountRequestPatch); + const localVarPath = `/cross-account-requests/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(crossAccountRequestPatch, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestUpdateIn} crossAccountRequestUpdateIn Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + putCrossAccountRequest: async ( + uuid: string, + crossAccountRequestUpdateIn: CrossAccountRequestUpdateIn, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('putCrossAccountRequest', 'uuid', uuid); + // verify required parameter 'crossAccountRequestUpdateIn' is not null or undefined + assertParamExists('putCrossAccountRequest', 'crossAccountRequestUpdateIn', crossAccountRequestUpdateIn); + const localVarPath = `/cross-account-requests/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(crossAccountRequestUpdateIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * CrossAccountRequestApi - functional programming interface + * @export + */ +export const CrossAccountRequestApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = CrossAccountRequestApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Create a cross account request + * @param {CrossAccountRequestIn} crossAccountRequestIn CrossAccountRequest to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createCrossAccountRequests( + crossAccountRequestIn: CrossAccountRequestIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createCrossAccountRequests(crossAccountRequestIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get a cross account request + * @param {string} uuid ID of cross account request to get + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getCrossAccountRequest( + uuid: string, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCrossAccountRequest(uuid, queryBy, account, approvedOnly, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by created_at + * @summary List the cross account requests for a user or account + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {'pending' | 'approved' | 'denied' | 'cancelled' | 'expired'} [status] Parameter for filtering resource based on status. + * @param {'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status'} [orderBy] Parameter for ordering by field. For inverse ordering, use \'-\', e.g. ?order_by=-start_date. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listCrossAccountRequests( + limit?: number, + offset?: number, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + status?: 'pending' | 'approved' | 'denied' | 'cancelled' | 'expired', + orderBy?: 'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listCrossAccountRequests( + limit, + offset, + queryBy, + account, + approvedOnly, + status, + orderBy, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestPatch} crossAccountRequestPatch Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchCrossAccountRequest( + uuid: string, + crossAccountRequestPatch: CrossAccountRequestPatch, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchCrossAccountRequest(uuid, crossAccountRequestPatch, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestUpdateIn} crossAccountRequestUpdateIn Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async putCrossAccountRequest( + uuid: string, + crossAccountRequestUpdateIn: CrossAccountRequestUpdateIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.putCrossAccountRequest(uuid, crossAccountRequestUpdateIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * CrossAccountRequestApi - factory interface + * @export + */ +export const CrossAccountRequestApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CrossAccountRequestApiFp(configuration); + return { + /** + * + * @summary Create a cross account request + * @param {CrossAccountRequestIn} crossAccountRequestIn CrossAccountRequest to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createCrossAccountRequests(crossAccountRequestIn: CrossAccountRequestIn, options?: any): AxiosPromise { + return localVarFp.createCrossAccountRequests(crossAccountRequestIn, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a cross account request + * @param {string} uuid ID of cross account request to get + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCrossAccountRequest( + uuid: string, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + options?: any + ): AxiosPromise { + return localVarFp.getCrossAccountRequest(uuid, queryBy, account, approvedOnly, options).then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by created_at + * @summary List the cross account requests for a user or account + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {'pending' | 'approved' | 'denied' | 'cancelled' | 'expired'} [status] Parameter for filtering resource based on status. + * @param {'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status'} [orderBy] Parameter for ordering by field. For inverse ordering, use \'-\', e.g. ?order_by=-start_date. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listCrossAccountRequests( + limit?: number, + offset?: number, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + status?: 'pending' | 'approved' | 'denied' | 'cancelled' | 'expired', + orderBy?: 'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status', + options?: any + ): AxiosPromise { + return localVarFp + .listCrossAccountRequests(limit, offset, queryBy, account, approvedOnly, status, orderBy, options) + .then((request) => request(axios, basePath)); + }, + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestPatch} crossAccountRequestPatch Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchCrossAccountRequest( + uuid: string, + crossAccountRequestPatch: CrossAccountRequestPatch, + options?: any + ): AxiosPromise { + return localVarFp.patchCrossAccountRequest(uuid, crossAccountRequestPatch, options).then((request) => request(axios, basePath)); + }, + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestUpdateIn} crossAccountRequestUpdateIn Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + putCrossAccountRequest( + uuid: string, + crossAccountRequestUpdateIn: CrossAccountRequestUpdateIn, + options?: any + ): AxiosPromise { + return localVarFp.putCrossAccountRequest(uuid, crossAccountRequestUpdateIn, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CrossAccountRequestApi - object-oriented interface + * @export + * @class CrossAccountRequestApi + * @extends {BaseAPI} + */ +export class CrossAccountRequestApi extends BaseAPI { + /** + * + * @summary Create a cross account request + * @param {CrossAccountRequestIn} crossAccountRequestIn CrossAccountRequest to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CrossAccountRequestApi + */ + public createCrossAccountRequests(crossAccountRequestIn: CrossAccountRequestIn, options?: AxiosRequestConfig) { + return CrossAccountRequestApiFp(this.configuration) + .createCrossAccountRequests(crossAccountRequestIn, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a cross account request + * @param {string} uuid ID of cross account request to get + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CrossAccountRequestApi + */ + public getCrossAccountRequest( + uuid: string, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + options?: AxiosRequestConfig + ) { + return CrossAccountRequestApiFp(this.configuration) + .getCrossAccountRequest(uuid, queryBy, account, approvedOnly, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by created_at + * @summary List the cross account requests for a user or account + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'user_id' | 'target_account'} [queryBy] Parameter for filtering resource by either a user\'s ID, or a client\'s account number. The default value is target_account. + * @param {string} [account] Parameter for filtering resource by an account number. Value can be a comma-separated list of ids. To be used in tandem with ?query_by=user_id to further filter a user\'s requests by account number. + * @param {'true'} [approvedOnly] Parameter for filtering resource which have been approved. + * @param {'pending' | 'approved' | 'denied' | 'cancelled' | 'expired'} [status] Parameter for filtering resource based on status. + * @param {'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status'} [orderBy] Parameter for ordering by field. For inverse ordering, use \'-\', e.g. ?order_by=-start_date. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CrossAccountRequestApi + */ + public listCrossAccountRequests( + limit?: number, + offset?: number, + queryBy?: 'user_id' | 'target_account', + account?: string, + approvedOnly?: 'true', + status?: 'pending' | 'approved' | 'denied' | 'cancelled' | 'expired', + orderBy?: 'request_id' | 'start_date' | 'end_date' | 'created' | 'modified' | 'status', + options?: AxiosRequestConfig + ) { + return CrossAccountRequestApiFp(this.configuration) + .listCrossAccountRequests(limit, offset, queryBy, account, approvedOnly, status, orderBy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestPatch} crossAccountRequestPatch Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CrossAccountRequestApi + */ + public patchCrossAccountRequest(uuid: string, crossAccountRequestPatch: CrossAccountRequestPatch, options?: AxiosRequestConfig) { + return CrossAccountRequestApiFp(this.configuration) + .patchCrossAccountRequest(uuid, crossAccountRequestPatch, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update a cross account request + * @summary Update a cross account request + * @param {string} uuid ID of cross account request to get + * @param {CrossAccountRequestUpdateIn} crossAccountRequestUpdateIn Updates to CrossAccountRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CrossAccountRequestApi + */ + public putCrossAccountRequest(uuid: string, crossAccountRequestUpdateIn: CrossAccountRequestUpdateIn, options?: AxiosRequestConfig) { + return CrossAccountRequestApiFp(this.configuration) + .putCrossAccountRequest(uuid, crossAccountRequestUpdateIn, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * GroupApi - axios parameter creator + * @export + */ +export const GroupApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a principal to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupPrincipalIn} groupPrincipalIn Principal to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPrincipalToGroup: async (uuid: string, groupPrincipalIn: GroupPrincipalIn, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('addPrincipalToGroup', 'uuid', uuid); + // verify required parameter 'groupPrincipalIn' is not null or undefined + assertParamExists('addPrincipalToGroup', 'groupPrincipalIn', groupPrincipalIn); + const localVarPath = `/groups/{uuid}/principals/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(groupPrincipalIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Add a role to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupRoleIn} groupRoleIn Role to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addRoleToGroup: async (uuid: string, groupRoleIn: GroupRoleIn, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('addRoleToGroup', 'uuid', uuid); + // verify required parameter 'groupRoleIn' is not null or undefined + assertParamExists('addRoleToGroup', 'groupRoleIn', groupRoleIn); + const localVarPath = `/groups/{uuid}/roles/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(groupRoleIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create a group in a tenant + * @param {Group} group Group to create in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroup: async (group: Group, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'group' is not null or undefined + assertParamExists('createGroup', 'group', group); + const localVarPath = `/groups/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a group in the tenant + * @param {string} uuid ID of group to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroup: async (uuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('deleteGroup', 'uuid', uuid); + const localVarPath = `/groups/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Remove a principal from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} usernames A comma separated list of usernames for principals to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePrincipalFromGroup: async (uuid: string, usernames: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('deletePrincipalFromGroup', 'uuid', uuid); + // verify required parameter 'usernames' is not null or undefined + assertParamExists('deletePrincipalFromGroup', 'usernames', usernames); + const localVarPath = `/groups/{uuid}/principals/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (usernames !== undefined) { + localVarQueryParameter['usernames'] = usernames; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Remove a role from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} roles A comma separated list of role UUIDs for roles to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRoleFromGroup: async (uuid: string, roles: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('deleteRoleFromGroup', 'uuid', uuid); + // verify required parameter 'roles' is not null or undefined + assertParamExists('deleteRoleFromGroup', 'roles', roles); + const localVarPath = `/groups/{uuid}/roles/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (roles !== undefined) { + localVarQueryParameter['roles'] = roles; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a group in the tenant + * @param {string} uuid ID of group to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGroup: async (uuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('getGroup', 'uuid', uuid); + const localVarPath = `/groups/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by username + * @summary Get a list of principals from a group in the tenant + * @param {string} uuid ID of group from which to get principals + * @param {string} [principalUsername] Parameter for filtering group principals by principal `username` using string contains search. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPrincipalsFromGroup: async ( + uuid: string, + principalUsername?: string, + limit?: number, + offset?: number, + orderBy?: 'username', + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('getPrincipalsFromGroup', 'uuid', uuid); + const localVarPath = `/groups/{uuid}/principals/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (principalUsername !== undefined) { + localVarQueryParameter['principal_username'] = principalUsername; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by group name + * @summary List the groups for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [username] A username for a principal to filter for groups + * @param {Array} [uuid] A list of UUIDs to filter listed groups. + * @param {Array} [roleNames] List of role name to filter for groups. It is exact match but case-insensitive + * @param {'all' | 'any'} [roleDiscriminator] Discriminator that works with role_names to indicate matching all/any of the role names + * @param {'name' | 'modified' | 'principalCount' | 'policyCount'} [orderBy] Parameter for ordering groups by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGroups: async ( + limit?: number, + offset?: number, + name?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + username?: string, + uuid?: Array, + roleNames?: Array, + roleDiscriminator?: 'all' | 'any', + orderBy?: 'name' | 'modified' | 'principalCount' | 'policyCount', + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/groups/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (nameMatch !== undefined) { + localVarQueryParameter['name_match'] = nameMatch; + } + + if (scope !== undefined) { + localVarQueryParameter['scope'] = scope; + } + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (uuid) { + localVarQueryParameter['uuid'] = uuid.join(COLLECTION_FORMATS.csv); + } + + if (roleNames) { + localVarQueryParameter['role_names'] = roleNames.join(COLLECTION_FORMATS.csv); + } + + if (roleDiscriminator !== undefined) { + localVarQueryParameter['role_discriminator'] = roleDiscriminator; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a group in the tenant + * @param {string} uuid ID of group + * @param {boolean} [exclude] If this is set to true, the result would be roles excluding the ones in the group + * @param {string} [roleName] Parameter for filtering group roles by role `name` using string contains search. + * @param {string} [roleDisplayName] Parameter for filtering group roles by role `display_name` using string contains search. + * @param {string} [roleDescription] Parameter for filtering group roles by role `description` using string contains search. + * @param {boolean} [roleSystem] Parameter for filtering group roles by system flag. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRolesForGroup: async ( + uuid: string, + exclude?: boolean, + roleName?: string, + roleDisplayName?: string, + roleDescription?: string, + roleSystem?: boolean, + limit?: number, + offset?: number, + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('listRolesForGroup', 'uuid', uuid); + const localVarPath = `/groups/{uuid}/roles/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (exclude !== undefined) { + localVarQueryParameter['exclude'] = exclude; + } + + if (roleName !== undefined) { + localVarQueryParameter['role_name'] = roleName; + } + + if (roleDisplayName !== undefined) { + localVarQueryParameter['role_display_name'] = roleDisplayName; + } + + if (roleDescription !== undefined) { + localVarQueryParameter['role_description'] = roleDescription; + } + + if (roleSystem !== undefined) { + localVarQueryParameter['role_system'] = roleSystem; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a group in the tenant + * @param {string} uuid ID of group to update + * @param {Group} group Group to update in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGroup: async (uuid: string, group: Group, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('updateGroup', 'uuid', uuid); + // verify required parameter 'group' is not null or undefined + assertParamExists('updateGroup', 'group', group); + const localVarPath = `/groups/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * GroupApi - functional programming interface + * @export + */ +export const GroupApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = GroupApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Add a principal to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupPrincipalIn} groupPrincipalIn Principal to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addPrincipalToGroup( + uuid: string, + groupPrincipalIn: GroupPrincipalIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPrincipalToGroup(uuid, groupPrincipalIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Add a role to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupRoleIn} groupRoleIn Role to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addRoleToGroup( + uuid: string, + groupRoleIn: GroupRoleIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addRoleToGroup(uuid, groupRoleIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Create a group in a tenant + * @param {Group} group Group to create in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroup(group: Group, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroup(group, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Delete a group in the tenant + * @param {string} uuid ID of group to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGroup(uuid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroup(uuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Remove a principal from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} usernames A comma separated list of usernames for principals to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePrincipalFromGroup( + uuid: string, + usernames: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePrincipalFromGroup(uuid, usernames, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Remove a role from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} roles A comma separated list of role UUIDs for roles to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteRoleFromGroup( + uuid: string, + roles: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRoleFromGroup(uuid, roles, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get a group in the tenant + * @param {string} uuid ID of group to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getGroup( + uuid: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGroup(uuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by username + * @summary Get a list of principals from a group in the tenant + * @param {string} uuid ID of group from which to get principals + * @param {string} [principalUsername] Parameter for filtering group principals by principal `username` using string contains search. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPrincipalsFromGroup( + uuid: string, + principalUsername?: string, + limit?: number, + offset?: number, + orderBy?: 'username', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPrincipalsFromGroup(uuid, principalUsername, limit, offset, orderBy, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by group name + * @summary List the groups for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [username] A username for a principal to filter for groups + * @param {Array} [uuid] A list of UUIDs to filter listed groups. + * @param {Array} [roleNames] List of role name to filter for groups. It is exact match but case-insensitive + * @param {'all' | 'any'} [roleDiscriminator] Discriminator that works with role_names to indicate matching all/any of the role names + * @param {'name' | 'modified' | 'principalCount' | 'policyCount'} [orderBy] Parameter for ordering groups by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listGroups( + limit?: number, + offset?: number, + name?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + username?: string, + uuid?: Array, + roleNames?: Array, + roleDiscriminator?: 'all' | 'any', + orderBy?: 'name' | 'modified' | 'principalCount' | 'policyCount', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listGroups( + limit, + offset, + name, + nameMatch, + scope, + username, + uuid, + roleNames, + roleDiscriminator, + orderBy, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a group in the tenant + * @param {string} uuid ID of group + * @param {boolean} [exclude] If this is set to true, the result would be roles excluding the ones in the group + * @param {string} [roleName] Parameter for filtering group roles by role `name` using string contains search. + * @param {string} [roleDisplayName] Parameter for filtering group roles by role `display_name` using string contains search. + * @param {string} [roleDescription] Parameter for filtering group roles by role `description` using string contains search. + * @param {boolean} [roleSystem] Parameter for filtering group roles by system flag. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRolesForGroup( + uuid: string, + exclude?: boolean, + roleName?: string, + roleDisplayName?: string, + roleDescription?: string, + roleSystem?: boolean, + limit?: number, + offset?: number, + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRolesForGroup( + uuid, + exclude, + roleName, + roleDisplayName, + roleDescription, + roleSystem, + limit, + offset, + orderBy, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Update a group in the tenant + * @param {string} uuid ID of group to update + * @param {Group} group Group to update in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateGroup( + uuid: string, + group: Group, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateGroup(uuid, group, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * GroupApi - factory interface + * @export + */ +export const GroupApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GroupApiFp(configuration); + return { + /** + * + * @summary Add a principal to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupPrincipalIn} groupPrincipalIn Principal to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPrincipalToGroup(uuid: string, groupPrincipalIn: GroupPrincipalIn, options?: any): AxiosPromise { + return localVarFp.addPrincipalToGroup(uuid, groupPrincipalIn, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Add a role to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupRoleIn} groupRoleIn Role to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addRoleToGroup(uuid: string, groupRoleIn: GroupRoleIn, options?: any): AxiosPromise { + return localVarFp.addRoleToGroup(uuid, groupRoleIn, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create a group in a tenant + * @param {Group} group Group to create in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroup(group: Group, options?: any): AxiosPromise { + return localVarFp.createGroup(group, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a group in the tenant + * @param {string} uuid ID of group to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroup(uuid: string, options?: any): AxiosPromise { + return localVarFp.deleteGroup(uuid, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Remove a principal from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} usernames A comma separated list of usernames for principals to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePrincipalFromGroup(uuid: string, usernames: string, options?: any): AxiosPromise { + return localVarFp.deletePrincipalFromGroup(uuid, usernames, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Remove a role from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} roles A comma separated list of role UUIDs for roles to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRoleFromGroup(uuid: string, roles: string, options?: any): AxiosPromise { + return localVarFp.deleteRoleFromGroup(uuid, roles, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a group in the tenant + * @param {string} uuid ID of group to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGroup(uuid: string, options?: any): AxiosPromise { + return localVarFp.getGroup(uuid, options).then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by username + * @summary Get a list of principals from a group in the tenant + * @param {string} uuid ID of group from which to get principals + * @param {string} [principalUsername] Parameter for filtering group principals by principal `username` using string contains search. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPrincipalsFromGroup( + uuid: string, + principalUsername?: string, + limit?: number, + offset?: number, + orderBy?: 'username', + options?: any + ): AxiosPromise { + return localVarFp.getPrincipalsFromGroup(uuid, principalUsername, limit, offset, orderBy, options).then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by group name + * @summary List the groups for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [username] A username for a principal to filter for groups + * @param {Array} [uuid] A list of UUIDs to filter listed groups. + * @param {Array} [roleNames] List of role name to filter for groups. It is exact match but case-insensitive + * @param {'all' | 'any'} [roleDiscriminator] Discriminator that works with role_names to indicate matching all/any of the role names + * @param {'name' | 'modified' | 'principalCount' | 'policyCount'} [orderBy] Parameter for ordering groups by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGroups( + limit?: number, + offset?: number, + name?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + username?: string, + uuid?: Array, + roleNames?: Array, + roleDiscriminator?: 'all' | 'any', + orderBy?: 'name' | 'modified' | 'principalCount' | 'policyCount', + options?: any + ): AxiosPromise { + return localVarFp + .listGroups(limit, offset, name, nameMatch, scope, username, uuid, roleNames, roleDiscriminator, orderBy, options) + .then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a group in the tenant + * @param {string} uuid ID of group + * @param {boolean} [exclude] If this is set to true, the result would be roles excluding the ones in the group + * @param {string} [roleName] Parameter for filtering group roles by role `name` using string contains search. + * @param {string} [roleDisplayName] Parameter for filtering group roles by role `display_name` using string contains search. + * @param {string} [roleDescription] Parameter for filtering group roles by role `description` using string contains search. + * @param {boolean} [roleSystem] Parameter for filtering group roles by system flag. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRolesForGroup( + uuid: string, + exclude?: boolean, + roleName?: string, + roleDisplayName?: string, + roleDescription?: string, + roleSystem?: boolean, + limit?: number, + offset?: number, + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + options?: any + ): AxiosPromise { + return localVarFp + .listRolesForGroup(uuid, exclude, roleName, roleDisplayName, roleDescription, roleSystem, limit, offset, orderBy, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a group in the tenant + * @param {string} uuid ID of group to update + * @param {Group} group Group to update in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGroup(uuid: string, group: Group, options?: any): AxiosPromise { + return localVarFp.updateGroup(uuid, group, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GroupApi - object-oriented interface + * @export + * @class GroupApi + * @extends {BaseAPI} + */ +export class GroupApi extends BaseAPI { + /** + * + * @summary Add a principal to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupPrincipalIn} groupPrincipalIn Principal to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public addPrincipalToGroup(uuid: string, groupPrincipalIn: GroupPrincipalIn, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .addPrincipalToGroup(uuid, groupPrincipalIn, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Add a role to a group in the tenant + * @param {string} uuid ID of group to update + * @param {GroupRoleIn} groupRoleIn Role to add to a group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public addRoleToGroup(uuid: string, groupRoleIn: GroupRoleIn, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .addRoleToGroup(uuid, groupRoleIn, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create a group in a tenant + * @param {Group} group Group to create in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroup(group: Group, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .createGroup(group, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a group in the tenant + * @param {string} uuid ID of group to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public deleteGroup(uuid: string, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .deleteGroup(uuid, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Remove a principal from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} usernames A comma separated list of usernames for principals to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public deletePrincipalFromGroup(uuid: string, usernames: string, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .deletePrincipalFromGroup(uuid, usernames, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Remove a role from a group in the tenant + * @param {string} uuid ID of group to update + * @param {string} roles A comma separated list of role UUIDs for roles to remove from the group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public deleteRoleFromGroup(uuid: string, roles: string, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .deleteRoleFromGroup(uuid, roles, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a group in the tenant + * @param {string} uuid ID of group to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public getGroup(uuid: string, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .getGroup(uuid, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by username + * @summary Get a list of principals from a group in the tenant + * @param {string} uuid ID of group from which to get principals + * @param {string} [principalUsername] Parameter for filtering group principals by principal `username` using string contains search. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public getPrincipalsFromGroup( + uuid: string, + principalUsername?: string, + limit?: number, + offset?: number, + orderBy?: 'username', + options?: AxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .getPrincipalsFromGroup(uuid, principalUsername, limit, offset, orderBy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by group name + * @summary List the groups for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [username] A username for a principal to filter for groups + * @param {Array} [uuid] A list of UUIDs to filter listed groups. + * @param {Array} [roleNames] List of role name to filter for groups. It is exact match but case-insensitive + * @param {'all' | 'any'} [roleDiscriminator] Discriminator that works with role_names to indicate matching all/any of the role names + * @param {'name' | 'modified' | 'principalCount' | 'policyCount'} [orderBy] Parameter for ordering groups by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listGroups( + limit?: number, + offset?: number, + name?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + username?: string, + uuid?: Array, + roleNames?: Array, + roleDiscriminator?: 'all' | 'any', + orderBy?: 'name' | 'modified' | 'principalCount' | 'policyCount', + options?: AxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .listGroups(limit, offset, name, nameMatch, scope, username, uuid, roleNames, roleDiscriminator, orderBy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a group in the tenant + * @param {string} uuid ID of group + * @param {boolean} [exclude] If this is set to true, the result would be roles excluding the ones in the group + * @param {string} [roleName] Parameter for filtering group roles by role `name` using string contains search. + * @param {string} [roleDisplayName] Parameter for filtering group roles by role `display_name` using string contains search. + * @param {string} [roleDescription] Parameter for filtering group roles by role `description` using string contains search. + * @param {boolean} [roleSystem] Parameter for filtering group roles by system flag. + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listRolesForGroup( + uuid: string, + exclude?: boolean, + roleName?: string, + roleDisplayName?: string, + roleDescription?: string, + roleSystem?: boolean, + limit?: number, + offset?: number, + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + options?: AxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .listRolesForGroup(uuid, exclude, roleName, roleDisplayName, roleDescription, roleSystem, limit, offset, orderBy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a group in the tenant + * @param {string} uuid ID of group to update + * @param {Group} group Group to update in tenant + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public updateGroup(uuid: string, group: Group, options?: AxiosRequestConfig) { + return GroupApiFp(this.configuration) + .updateGroup(uuid, group, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * PermissionApi - axios parameter creator + * @export + */ +export const PermissionApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * By default, options of application is returned. And could be resource_type or verb on demand. + * @summary List the available options for fields of permissions for a tenant + * @param {'application' | 'resource_type' | 'verb'} field specify which fields of permission to display + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [application] Filter returned options based on application. You may also use a comma-separated list to filter on multiple applications. + * @param {string} [resourceType] Filter returned options based on resource_type. You may also use a comma-separated list to filter on multiple resource_types. + * @param {string} [verb] Filter returned options based on verb. You may also use a comma-separated list to filter on multiple verbs. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission option with a global allowance on the supplied \'?field=\' value of \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPermissionOptions: async ( + field: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + application?: string, + resourceType?: string, + verb?: string, + excludeGlobals?: 'true' | 'false', + allowedOnly?: 'true' | 'false', + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'field' is not null or undefined + assertParamExists('listPermissionOptions', 'field', field); + const localVarPath = `/permissions/options/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (field !== undefined) { + localVarQueryParameter['field'] = field; + } + + if (application !== undefined) { + localVarQueryParameter['application'] = application; + } + + if (resourceType !== undefined) { + localVarQueryParameter['resource_type'] = resourceType; + } + + if (verb !== undefined) { + localVarQueryParameter['verb'] = verb; + } + + if (excludeGlobals !== undefined) { + localVarQueryParameter['exclude_globals'] = excludeGlobals; + } + + if (allowedOnly !== undefined) { + localVarQueryParameter['allowed_only'] = allowedOnly; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by permission application. + * @summary List the permissions for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'application' | 'resource_type' | 'verb' | 'permission'} [orderBy] Parameter for ordering permissions by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {string} [application] Exact match for the application name of a permission. You may also use a comma-separated list to match on multiple applications. + * @param {string} [resourceType] Exact match for the resource type name of a permission. You may also use a comma-separated list to match on multiple resource_types. + * @param {string} [verb] Exact match for the operation verb name of a permission You may also use a comma-separated list to match on multiple verbs. + * @param {string} [permission] Partial match for the aggregate permission value name of a permission object. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission with a global allowance on either \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {string} [excludeRoles] An optional string filter which accepts one or more role UUIDs, comma-separated, to return permissions not associated with the supplied role(s). + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPermissions: async ( + limit?: number, + offset?: number, + orderBy?: 'application' | 'resource_type' | 'verb' | 'permission', + application?: string, + resourceType?: string, + verb?: string, + permission?: string, + excludeGlobals?: 'true' | 'false', + excludeRoles?: string, + allowedOnly?: 'true' | 'false', + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/permissions/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + if (application !== undefined) { + localVarQueryParameter['application'] = application; + } + + if (resourceType !== undefined) { + localVarQueryParameter['resource_type'] = resourceType; + } + + if (verb !== undefined) { + localVarQueryParameter['verb'] = verb; + } + + if (permission !== undefined) { + localVarQueryParameter['permission'] = permission; + } + + if (excludeGlobals !== undefined) { + localVarQueryParameter['exclude_globals'] = excludeGlobals; + } + + if (excludeRoles !== undefined) { + localVarQueryParameter['exclude_roles'] = excludeRoles; + } + + if (allowedOnly !== undefined) { + localVarQueryParameter['allowed_only'] = allowedOnly; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * PermissionApi - functional programming interface + * @export + */ +export const PermissionApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PermissionApiAxiosParamCreator(configuration); + return { + /** + * By default, options of application is returned. And could be resource_type or verb on demand. + * @summary List the available options for fields of permissions for a tenant + * @param {'application' | 'resource_type' | 'verb'} field specify which fields of permission to display + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [application] Filter returned options based on application. You may also use a comma-separated list to filter on multiple applications. + * @param {string} [resourceType] Filter returned options based on resource_type. You may also use a comma-separated list to filter on multiple resource_types. + * @param {string} [verb] Filter returned options based on verb. You may also use a comma-separated list to filter on multiple verbs. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission option with a global allowance on the supplied \'?field=\' value of \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPermissionOptions( + field: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + application?: string, + resourceType?: string, + verb?: string, + excludeGlobals?: 'true' | 'false', + allowedOnly?: 'true' | 'false', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPermissionOptions( + field, + limit, + offset, + application, + resourceType, + verb, + excludeGlobals, + allowedOnly, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by permission application. + * @summary List the permissions for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'application' | 'resource_type' | 'verb' | 'permission'} [orderBy] Parameter for ordering permissions by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {string} [application] Exact match for the application name of a permission. You may also use a comma-separated list to match on multiple applications. + * @param {string} [resourceType] Exact match for the resource type name of a permission. You may also use a comma-separated list to match on multiple resource_types. + * @param {string} [verb] Exact match for the operation verb name of a permission You may also use a comma-separated list to match on multiple verbs. + * @param {string} [permission] Partial match for the aggregate permission value name of a permission object. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission with a global allowance on either \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {string} [excludeRoles] An optional string filter which accepts one or more role UUIDs, comma-separated, to return permissions not associated with the supplied role(s). + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPermissions( + limit?: number, + offset?: number, + orderBy?: 'application' | 'resource_type' | 'verb' | 'permission', + application?: string, + resourceType?: string, + verb?: string, + permission?: string, + excludeGlobals?: 'true' | 'false', + excludeRoles?: string, + allowedOnly?: 'true' | 'false', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPermissions( + limit, + offset, + orderBy, + application, + resourceType, + verb, + permission, + excludeGlobals, + excludeRoles, + allowedOnly, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * PermissionApi - factory interface + * @export + */ +export const PermissionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PermissionApiFp(configuration); + return { + /** + * By default, options of application is returned. And could be resource_type or verb on demand. + * @summary List the available options for fields of permissions for a tenant + * @param {'application' | 'resource_type' | 'verb'} field specify which fields of permission to display + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [application] Filter returned options based on application. You may also use a comma-separated list to filter on multiple applications. + * @param {string} [resourceType] Filter returned options based on resource_type. You may also use a comma-separated list to filter on multiple resource_types. + * @param {string} [verb] Filter returned options based on verb. You may also use a comma-separated list to filter on multiple verbs. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission option with a global allowance on the supplied \'?field=\' value of \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPermissionOptions( + field: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + application?: string, + resourceType?: string, + verb?: string, + excludeGlobals?: 'true' | 'false', + allowedOnly?: 'true' | 'false', + options?: any + ): AxiosPromise { + return localVarFp + .listPermissionOptions(field, limit, offset, application, resourceType, verb, excludeGlobals, allowedOnly, options) + .then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by permission application. + * @summary List the permissions for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'application' | 'resource_type' | 'verb' | 'permission'} [orderBy] Parameter for ordering permissions by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {string} [application] Exact match for the application name of a permission. You may also use a comma-separated list to match on multiple applications. + * @param {string} [resourceType] Exact match for the resource type name of a permission. You may also use a comma-separated list to match on multiple resource_types. + * @param {string} [verb] Exact match for the operation verb name of a permission You may also use a comma-separated list to match on multiple verbs. + * @param {string} [permission] Partial match for the aggregate permission value name of a permission object. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission with a global allowance on either \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {string} [excludeRoles] An optional string filter which accepts one or more role UUIDs, comma-separated, to return permissions not associated with the supplied role(s). + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPermissions( + limit?: number, + offset?: number, + orderBy?: 'application' | 'resource_type' | 'verb' | 'permission', + application?: string, + resourceType?: string, + verb?: string, + permission?: string, + excludeGlobals?: 'true' | 'false', + excludeRoles?: string, + allowedOnly?: 'true' | 'false', + options?: any + ): AxiosPromise { + return localVarFp + .listPermissions(limit, offset, orderBy, application, resourceType, verb, permission, excludeGlobals, excludeRoles, allowedOnly, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PermissionApi - object-oriented interface + * @export + * @class PermissionApi + * @extends {BaseAPI} + */ +export class PermissionApi extends BaseAPI { + /** + * By default, options of application is returned. And could be resource_type or verb on demand. + * @summary List the available options for fields of permissions for a tenant + * @param {'application' | 'resource_type' | 'verb'} field specify which fields of permission to display + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [application] Filter returned options based on application. You may also use a comma-separated list to filter on multiple applications. + * @param {string} [resourceType] Filter returned options based on resource_type. You may also use a comma-separated list to filter on multiple resource_types. + * @param {string} [verb] Filter returned options based on verb. You may also use a comma-separated list to filter on multiple verbs. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission option with a global allowance on the supplied \'?field=\' value of \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PermissionApi + */ + public listPermissionOptions( + field: 'application' | 'resource_type' | 'verb', + limit?: number, + offset?: number, + application?: string, + resourceType?: string, + verb?: string, + excludeGlobals?: 'true' | 'false', + allowedOnly?: 'true' | 'false', + options?: AxiosRequestConfig + ) { + return PermissionApiFp(this.configuration) + .listPermissionOptions(field, limit, offset, application, resourceType, verb, excludeGlobals, allowedOnly, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by permission application. + * @summary List the permissions for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'application' | 'resource_type' | 'verb' | 'permission'} [orderBy] Parameter for ordering permissions by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-application + * @param {string} [application] Exact match for the application name of a permission. You may also use a comma-separated list to match on multiple applications. + * @param {string} [resourceType] Exact match for the resource type name of a permission. You may also use a comma-separated list to match on multiple resource_types. + * @param {string} [verb] Exact match for the operation verb name of a permission You may also use a comma-separated list to match on multiple verbs. + * @param {string} [permission] Partial match for the aggregate permission value name of a permission object. + * @param {'true' | 'false'} [excludeGlobals] If set to \'true\', this will exclude any permission with a global allowance on either \'application\', \'resource_type\' or \'verb\'. The default is \'false\'. + * @param {string} [excludeRoles] An optional string filter which accepts one or more role UUIDs, comma-separated, to return permissions not associated with the supplied role(s). + * @param {'true' | 'false'} [allowedOnly] If set to \'true\', this will exclude any permission with a role where the \'application\' is not in the role create allow list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PermissionApi + */ + public listPermissions( + limit?: number, + offset?: number, + orderBy?: 'application' | 'resource_type' | 'verb' | 'permission', + application?: string, + resourceType?: string, + verb?: string, + permission?: string, + excludeGlobals?: 'true' | 'false', + excludeRoles?: string, + allowedOnly?: 'true' | 'false', + options?: AxiosRequestConfig + ) { + return PermissionApiFp(this.configuration) + .listPermissions(limit, offset, orderBy, application, resourceType, verb, permission, excludeGlobals, excludeRoles, allowedOnly, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * PolicyApi - axios parameter creator + * @export + */ +export const PolicyApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create a policy in a tenant + * @param {PolicyIn} policyIn Policy to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPolicies: async (policyIn: PolicyIn, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'policyIn' is not null or undefined + assertParamExists('createPolicies', 'policyIn', policyIn); + const localVarPath = `/policies/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(policyIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a policy in the tenant + * @param {string} uuid ID of policy to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePolicy: async (uuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('deletePolicy', 'uuid', uuid); + const localVarPath = `/policies/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a policy in the tenant + * @param {string} uuid ID of policy to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPolicy: async (uuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('getPolicy', 'uuid', uuid); + const localVarPath = `/policies/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by policy name + * @summary List the policies in the tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [groupName] Parameter for filtering resource by group name using string contains search. + * @param {string} [groupUuid] Parameter for filtering resource by group uuid using UUID exact match. + * @param {'name' | 'modified'} [orderBy] Parameter for ordering policies by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPolicies: async ( + limit?: number, + offset?: number, + name?: string, + scope?: 'account' | 'principal', + groupName?: string, + groupUuid?: string, + orderBy?: 'name' | 'modified', + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/policies/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (scope !== undefined) { + localVarQueryParameter['scope'] = scope; + } + + if (groupName !== undefined) { + localVarQueryParameter['group_name'] = groupName; + } + + if (groupUuid !== undefined) { + localVarQueryParameter['group_uuid'] = groupUuid; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a policy in the tenant + * @param {string} uuid ID of policy to update + * @param {PolicyIn} policyIn Policy to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePolicy: async (uuid: string, policyIn: PolicyIn, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('updatePolicy', 'uuid', uuid); + // verify required parameter 'policyIn' is not null or undefined + assertParamExists('updatePolicy', 'policyIn', policyIn); + const localVarPath = `/policies/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(policyIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * PolicyApi - functional programming interface + * @export + */ +export const PolicyApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PolicyApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Create a policy in a tenant + * @param {PolicyIn} policyIn Policy to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createPolicies( + policyIn: PolicyIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createPolicies(policyIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Delete a policy in the tenant + * @param {string} uuid ID of policy to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePolicy(uuid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePolicy(uuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get a policy in the tenant + * @param {string} uuid ID of policy to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPolicy(uuid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPolicy(uuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by policy name + * @summary List the policies in the tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [groupName] Parameter for filtering resource by group name using string contains search. + * @param {string} [groupUuid] Parameter for filtering resource by group uuid using UUID exact match. + * @param {'name' | 'modified'} [orderBy] Parameter for ordering policies by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPolicies( + limit?: number, + offset?: number, + name?: string, + scope?: 'account' | 'principal', + groupName?: string, + groupUuid?: string, + orderBy?: 'name' | 'modified', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPolicies(limit, offset, name, scope, groupName, groupUuid, orderBy, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Update a policy in the tenant + * @param {string} uuid ID of policy to update + * @param {PolicyIn} policyIn Policy to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePolicy( + uuid: string, + policyIn: PolicyIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePolicy(uuid, policyIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * PolicyApi - factory interface + * @export + */ +export const PolicyApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PolicyApiFp(configuration); + return { + /** + * + * @summary Create a policy in a tenant + * @param {PolicyIn} policyIn Policy to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPolicies(policyIn: PolicyIn, options?: any): AxiosPromise { + return localVarFp.createPolicies(policyIn, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a policy in the tenant + * @param {string} uuid ID of policy to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePolicy(uuid: string, options?: any): AxiosPromise { + return localVarFp.deletePolicy(uuid, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a policy in the tenant + * @param {string} uuid ID of policy to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPolicy(uuid: string, options?: any): AxiosPromise { + return localVarFp.getPolicy(uuid, options).then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by policy name + * @summary List the policies in the tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [groupName] Parameter for filtering resource by group name using string contains search. + * @param {string} [groupUuid] Parameter for filtering resource by group uuid using UUID exact match. + * @param {'name' | 'modified'} [orderBy] Parameter for ordering policies by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPolicies( + limit?: number, + offset?: number, + name?: string, + scope?: 'account' | 'principal', + groupName?: string, + groupUuid?: string, + orderBy?: 'name' | 'modified', + options?: any + ): AxiosPromise { + return localVarFp.listPolicies(limit, offset, name, scope, groupName, groupUuid, orderBy, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a policy in the tenant + * @param {string} uuid ID of policy to update + * @param {PolicyIn} policyIn Policy to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePolicy(uuid: string, policyIn: PolicyIn, options?: any): AxiosPromise { + return localVarFp.updatePolicy(uuid, policyIn, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PolicyApi - object-oriented interface + * @export + * @class PolicyApi + * @extends {BaseAPI} + */ +export class PolicyApi extends BaseAPI { + /** + * + * @summary Create a policy in a tenant + * @param {PolicyIn} policyIn Policy to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PolicyApi + */ + public createPolicies(policyIn: PolicyIn, options?: AxiosRequestConfig) { + return PolicyApiFp(this.configuration) + .createPolicies(policyIn, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a policy in the tenant + * @param {string} uuid ID of policy to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PolicyApi + */ + public deletePolicy(uuid: string, options?: AxiosRequestConfig) { + return PolicyApiFp(this.configuration) + .deletePolicy(uuid, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a policy in the tenant + * @param {string} uuid ID of policy to get + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PolicyApi + */ + public getPolicy(uuid: string, options?: AxiosRequestConfig) { + return PolicyApiFp(this.configuration) + .getPolicy(uuid, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by policy name + * @summary List the policies in the tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {string} [groupName] Parameter for filtering resource by group name using string contains search. + * @param {string} [groupUuid] Parameter for filtering resource by group uuid using UUID exact match. + * @param {'name' | 'modified'} [orderBy] Parameter for ordering policies by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PolicyApi + */ + public listPolicies( + limit?: number, + offset?: number, + name?: string, + scope?: 'account' | 'principal', + groupName?: string, + groupUuid?: string, + orderBy?: 'name' | 'modified', + options?: AxiosRequestConfig + ) { + return PolicyApiFp(this.configuration) + .listPolicies(limit, offset, name, scope, groupName, groupUuid, orderBy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a policy in the tenant + * @param {string} uuid ID of policy to update + * @param {PolicyIn} policyIn Policy to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PolicyApi + */ + public updatePolicy(uuid: string, policyIn: PolicyIn, options?: AxiosRequestConfig) { + return PolicyApiFp(this.configuration) + .updatePolicy(uuid, policyIn, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * PrincipalApi - axios parameter creator + * @export + */ +export const PrincipalApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * By default, responses are sorted in ascending order by username + * @summary List the principals for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'partial' | 'exact'} [matchCriteria] Parameter for specifying the matching criteria for an object\'s name and/or email. Currently, match_criteria of partial searches for a username/email using \"starts with\" pattern. + * @param {string} [usernames] Comma separated usernames of principals to get. If match_criteria is specified, only the first username will be picked up for search. + * @param {'asc' | 'desc'} [sortOrder] The sort order of the query, either ascending or descending. Defaults to ascending. + * @param {string} [email] E-mail address of principal to search for. Could be combined with match_criteria for searching. + * @param {'enabled' | 'disabled' | 'all'} [status] Set the status of users to get back. + * @param {'true' | 'false'} [adminOnly] Get only admin users within an account. Setting this would ignore the parameters: usernames, email + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPrincipals: async ( + limit?: number, + offset?: number, + matchCriteria?: 'partial' | 'exact', + usernames?: string, + sortOrder?: 'asc' | 'desc', + email?: string, + status?: 'enabled' | 'disabled' | 'all', + adminOnly?: 'true' | 'false', + orderBy?: 'username', + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/principals/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (matchCriteria !== undefined) { + localVarQueryParameter['match_criteria'] = matchCriteria; + } + + if (usernames !== undefined) { + localVarQueryParameter['usernames'] = usernames; + } + + if (sortOrder !== undefined) { + localVarQueryParameter['sort_order'] = sortOrder; + } + + if (email !== undefined) { + localVarQueryParameter['email'] = email; + } + + if (status !== undefined) { + localVarQueryParameter['status'] = status; + } + + if (adminOnly !== undefined) { + localVarQueryParameter['admin_only'] = adminOnly; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * PrincipalApi - functional programming interface + * @export + */ +export const PrincipalApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PrincipalApiAxiosParamCreator(configuration); + return { + /** + * By default, responses are sorted in ascending order by username + * @summary List the principals for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'partial' | 'exact'} [matchCriteria] Parameter for specifying the matching criteria for an object\'s name and/or email. Currently, match_criteria of partial searches for a username/email using \"starts with\" pattern. + * @param {string} [usernames] Comma separated usernames of principals to get. If match_criteria is specified, only the first username will be picked up for search. + * @param {'asc' | 'desc'} [sortOrder] The sort order of the query, either ascending or descending. Defaults to ascending. + * @param {string} [email] E-mail address of principal to search for. Could be combined with match_criteria for searching. + * @param {'enabled' | 'disabled' | 'all'} [status] Set the status of users to get back. + * @param {'true' | 'false'} [adminOnly] Get only admin users within an account. Setting this would ignore the parameters: usernames, email + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPrincipals( + limit?: number, + offset?: number, + matchCriteria?: 'partial' | 'exact', + usernames?: string, + sortOrder?: 'asc' | 'desc', + email?: string, + status?: 'enabled' | 'disabled' | 'all', + adminOnly?: 'true' | 'false', + orderBy?: 'username', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPrincipals( + limit, + offset, + matchCriteria, + usernames, + sortOrder, + email, + status, + adminOnly, + orderBy, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * PrincipalApi - factory interface + * @export + */ +export const PrincipalApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PrincipalApiFp(configuration); + return { + /** + * By default, responses are sorted in ascending order by username + * @summary List the principals for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'partial' | 'exact'} [matchCriteria] Parameter for specifying the matching criteria for an object\'s name and/or email. Currently, match_criteria of partial searches for a username/email using \"starts with\" pattern. + * @param {string} [usernames] Comma separated usernames of principals to get. If match_criteria is specified, only the first username will be picked up for search. + * @param {'asc' | 'desc'} [sortOrder] The sort order of the query, either ascending or descending. Defaults to ascending. + * @param {string} [email] E-mail address of principal to search for. Could be combined with match_criteria for searching. + * @param {'enabled' | 'disabled' | 'all'} [status] Set the status of users to get back. + * @param {'true' | 'false'} [adminOnly] Get only admin users within an account. Setting this would ignore the parameters: usernames, email + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPrincipals( + limit?: number, + offset?: number, + matchCriteria?: 'partial' | 'exact', + usernames?: string, + sortOrder?: 'asc' | 'desc', + email?: string, + status?: 'enabled' | 'disabled' | 'all', + adminOnly?: 'true' | 'false', + orderBy?: 'username', + options?: any + ): AxiosPromise { + return localVarFp + .listPrincipals(limit, offset, matchCriteria, usernames, sortOrder, email, status, adminOnly, orderBy, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PrincipalApi - object-oriented interface + * @export + * @class PrincipalApi + * @extends {BaseAPI} + */ +export class PrincipalApi extends BaseAPI { + /** + * By default, responses are sorted in ascending order by username + * @summary List the principals for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {'partial' | 'exact'} [matchCriteria] Parameter for specifying the matching criteria for an object\'s name and/or email. Currently, match_criteria of partial searches for a username/email using \"starts with\" pattern. + * @param {string} [usernames] Comma separated usernames of principals to get. If match_criteria is specified, only the first username will be picked up for search. + * @param {'asc' | 'desc'} [sortOrder] The sort order of the query, either ascending or descending. Defaults to ascending. + * @param {string} [email] E-mail address of principal to search for. Could be combined with match_criteria for searching. + * @param {'enabled' | 'disabled' | 'all'} [status] Set the status of users to get back. + * @param {'true' | 'false'} [adminOnly] Get only admin users within an account. Setting this would ignore the parameters: usernames, email + * @param {'username'} [orderBy] Parameter for ordering principals by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-username + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PrincipalApi + */ + public listPrincipals( + limit?: number, + offset?: number, + matchCriteria?: 'partial' | 'exact', + usernames?: string, + sortOrder?: 'asc' | 'desc', + email?: string, + status?: 'enabled' | 'disabled' | 'all', + adminOnly?: 'true' | 'false', + orderBy?: 'username', + options?: AxiosRequestConfig + ) { + return PrincipalApiFp(this.configuration) + .listPrincipals(limit, offset, matchCriteria, usernames, sortOrder, email, status, adminOnly, orderBy, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * RoleApi - axios parameter creator + * @export + */ +export const RoleApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create a roles for a tenant + * @param {RoleIn} roleIn Role to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRoles: async (roleIn: RoleIn, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'roleIn' is not null or undefined + assertParamExists('createRoles', 'roleIn', roleIn); + const localVarPath = `/roles/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(roleIn, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a role in the tenant + * @param {string} uuid ID of role to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRole: async (uuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('deleteRole', 'uuid', uuid); + const localVarPath = `/roles/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a role in the tenant + * @param {string} uuid ID of role to get + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRole: async (uuid: string, scope?: 'account' | 'principal', options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('getRole', 'uuid', uuid); + const localVarPath = `/roles/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (scope !== undefined) { + localVarQueryParameter['scope'] = scope; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get access for a role in the tenant + * @param {string} uuid ID of the role + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRoleAccess: async (uuid: string, limit?: number, offset?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('getRoleAccess', 'uuid', uuid); + const localVarPath = `/roles/{uuid}/access/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {boolean} [system] Parameter for filtering resource by system flag. + * @param {string} [displayName] Parameter for filtering resource by display_name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {Array<'groups_in' | 'groups_in_count'>} [addFields] Parameter for add list of fields to display for roles. + * @param {string} [username] Unique username of the principal to obtain roles for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {string} [application] The application name(s) to filter roles by, from permissions. This is an exact match. You may also use a comma-separated list to match on multiple applications. + * @param {string} [permission] The permission(s) to filter roles by. This is an exact match. You may also use a comma-separated list to match on multiple permissions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRoles: async ( + limit?: number, + offset?: number, + name?: string, + system?: boolean, + displayName?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + addFields?: Array<'groups_in' | 'groups_in_count'>, + username?: string, + application?: string, + permission?: string, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/roles/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (system !== undefined) { + localVarQueryParameter['system'] = system; + } + + if (displayName !== undefined) { + localVarQueryParameter['display_name'] = displayName; + } + + if (nameMatch !== undefined) { + localVarQueryParameter['name_match'] = nameMatch; + } + + if (scope !== undefined) { + localVarQueryParameter['scope'] = scope; + } + + if (orderBy !== undefined) { + localVarQueryParameter['order_by'] = orderBy; + } + + if (addFields) { + localVarQueryParameter['add_fields'] = addFields.join(COLLECTION_FORMATS.csv); + } + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (application !== undefined) { + localVarQueryParameter['application'] = application; + } + + if (permission !== undefined) { + localVarQueryParameter['permission'] = permission; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Patch a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RolePatch} [rolePatch] Patch to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchRole: async (uuid: string, rolePatch?: RolePatch, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('patchRole', 'uuid', uuid); + const localVarPath = `/roles/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(rolePatch, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RoleWithAccess} roleWithAccess Update to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRole: async (uuid: string, roleWithAccess: RoleWithAccess, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'uuid' is not null or undefined + assertParamExists('updateRole', 'uuid', uuid); + // verify required parameter 'roleWithAccess' is not null or undefined + assertParamExists('updateRole', 'roleWithAccess', roleWithAccess); + const localVarPath = `/roles/{uuid}/`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + localVarRequestOptions.data = serializeDataIfNeeded(roleWithAccess, localVarRequestOptions, configuration); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * RoleApi - functional programming interface + * @export + */ +export const RoleApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = RoleApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Create a roles for a tenant + * @param {RoleIn} roleIn Role to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createRoles( + roleIn: RoleIn, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createRoles(roleIn, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Delete a role in the tenant + * @param {string} uuid ID of role to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteRole(uuid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRole(uuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get a role in the tenant + * @param {string} uuid ID of role to get + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRole( + uuid: string, + scope?: 'account' | 'principal', + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRole(uuid, scope, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get access for a role in the tenant + * @param {string} uuid ID of the role + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRoleAccess( + uuid: string, + limit?: number, + offset?: number, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRoleAccess(uuid, limit, offset, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {boolean} [system] Parameter for filtering resource by system flag. + * @param {string} [displayName] Parameter for filtering resource by display_name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {Array<'groups_in' | 'groups_in_count'>} [addFields] Parameter for add list of fields to display for roles. + * @param {string} [username] Unique username of the principal to obtain roles for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {string} [application] The application name(s) to filter roles by, from permissions. This is an exact match. You may also use a comma-separated list to match on multiple applications. + * @param {string} [permission] The permission(s) to filter roles by. This is an exact match. You may also use a comma-separated list to match on multiple permissions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRoles( + limit?: number, + offset?: number, + name?: string, + system?: boolean, + displayName?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + addFields?: Array<'groups_in' | 'groups_in_count'>, + username?: string, + application?: string, + permission?: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRoles( + limit, + offset, + name, + system, + displayName, + nameMatch, + scope, + orderBy, + addFields, + username, + application, + permission, + options + ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Patch a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RolePatch} [rolePatch] Patch to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchRole( + uuid: string, + rolePatch?: RolePatch, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchRole(uuid, rolePatch, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Update a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RoleWithAccess} roleWithAccess Update to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateRole( + uuid: string, + roleWithAccess: RoleWithAccess, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateRole(uuid, roleWithAccess, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * RoleApi - factory interface + * @export + */ +export const RoleApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = RoleApiFp(configuration); + return { + /** + * + * @summary Create a roles for a tenant + * @param {RoleIn} roleIn Role to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRoles(roleIn: RoleIn, options?: any): AxiosPromise { + return localVarFp.createRoles(roleIn, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a role in the tenant + * @param {string} uuid ID of role to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRole(uuid: string, options?: any): AxiosPromise { + return localVarFp.deleteRole(uuid, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a role in the tenant + * @param {string} uuid ID of role to get + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRole(uuid: string, scope?: 'account' | 'principal', options?: any): AxiosPromise { + return localVarFp.getRole(uuid, scope, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get access for a role in the tenant + * @param {string} uuid ID of the role + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRoleAccess(uuid: string, limit?: number, offset?: number, options?: any): AxiosPromise { + return localVarFp.getRoleAccess(uuid, limit, offset, options).then((request) => request(axios, basePath)); + }, + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {boolean} [system] Parameter for filtering resource by system flag. + * @param {string} [displayName] Parameter for filtering resource by display_name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {Array<'groups_in' | 'groups_in_count'>} [addFields] Parameter for add list of fields to display for roles. + * @param {string} [username] Unique username of the principal to obtain roles for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {string} [application] The application name(s) to filter roles by, from permissions. This is an exact match. You may also use a comma-separated list to match on multiple applications. + * @param {string} [permission] The permission(s) to filter roles by. This is an exact match. You may also use a comma-separated list to match on multiple permissions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRoles( + limit?: number, + offset?: number, + name?: string, + system?: boolean, + displayName?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + addFields?: Array<'groups_in' | 'groups_in_count'>, + username?: string, + application?: string, + permission?: string, + options?: any + ): AxiosPromise { + return localVarFp + .listRoles(limit, offset, name, system, displayName, nameMatch, scope, orderBy, addFields, username, application, permission, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Patch a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RolePatch} [rolePatch] Patch to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchRole(uuid: string, rolePatch?: RolePatch, options?: any): AxiosPromise { + return localVarFp.patchRole(uuid, rolePatch, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RoleWithAccess} roleWithAccess Update to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRole(uuid: string, roleWithAccess: RoleWithAccess, options?: any): AxiosPromise { + return localVarFp.updateRole(uuid, roleWithAccess, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * RoleApi - object-oriented interface + * @export + * @class RoleApi + * @extends {BaseAPI} + */ +export class RoleApi extends BaseAPI { + /** + * + * @summary Create a roles for a tenant + * @param {RoleIn} roleIn Role to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public createRoles(roleIn: RoleIn, options?: AxiosRequestConfig) { + return RoleApiFp(this.configuration) + .createRoles(roleIn, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a role in the tenant + * @param {string} uuid ID of role to delete + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public deleteRole(uuid: string, options?: AxiosRequestConfig) { + return RoleApiFp(this.configuration) + .deleteRole(uuid, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a role in the tenant + * @param {string} uuid ID of role to get + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public getRole(uuid: string, scope?: 'account' | 'principal', options?: AxiosRequestConfig) { + return RoleApiFp(this.configuration) + .getRole(uuid, scope, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get access for a role in the tenant + * @param {string} uuid ID of the role + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public getRoleAccess(uuid: string, limit?: number, offset?: number, options?: AxiosRequestConfig) { + return RoleApiFp(this.configuration) + .getRoleAccess(uuid, limit, offset, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * By default, responses are sorted in ascending order by role name + * @summary List the roles for a tenant + * @param {number} [limit] Parameter for selecting the amount of data returned. + * @param {number} [offset] Parameter for selecting the offset of data. + * @param {string} [name] Parameter for filtering resource by name using string contains search. + * @param {boolean} [system] Parameter for filtering resource by system flag. + * @param {string} [displayName] Parameter for filtering resource by display_name using string contains search. + * @param {'partial' | 'exact'} [nameMatch] Parameter for specifying the matching criteria for an object\'s name or display_name. + * @param {'account' | 'principal'} [scope] Parameter for filtering resource by scope. + * @param {'name' | 'display_name' | 'modified' | 'policyCount'} [orderBy] Parameter for ordering roles by value. For inverse ordering, supply \'-\' before the param value, such as: ?order_by=-name + * @param {Array<'groups_in' | 'groups_in_count'>} [addFields] Parameter for add list of fields to display for roles. + * @param {string} [username] Unique username of the principal to obtain roles for (only available for admins, and if supplied, takes precedence over the identity header). + * @param {string} [application] The application name(s) to filter roles by, from permissions. This is an exact match. You may also use a comma-separated list to match on multiple applications. + * @param {string} [permission] The permission(s) to filter roles by. This is an exact match. You may also use a comma-separated list to match on multiple permissions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public listRoles( + limit?: number, + offset?: number, + name?: string, + system?: boolean, + displayName?: string, + nameMatch?: 'partial' | 'exact', + scope?: 'account' | 'principal', + orderBy?: 'name' | 'display_name' | 'modified' | 'policyCount', + addFields?: Array<'groups_in' | 'groups_in_count'>, + username?: string, + application?: string, + permission?: string, + options?: AxiosRequestConfig + ) { + return RoleApiFp(this.configuration) + .listRoles(limit, offset, name, system, displayName, nameMatch, scope, orderBy, addFields, username, application, permission, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Patch a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RolePatch} [rolePatch] Patch to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public patchRole(uuid: string, rolePatch?: RolePatch, options?: AxiosRequestConfig) { + return RoleApiFp(this.configuration) + .patchRole(uuid, rolePatch, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a Role in the tenant + * @param {string} uuid ID of role to update + * @param {RoleWithAccess} roleWithAccess Update to a Role + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RoleApi + */ + public updateRole(uuid: string, roleWithAccess: RoleWithAccess, options?: AxiosRequestConfig) { + return RoleApiFp(this.configuration) + .updateRole(uuid, roleWithAccess, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * StatusApi - axios parameter creator + * @export + */ +export const StatusApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Obtain server status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStatus: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/status/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basic_auth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * StatusApi - functional programming interface + * @export + */ +export const StatusApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = StatusApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Obtain server status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getStatus(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStatus(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + }; +}; + +/** + * StatusApi - factory interface + * @export + */ +export const StatusApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StatusApiFp(configuration); + return { + /** + * + * @summary Obtain server status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStatus(options?: any): AxiosPromise { + return localVarFp.getStatus(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * StatusApi - object-oriented interface + * @export + * @class StatusApi + * @extends {BaseAPI} + */ +export class StatusApi extends BaseAPI { + /** + * + * @summary Obtain server status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StatusApi + */ + public getStatus(options?: AxiosRequestConfig) { + return StatusApiFp(this.configuration) + .getStatus(options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/Api/rbac/base.ts b/src/Api/rbac/base.ts new file mode 100644 index 0000000..c11851f --- /dev/null +++ b/src/Api/rbac/base.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Role Based Access Control + * The API for Role Based Access Control. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = 'https://raw.githubusercontent.com/api/rbac/v1'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: AxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = 'RequiredError'; + } +} diff --git a/src/Api/rbac/common.ts b/src/Api/rbac/common.ts new file mode 100644 index 0000000..e3e45b6 --- /dev/null +++ b/src/Api/rbac/common.ts @@ -0,0 +1,138 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Role Based Access Control + * The API for Role Based Access Control. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { RequestArgs } from './base'; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from './base'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com'; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey(keyParamName) : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object['auth'] = { username: configuration.username, password: configuration.password }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' ? await configuration.accessToken() : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === 'function' ? await configuration.accessToken(name, scopes) : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ''): void { + if (parameter == null) return; + if (typeof parameter === 'object') { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = + nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; + return needsSerialization ? JSON.stringify(value !== undefined ? value : {}) : value || ''; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/src/Api/rbac/configuration.ts b/src/Api/rbac/configuration.ts new file mode 100644 index 0000000..a48bfe2 --- /dev/null +++ b/src/Api/rbac/configuration.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Role Based Access Control + * The API for Role Based Access Control. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/src/Api/rbac/index.ts b/src/Api/rbac/index.ts new file mode 100644 index 0000000..4088a9f --- /dev/null +++ b/src/Api/rbac/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Role Based Access Control + * The API for Role Based Access Control. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration';