# Beta.Libraries.Accesses ## Overview (beta) Libraries API - manage access to a library. ### Available Operations * [list](#list) - List all of the access to this library. * [update_or_create](#update_or_create) - Create or update an access level. * [delete](#delete) - Delete an access level. ## list Given a library, list all of the Entity that have access and to what level. ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.libraries.accesses.list(library_id="d2169833-d8e2-416e-a372-76518d3d99c2") # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.ListSharingResponse](../../models/listsharingresponse.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## update_or_create Given a library id, you can create or update the access level of an entity. You have to be owner of the library to share a library. An owner cannot change their own role. A library cannot be shared outside of the organization. ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.libraries.accesses.update_or_create(library_id="36de3a24-5b1c-4c8f-9d84-d5642205a976", level="Viewer", share_with_uuid="0ae92ecb-21ed-47c5-9f7e-0b2cbe325a20", share_with_type="User") # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | | `level` | [models.ShareEnum](../../models/shareenum.md) | :heavy_check_mark: | N/A | | `share_with_uuid` | *str* | :heavy_check_mark: | The id of the user or workspace to share with | | `share_with_type` | [models.EntityType](../../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | | `org_id` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.Sharing](../../models/sharing.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## delete Given a library id, you can delete the access level of an entity. An owner cannot delete their own access. You have to be the owner of the library to delete an access other than yours. Warning: the response will change from 200 (returning the deleted sharing) to 204 No Content in a future version. ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.libraries.accesses.delete(library_id="709e3cad-9fb2-4f4e-bf88-143cf1808107", share_with_uuid="b843cc47-ce8f-4354-8cfc-5fcd7fb2865b", share_with_type="User") assert res is not None # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | | `share_with_uuid` | *str* | :heavy_check_mark: | The id of the entity to stop sharing with, as returned by the list endpoint | | `share_with_type` | [models.EntityType](../../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | | `org_id` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.Sharing](../../models/sharing.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* |