WordpressClient
Attributes
TRIGGER_OPERATIONS
module-attribute
TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnTriggerNewPost': {'operation_id': 'OnTriggerNewPost', 'path': '/{connectionId}/trigger/me/posts', 'method': 'get', 'required_parameters': [], 'callback_payload_type': 'ListPostsResponse'}}
Classes
ListPostsResponse
dataclass
SiteStatsModel
dataclass
SiteStatsModel(*, visitors_today: Optional[int] = None, visitors_yesterday: Optional[int] = None, visitors: Optional[int] = None, views_today: Optional[int] = None, views_yesterday: Optional[int] = None, views_best_day: Optional[str] = None, views_best_day_total: Optional[int] = None, views: Optional[int] = None, comments: Optional[int] = None, posts: Optional[int] = None, followers_blog: Optional[int] = None, followers_comments: Optional[int] = None, comments_per_month: Optional[int] = None, comments_most_active_recent_day: Optional[str] = None, comments_most_active_time: Optional[str] = None, comments_spam: Optional[int] = None, categories: Optional[int] = None, tags: Optional[int] = None, shares: Optional[int] = None, shares_twitter: Optional[int] = None, shares_facebook: Optional[int] = None, shares_press_this: Optional[int] = None)
Response for Get site statistics
PostModel
dataclass
PostModel(*, id: Optional[int] = None, site_id: Optional[int] = None, date: Optional[str] = None, modified: Optional[str] = None, title: Optional[str] = None, u_r_l: Optional[str] = None, short_u_r_l: Optional[str] = None, content: Optional[str] = None, excerpt: Optional[str] = None, slug: Optional[str] = None, guid: Optional[str] = None, status: Optional[str] = None, sticky: Optional[bool] = None, password: Optional[str] = None, parent: Optional[Any] = None, type_: Optional[str] = None, likes_enabled: Optional[bool] = None, sharing_enabled: Optional[bool] = None, like_count: Optional[int] = None, i_like: Optional[bool] = None, is_reblogged: Optional[bool] = None, is_following: Optional[bool] = None, global_id: Optional[str] = None, featured_image: Optional[str] = None, post_thumbnail: Optional[Dict[str, Any]] = None, format: Optional[str] = None, geo: Optional[bool] = None)
Response for Get post
SiteList
dataclass
Site
dataclass
Site(*, id: Optional[int] = None, name: Optional[str] = None, description: Optional[str] = None, u_r_l: Optional[str] = None, is_multisite: Optional[bool] = None, post_count: Optional[int] = None, subscribers_count: Optional[int] = None, lang: Optional[str] = None, visible: Optional[bool] = None, is_private: Optional[bool] = None, single_user_site: Optional[bool] = None, is_vip: Optional[bool] = None, is_following: Optional[bool] = None)
Definition: Site
Attributes
id
class-attribute
instance-attribute
Site ID
name
class-attribute
instance-attribute
Site Name
description
class-attribute
instance-attribute
Site Description
u_r_l
class-attribute
instance-attribute
Site URL
is_multisite
class-attribute
instance-attribute
Whether the site is a Multisite site or not. Always true for WP.com sites.
post_count
class-attribute
instance-attribute
The number of posts the site has
subscribers_count
class-attribute
instance-attribute
The number of subscribers the site has
lang
class-attribute
instance-attribute
Language
visible
class-attribute
instance-attribute
Site visibility
is_private
class-attribute
instance-attribute
Is site private
single_user_site
class-attribute
instance-attribute
Is single user site
is_vip
class-attribute
instance-attribute
Is VIP
SiteInsightsModel
dataclass
SiteInsightsModel(*, highest_hour: Optional[int] = None, highest_hour_percent: Optional[float] = None, highest_day_of_week: Optional[int] = None, highest_day_percent: Optional[float] = None)
Definition: SiteInsightsModel
PostResponse
dataclass
PostResponse(*, id: Optional[int] = None, comment_count: Optional[int] = None, site_id: Optional[int] = None, date: Optional[str] = None, modified: Optional[str] = None, title: Optional[str] = None, u_r_l: Optional[str] = None, slug: Optional[str] = None, guid: Optional[str] = None, type_: Optional[str] = None, like_count: Optional[int] = None)
Definition: PostResponse
CreatePostModel
dataclass
CreatePostModel(*, title: Optional[str] = None, content: Optional[str] = None, status: Optional[str] = None, tags: Optional[str] = None)
Definition: CreatePostModel
Attributes
title
class-attribute
instance-attribute
The title of the post
content
class-attribute
instance-attribute
The content of the post
status
class-attribute
instance-attribute
The status of the post
Error
dataclass
Definition: Error
WordpressClient
WordpressClient(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 wordpress connector.
Initialize a WordpressClient.
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:
site_stats
async
site_stats(site_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 site statistics
Get statistics for a specified site
Swagger operation ID: SiteStats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_id
|
str
|
The site's id or domain. |
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
async
get(site_id: str, post_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 post
Get post
Swagger operation ID: GetPost.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_id
|
str
|
The site's id or domain. |
required |
post_id
|
str
|
The post Id. |
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. |
create
async
create(input: CreatePostModel | Mapping[str, Any], site_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
Create post
Create post
Swagger operation ID: CreatePost.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreatePostModel | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
site_id
|
str
|
The site's id or domain. |
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_sites
list_sites(*, 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 sites
List sites
Returns a single-page Azure Core async collection.
Swagger operation ID: ListSites.
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. |