/** * 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. */ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; import { RequestArgs, BaseAPI } from '../base'; import { ResourceCreate } from '../types'; import { ResourceRead } from '../types'; import { ResourceReplace } from '../types'; import { ResourceUpdate } from '../types'; /** * ResourcesApi - axios parameter creator * @export */ export declare const ResourcesApiAxiosParamCreator: (configuration?: Configuration) => { /** * Creates a new resource (a type of object you may protect with permissions). * @summary Create Resource * @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 {ResourceCreate} resourceCreate * @param {*} [options] Override http request option. * @throws {RequiredError} */ createResource: (projId: string, envId: string, resourceCreate: ResourceCreate, options?: AxiosRequestConfig) => Promise; /** * Deletes the resource and all its related data. * @summary Delete Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteResource: (projId: string, envId: string, resourceId: string, options?: AxiosRequestConfig) => Promise; /** * Gets a single resource, if such resource exists. * @summary Get Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResource: (projId: string, envId: string, resourceId: string, options?: AxiosRequestConfig) => Promise; /** * Lists all the resources defined in your schema. * @summary List Resources * @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 {boolean} [includeBuiltIn] Whether to include or exclude built-in resources, default is False * @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. * @throws {RequiredError} */ listResources: (projId: string, envId: string, includeBuiltIn?: boolean, page?: number, perPage?: number, options?: AxiosRequestConfig) => Promise; /** * Completely replaces the resource definition. - If the resource key is changed, all role and permissions assignments for the the resource will be revoked. - If the resource key is unchanged, but some actions are removed or renamed from the resource definition, role and permissions assignments for these actions will be revoked. TODO: we need to decide if we are auto-revoking, or if we are rejecting the PUT completely while there are permissions that can be affected. * @summary Replace Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {ResourceReplace} resourceReplace * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceResource: (projId: string, envId: string, resourceId: string, resourceReplace: ResourceReplace, options?: AxiosRequestConfig) => Promise; /** * Partially updates the resource definition. Fields that will be provided will be completely overwritten. * @summary Update Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {ResourceUpdate} resourceUpdate * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateResource: (projId: string, envId: string, resourceId: string, resourceUpdate: ResourceUpdate, options?: AxiosRequestConfig) => Promise; }; /** * ResourcesApi - functional programming interface * @export */ export declare const ResourcesApiFp: (configuration?: Configuration) => { /** * Creates a new resource (a type of object you may protect with permissions). * @summary Create Resource * @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 {ResourceCreate} resourceCreate * @param {*} [options] Override http request option. * @throws {RequiredError} */ createResource(projId: string, envId: string, resourceCreate: ResourceCreate, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Deletes the resource and all its related data. * @summary Delete Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteResource(projId: string, envId: string, resourceId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Gets a single resource, if such resource exists. * @summary Get Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResource(projId: string, envId: string, resourceId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Lists all the resources defined in your schema. * @summary List Resources * @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 {boolean} [includeBuiltIn] Whether to include or exclude built-in resources, default is False * @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. * @throws {RequiredError} */ listResources(projId: string, envId: string, includeBuiltIn?: boolean, page?: number, perPage?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>; /** * Completely replaces the resource definition. - If the resource key is changed, all role and permissions assignments for the the resource will be revoked. - If the resource key is unchanged, but some actions are removed or renamed from the resource definition, role and permissions assignments for these actions will be revoked. TODO: we need to decide if we are auto-revoking, or if we are rejecting the PUT completely while there are permissions that can be affected. * @summary Replace Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {ResourceReplace} resourceReplace * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceResource(projId: string, envId: string, resourceId: string, resourceReplace: ResourceReplace, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Partially updates the resource definition. Fields that will be provided will be completely overwritten. * @summary Update Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {ResourceUpdate} resourceUpdate * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateResource(projId: string, envId: string, resourceId: string, resourceUpdate: ResourceUpdate, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; }; /** * ResourcesApi - factory interface * @export */ export declare const ResourcesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Creates a new resource (a type of object you may protect with permissions). * @summary Create Resource * @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 {ResourceCreate} resourceCreate * @param {*} [options] Override http request option. * @throws {RequiredError} */ createResource(projId: string, envId: string, resourceCreate: ResourceCreate, options?: any): AxiosPromise; /** * Deletes the resource and all its related data. * @summary Delete Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteResource(projId: string, envId: string, resourceId: string, options?: any): AxiosPromise; /** * Gets a single resource, if such resource exists. * @summary Get Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResource(projId: string, envId: string, resourceId: string, options?: any): AxiosPromise; /** * Lists all the resources defined in your schema. * @summary List Resources * @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 {boolean} [includeBuiltIn] Whether to include or exclude built-in resources, default is False * @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. * @throws {RequiredError} */ listResources(projId: string, envId: string, includeBuiltIn?: boolean, page?: number, perPage?: number, options?: any): AxiosPromise>; /** * Completely replaces the resource definition. - If the resource key is changed, all role and permissions assignments for the the resource will be revoked. - If the resource key is unchanged, but some actions are removed or renamed from the resource definition, role and permissions assignments for these actions will be revoked. TODO: we need to decide if we are auto-revoking, or if we are rejecting the PUT completely while there are permissions that can be affected. * @summary Replace Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {ResourceReplace} resourceReplace * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceResource(projId: string, envId: string, resourceId: string, resourceReplace: ResourceReplace, options?: any): AxiosPromise; /** * Partially updates the resource definition. Fields that will be provided will be completely overwritten. * @summary Update Resource * @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} resourceId Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @param {ResourceUpdate} resourceUpdate * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateResource(projId: string, envId: string, resourceId: string, resourceUpdate: ResourceUpdate, options?: any): AxiosPromise; }; /** * Request parameters for createResource operation in ResourcesApi. * @export * @interface ResourcesApiCreateResourceRequest */ export interface ResourcesApiCreateResourceRequest { /** * Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiCreateResource */ readonly projId: string; /** * Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiCreateResource */ readonly envId: string; /** * * @type {ResourceCreate} * @memberof ResourcesApiCreateResource */ readonly resourceCreate: ResourceCreate; } /** * Request parameters for deleteResource operation in ResourcesApi. * @export * @interface ResourcesApiDeleteResourceRequest */ export interface ResourcesApiDeleteResourceRequest { /** * Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiDeleteResource */ readonly projId: string; /** * Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiDeleteResource */ readonly envId: string; /** * Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiDeleteResource */ readonly resourceId: string; } /** * Request parameters for getResource operation in ResourcesApi. * @export * @interface ResourcesApiGetResourceRequest */ export interface ResourcesApiGetResourceRequest { /** * Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiGetResource */ readonly projId: string; /** * Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiGetResource */ readonly envId: string; /** * Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiGetResource */ readonly resourceId: string; } /** * Request parameters for listResources operation in ResourcesApi. * @export * @interface ResourcesApiListResourcesRequest */ export interface ResourcesApiListResourcesRequest { /** * Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiListResources */ readonly projId: string; /** * Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiListResources */ readonly envId: string; /** * Whether to include or exclude built-in resources, default is False * @type {boolean} * @memberof ResourcesApiListResources */ readonly includeBuiltIn?: boolean; /** * Page number of the results to fetch, starting at 1. * @type {number} * @memberof ResourcesApiListResources */ readonly page?: number; /** * The number of results per page (max 100). * @type {number} * @memberof ResourcesApiListResources */ readonly perPage?: number; } /** * Request parameters for replaceResource operation in ResourcesApi. * @export * @interface ResourcesApiReplaceResourceRequest */ export interface ResourcesApiReplaceResourceRequest { /** * Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiReplaceResource */ readonly projId: string; /** * Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiReplaceResource */ readonly envId: string; /** * Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiReplaceResource */ readonly resourceId: string; /** * * @type {ResourceReplace} * @memberof ResourcesApiReplaceResource */ readonly resourceReplace: ResourceReplace; } /** * Request parameters for updateResource operation in ResourcesApi. * @export * @interface ResourcesApiUpdateResourceRequest */ export interface ResourcesApiUpdateResourceRequest { /** * Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiUpdateResource */ readonly projId: string; /** * Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiUpdateResource */ readonly envId: string; /** * Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\"). * @type {string} * @memberof ResourcesApiUpdateResource */ readonly resourceId: string; /** * * @type {ResourceUpdate} * @memberof ResourcesApiUpdateResource */ readonly resourceUpdate: ResourceUpdate; } /** * ResourcesApi - object-oriented interface * @export * @class ResourcesApi * @extends {BaseAPI} */ export declare class ResourcesApi extends BaseAPI { /** * Creates a new resource (a type of object you may protect with permissions). * @summary Create Resource * @param {ResourcesApiCreateResourceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourcesApi */ createResource(requestParameters: ResourcesApiCreateResourceRequest, options?: AxiosRequestConfig): Promise>; /** * Deletes the resource and all its related data. * @summary Delete Resource * @param {ResourcesApiDeleteResourceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourcesApi */ deleteResource(requestParameters: ResourcesApiDeleteResourceRequest, options?: AxiosRequestConfig): Promise>; /** * Gets a single resource, if such resource exists. * @summary Get Resource * @param {ResourcesApiGetResourceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourcesApi */ getResource(requestParameters: ResourcesApiGetResourceRequest, options?: AxiosRequestConfig): Promise>; /** * Lists all the resources defined in your schema. * @summary List Resources * @param {ResourcesApiListResourcesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourcesApi */ listResources(requestParameters: ResourcesApiListResourcesRequest, options?: AxiosRequestConfig): Promise>; /** * Completely replaces the resource definition. - If the resource key is changed, all role and permissions assignments for the the resource will be revoked. - If the resource key is unchanged, but some actions are removed or renamed from the resource definition, role and permissions assignments for these actions will be revoked. TODO: we need to decide if we are auto-revoking, or if we are rejecting the PUT completely while there are permissions that can be affected. * @summary Replace Resource * @param {ResourcesApiReplaceResourceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourcesApi */ replaceResource(requestParameters: ResourcesApiReplaceResourceRequest, options?: AxiosRequestConfig): Promise>; /** * Partially updates the resource definition. Fields that will be provided will be completely overwritten. * @summary Update Resource * @param {ResourcesApiUpdateResourceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourcesApi */ updateResource(requestParameters: ResourcesApiUpdateResourceRequest, options?: AxiosRequestConfig): Promise>; }