diff --git a/src/api/base.ts b/src/api/base.ts index f676352..01c8494 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -47,7 +47,7 @@ export interface IPagination { perPage?: number; } -interface IBasePaginationExtended { +export interface IBasePaginationExtended { /** * the page number to fetch (default: 1) */ diff --git a/src/api/deprecated.ts b/src/api/deprecated.ts index 819c982..8734612 100644 --- a/src/api/deprecated.ts +++ b/src/api/deprecated.ts @@ -415,7 +415,7 @@ export class DeprecatedApiClient extends BasePermitApi implements IDeprecatedPer this.logger.debug( `[${response.status}] permit.api.getAssignedRoles(${user}, ${tenant ?? 'all tenants'})`, ); - return response.data; + return response.data as RoleAssignmentRead[]; } catch (err) { if (axios.isAxiosError(err)) { this.logger.error( diff --git a/src/api/role-assignments.ts b/src/api/role-assignments.ts index d636d67..af4c62e 100644 --- a/src/api/role-assignments.ts +++ b/src/api/role-assignments.ts @@ -5,27 +5,33 @@ import { RoleAssignmentsApi as AutogenRoleAssignmentsApi, BulkRoleAssignmentReport, BulkRoleUnAssignmentReport, + PaginatedResultRoleAssignmentDetailedRead, + PaginatedResultRoleAssignmentRead, RoleAssignmentCreate, + RoleAssignmentDetailedRead, RoleAssignmentRead, RoleAssignmentRemove, } from '../openapi'; import { BASE_PATH } from '../openapi/base'; -import { BaseFactsPermitAPI, IPagination, IWaitForSync } from './base'; +import { BaseFactsPermitAPI, IBasePaginationExtended, IWaitForSync } from './base'; import { ApiContextLevel, ApiKeyLevel } from './context'; export { BulkRoleAssignmentReport, BulkRoleUnAssignmentReport, + PaginatedResultRoleAssignmentDetailedRead, + PaginatedResultRoleAssignmentRead, RoleAssignmentCreate, RoleAssignmentRead, + RoleAssignmentDetailedRead, RoleAssignmentRemove, } from '../openapi'; /** * Represents the parameters for listing role assignments. */ -export interface IListRoleAssignments extends IPagination { +export interface IBaseListRoleAssignments extends IBasePaginationExtended { /** * optional user filter, will only return role assignments granted to this user. */ @@ -45,8 +51,33 @@ export interface IListRoleAssignments extends IPagination { * optional resource instance filter, will only return (resource) role assignments granted on that resource instance. */ resourceInstance?: string; + + /** + * optional detailed flag, will return detailed role assignments. + */ + detailed?: boolean; } +type IListRoleAssignmentsIncludeTotalCount = IBaseListRoleAssignments & { includeTotalCount: true }; + +type IListRoleAssignmentsDetailed = IBaseListRoleAssignments & { detailed: true }; + +export type IListRoleAssignments = + | IBaseListRoleAssignments + | IListRoleAssignmentsIncludeTotalCount + | IListRoleAssignmentsDetailed; + +type ReturnListRoleAssignments = + T extends IListRoleAssignmentsIncludeTotalCount + ? // with total count + T extends IListRoleAssignmentsDetailed + ? PaginatedResultRoleAssignmentDetailedRead + : PaginatedResultRoleAssignmentRead + : // without total count + T extends IListRoleAssignmentsDetailed + ? RoleAssignmentDetailedRead[] + : RoleAssignmentRead[]; + /** * API client for managing role assignments. */ @@ -59,7 +90,7 @@ export interface IRoleAssignmentsApi extends IWaitForSync { * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ - list(params: IListRoleAssignments): Promise; + list(params: T): Promise>; /** * Assigns a role to a user in the scope of a given tenant. @@ -132,10 +163,29 @@ export class RoleAssignmentsApi extends BaseFactsPermitAPI implements IRoleAssig * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ - public async list(params: IListRoleAssignments): Promise { + public async list( + params: T, + ): Promise>; + public async list( + params: IListRoleAssignments, + ): Promise< + | Array + | Array + | PaginatedResultRoleAssignmentRead + | PaginatedResultRoleAssignmentDetailedRead + > { await this.ensureAccessLevel(ApiKeyLevel.ENVIRONMENT_LEVEL_API_KEY); await this.ensureContext(ApiContextLevel.ENVIRONMENT); - const { user, tenant, role, resourceInstance, page = 1, perPage = 100 } = params; + const { + user, + tenant, + role, + resourceInstance, + page = 1, + perPage = 100, + detailed, + includeTotalCount, + } = params; try { return ( await this.roleAssignments.listRoleAssignments({ @@ -144,8 +194,10 @@ export class RoleAssignmentsApi extends BaseFactsPermitAPI implements IRoleAssig tenant, role, resourceInstance, + detailed, page, perPage, + includeTotalCount, }) ).data; } catch (err) { diff --git a/src/api/users.ts b/src/api/users.ts index 1a6e262..858c39e 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -4,8 +4,11 @@ import { IPermitConfig } from '../config'; import { RoleAssignmentsApi as AutogenRoleAssignmentsApi, UsersApi as AutogenUsersApi, + PaginatedResultRoleAssignmentDetailedRead, + PaginatedResultRoleAssignmentRead, PaginatedResultUserRead, RoleAssignmentCreate, + RoleAssignmentDetailedRead, RoleAssignmentRead, RoleAssignmentRemove, UserCreate, @@ -43,7 +46,7 @@ export interface ICreateOrUpdateUserResult { created: boolean; } -export interface IGetUserRoles { +export interface IBaseGetUserRoles { /** * id or key of the user * @type {string} @@ -56,19 +59,50 @@ export interface IGetUserRoles { */ readonly tenant?: string; + /** + * Whether to return full details about the user, tenant and role + * @type {boolean} + * @default false + */ + readonly detailed?: boolean; + + /** + * If true, returns the list of role assignments and the total count. + * @type {boolean} + * @default false + */ + readonly includeTotalCount?: boolean; + /** * Page number of the results to fetch, starting at 1. * @type {number} + * @default 1 */ readonly page?: number; /** * The number of results per page (max 100). * @type {number} + * @default 100 */ readonly perPage?: number; } +type IGetUserRolesWithTotalCount = IBaseGetUserRoles & { includeTotalCount: true }; +type IGetUserRolesWithDetails = IBaseGetUserRoles & { detailed: true }; + +type IGetUserRoles = IBaseGetUserRoles | IGetUserRolesWithTotalCount | IGetUserRolesWithDetails; + +type ReturnIGetUserRolesType = T extends IGetUserRolesWithTotalCount + ? // with total count + T extends IGetUserRolesWithDetails + ? PaginatedResultRoleAssignmentDetailedRead + : PaginatedResultRoleAssignmentRead + : // without total count + T extends IGetUserRolesWithDetails + ? RoleAssignmentDetailedRead[] + : RoleAssignmentRead[]; + export interface IUsersListParams extends IPagination { search?: string; role?: string; @@ -187,7 +221,7 @@ export interface IUsersApi extends IWaitForSync { * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ - getAssignedRoles({ user, tenant, page, perPage }: IGetUserRoles): Promise; + getAssignedRoles(params: T): Promise>; /** * Creates users in bulk. @@ -225,7 +259,7 @@ export interface IUsersApi extends IWaitForSync { /** * The UsersApi class provides methods for interacting with Permit Users. */ -export class UsersApi extends BaseFactsPermitAPI { +export class UsersApi extends BaseFactsPermitAPI implements IUsersApi { private users: AutogenUsersApi; private roleAssignments: AutogenRoleAssignmentsApi; private bulkOperationsApi: BulkOperationsApi; @@ -559,12 +593,22 @@ export class UsersApi extends BaseFactsPermitAPI { * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ + public async getAssignedRoles( + params: T, + ): Promise>; public async getAssignedRoles({ user, tenant, page = 1, perPage = 100, - }: IGetUserRoles): Promise { + detailed = false, + includeTotalCount = false, + }: IGetUserRoles): Promise< + | RoleAssignmentRead[] + | RoleAssignmentDetailedRead[] + | PaginatedResultRoleAssignmentRead + | PaginatedResultRoleAssignmentDetailedRead + > { await this.ensureAccessLevel(ApiKeyLevel.ENVIRONMENT_LEVEL_API_KEY); await this.ensureContext(ApiContextLevel.ENVIRONMENT); try { @@ -575,6 +619,8 @@ export class UsersApi extends BaseFactsPermitAPI { tenant, page, perPage, + detailed, + includeTotalCount, }) ).data; } catch (err) { diff --git a/src/openapi/api/role-assignments-api.ts b/src/openapi/api/role-assignments-api.ts index 224789b..59c9123 100644 --- a/src/openapi/api/role-assignments-api.ts +++ b/src/openapi/api/role-assignments-api.ts @@ -41,7 +41,13 @@ import { RoleAssignmentCreate } from '../types'; // @ts-ignore import { RoleAssignmentRead } from '../types'; // @ts-ignore +import { RoleAssignmentDetailedRead } from '../types'; +// @ts-ignore import { RoleAssignmentRemove } from '../types'; +// @ts-ignore +import { PaginatedResultRoleAssignmentRead } from '../types'; +// @ts-ignore +import { PaginatedResultRoleAssignmentDetailedRead } from '../types'; /** * RoleAssignmentsApi - axios parameter creator * @export @@ -226,14 +232,17 @@ export const RoleAssignmentsApiAxiosParamCreator = function (configuration?: Con }; }, /** - * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user. - If the `tenant` filter is present, will only return the role assignments in that tenant. - If the `role` filter is present, will only return role assignments that are granting that role. + * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user (supports multiple). - If the `tenant` filter is present, will only return the role assignments in that tenant (supports multiple). - If the `role` filter is present, will only return role assignments that are granting that role (supports multiple). - If the `resource` filter is present, will only return role assignments for resource instances of that resource type. - If the `resource_instance` filter is present, will only return role assignments for that resource instance. Providing both `tenant` and `resource_instance` filters will only return role assignments if the resource instance is in that tenant. If multiple tenants are received, the last tenant will be compared with the resource instance. * @summary List Role Assignments * @param {string} projId Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @param {string} envId Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). - * @param {string} [user] optional user filter, will only return role assignments granted to this user. - * @param {string} [role] optional role filter, will only return role assignments granting this role. - * @param {string} [tenant] optional tenant filter, will only return role assignments granted in that tenant. + * @param {string} [user] optional user(s) filter, will only return role assignments granted to this user(s). + * @param {string} [role] optional role(s) filter, will only return role assignments granting this role(s). + * @param {string} [tenant] optional tenant(s) filter, will only return role assignments granted in that tenant(s). + * @param {string} [resource] optional resource **type** filter, will only return role assignments granted on that resource type. * @param {string} [resourceInstance] optional resource instance filter, will only return role assignments granted on that resource instance. + * @param {boolean} [detailed] Whether to return full details about the user, tenant and role + * @param {boolean} [includeTotalCount] If true, returns the list of role assignments and the total count. * @param {number} [page] Page number of the results to fetch, starting at 1. * @param {number} [perPage] The number of results per page (max 100). * @param {*} [options] Override http request option. @@ -245,7 +254,10 @@ export const RoleAssignmentsApiAxiosParamCreator = function (configuration?: Con user?: string, role?: string, tenant?: string, + resource?: string, resourceInstance?: string, + detailed?: boolean, + includeTotalCount?: boolean, page?: number, perPage?: number, options: AxiosRequestConfig = {}, @@ -284,10 +296,22 @@ export const RoleAssignmentsApiAxiosParamCreator = function (configuration?: Con localVarQueryParameter['tenant'] = tenant; } + if (resource !== undefined) { + localVarQueryParameter['resource'] = resource; + } + if (resourceInstance !== undefined) { localVarQueryParameter['resource_instance'] = resourceInstance; } + if (detailed !== undefined) { + localVarQueryParameter['detailed'] = detailed; + } + + if (includeTotalCount !== undefined) { + localVarQueryParameter['include_total_count'] = includeTotalCount; + } + if (page !== undefined) { localVarQueryParameter['page'] = page; } @@ -452,14 +476,17 @@ export const RoleAssignmentsApiFp = function (configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** - * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user. - If the `tenant` filter is present, will only return the role assignments in that tenant. - If the `role` filter is present, will only return role assignments that are granting that role. + * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user (supports multiple). - If the `tenant` filter is present, will only return the role assignments in that tenant (supports multiple). - If the `role` filter is present, will only return role assignments that are granting that role (supports multiple). - If the `resource` filter is present, will only return role assignments for resource instances of that resource type. - If the `resource_instance` filter is present, will only return role assignments for that resource instance. Providing both `tenant` and `resource_instance` filters will only return role assignments if the resource instance is in that tenant. If multiple tenants are received, the last tenant will be compared with the resource instance. * @summary List Role Assignments * @param {string} projId Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @param {string} envId Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). - * @param {string} [user] optional user filter, will only return role assignments granted to this user. - * @param {string} [role] optional role filter, will only return role assignments granting this role. - * @param {string} [tenant] optional tenant filter, will only return role assignments granted in that tenant. + * @param {string} [user] optional user(s) filter, will only return role assignments granted to this user(s). + * @param {string} [role] optional role(s) filter, will only return role assignments granting this role(s). + * @param {string} [tenant] optional tenant(s) filter, will only return role assignments granted in that tenant(s). + * @param {string} [resource] optional resource **type** filter, will only return role assignments granted on that resource type. * @param {string} [resourceInstance] optional resource instance filter, will only return role assignments granted on that resource instance. + * @param {boolean} [detailed] Whether to return full details about the user, tenant and role + * @param {boolean} [includeTotalCount] If true, returns the list of role assignments and the total count. * @param {number} [page] Page number of the results to fetch, starting at 1. * @param {number} [perPage] The number of results per page (max 100). * @param {*} [options] Override http request option. @@ -471,12 +498,23 @@ export const RoleAssignmentsApiFp = function (configuration?: Configuration) { user?: string, role?: string, tenant?: string, + resource?: string, resourceInstance?: string, + detailed?: boolean, + includeTotalCount?: boolean, page?: number, perPage?: number, options?: AxiosRequestConfig, ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise> + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise< + | Array + | Array + | PaginatedResultRoleAssignmentRead + | PaginatedResultRoleAssignmentDetailedRead + > > { const localVarAxiosArgs = await localVarAxiosParamCreator.listRoleAssignments( projId, @@ -484,7 +522,10 @@ export const RoleAssignmentsApiFp = function (configuration?: Configuration) { user, role, tenant, + resource, resourceInstance, + detailed, + includeTotalCount, page, perPage, options, @@ -586,14 +627,17 @@ export const RoleAssignmentsApiFactory = function ( .then((request) => request(axios, basePath)); }, /** - * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user. - If the `tenant` filter is present, will only return the role assignments in that tenant. - If the `role` filter is present, will only return role assignments that are granting that role. + * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user (supports multiple). - If the `tenant` filter is present, will only return the role assignments in that tenant (supports multiple). - If the `role` filter is present, will only return role assignments that are granting that role (supports multiple). - If the `resource` filter is present, will only return role assignments for resource instances of that resource type. - If the `resource_instance` filter is present, will only return role assignments for that resource instance. Providing both `tenant` and `resource_instance` filters will only return role assignments if the resource instance is in that tenant. If multiple tenants are received, the last tenant will be compared with the resource instance. * @summary List Role Assignments * @param {string} projId Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @param {string} envId Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). - * @param {string} [user] optional user filter, will only return role assignments granted to this user. - * @param {string} [role] optional role filter, will only return role assignments granting this role. - * @param {string} [tenant] optional tenant filter, will only return role assignments granted in that tenant. + * @param {string} [user] optional user(s) filter, will only return role assignments granted to this user(s). + * @param {string} [role] optional role(s) filter, will only return role assignments granting this role(s). + * @param {string} [tenant] optional tenant(s) filter, will only return role assignments granted in that tenant(s). + * @param {string} [resource] optional resource **type** filter, will only return role assignments granted on that resource type. * @param {string} [resourceInstance] optional resource instance filter, will only return role assignments granted on that resource instance. + * @param {boolean} [detailed] Whether to return full details about the user, tenant and role + * @param {boolean} [includeTotalCount] If true, returns the list of role assignments and the total count. * @param {number} [page] Page number of the results to fetch, starting at 1. * @param {number} [perPage] The number of results per page (max 100). * @param {*} [options] Override http request option. @@ -605,11 +649,19 @@ export const RoleAssignmentsApiFactory = function ( user?: string, role?: string, tenant?: string, + resource?: string, resourceInstance?: string, + detailed?: boolean, + includeTotalCount?: boolean, page?: number, perPage?: number, options?: any, - ): AxiosPromise> { + ): AxiosPromise< + | Array + | Array + | PaginatedResultRoleAssignmentRead + | PaginatedResultRoleAssignmentDetailedRead + > { return localVarFp .listRoleAssignments( projId, @@ -617,7 +669,10 @@ export const RoleAssignmentsApiFactory = function ( user, role, tenant, + resource, resourceInstance, + detailed, + includeTotalCount, page, perPage, options, @@ -751,26 +806,33 @@ export interface RoleAssignmentsApiListRoleAssignmentsRequest { readonly envId: string; /** - * optional user filter, will only return role assignments granted to this user. + * optional user(s) filter, will only return role assignments granted to this user(s). * @type {string} * @memberof RoleAssignmentsApiListRoleAssignments */ readonly user?: string; /** - * optional role filter, will only return role assignments granting this role. + * optional role(s) filter, will only return role assignments granting this role(s). * @type {string} * @memberof RoleAssignmentsApiListRoleAssignments */ readonly role?: string; /** - * optional tenant filter, will only return role assignments granted in that tenant. + * optional tenant(s) filter, will only return role assignments granted in that tenant(s). * @type {string} * @memberof RoleAssignmentsApiListRoleAssignments */ readonly tenant?: string; + /** + * optional resource **type** filter, will only return role assignments granted on that resource type. + * @type {string} + * @memberof RoleAssignmentsApiListRoleAssignments + */ + readonly resource?: string; + /** * optional resource instance filter, will only return role assignments granted on that resource instance. * @type {string} @@ -778,6 +840,20 @@ export interface RoleAssignmentsApiListRoleAssignmentsRequest { */ readonly resourceInstance?: string; + /** + * Whether to return full details about the user, tenant and role + * @type {boolean} + * @memberof RoleAssignmentsApiListRoleAssignments + */ + readonly detailed?: boolean; + + /** + * If true, returns the list of role assignments and the total count. + * @type {boolean} + * @memberof RoleAssignmentsApiListRoleAssignments + */ + readonly includeTotalCount?: boolean; + /** * Page number of the results to fetch, starting at 1. * @type {number} @@ -895,7 +971,7 @@ export class RoleAssignmentsApi extends BaseAPI { } /** - * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user. - If the `tenant` filter is present, will only return the role assignments in that tenant. - If the `role` filter is present, will only return role assignments that are granting that role. + * Lists the role assignments defined within an environment. - If the `user` filter is present, will only return the role assignments of that user (supports multiple). - If the `tenant` filter is present, will only return the role assignments in that tenant (supports multiple). - If the `role` filter is present, will only return role assignments that are granting that role (supports multiple). - If the `resource` filter is present, will only return role assignments for resource instances of that resource type. - If the `resource_instance` filter is present, will only return role assignments for that resource instance. Providing both `tenant` and `resource_instance` filters will only return role assignments if the resource instance is in that tenant. If multiple tenants are received, the last tenant will be compared with the resource instance. * @summary List Role Assignments * @param {RoleAssignmentsApiListRoleAssignmentsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. @@ -913,7 +989,10 @@ export class RoleAssignmentsApi extends BaseAPI { requestParameters.user, requestParameters.role, requestParameters.tenant, + requestParameters.resource, requestParameters.resourceInstance, + requestParameters.detailed, + requestParameters.includeTotalCount, requestParameters.page, requestParameters.perPage, options, diff --git a/src/openapi/types/index.ts b/src/openapi/types/index.ts index 0e1cebd..7d54b46 100644 --- a/src/openapi/types/index.ts +++ b/src/openapi/types/index.ts @@ -145,6 +145,8 @@ export * from './paginated-result-elements-config-read'; export * from './paginated-result-opadecision-log'; export * from './paginated-result-resource-read'; export * from './paginated-result-role-read'; +export * from './paginated-result-role-assignment-detailed-read'; +export * from './paginated-result-role-assignment-read'; export * from './paginated-result-tenant-read'; export * from './paginated-result-user-read'; export * from './parent-id'; @@ -214,7 +216,12 @@ export * from './response-get-data-for-tenant-v2-internal-opal-data-org-id-proj- export * from './response-get-data-for-user-v2-internal-opal-data-org-id-proj-id-env-id-users-user-id-get'; export * from './role-assignment-create'; export * from './role-assignment-read'; +export * from './role-assignment-detailed-read'; export * from './role-assignment-remove'; +export * from './role-assignment-resource-instance'; +export * from './role-assignment-role'; +export * from './role-assignment-tenant'; +export * from './role-assignment-user'; export * from './role-create'; export * from './role-data'; export * from './role-read'; diff --git a/src/openapi/types/paginated-result-role-assignment-detailed-read.ts b/src/openapi/types/paginated-result-role-assignment-detailed-read.ts new file mode 100644 index 0000000..bfc2e35 --- /dev/null +++ b/src/openapi/types/paginated-result-role-assignment-detailed-read.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { RoleAssignmentDetailedRead } from './role-assignment-detailed-read'; + +/** + * + * @export + * @interface PaginatedResultRoleAssignmentDetailedRead + */ +export interface PaginatedResultRoleAssignmentDetailedRead { + /** + * List of Role Assignment Detaileds + * @type {Array} + * @memberof PaginatedResultRoleAssignmentDetailedRead + */ + data: Array; + /** + * + * @type {number} + * @memberof PaginatedResultRoleAssignmentDetailedRead + */ + total_count: number; + /** + * + * @type {number} + * @memberof PaginatedResultRoleAssignmentDetailedRead + */ + page_count?: number; +} diff --git a/src/openapi/types/paginated-result-role-assignment-read.ts b/src/openapi/types/paginated-result-role-assignment-read.ts new file mode 100644 index 0000000..c1aa6e3 --- /dev/null +++ b/src/openapi/types/paginated-result-role-assignment-read.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { RoleAssignmentRead } from './role-assignment-read'; + +/** + * + * @export + * @interface PaginatedResultRoleAssignmentRead + */ +export interface PaginatedResultRoleAssignmentRead { + /** + * List of Role Assignments + * @type {Array} + * @memberof PaginatedResultRoleAssignmentRead + */ + data: Array; + /** + * + * @type {number} + * @memberof PaginatedResultRoleAssignmentRead + */ + total_count: number; + /** + * + * @type {number} + * @memberof PaginatedResultRoleAssignmentRead + */ + page_count?: number; +} diff --git a/src/openapi/types/role-assignment-detailed-read.ts b/src/openapi/types/role-assignment-detailed-read.ts new file mode 100644 index 0000000..b874e17 --- /dev/null +++ b/src/openapi/types/role-assignment-detailed-read.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { RoleAssignmentResourceInstance } from './role-assignment-resource-instance'; +// @ts-ignore +import { RoleAssignmentRole } from './role-assignment-role'; +// @ts-ignore +import { RoleAssignmentTenant } from './role-assignment-tenant'; +// @ts-ignore +import { RoleAssignmentUser } from './role-assignment-user'; + +/** + * + * @export + * @interface RoleAssignmentDetailedRead + */ +export interface RoleAssignmentDetailedRead { + /** + * Unique id of the role assignment + * @type {string} + * @memberof RoleAssignmentDetailedRead + */ + id: string; + /** + * the role that is assigned + * @type {RoleAssignmentRole} + * @memberof RoleAssignmentDetailedRead + */ + role: RoleAssignmentRole; + /** + * the user the role is assigned to + * @type {RoleAssignmentUser} + * @memberof RoleAssignmentDetailedRead + */ + user: RoleAssignmentUser; + /** + * the tenant the role is associated with + * @type {RoleAssignmentTenant} + * @memberof RoleAssignmentDetailedRead + */ + tenant: RoleAssignmentTenant; + /** + * + * @type {RoleAssignmentResourceInstance} + * @memberof RoleAssignmentDetailedRead + */ + resource_instance?: RoleAssignmentResourceInstance; + /** + * Unique id of the organization that the role assignment belongs to. + * @type {string} + * @memberof RoleAssignmentDetailedRead + */ + organization_id: string; + /** + * Unique id of the project that the role assignment belongs to. + * @type {string} + * @memberof RoleAssignmentDetailedRead + */ + project_id: string; + /** + * Unique id of the environment that the role assignment belongs to. + * @type {string} + * @memberof RoleAssignmentDetailedRead + */ + environment_id: string; + /** + * Date and time when the role assignment was created (ISO_8601 format). + * @type {string} + * @memberof RoleAssignmentDetailedRead + */ + created_at: string; +} diff --git a/src/openapi/types/role-assignment-read.ts b/src/openapi/types/role-assignment-read.ts index e228c1d..7535ea8 100644 --- a/src/openapi/types/role-assignment-read.ts +++ b/src/openapi/types/role-assignment-read.ts @@ -42,24 +42,12 @@ export interface RoleAssignmentRead { * @memberof RoleAssignmentRead */ tenant?: string; - /** - * the resource type the role is associated with - * @type {string} - * @memberof RoleAssignmentRead - */ - resource?: string; /** * the resource instance the role is associated with * @type {string} * @memberof RoleAssignmentRead */ resource_instance?: string; - /** - * Unique id of the resource type - * @type {string} - * @memberof RoleAssignmentRead - */ - resource_id?: string; /** * Unique id of the resource instance * @type {string} diff --git a/src/openapi/types/role-assignment-resource-instance.ts b/src/openapi/types/role-assignment-resource-instance.ts new file mode 100644 index 0000000..5c9f7bb --- /dev/null +++ b/src/openapi/types/role-assignment-resource-instance.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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 RoleAssignmentResourceInstance + */ +export interface RoleAssignmentResourceInstance { + /** + * + * @type {string} + * @memberof RoleAssignmentResourceInstance + */ + id: string; + /** + * + * @type {string} + * @memberof RoleAssignmentResourceInstance + */ + key: string; + /** + * + * @type {string} + * @memberof RoleAssignmentResourceInstance + */ + resource: string; + /** + * + * @type {Record} + * @memberof RoleAssignmentResourceInstance + */ + attributes?: Record; +} diff --git a/src/openapi/types/role-assignment-role.ts b/src/openapi/types/role-assignment-role.ts new file mode 100644 index 0000000..f2640fe --- /dev/null +++ b/src/openapi/types/role-assignment-role.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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 RoleAssignmentRole + */ +export interface RoleAssignmentRole { + /** + * + * @type {string} + * @memberof RoleAssignmentRole + */ + id: string; + /** + * + * @type {string} + * @memberof RoleAssignmentRole + */ + key: string; + /** + * + * @type {string} + * @memberof RoleAssignmentRole + */ + name: string; + /** + * + * @type {Array} + * @memberof RoleAssignmentRole + */ + permissions?: Array; +} diff --git a/src/openapi/types/role-assignment-tenant.ts b/src/openapi/types/role-assignment-tenant.ts new file mode 100644 index 0000000..99ecb79 --- /dev/null +++ b/src/openapi/types/role-assignment-tenant.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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 RoleAssignmentTenant + */ +export interface RoleAssignmentTenant { + /** + * + * @type {string} + * @memberof RoleAssignmentTenant + */ + id: string; + /** + * + * @type {string} + * @memberof RoleAssignmentTenant + */ + key: string; + /** + * + * @type {string} + * @memberof RoleAssignmentTenant + */ + name: string; + /** + * + * @type {Record} + * @memberof RoleAssignmentTenant + */ + attributes?: Record; +} diff --git a/src/openapi/types/role-assignment-user.ts b/src/openapi/types/role-assignment-user.ts new file mode 100644 index 0000000..db52200 --- /dev/null +++ b/src/openapi/types/role-assignment-user.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Permit.io API + * Authorization as a service + * + * The version of the OpenAPI document: 2.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 RoleAssignmentUser + */ +export interface RoleAssignmentUser { + /** + * + * @type {string} + * @memberof RoleAssignmentUser + */ + id: string; + /** + * + * @type {string} + * @memberof RoleAssignmentUser + */ + key: string; + /** + * + * @type {string} + * @memberof RoleAssignmentUser + */ + email?: string; + /** + * + * @type {string} + * @memberof RoleAssignmentUser + */ + first_name?: string; + /** + * + * @type {string} + * @memberof RoleAssignmentUser + */ + last_name?: string; + /** + * + * @type {Record} + * @memberof RoleAssignmentUser + */ + attributes?: Record; +}