WordOnlineBusinessClient
Attributes
Classes
CreateFileItemInput
dataclass
GetSourcesResponse
dataclass
Response for Get sources
GetDrivesResponse
dataclass
Response for Get drives
GetFileSchemaResponse
dataclass
BlobMetadata
dataclass
BlobMetadata(*, id: Optional[str] = None, name: Optional[str] = None, display_name: Optional[str] = None, path: Optional[str] = None, media_type: Optional[str] = None, is_folder: Optional[bool] = None, file_locator: Optional[str] = None)
Definition: BlobMetadata
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.
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.
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.
ContentBody
dataclass
WordOnlineBusinessClient
WordOnlineBusinessClient(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 wordonlinebusiness connector.
Initialize a WordOnlineBusinessClient.
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:
create_file_item
async
create_file_item(input: CreateFileItemInput | Mapping[str, Any], source: str, drive: str, file: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> bytes
Populate a Microsoft Word template
Reads a Microsoft Word template to then fill the template fields with selected dynamic values to generate a Word Document.
Swagger operation ID: CreateFileItem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreateFileItemInput | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
source
|
str
|
Select from the drop-down or specify one of the following: - "me" - "SharePoint Site URL" - "users/someone's UPN" - "groups/group Id" - "sites/SharePoint Site URL:/teams/team name:" (colons are required). |
required |
drive
|
str
|
Select a document library from the drop-down. |
required |
file
|
str
|
Select a Word file through File Browse. |
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 |
|---|---|---|
bytes |
bytes
|
The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
create_word_file_with_content
async
create_word_file_with_content(input: ContentBody | Mapping[str, Any], *, file_name: 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 a Microsoft Word document with the given content
Creates or replaces a Microsoft Word document in the root folder of the connected user's OneDrive and returns a URL to the document. Use a unique file name because an existing file with the same name is replaced when this action runs. Accessing the returned URL may require signing in with an account that has permission to the file; do not rely on anonymous access.
Swagger operation ID: CreateWordFileWithContent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
ContentBody | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
file_name
|
Optional[str]
|
Unique name of the generated document without the .docx extension. The connector writes the document to the connected user's OneDrive root when this action runs; using an existing name replaces that file. |
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. |
get_file_pdf
async
get_file_pdf(source: str, drive: str, file: str, *, extract_sensitivity_label: Optional[bool] = None, fetch_sensitivity_label_metadata: 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
Convert Word Document to PDF
Gets a PDF version of the selected file
Swagger operation ID: GetFilePDF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Select from the drop-down or specify one of the following: - "me" - "SharePoint Site URL" - "users/someone's UPN" - "groups/group Id" - "sites/SharePoint Site URL:/teams/team name:" (colons are required). |
required |
drive
|
str
|
Select a document library from the drop-down. |
required |
file
|
str
|
Select a Word file through File Browse. |
required |
extract_sensitivity_label
|
Optional[bool]
|
Select if you want to extract Sensitivity label ( false, true). |
None
|
fetch_sensitivity_label_metadata
|
Optional[bool]
|
A boolean whether to fetch sensitivity label Metadata for associated LabelId. |
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. |
list_sources
list_sources(*, 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]]
Get sources
Get a list of sources.
Returns a single-page Azure Core async collection.
Swagger operation ID: GetSources.
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. |
list_drives
list_drives(*, 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]]
Get drives
Get a list of drives.
Returns a single-page Azure Core async collection.
Swagger operation ID: GetDrives.
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. |
get_file_schema
async
get_file_schema(source: str, drive: str, file: 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
Fetches the schema of the selected file
Fetches the schema of the selected file.
Swagger operation ID: GetFileSchema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
source. |
required |
drive
|
str
|
drive. |
required |
file
|
str
|
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. |