GoogledriveClient
Classes
BlobMetadata
dataclass
BlobMetadata(*, id: Optional[str] = None, name: Optional[str] = None, display_name: Optional[str] = None, path: Optional[str] = None, folder_id: Optional[str] = None, folder_path: Optional[str] = None, last_modified: Optional[str] = None, size: Optional[int] = None, media_type: Optional[str] = None, is_folder: Optional[bool] = None, e_tag: Optional[str] = None, file_locator: Optional[str] = None, last_modified_by: Optional[str] = None)
Response for Get file metadata using id
Attributes
id
class-attribute
instance-attribute
The unique id of the file or folder.
name
class-attribute
instance-attribute
The name of the file or folder.
display_name
class-attribute
instance-attribute
display_name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'DisplayName'})
The display name of the file or folder.
path
class-attribute
instance-attribute
The path of the file or folder.
folder_id
class-attribute
instance-attribute
folder_id: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'FolderId'})
The unique id of the parent folder of the file or folder.
folder_path
class-attribute
instance-attribute
folder_path: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'FolderPath'})
The current path of the parent folder of the file or folder.
last_modified
class-attribute
instance-attribute
last_modified: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'LastModified'})
The date and time the file or folder was last modified.
size
class-attribute
instance-attribute
The size of the file or folder.
media_type
class-attribute
instance-attribute
media_type: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'MediaType'})
The media type of the file or folder.
is_folder
class-attribute
instance-attribute
is_folder: Optional[bool] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'IsFolder'})
A boolean value (true, false) to indicate whether or not the blob is a folder.
e_tag
class-attribute
instance-attribute
The etag of the file or folder.
DataSetsMetadata
dataclass
DataSetsMetadata(*, tabular: Optional[TabularDataSetsMetadata | Mapping[str, Any]] = None, blob: Optional[BlobDataSetsMetadata | Mapping[str, Any]] = None)
Definition: DataSetsMetadata
TabularDataSetsMetadata
dataclass
TabularDataSetsMetadata(*, source: Optional[str] = None, display_name: Optional[str] = None, url_encoding: Optional[str] = None, table_display_name: Optional[str] = None, table_plural_name: Optional[str] = None)
Definition: TabularDataSetsMetadata
Attributes
source
class-attribute
instance-attribute
Dataset source
display_name
class-attribute
instance-attribute
display_name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'displayName'})
Dataset display name
url_encoding
class-attribute
instance-attribute
url_encoding: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'urlEncoding'})
Dataset url encoding
BlobDataSetsMetadata
dataclass
BlobDataSetsMetadata(*, source: Optional[str] = None, display_name: Optional[str] = None, url_encoding: Optional[str] = None)
ObjectEntity
dataclass
TableMetadata
dataclass
TableMetadata(*, name: Optional[str] = None, title: Optional[str] = None, x_ms_permission: Optional[str] = None, x_ms_capabilities: Optional[TableCapabilitiesMetadata | Mapping[str, Any]] = None, schema: Optional[ObjectEntity | Mapping[str, Any]] = None, referenced_entities: Optional[ObjectEntity | Mapping[str, Any]] = None, web_url: Optional[str] = None)
Definition: TableMetadata
Attributes
name
class-attribute
instance-attribute
Table name
title
class-attribute
instance-attribute
Table title
TableCapabilitiesMetadata
dataclass
TableCapabilitiesMetadata(*, sort_restrictions: Optional[TableSortRestrictionsMetadata | Mapping[str, Any]] = None, filter_restrictions: Optional[TableFilterRestrictionsMetadata | Mapping[str, Any]] = None, select_restrictions: Optional[TableSelectRestrictionsMetadata | Mapping[str, Any]] = None, is_only_server_pagable: Optional[bool] = None, filter_function_support: Optional[List[str]] = None, server_paging_options: Optional[List[str]] = None)
Definition: TableCapabilitiesMetadata
Attributes
is_only_server_pagable
class-attribute
instance-attribute
is_only_server_pagable: Optional[bool] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'isOnlyServerPagable'})
Server paging restrictions
TableSortRestrictionsMetadata
dataclass
TableSortRestrictionsMetadata(*, sortable: Optional[bool] = None, unsortable_properties: Optional[List[str]] = None, ascending_only_properties: Optional[List[str]] = None)
Definition: TableSortRestrictionsMetadata
Attributes
sortable
class-attribute
instance-attribute
Indicates whether this table has sortable columns
TableFilterRestrictionsMetadata
dataclass
TableFilterRestrictionsMetadata(*, filterable: Optional[bool] = None, non_filterable_properties: Optional[List[str]] = None, required_properties: Optional[List[str]] = None)
Definition: TableFilterRestrictionsMetadata
Attributes
filterable
class-attribute
instance-attribute
Indicates whether this table has filterable columns
TableSelectRestrictionsMetadata
dataclass
TablesList
dataclass
Table
dataclass
Table(*, name: Optional[str] = None, display_name: Optional[str] = None, dynamic_properties: Optional[Dict[str, str]] = None)
Definition: Table
Item
dataclass
Definition: Item
ItemsList
dataclass
DataSetsList
dataclass
DataSet
dataclass
DataSet(*, name: Optional[str] = None, display_name: Optional[str] = None, query: Optional[List[PassThroughNativeQuery | Mapping[str, Any]]] = None)
Procedure
dataclass
Definition: Procedure
Attributes
name
class-attribute
instance-attribute
Procedure name
PassThroughNativeQuery
dataclass
GoogledriveClient
GoogledriveClient(connection_runtime_url: str, credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)
Bases: ConnectorClientBase
Typed client for googledrive connector.
Initialize a GoogledriveClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_runtime_url
|
str
|
The connection runtime URL from Azure Portal. |
required |
credential
|
AsyncTokenCredential | AzureKeyCredential
|
Caller-owned Azure Core credential. |
required |
max_retry_attempts
|
int
|
The maximum number of request attempts. |
3
|
timeout
|
float
|
The network timeout in seconds for each request. The value configures Azure Core retry and transport deadlines. Nonpositive values disable SDK and transport deadlines. |
30.0
|
use_exponential_backoff
|
bool
|
Whether retries use exponential backoff. |
True
|
initial_retry_delay_seconds
|
float
|
The initial retry delay in seconds. |
0.5
|
maximum_retry_delay_seconds
|
float
|
The maximum retry delay in seconds. |
120.0
|
retry_jitter_factor
|
float
|
The jitter fraction applied to retry delays. |
0.1
|
retry_unsafe_http_methods
|
bool
|
Whether unsafe HTTP methods may be retried. |
False
|
transport
|
Optional[AsyncHttpTransport]
|
Optional Azure Core async HTTP transport closed by the client through its asynchronous lifecycle. |
None
|
**kwargs
|
Any
|
Optional Azure Core pipeline policy settings. |
{}
|
Methods:
get_file_metadata
async
get_file_metadata(id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Get file metadata using id
Retrieves file metadata from Google Drive using id
Swagger operation ID: GetFileMetadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Specify the file. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
update_file
async
update_file(input: bytes, id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Update file
Updates a file in Google Drive
Swagger operation ID: UpdateFile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
bytes
|
The binary request body. |
required |
id
|
str
|
Specify the file to update. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
delete_file
async
delete_file(id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> None
Delete file
Deletes a file from Google Drive
Swagger operation ID: DeleteFile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Specify the file to delete. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The operation completes without a response body. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
get_file_metadata_by_path
async
get_file_metadata_by_path(path: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Get file metadata using path
Retrieves file metadata from Google Drive using path
Swagger operation ID: GetFileMetadataByPath.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path of the file in Google Drive. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
get_file_content_by_path
async
get_file_content_by_path(path: str, *, infer_content_type: Optional[bool] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> bytes
Get file content using path
Retrieves file content from Google Drive using path
Swagger operation ID: GetFileContentByPath.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path of the file in Google Drive. |
required |
infer_content_type
|
Optional[bool]
|
Infer content-type based on extension. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
get_file_content
async
get_file_content(id: str, *, infer_content_type: Optional[bool] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> bytes
Get file content using id
Retrieves file content from Google Drive using id
Swagger operation ID: GetFileContent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Unique identifier of the file to retrieve in Google Drive. |
required |
infer_content_type
|
Optional[bool]
|
Infer content-type based on extension. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
copy_file
async
copy_file(source: str, destination: str, *, overwrite: Optional[bool] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Copy file
Copies a file on Google Drive
Swagger operation ID: CopyFile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Url to source file. |
required |
destination
|
str
|
Destination file path in Google Drive, including target filename. |
required |
overwrite
|
Optional[bool]
|
Overwrites the destination file if set to 'true'. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_folder
list_folder(id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
List files in folder
List files in a Google Drive folder
Returns a single-page Azure Core async collection.
Swagger operation ID: ListFolder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Specify the folder in Google Drive. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_root_folder
list_root_folder(*, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
List files in root folder
Lists files in the Google Drive root folder
Returns a single-page Azure Core async collection.
Swagger operation ID: ListRootFolder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
create_file
async
create_file(input: bytes, folder_id: str, name: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Create file
Uploads a file to a Google Drive folder selected by its identifier
Swagger operation ID: CreateFileV2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
bytes
|
The binary request body. |
required |
folder_id
|
str
|
Folder to upload the file to Google Drive. |
required |
name
|
str
|
Name of the file to create in Google Drive. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
extract_folder
async
extract_folder(source: str, destination: str, *, overwrite: Optional[bool] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Extract archive to folder
Extracts an archive file into a folder in Google Drive (example: .zip)
Swagger operation ID: ExtractFolderV2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Path to the archive file. |
required |
destination
|
str
|
Path in Google Drive to extract the archive contents. |
required |
overwrite
|
Optional[bool]
|
Overwrites the destination files if set to 'true'. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |