/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b309bb11fb79 */ import { indexingPermissionsAuthorizeBetaUsers } from "../funcs/indexingPermissionsAuthorizeBetaUsers.js"; import { indexingPermissionsBulkIndexGroups } from "../funcs/indexingPermissionsBulkIndexGroups.js"; import { indexingPermissionsBulkIndexMemberships } from "../funcs/indexingPermissionsBulkIndexMemberships.js"; import { indexingPermissionsBulkIndexUsers } from "../funcs/indexingPermissionsBulkIndexUsers.js"; import { indexingPermissionsDeleteGroup } from "../funcs/indexingPermissionsDeleteGroup.js"; import { indexingPermissionsDeleteMembership } from "../funcs/indexingPermissionsDeleteMembership.js"; import { indexingPermissionsDeleteUser } from "../funcs/indexingPermissionsDeleteUser.js"; import { indexingPermissionsIndexGroup } from "../funcs/indexingPermissionsIndexGroup.js"; import { indexingPermissionsIndexMembership } from "../funcs/indexingPermissionsIndexMembership.js"; import { indexingPermissionsIndexUser } from "../funcs/indexingPermissionsIndexUser.js"; import { indexingPermissionsProcessMemberships } from "../funcs/indexingPermissionsProcessMemberships.js"; import { indexingPermissionsUpdatePermissions } from "../funcs/indexingPermissionsUpdatePermissions.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Permissions extends ClientSDK { /** * Update document permissions * * @remarks * Updates the permissions for a given document without modifying document content. */ async updatePermissions( request: components.UpdatePermissionsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsUpdatePermissions( this, request, options, )); } /** * Index user * * @remarks * Adds a datasource user or updates an existing user. */ async indexUser( request: components.IndexUserRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsIndexUser( this, request, options, )); } /** * Bulk index users * * @remarks * Replaces the users in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * Note: Any users deleted from the existing set will have their associated memberships deleted as well. */ async bulkIndexUsers( request: components.BulkIndexUsersRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsBulkIndexUsers( this, request, options, )); } /** * Index group * * @remarks * Add or update a group in the datasource. */ async indexGroup( request: components.IndexGroupRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsIndexGroup( this, request, options, )); } /** * Bulk index groups * * @remarks * Replaces the groups in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * Note: Any groups deleted from the existing set will have their associated memberships deleted as well. */ async bulkIndexGroups( request: components.BulkIndexGroupsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsBulkIndexGroups( this, request, options, )); } /** * Index membership * * @remarks * Add the memberships of a group in the datasource. */ async indexMembership( request: components.IndexMembershipRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsIndexMembership( this, request, options, )); } /** * Bulk index memberships for a group * * @remarks * Replaces the memberships for a group in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints. */ async bulkIndexMemberships( request: components.BulkIndexMembershipsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsBulkIndexMemberships( this, request, options, )); } /** * Schedules the processing of group memberships * * @remarks * Schedules the immediate processing of all group memberships uploaded through the indexing API. By default the uploaded group memberships will be processed asynchronously but this API can be used to schedule processing of all memberships on demand. */ async processMemberships( request?: components.ProcessAllMembershipsRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsProcessMemberships( this, request, options, )); } /** * Delete user * * @remarks * Delete the user from the datasource. Silently succeeds if user is not present. * Note: All memberships associated with the deleted user will also be deleted. */ async deleteUser( request: components.DeleteUserRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsDeleteUser( this, request, options, )); } /** * Delete group * * @remarks * Delete group from the datasource. Silently succeeds if group is not present. * Note: All memberships associated with the deleted group will also be deleted. */ async deleteGroup( request: components.DeleteGroupRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsDeleteGroup( this, request, options, )); } /** * Delete membership * * @remarks * Delete membership to a group in the specified datasource. Silently succeeds if membership is not present. */ async deleteMembership( request: components.DeleteMembershipRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsDeleteMembership( this, request, options, )); } /** * Beta users * * @remarks * Allow the datasource be visible to the specified beta users. The default behaviour is datasource being visible to all users if it is enabled and not visible to any user if it is not enabled. */ async authorizeBetaUsers( request: components.GreenlistUsersRequest, options?: RequestOptions, ): Promise { return unwrapAsync(indexingPermissionsAuthorizeBetaUsers( this, request, options, )); } }