/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { Assertion } from '../models/Assertion'; import type { BulkCreateAssertion } from '../models/BulkCreateAssertion'; import type { Credential } from '../models/Credential'; import type { CredentialProviderConfig } from '../models/CredentialProviderConfig'; import type { ExternalCredentialMapping } from '../models/ExternalCredentialMapping'; import type { Issuer } from '../models/Issuer'; import type { IssuerAuthority } from '../models/IssuerAuthority'; import type { OverTime } from '../models/OverTime'; import type { OvertimeWithChangeInfo } from '../models/OvertimeWithChangeInfo'; import type { PaginatedAssertionsResponse } from '../models/PaginatedAssertionsResponse'; import type { UploadedImage } from '../models/UploadedImage'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class CredentialsService { /** * Export credential information for a specific course. * * Args: * request: The HTTP request object * course_id: Course ID to export credentials for * * Returns: * Response: JSON response with credential data * @returns any No response body * @throws ApiError */ public static credentialsEximCredentialsCourseExportRetrieve({ courseId, }: { courseId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/exim/credentials/course/{course_id}/export/', path: { 'course_id': courseId, }, }); } /** * Import credential information for a specific course. * * Args: * request: The HTTP request object * course_id: Course ID to import credentials for * * Returns: * Response: JSON response with import results * @returns any No response body * @throws ApiError */ public static credentialsEximCredentialsCourseImportCreate({ courseId, }: { courseId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/exim/credentials/course/{course_id}/import/', path: { 'course_id': courseId, }, }); } /** * Get all credentials for a platform with search and pagination support. * * Query Parameters: * - platform_org: Platform org ID (takes precedence over URL org) * - page: Page number (default: 1) * - page_size: Items per page (default: 10, max: 100) * - search: Search term to filter credentials * - course: Course ID to filter credentials * - program: Program ID to filter credentials * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersRetrieve({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * API View for managing credentials across a platform. * * This endpoint allows creating and retrieving credentials for a specific organization/tenant, * with support for filtering, searching, and pagination. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * * Query Parameters: * # Platform identification * platform_org (str, optional): Alternative platform identifier (takes precedence over URL org) * * # Pagination * page (int, optional): Page number (default: 1) * page_size (int, optional): Items per page (default: 10, max: 100) * * # Filtering and search * search (str, optional): Search term to filter credentials by name or description * course (str, optional): Course ID to filter credentials associated with a specific course * program (str, optional): Program ID to filter credentials associated with a specific program * * Methods: * GET: Retrieve credentials with filtering and pagination * POST: Create a new credential * * POST Request Body: * A JSON object containing credential details: * - name (str): Credential name * - description (str, optional): Credential description * - issuer (str): Issuer entity ID * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": { * "next": "URL to next page", * "previous": "URL to previous page", * "count": 42, * "data": [ * {credential object}, * {credential object}, * ... * ], * "num_pages": 5, * "page_number": 1, * "max_page_size": 100 * } * } * * POST: A JSON response containing: * { * "status": {"success": true, "description": "Created"}, * "result": {credential object} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the platform doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Only public credentials are returned by default * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersCreate({ platformKey, userId, requestBody, }: { platformKey: string, userId: number, requestBody: Credential, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/', path: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API View for managing individual credentials. * * This endpoint allows retrieving, updating, and deleting specific credentials * identified by their entity_id. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * entity_id (str): The credential entity ID * * Methods: * GET: Retrieve a specific credential * PUT: Update a specific credential * DELETE: Delete a specific credential * * PUT Request Body: * A JSON object containing credential details to update: * - name (str, optional): Credential name * - description (str, optional): Credential description * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": {credential object} * } * * PUT: A JSON response containing: * { * "status": {"success": true, "description": "Updated"}, * "result": {credential object} * } * * DELETE: A JSON response indicating success: * { * "status": {"success": true, "description": "Deleted"} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the credential doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Users can only manage credentials they have permission to access * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersRetrieve2({ entityId, platformKey, userId, }: { entityId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * API View for managing individual credentials. * * This endpoint allows retrieving, updating, and deleting specific credentials * identified by their entity_id. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * entity_id (str): The credential entity ID * * Methods: * GET: Retrieve a specific credential * PUT: Update a specific credential * DELETE: Delete a specific credential * * PUT Request Body: * A JSON object containing credential details to update: * - name (str, optional): Credential name * - description (str, optional): Credential description * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": {credential object} * } * * PUT: A JSON response containing: * { * "status": {"success": true, "description": "Updated"}, * "result": {credential object} * } * * DELETE: A JSON response indicating success: * { * "status": {"success": true, "description": "Deleted"} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the credential doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Users can only manage credentials they have permission to access * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersUpdate({ entityId, platformKey, userId, requestBody, }: { entityId: string, platformKey: string, userId: number, requestBody: Credential, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API View for managing individual credentials. * * This endpoint allows retrieving, updating, and deleting specific credentials * identified by their entity_id. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * entity_id (str): The credential entity ID * * Methods: * GET: Retrieve a specific credential * PUT: Update a specific credential * DELETE: Delete a specific credential * * PUT Request Body: * A JSON object containing credential details to update: * - name (str, optional): Credential name * - description (str, optional): Credential description * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": {credential object} * } * * PUT: A JSON response containing: * { * "status": {"success": true, "description": "Updated"}, * "result": {credential object} * } * * DELETE: A JSON response indicating success: * { * "status": {"success": true, "description": "Deleted"} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the credential doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Users can only manage credentials they have permission to access * @returns void * @throws ApiError */ public static credentialsOrgsUsersDestroy({ entityId, platformKey, userId, }: { entityId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns PaginatedAssertionsResponse * @throws ApiError */ public static credentialsOrgsUsersAssertionsRetrieve3({ entityId, platformKey, userId, }: { entityId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}/assertions/', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns Assertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsCreate({ entityId, platformKey, userId, requestBody, }: { entityId: string, platformKey: string, userId: number, requestBody: Assertion, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}/assertions/', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @returns BulkCreateAssertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsBulkCreate({ entityId, platformKey, userId, requestBody, }: { entityId: string, platformKey: string, userId: number, requestBody: BulkCreateAssertion, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}/assertions/bulk/', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * A GET View that validates QueryParams and returns results to a serializer * @returns PaginatedAssertionsResponse * @throws ApiError */ public static credentialsOrgsUsersAssertionsRetrieve({ platformKey, userId, course, excludeMainTenantAssertions, includeExpired, includeRevoked, page, pageSize, }: { platformKey: string, userId: number, course?: string, excludeMainTenantAssertions?: boolean, includeExpired?: boolean, includeRevoked?: boolean, page?: number, pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assertions/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'course': course, 'exclude_main_tenant_assertions': excludeMainTenantAssertions, 'include_expired': includeExpired, 'include_revoked': includeRevoked, 'page': page, 'page_size': pageSize, }, }); } /** * Get all credentials of a given tenant * @returns OvertimeWithChangeInfo * @throws ApiError */ public static credentialsOrgsUsersAssertionsOverTimeRetrieve({ platformKey, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { platformKey: string, userId: number, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assertions-over-time/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * @returns Assertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsRetrieve2({ entityId, platformKey, userId, }: { entityId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assertions/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns Assertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsUpdate({ entityId, platformKey, userId, requestBody, }: { entityId: string, platformKey: string, userId: number, requestBody: Assertion, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assertions/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a credential assignment using its entity_id. * Only platform admins and department admins can delete assignments. * @returns void * @throws ApiError */ public static credentialsOrgsUsersAssignmentsDestroy({ assignmentId, platformKey, userId, }: { assignmentId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assignments/{assignment_id}', path: { 'assignment_id': assignmentId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Get group assignments with department-aware filtering * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsGroupsRetrieve({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assignments/groups/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Create group assignment with department access validation * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsGroupsCreate({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assignments/groups/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Get assignments and their corresponding assertions based on user role: * - Regular users: get only their own assignments * - Platform admins: get assignments for all users in their platform * - Department admins: get assignments for users in their department groups * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsUsersRetrieve({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assignments/users/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Create assignments with department access validation * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsUsersCreate({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/assignments/users/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Get all credentials of a given tenant * @returns OverTime * @throws ApiError */ public static credentialsOrgsUsersCourseAssertionsOverTimeRetrieve({ platformKey, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { platformKey: string, userId: number, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/course-assertions-over-time/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * DRF view mixin that routes all ORM reads to the read replica. * * Falls back to the primary database if the replica is unreachable. * * Add as the **first** base class on read-only views/viewsets:: * * class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView): * ... * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersCourseCredentialsList({ platformKey, userId, page, pageSize, }: { platformKey: string, userId: number, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/course-credentials/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Get all credentials of a given tenant * @returns OverTime * @throws ApiError */ public static credentialsOrgsUsersCredentialsOverTimeRetrieve({ platformKey, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { platformKey: string, userId: number, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/credentials-over-time/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Retrieve external credential mappings for the platform. * * Query Parameters: * credential_id (str, optional): Filter by credential entity_id * provider_name (str, optional): Filter by provider name * page (int, optional): Page number * page_size (int, optional): Items per page * * Returns all mappings for the platform if the user is an admin. * @returns ExternalCredentialMapping * @throws ApiError */ public static credentialsOrgsUsersExternalMappingRetrieve({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/external-mapping/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Create or update an external credential mapping. * * If a mapping doesn't exist for the credential + platform + provider combination, * it will be created. If it exists, it will be updated. * * Request Body: * { * "credential_id": "credential-entity-id", // Required * "provider_name": "accredible", // Required * "external_template_id": "123456", // Optional * "metadata": {} // Optional * } * * Returns: * - 201 Created: When creating a new mapping * - 200 OK: When updating an existing mapping * @returns ExternalCredentialMapping * @throws ApiError */ public static credentialsOrgsUsersExternalMappingCreate({ platformKey, userId, requestBody, }: { platformKey: string, userId: number, requestBody: ExternalCredentialMapping, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/external-mapping/', path: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete an external credential mapping. * * Request Body: * { * "credential_id": "credential-entity-id", // Required * "provider_name": "accredible" // Required * } * * Returns: * A JSON response confirming deletion * @returns void * @throws ApiError */ public static credentialsOrgsUsersExternalMappingDestroy({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/external-mapping/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns UploadedImage * @throws ApiError */ public static credentialsOrgsUsersImagesRetrieve({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/images/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns UploadedImage * @throws ApiError */ public static credentialsOrgsUsersImagesCreate({ platformKey, userId, requestBody, }: { platformKey: string, userId: number, requestBody?: UploadedImage, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/images/', path: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * A GET View that validates QueryParams and returns results to a serializer * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersRetrieve({ platformKey, q, userId, }: { platformKey: string, q: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/issuers/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'q': q, }, }); } /** * A GET View that validates QueryParams and returns results to a serializer * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersCreate({ platformKey, q, userId, requestBody, }: { platformKey: string, q: string, userId: number, requestBody: Issuer, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/issuers/', path: { 'platform_key': platformKey, 'user_id': userId, }, query: { 'q': q, }, body: requestBody, mediaType: 'application/json', }); } /** * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersRetrieve2({ entityId, platformKey, userId, }: { entityId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/issuers/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersUpdate({ entityId, platformKey, userId, requestBody, }: { entityId: string, platformKey: string, userId: number, requestBody: Issuer, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/issuers/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @returns void * @throws ApiError */ public static credentialsOrgsUsersIssuersDestroy({ entityId, platformKey, userId, }: { entityId: string, platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/issuers/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'user_id': userId, }, }); } /** * @returns IssuerAuthority * @throws ApiError */ public static credentialsOrgsUsersIssuersAuthorityCreate({ platformKey, userId, requestBody, }: { platformKey: string, userId: number, requestBody: IssuerAuthority, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/issuers/authority/', path: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve provider configurations for the platform. * * Query Parameters: * provider_name (str, optional): Filter to a specific provider * page (int, optional): Page number * page_size (int, optional): Items per page * * Returns all configurations for the platform if the user is an admin. * @returns CredentialProviderConfig * @throws ApiError */ public static credentialsOrgsUsersProviderConfigRetrieve({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/provider-config/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Create or update a provider configuration. * * If a configuration doesn't exist for the platform and provider, it will be created. * If it exists, it will be updated. * * Request Body: * { * "provider_name": "accredible", // Required * "config": {...}, // Optional * "enabled": true // Optional * } * * Returns: * - 201 Created: When creating a new configuration * - 200 OK: When updating an existing configuration * @returns CredentialProviderConfig * @throws ApiError */ public static credentialsOrgsUsersProviderConfigCreate({ platformKey, userId, requestBody, }: { platformKey: string, userId: number, requestBody: CredentialProviderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/provider-config/', path: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Deactivate a provider configuration (sets enabled=False). * * Request Body: * { * "provider_name": "accredible" // Required * } * @returns void * @throws ApiError */ public static credentialsOrgsUsersProviderConfigDestroy({ platformKey, userId, }: { platformKey: string, userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{user_id}/provider-config/', path: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Get all credentials for a platform with search and pagination support. * * Query Parameters: * - platform_org: Platform org ID (takes precedence over URL org) * - page: Page number (default: 1) * - page_size: Items per page (default: 10, max: 100) * - search: Search term to filter credentials * - course: Course ID to filter credentials * - program: Program ID to filter credentials * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersRetrieve3({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * API View for managing credentials across a platform. * * This endpoint allows creating and retrieving credentials for a specific organization/tenant, * with support for filtering, searching, and pagination. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * * Query Parameters: * # Platform identification * platform_org (str, optional): Alternative platform identifier (takes precedence over URL org) * * # Pagination * page (int, optional): Page number (default: 1) * page_size (int, optional): Items per page (default: 10, max: 100) * * # Filtering and search * search (str, optional): Search term to filter credentials by name or description * course (str, optional): Course ID to filter credentials associated with a specific course * program (str, optional): Program ID to filter credentials associated with a specific program * * Methods: * GET: Retrieve credentials with filtering and pagination * POST: Create a new credential * * POST Request Body: * A JSON object containing credential details: * - name (str): Credential name * - description (str, optional): Credential description * - issuer (str): Issuer entity ID * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": { * "next": "URL to next page", * "previous": "URL to previous page", * "count": 42, * "data": [ * {credential object}, * {credential object}, * ... * ], * "num_pages": 5, * "page_number": 1, * "max_page_size": 100 * } * } * * POST: A JSON response containing: * { * "status": {"success": true, "description": "Created"}, * "result": {credential object} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the platform doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Only public credentials are returned by default * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersCreate2({ platformKey, username, requestBody, }: { platformKey: string, username: string, requestBody: Credential, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/', path: { 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * API View for managing individual credentials. * * This endpoint allows retrieving, updating, and deleting specific credentials * identified by their entity_id. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * entity_id (str): The credential entity ID * * Methods: * GET: Retrieve a specific credential * PUT: Update a specific credential * DELETE: Delete a specific credential * * PUT Request Body: * A JSON object containing credential details to update: * - name (str, optional): Credential name * - description (str, optional): Credential description * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": {credential object} * } * * PUT: A JSON response containing: * { * "status": {"success": true, "description": "Updated"}, * "result": {credential object} * } * * DELETE: A JSON response indicating success: * { * "status": {"success": true, "description": "Deleted"} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the credential doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Users can only manage credentials they have permission to access * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersRetrieve4({ entityId, platformKey, username, }: { entityId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, }); } /** * API View for managing individual credentials. * * This endpoint allows retrieving, updating, and deleting specific credentials * identified by their entity_id. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * entity_id (str): The credential entity ID * * Methods: * GET: Retrieve a specific credential * PUT: Update a specific credential * DELETE: Delete a specific credential * * PUT Request Body: * A JSON object containing credential details to update: * - name (str, optional): Credential name * - description (str, optional): Credential description * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": {credential object} * } * * PUT: A JSON response containing: * { * "status": {"success": true, "description": "Updated"}, * "result": {credential object} * } * * DELETE: A JSON response indicating success: * { * "status": {"success": true, "description": "Deleted"} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the credential doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Users can only manage credentials they have permission to access * @returns Credential * @throws ApiError */ public static credentialsOrgsUsersUpdate2({ entityId, platformKey, username, requestBody, }: { entityId: string, platformKey: string, username: string, requestBody: Credential, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/credentials/orgs/{platform_key}/users/{username}/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * API View for managing individual credentials. * * This endpoint allows retrieving, updating, and deleting specific credentials * identified by their entity_id. * * Path Parameters: * org (str): The organization/tenant identifier * user_id (str): The user ID making the request * entity_id (str): The credential entity ID * * Methods: * GET: Retrieve a specific credential * PUT: Update a specific credential * DELETE: Delete a specific credential * * PUT Request Body: * A JSON object containing credential details to update: * - name (str, optional): Credential name * - description (str, optional): Credential description * - credential_type (str, optional): Type of credential * - html_template (str, optional): HTML template for credential rendering * - css_template (str, optional): CSS template for credential styling * - icon_image (str, optional): URL to credential icon * - background_image (str, optional): URL to credential background * - thumbnail_image (str, optional): URL to credential thumbnail * - criteria_url (str, optional): URL to credential criteria * - criteria_text (str, optional): Text description of credential criteria * - issuing_signal (str, optional): Signal that triggers credential issuance * * Returns: * GET: A JSON response containing: * { * "status": {"success": true, "description": "Ok"}, * "result": {credential object} * } * * PUT: A JSON response containing: * { * "status": {"success": true, "description": "Updated"}, * "result": {credential object} * } * * DELETE: A JSON response indicating success: * { * "status": {"success": true, "description": "Deleted"} * } * * Error Responses: * 400 Bad Request: If the request data is invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the credential doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires CredentialAssignmentPermission * - Users can only manage credentials they have permission to access * @returns void * @throws ApiError */ public static credentialsOrgsUsersDestroy2({ entityId, platformKey, username, }: { entityId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{username}/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, }); } /** * @returns PaginatedAssertionsResponse * @throws ApiError */ public static credentialsOrgsUsersAssertionsRetrieve6({ entityId, platformKey, username, }: { entityId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/{entity_id}/assertions/', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, }); } /** * @returns Assertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsCreate2({ entityId, platformKey, username, requestBody, }: { entityId: string, platformKey: string, username: string, requestBody: Assertion, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/{entity_id}/assertions/', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * @returns BulkCreateAssertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsBulkCreate2({ entityId, platformKey, username, requestBody, }: { entityId: string, platformKey: string, username: string, requestBody: BulkCreateAssertion, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/{entity_id}/assertions/bulk/', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * A GET View that validates QueryParams and returns results to a serializer * @returns PaginatedAssertionsResponse * @throws ApiError */ public static credentialsOrgsUsersAssertionsRetrieve4({ platformKey, username, course, excludeMainTenantAssertions, includeExpired, includeRevoked, page, pageSize, }: { platformKey: string, username: string, course?: string, excludeMainTenantAssertions?: boolean, includeExpired?: boolean, includeRevoked?: boolean, page?: number, pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/assertions/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'course': course, 'exclude_main_tenant_assertions': excludeMainTenantAssertions, 'include_expired': includeExpired, 'include_revoked': includeRevoked, 'page': page, 'page_size': pageSize, }, }); } /** * Get all credentials of a given tenant * @returns OvertimeWithChangeInfo * @throws ApiError */ public static credentialsOrgsUsersAssertionsOverTimeRetrieve2({ platformKey, username, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { platformKey: string, username: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/assertions-over-time/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * @returns Assertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsRetrieve5({ entityId, platformKey, username, }: { entityId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/assertions/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, }); } /** * @returns Assertion * @throws ApiError */ public static credentialsOrgsUsersAssertionsUpdate2({ entityId, platformKey, username, requestBody, }: { entityId: string, platformKey: string, username: string, requestBody: Assertion, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/credentials/orgs/{platform_key}/users/{username}/assertions/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a credential assignment using its entity_id. * Only platform admins and department admins can delete assignments. * @returns void * @throws ApiError */ public static credentialsOrgsUsersAssignmentsDestroy2({ assignmentId, platformKey, username, }: { assignmentId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{username}/assignments/{assignment_id}', path: { 'assignment_id': assignmentId, 'platform_key': platformKey, 'username': username, }, }); } /** * Get group assignments with department-aware filtering * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsGroupsRetrieve2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/assignments/groups/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Create group assignment with department access validation * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsGroupsCreate2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/assignments/groups/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Get assignments and their corresponding assertions based on user role: * - Regular users: get only their own assignments * - Platform admins: get assignments for all users in their platform * - Department admins: get assignments for users in their department groups * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsUsersRetrieve2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/assignments/users/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Create assignments with department access validation * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersAssignmentsUsersCreate2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/assignments/users/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Get all credentials of a given tenant * @returns OverTime * @throws ApiError */ public static credentialsOrgsUsersCourseAssertionsOverTimeRetrieve2({ platformKey, username, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { platformKey: string, username: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/course-assertions-over-time/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * DRF view mixin that routes all ORM reads to the read replica. * * Falls back to the primary database if the replica is unreachable. * * Add as the **first** base class on read-only views/viewsets:: * * class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView): * ... * @returns any No response body * @throws ApiError */ public static credentialsOrgsUsersCourseCredentialsList2({ platformKey, username, page, pageSize, }: { platformKey: string, username: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/course-credentials/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Get all credentials of a given tenant * @returns OverTime * @throws ApiError */ public static credentialsOrgsUsersCredentialsOverTimeRetrieve2({ platformKey, username, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { platformKey: string, username: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/credentials-over-time/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Retrieve external credential mappings for the platform. * * Query Parameters: * credential_id (str, optional): Filter by credential entity_id * provider_name (str, optional): Filter by provider name * page (int, optional): Page number * page_size (int, optional): Items per page * * Returns all mappings for the platform if the user is an admin. * @returns ExternalCredentialMapping * @throws ApiError */ public static credentialsOrgsUsersExternalMappingRetrieve2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/external-mapping/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Create or update an external credential mapping. * * If a mapping doesn't exist for the credential + platform + provider combination, * it will be created. If it exists, it will be updated. * * Request Body: * { * "credential_id": "credential-entity-id", // Required * "provider_name": "accredible", // Required * "external_template_id": "123456", // Optional * "metadata": {} // Optional * } * * Returns: * - 201 Created: When creating a new mapping * - 200 OK: When updating an existing mapping * @returns ExternalCredentialMapping * @throws ApiError */ public static credentialsOrgsUsersExternalMappingCreate2({ platformKey, username, requestBody, }: { platformKey: string, username: string, requestBody: ExternalCredentialMapping, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/external-mapping/', path: { 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete an external credential mapping. * * Request Body: * { * "credential_id": "credential-entity-id", // Required * "provider_name": "accredible" // Required * } * * Returns: * A JSON response confirming deletion * @returns void * @throws ApiError */ public static credentialsOrgsUsersExternalMappingDestroy2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{username}/external-mapping/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * @returns UploadedImage * @throws ApiError */ public static credentialsOrgsUsersImagesRetrieve2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/images/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * @returns UploadedImage * @throws ApiError */ public static credentialsOrgsUsersImagesCreate2({ platformKey, username, requestBody, }: { platformKey: string, username: string, requestBody?: UploadedImage, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/images/', path: { 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * A GET View that validates QueryParams and returns results to a serializer * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersRetrieve3({ platformKey, q, username, }: { platformKey: string, q: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/issuers/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'q': q, }, }); } /** * A GET View that validates QueryParams and returns results to a serializer * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersCreate2({ platformKey, q, username, requestBody, }: { platformKey: string, q: string, username: string, requestBody: Issuer, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/issuers/', path: { 'platform_key': platformKey, 'username': username, }, query: { 'q': q, }, body: requestBody, mediaType: 'application/json', }); } /** * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersRetrieve4({ entityId, platformKey, username, }: { entityId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/issuers/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, }); } /** * @returns Issuer * @throws ApiError */ public static credentialsOrgsUsersIssuersUpdate2({ entityId, platformKey, username, requestBody, }: { entityId: string, platformKey: string, username: string, requestBody: Issuer, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/credentials/orgs/{platform_key}/users/{username}/issuers/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * @returns void * @throws ApiError */ public static credentialsOrgsUsersIssuersDestroy2({ entityId, platformKey, username, }: { entityId: string, platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{username}/issuers/{entity_id}', path: { 'entity_id': entityId, 'platform_key': platformKey, 'username': username, }, }); } /** * @returns IssuerAuthority * @throws ApiError */ public static credentialsOrgsUsersIssuersAuthorityCreate2({ platformKey, username, requestBody, }: { platformKey: string, username: string, requestBody: IssuerAuthority, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/issuers/authority/', path: { 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve provider configurations for the platform. * * Query Parameters: * provider_name (str, optional): Filter to a specific provider * page (int, optional): Page number * page_size (int, optional): Items per page * * Returns all configurations for the platform if the user is an admin. * @returns CredentialProviderConfig * @throws ApiError */ public static credentialsOrgsUsersProviderConfigRetrieve2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/orgs/{platform_key}/users/{username}/provider-config/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Create or update a provider configuration. * * If a configuration doesn't exist for the platform and provider, it will be created. * If it exists, it will be updated. * * Request Body: * { * "provider_name": "accredible", // Required * "config": {...}, // Optional * "enabled": true // Optional * } * * Returns: * - 201 Created: When creating a new configuration * - 200 OK: When updating an existing configuration * @returns CredentialProviderConfig * @throws ApiError */ public static credentialsOrgsUsersProviderConfigCreate2({ platformKey, username, requestBody, }: { platformKey: string, username: string, requestBody: CredentialProviderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/credentials/orgs/{platform_key}/users/{username}/provider-config/', path: { 'platform_key': platformKey, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Deactivate a provider configuration (sets enabled=False). * * Request Body: * { * "provider_name": "accredible" // Required * } * @returns void * @throws ApiError */ public static credentialsOrgsUsersProviderConfigDestroy2({ platformKey, username, }: { platformKey: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/credentials/orgs/{platform_key}/users/{username}/provider-config/', path: { 'platform_key': platformKey, 'username': username, }, }); } /** * Get list of enabled credential providers with pagination. * @returns any No response body * @throws ApiError */ public static credentialsProvidersRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/providers/', }); } /** * Public endpoint to retrieve a specific credential assertion by its entity ID. * * This endpoint allows public access to view a specific credential assertion * without authentication. * * Path Parameters: * entity_id (str): The assertion entity ID * * Returns: * A JSON response containing the assertion details using the AssertionSerializer format * * Error Responses: * 404 Not Found: * - If the assertion doesn't exist: Empty response with 404 status * - If the assertion has been revoked: JSON with error detail and revocation reason * 500 Internal Server Error: If an unexpected error occurs * @returns Assertion * @throws ApiError */ public static credentialsPublicAssertionsRetrieve({ entityId, }: { entityId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/credentials/public/assertions/{entity_id}/', path: { 'entity_id': entityId, }, }); } }