Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cloudglue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
from cloudglue.sdk.models.chat_completion_request_filter_file_inner import ChatCompletionRequestFilterFileInner
from cloudglue.sdk.models.file_update import FileUpdate

# Provider source metadata attached to connector-synced files
# (file.source_metadata) and returned by data_connectors.get_source_metadata()
from cloudglue.sdk.models.source_metadata import SourceMetadata
from cloudglue.sdk.models.source_metadata_response import SourceMetadataResponse
from cloudglue.sdk.models.grain_source_metadata import GrainSourceMetadata
from cloudglue.sdk.models.zoom_source_metadata import ZoomSourceMetadata
from cloudglue.sdk.models.recall_source_metadata import RecallSourceMetadata
from cloudglue.sdk.models.google_drive_source_metadata import GoogleDriveSourceMetadata
from cloudglue.sdk.models.dropbox_source_metadata import DropboxSourceMetadata
from cloudglue.sdk.models.gong_source_metadata import GongSourceMetadata

# Export key classes at the module level for clean imports
__all__ = [
"Cloudglue",
Expand All @@ -26,4 +37,12 @@
"ChatCompletionRequestFilterFileInner",
"FileUpdate",
"CloudglueError",
"SourceMetadata",
"SourceMetadataResponse",
"GrainSourceMetadata",
"ZoomSourceMetadata",
"RecallSourceMetadata",
"GoogleDriveSourceMetadata",
"DropboxSourceMetadata",
"GongSourceMetadata",
]
44 changes: 32 additions & 12 deletions cloudglue/client/resources/data_connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,35 @@ def list_files(
):
"""Browse files available in a connected data source.

Returns URIs compatible with Cloudglue's file import system.
Supports pagination and provider-specific filtering.
Returns URIs compatible with Cloudglue's file import system, plus
per-file provider metadata (the `metadata` field) so you can inspect
participants, hosts, durations, and AI summaries before importing.

Supports pagination and filtering; parameters a connector can't honor
are silently ignored. When filters are applied, a page may contain
fewer than `limit` items — even zero — while `has_more` is still
true: keep paginating until `next_page_token` is None rather than
stopping at the first short or empty page.

Args:
connector_id: The ID of the data connector.
limit: Maximum number of files to return (1-100).
page_token: Opaque cursor for pagination. Use the `next_page_token` from a previous response.
var_from: Start date for filtering (YYYY-MM-DD). Applies to Zoom and Grain connectors only.
to: End date for filtering (YYYY-MM-DD). Applies to Zoom and Grain connectors only.
page_token: Opaque cursor for pagination. Use the `next_page_token`
from a previous response. Tokens are only valid with the same
filter parameters they were issued under.
var_from: Start date for filtering (YYYY-MM-DD, inclusive UTC day
bound). Supported by Grain, Zoom, Recall, Google Drive,
Dropbox, and Gong (Zoom and Gong default to a 6-month lookback
when omitted); ignored for S3/GCS.
to: End date for filtering (YYYY-MM-DD). Same per-connector
support as `var_from`.
folder_id: Google Drive folder ID to list contents of. Applies to Google Drive connectors only.
path: Dropbox folder path to list contents of (default: root). Applies to Dropbox connectors only.
bucket: Bucket name. Required for S3 and GCS connectors.
prefix: Key prefix filter. Applies to S3 and GCS connectors only.
title_search: Title search filter. Applies to Grain connectors only. See the [Grain documentation](https://developers.grain.com/#recording-filter) for more details.
title_search: Case-insensitive title filter. Supported by Grain,
Zoom, Google Drive, Dropbox, and Gong; ignored for Recall (no
title is available when listing) and S3/GCS.
team: Team filter. Applies to Grain connectors only. See the [Grain documentation](https://developers.grain.com/#recording-filter) for more details.
meeting_type: Meeting type filter. Applies to Grain connectors only. See the [Grain documentation](https://developers.grain.com/#recording-filter) for more details.

Expand Down Expand Up @@ -100,22 +115,25 @@ def list_files(
def get_source_metadata(self, connector_id: str, url: str):
"""Look up source metadata for a connector URI.

Returns provider-specific metadata (e.g. Grain recording details) for a
Returns provider-specific metadata (recording/call/file details) for a
single file in a connected data source, without importing it.

Note: currently only supported for Grain connectors. Other connector
types raise a CloudglueError with status 501 (Not Implemented).
Supported for Grain, Zoom, Recall, Google Drive, Dropbox, and Gong
connectors. S3/GCS raise a CloudglueError with status 501 (plain
object stores have no richer metadata); a 502 is raised when the
upstream provider's response can't be validated.

Args:
connector_id: The ID of the data connector.
url: Connector URI to look up. Must match the connector's type.

Returns:
SourceMetadataResponse object.
SourceMetadataResponse object. `source_metadata` holds the
provider's metadata, discriminated by its `source_type` field.

Raises:
CloudglueError: If there is an error fetching source metadata
(including 501 for non-Grain connectors).
(including 501 for S3/GCS connectors).
"""
try:
return self.api.get_data_connector_source_metadata(
Expand All @@ -132,7 +150,9 @@ def sync_file(self, connector_id: str, url: str):

Imports the file at the given connector URI, returning the resulting
Cloudglue file (creating it if it does not already exist). Idempotent:
syncing the same URI returns the existing file.
syncing the same URI returns the existing file. For Grain, Zoom,
Recall, Google Drive, Dropbox, and Gong the file's `source_metadata`
is populated from the provider.

Besides the connector URIs emitted by `list_files()` (`s3://`,
`gs://`, `gdrive://file/<id>`, `dropbox://<path>`, `zoom://`,
Expand Down
15 changes: 14 additions & 1 deletion cloudglue/sdk/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion cloudglue/sdk/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cloudglue/sdk/api/chat_api.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cloudglue/sdk/api/collections_api.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading