Skip to content

OnedriveforbusinessClient

Attributes

TRIGGER_OPERATIONS module-attribute

TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnNewFileV2': {'operation_id': 'OnNewFileV2', 'path': '/{connectionId}/datasets/default/triggers/onnewfilev2', 'method': 'get', 'required_parameters': ['folderId'], 'callback_payload_type': None}, 'OnNewFilesV2': {'operation_id': 'OnNewFilesV2', 'path': '/{connectionId}/datasets/default/triggers/batch/onnewfilesv2', 'method': 'get', 'required_parameters': ['folderId'], 'callback_payload_type': 'BlobMetadata'}, 'OnUpdatedFileV2': {'operation_id': 'OnUpdatedFileV2', 'path': '/{connectionId}/datasets/default/triggers/onupdatedfilev2', 'method': 'get', 'required_parameters': ['folderId'], 'callback_payload_type': None}, 'OnUpdatedFilesV2': {'operation_id': 'OnUpdatedFilesV2', 'path': '/{connectionId}/datasets/default/triggers/batch/onupdatedfilesv2', 'method': 'get', 'required_parameters': ['folderId'], 'callback_payload_type': 'BlobMetadata'}}

Classes

BlobMetadata dataclass

BlobMetadata(*, id: Optional[str] = None, name: Optional[str] = None, name_no_ext: Optional[str] = None, display_name: Optional[str] = None, 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

Attributes

id class-attribute instance-attribute
id: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Id'})

The unique identifier of the file or folder.

name class-attribute instance-attribute
name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Name'})

The name of the file or folder.

name_no_ext class-attribute instance-attribute
name_no_ext: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'NameNoExt'})

The name of the file or folder, without the file extension.

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
path: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Path'})

The path 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
size: Optional[int] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Size'})

The file or folder size in bytes.

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
e_tag: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'ETag'})

The etag of the file or folder.

file_locator class-attribute instance-attribute
file_locator: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'FileLocator'})

The file locator of the file or folder.

last_modified_by class-attribute instance-attribute
last_modified_by: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'LastModifiedBy'})

The user who last modified the file or folder.

Thumbnail dataclass

Thumbnail(*, url: Optional[str] = None, width: Optional[int] = None, height: Optional[int] = None)

Response for Get file thumbnail

Attributes

url class-attribute instance-attribute
url: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Url'})

A URL that points to the thumbnail.

width class-attribute instance-attribute
width: Optional[int] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Width'})

The thumbnail width in pixels.

height class-attribute instance-attribute
height: Optional[int] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Height'})

The thumbnail height in pixels.

SharingLink(*, web_url: Optional[str] = None)

Response for Create share link

web_url class-attribute instance-attribute
web_url: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'WebUrl'})

A URL that points to the file or folder.

BlobMetadataPage dataclass

BlobMetadataPage(*, value: Optional[List[BlobMetadata | Mapping[str, Any]]] = None, next_link: Optional[str] = None)

Response for List files in folder

Attributes

value class-attribute instance-attribute
value: Optional[List[BlobMetadata | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)

Blob metadata collection.

next_link: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'nextLink'})

A URL which can be used to retrieve the next page.

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
source: Optional[str] = dataclass_field(default=None, kw_only=True)

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

table_display_name class-attribute instance-attribute
table_display_name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'tableDisplayName'})

Table display name

table_plural_name class-attribute instance-attribute
table_plural_name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'tablePluralName'})

Table plural display name

BlobDataSetsMetadata dataclass

BlobDataSetsMetadata(*, source: Optional[str] = None, display_name: Optional[str] = None, url_encoding: Optional[str] = None)

Definition: BlobDataSetsMetadata

Attributes

source class-attribute instance-attribute
source: Optional[str] = dataclass_field(default=None, kw_only=True)

Blob dataset source

display_name class-attribute instance-attribute
display_name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'displayName'})

Blob dataset display name

url_encoding class-attribute instance-attribute
url_encoding: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'urlEncoding'})

Blob dataset url encoding

Tags dataclass

Tags(*, tags: Optional[List[str]] = None)

Definition: Tags

Attributes

tags class-attribute instance-attribute
tags: Optional[List[str]] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'Tags'})

A list of tags.

ForASelectedFileResponse dataclass

ForASelectedFileResponse(*, file_path: Optional[str] = None, file_url: Optional[str] = None)

Definition: ForASelectedFileResponse

Attributes

file_path class-attribute instance-attribute
file_path: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'filePath'})

The unique path of the file.

file_url class-attribute instance-attribute
file_url: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'fileUrl'})

The URL to the source file.

OnedriveforbusinessClient

OnedriveforbusinessClient(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 onedriveforbusiness connector.

Initialize a OnedriveforbusinessClient.

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

This operation gets the metadata for a file.

Swagger operation ID: GetFileMetadata.

Parameters:

Name Type Description Default
id str

The unique identifier of 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

This operation updates a file.

Swagger operation ID: UpdateFile.

Parameters:

Name Type Description Default
input bytes

The binary request body.

required
id str

The unique identifier of 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.

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

This operation deletes a file.

Swagger operation ID: DeleteFile.

Parameters:

Name Type Description Default
id str

The unique identifier of 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:

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

This operation gets the metadata of a file using the path.

Swagger operation ID: GetFileMetadataByPath.

Parameters:

Name Type Description Default
path str

The unique path of 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.

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

This operation gets the content of a file using the path.

Swagger operation ID: GetFileContentByPath.

Parameters:

Name Type Description Default
path str

The unique path of the file.

required
infer_content_type Optional[bool]

A boolean value (true, false) to 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

This operation gets the content of a file.

Swagger operation ID: GetFileContent.

Parameters:

Name Type Description Default
id str

The unique identifier of the file.

required
infer_content_type Optional[bool]

A boolean value (true, false) to 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.

create_file async
create_file(input: bytes, folder_path: 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

This operation creates a file.

Swagger operation ID: CreateFile.

Parameters:

Name Type Description Default
input bytes

The binary request body.

required
folder_path str

The unique path of the folder.

required
name str

The name of the file. Certain characters are disallowed by OneDrive and will be replaced by underscores.

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.

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

Upload file from URL

This operation uploads a file from a URL to OneDrive.

Swagger operation ID: CopyFile.

Parameters:

Name Type Description Default
source str

The url to the source file.

required
destination str

The destination file path, 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.

copy_drive_file async
copy_drive_file(id: 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

This operation copies a file within OneDrive.

Swagger operation ID: CopyDriveFile.

Parameters:

Name Type Description Default
id str

The unique identifier of the file.

required
destination str

The destination file path, 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.

copy_drive_file_by_path async
copy_drive_file_by_path(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 using path

This operation copies a file within OneDrive by path.

Swagger operation ID: CopyDriveFileByPath.

Parameters:

Name Type Description Default
source str

The unique path of the file.

required
destination str

The destination file path, 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.

move_file async
move_file(id: 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

Move or rename a file

This operation moves or renames a file.

Swagger operation ID: MoveFile.

Parameters:

Name Type Description Default
id str

The unique identifier of the file.

required
destination str

The destination file path, 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.

move_file_by_path async
move_file_by_path(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

Move or rename a file using path

This operation moves or renames a file using the path.

Swagger operation ID: MoveFileByPath.

Parameters:

Name Type Description Default
source str

The unique path of the file.

required
destination str

The destination file path, 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.

convert_file async
convert_file(id: str, *, type_: Optional[str] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> bytes

Convert file

This operation converts a file to another format. The list of supported conversions can be found at https://aka.ms/onedriveconversions

Swagger operation ID: ConvertFile.

Parameters:

Name Type Description Default
id str

The unique identifier of the file.

required
type_ Optional[str]

The target file type.

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.

convert_file_by_path async
convert_file_by_path(path: str, *, type_: Optional[str] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> bytes

Convert file using path

This operation converts a file to another format using the path. The list of supported conversions can be found at https://aka.ms/onedriveconversions

Swagger operation ID: ConvertFileByPath.

Parameters:

Name Type Description Default
path str

The unique path of the file.

required
type_ Optional[str]

The target file type.

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_thumbnail async
get_file_thumbnail(id: str, size: 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 thumbnail

This operation gets the thumbnail of a file. The thumbnail will only be valid for 6 hours.

Swagger operation ID: GetFileThumbnail.

Parameters:

Name Type Description Default
id str

The unique identifier of the file.

required
size str

The size of the thumbnail to retrieve.

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.

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

This operation gets the list of files and subfolders in the 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 async for.

Raises:

Type Description
ConnectorException

If the connector request fails.

list_find_files
list_find_files(id: str, query: str, find_mode: str, *, max_file_count: Optional[int] = None, 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]]

Find files in folder

This operation finds files within a folder using search or name pattern match.

Returns a single-page Azure Core async collection.

Swagger operation ID: FindFiles.

Parameters:

Name Type Description Default
id str

The unique identifier of the folder.

required
query str

The search query to use.

required
find_mode str

The search method to use. "Search" mode searches your OneDrive using the search query (similar a normal search engine). When "Regular Expression Pattern Match" mode is selected, the search query will be treated as a regex pattern, and it will return files with names that match the query.

required
max_file_count Optional[int]

Maximum number of files to return (1-100).

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
AsyncItemPaged[dict[str, Any]]

AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector results. Consume it with async for.

Raises:

Type Description
ConnectorException

If the connector request fails.

list_find_files_by_path
list_find_files_by_path(query: str, path: str, find_mode: str, *, max_file_count: Optional[int] = None, 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]]

Find files in folder by path

This operation finds files within a folder by path using search or name pattern match.

Returns a single-page Azure Core async collection.

Swagger operation ID: FindFilesByPath.

Parameters:

Name Type Description Default
query str

The search query to use.

required
path str

The unique path of the folder.

required
find_mode str

The search method to use. "Search" mode searches your OneDrive using the search query (similar a normal search engine). When "Regular Expression Pattern Match" mode is selected, the search query will be treated as a regex pattern, and it will return files with names that match the query.

required
max_file_count Optional[int]

Maximum number of files to return (1-100).

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
AsyncItemPaged[dict[str, Any]]

AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector results. Consume it with async for.

Raises:

Type Description
ConnectorException

If the connector request fails.

create_share_link(id: str, type_: str, *, scope: Optional[str] = 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

Create share link

This operation creates a share link for a file.

Swagger operation ID: CreateShareLinkV2.

Parameters:

Name Type Description Default
id str

The unique identifier of the file.

required
type_ str

The type of link.

required
scope Optional[str]

The scope of the link.

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.

create_share_link_by_path(path: str, type_: str, *, scope: Optional[str] = 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

Create share link by path

This operation creates a share link for a file using the path.

Swagger operation ID: CreateShareLinkByPathV2.

Parameters:

Name Type Description Default
path str

The unique path of the file.

required
type_ str

The type of link.

required
scope Optional[str]

The scope of the link.

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.

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

This operation extracts an archive file into a folder (example: .zip). Maximum archive size is 50 MB and 100 files inside.

Swagger operation ID: ExtractFolderV2.

Parameters:

Name Type Description Default
source str

The path to the archive file.

required
destination str

The path 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.

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

This operation gets the list of files and subfolders in a folder.

Returns an Azure Core async pager that follows the connector continuation URL.

Swagger operation ID: ListFolderV2.

Parameters:

Name Type Description Default
id str

The unique identifier of the folder.

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 async for.

Raises:

Type Description
ConnectorException

If the connector request fails.