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
The unique identifier of the file or folder.
name
class-attribute
instance-attribute
The name of the file or folder.
name_no_ext
class-attribute
instance-attribute
The name of the file or folder, without the file extension.
display_name
class-attribute
instance-attribute
The display name of the file or folder.
path
class-attribute
instance-attribute
The path of the file or folder.
last_modified
class-attribute
instance-attribute
The date and time the file or folder was last modified.
size
class-attribute
instance-attribute
The file or folder size in bytes.
media_type
class-attribute
instance-attribute
The media type of the file or folder.
is_folder
class-attribute
instance-attribute
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.
file_locator
class-attribute
instance-attribute
The file locator of the file or folder.
Thumbnail
dataclass
Response for Get file thumbnail
Attributes
url
class-attribute
instance-attribute
A URL that points to the thumbnail.
width
class-attribute
instance-attribute
The thumbnail width in pixels.
SharingLink
dataclass
BlobMetadataPage
dataclass
Response for List files in folder
DataSetsMetadata
dataclass
DataSetsMetadata(tabular: Optional[TabularDataSetsMetadata] = None, blob: Optional[BlobDataSetsMetadata] = 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
display_name
class-attribute
instance-attribute
Dataset display name
url_encoding
class-attribute
instance-attribute
Dataset url encoding
table_display_name
class-attribute
instance-attribute
Table display name
BlobDataSetsMetadata
dataclass
BlobDataSetsMetadata(source: Optional[str] = None, display_name: Optional[str] = None, url_encoding: Optional[str] = None)
Definition: BlobDataSetsMetadata
Attributes
display_name
class-attribute
instance-attribute
Blob dataset display name
Tags
dataclass
ForASelectedFileResponse
dataclass
Definition: ForASelectedFileResponse
Attributes
file_path
class-attribute
instance-attribute
The unique path of the file.
OnedriveforbusinessClient
OnedriveforbusinessClient(connection_runtime_url: str, token_provider: Optional[TokenProvider] = None, options: Optional[ConnectorClientOptions] = None)
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 |
token_provider
|
Optional[TokenProvider]
|
Optional token provider. Defaults to ManagedIdentityTokenProvider. |
None
|
options
|
Optional[ConnectorClientOptions]
|
Optional connector client options. |
None
|
Methods:
get_file_metadata_async
async
Get file metadata
This operation gets the metadata for a file.
update_file_async
async
Update file
This operation updates a file.
delete_file_async
async
Delete file
This operation deletes a file.
get_file_metadata_by_path_async
async
Get file metadata using path
This operation gets the metadata of a file using the path.
get_file_content_by_path_async
async
Get file content using path
This operation gets the content of a file using the path.
get_file_content_async
async
Get file content
This operation gets the content of a file.
create_file_async
async
Create file
This operation creates a file.
copy_file_async
async
copy_file_async(source: str, destination: str, overwrite: Optional[bool] = None) -> dict[str, Any] | None
Upload file from URL
This operation uploads a file from a URL to OneDrive.
copy_drive_file_async
async
copy_drive_file_async(id: str, destination: str, overwrite: Optional[bool] = None) -> dict[str, Any] | None
Copy file
This operation copies a file within OneDrive.
copy_drive_file_by_path_async
async
copy_drive_file_by_path_async(source: str, destination: str, overwrite: Optional[bool] = None) -> dict[str, Any] | None
Copy file using path
This operation copies a file within OneDrive by path.
move_file_async
async
move_file_async(id: str, destination: str, overwrite: Optional[bool] = None) -> dict[str, Any] | None
Move or rename a file
This operation moves or renames a file.
move_file_by_path_async
async
move_file_by_path_async(source: str, destination: str, overwrite: Optional[bool] = None) -> dict[str, Any] | None
Move or rename a file using path
This operation moves or renames a file using the path.
convert_file_async
async
Convert file
This operation converts a file to another format. The list of supported conversions can be found at https://aka.ms/onedriveconversions
convert_file_by_path_async
async
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
get_file_thumbnail_async
async
Get file thumbnail
This operation gets the thumbnail of a file. The thumbnail will only be valid for 6 hours.
list_root_folder_async
async
List files in root folder
This operation gets the list of files and subfolders in the root folder.
find_files_async
async
find_files_async(id: str, query: str, find_mode: str, max_file_count: Optional[int] = None) -> dict[str, Any] | None
Find files in folder
This operation finds files within a folder using search or name pattern match.
find_files_by_path_async
async
find_files_by_path_async(query: str, path: str, find_mode: str, max_file_count: Optional[int] = None) -> dict[str, Any] | None
Find files in folder by path
This operation finds files within a folder by path using search or name pattern match.
create_share_link_async
async
Create share link
This operation creates a share link for a file.
create_share_link_by_path_async
async
create_share_link_by_path_async(path: str, type_: str, scope: Optional[str] = None) -> dict[str, Any] | None
Create share link by path
This operation creates a share link for a file using the path.