diff --git a/unstructured/ingest/v2/cli/cmds/sharepoint.py b/unstructured/ingest/v2/cli/cmds/sharepoint.py index 71042dc150..27d5cf3ed7 100644 --- a/unstructured/ingest/v2/cli/cmds/sharepoint.py +++ b/unstructured/ingest/v2/cli/cmds/sharepoint.py @@ -35,6 +35,21 @@ def get_cli_options() -> list[click.Option]: https://[tenant]-admin.sharepoint.com.\ This requires the app to be registered at a tenant level", ), + click.Option( + ["--permissions-application-id"], + type=str, + help="Microsoft Graph API application id", + ), + click.Option( + ["--permissions-client-cred"], + type=str, + help="Microsoft Graph API application credentials", + ), + click.Option( + ["--permissions-tenant"], + type=str, + help="e.g https://contoso.onmicrosoft.com to get permissions data within tenant.", + ), ] return options @@ -71,21 +86,6 @@ def get_cli_options() -> list[click.Option]: default=False, help="Don't process site pages.", ), - click.Option( - ["--permissions-application-id"], - type=str, - help="Microsoft Graph API application id", - ), - click.Option( - ["--permissions-client-cred"], - type=str, - help="Microsoft Graph API application credentials", - ), - click.Option( - ["--permissions-tenant"], - type=str, - help="e.g https://contoso.onmicrosoft.com to get permissions data within tenant.", - ), ] return options diff --git a/unstructured/ingest/v2/processes/connectors/sharepoint.py b/unstructured/ingest/v2/processes/connectors/sharepoint.py index af36a80dd5..7e62525ace 100644 --- a/unstructured/ingest/v2/processes/connectors/sharepoint.py +++ b/unstructured/ingest/v2/processes/connectors/sharepoint.py @@ -7,7 +7,7 @@ from urllib.parse import quote from unstructured.documents.elements import DataSourceMetadata -from unstructured.ingest.enhanced_dataclass import enhanced_field +from unstructured.ingest.enhanced_dataclass import EnhancedDataClassJsonMixin, enhanced_field from unstructured.ingest.error import SourceConnectionNetworkError from unstructured.ingest.v2.interfaces import ( AccessConfig, @@ -61,7 +61,7 @@ class SharepointAccessConfig(AccessConfig): @dataclass -class SharepointPermissionsConfig: +class SharepointPermissionsConfig(EnhancedDataClassJsonMixin): permissions_application_id: str permissions_tenant: str permissions_client_cred: str = enhanced_field(sensitive=True)