- Удалена директория scripts/ - Убран gen-docs из pyproject.toml - Документация генерируется только через pre-commit hook
1950 lines
39 KiB
Markdown
1950 lines
39 KiB
Markdown
# Table of Contents
|
|
|
|
* [kwork\_api](#kwork_api)
|
|
* [KworkClient](#kwork_api.KworkClient)
|
|
* [KworkError](#kwork_api.KworkError)
|
|
* [KworkAuthError](#kwork_api.KworkAuthError)
|
|
* [KworkApiError](#kwork_api.KworkApiError)
|
|
* [\_\_version\_\_](#kwork_api.__version__)
|
|
* [\_\_all\_\_](#kwork_api.__all__)
|
|
* [kwork\_api.client](#kwork_api.client)
|
|
* [logging](#kwork_api.client.logging)
|
|
* [Any](#kwork_api.client.Any)
|
|
* [Optional](#kwork_api.client.Optional)
|
|
* [httpx](#kwork_api.client.httpx)
|
|
* [HttpUrl](#kwork_api.client.HttpUrl)
|
|
* [KworkApiError](#kwork_api.client.KworkApiError)
|
|
* [KworkAuthError](#kwork_api.client.KworkAuthError)
|
|
* [KworkError](#kwork_api.client.KworkError)
|
|
* [KworkNetworkError](#kwork_api.client.KworkNetworkError)
|
|
* [KworkNotFoundError](#kwork_api.client.KworkNotFoundError)
|
|
* [KworkRateLimitError](#kwork_api.client.KworkRateLimitError)
|
|
* [KworkValidationError](#kwork_api.client.KworkValidationError)
|
|
* [APIErrorResponse](#kwork_api.client.APIErrorResponse)
|
|
* [AuthResponse](#kwork_api.client.AuthResponse)
|
|
* [Badge](#kwork_api.client.Badge)
|
|
* [CatalogResponse](#kwork_api.client.CatalogResponse)
|
|
* [City](#kwork_api.client.City)
|
|
* [Country](#kwork_api.client.Country)
|
|
* [DataResponse](#kwork_api.client.DataResponse)
|
|
* [Dialog](#kwork_api.client.Dialog)
|
|
* [Feature](#kwork_api.client.Feature)
|
|
* [Kwork](#kwork_api.client.Kwork)
|
|
* [KworkDetails](#kwork_api.client.KworkDetails)
|
|
* [NotificationsResponse](#kwork_api.client.NotificationsResponse)
|
|
* [Project](#kwork_api.client.Project)
|
|
* [ProjectsResponse](#kwork_api.client.ProjectsResponse)
|
|
* [Review](#kwork_api.client.Review)
|
|
* [ReviewsResponse](#kwork_api.client.ReviewsResponse)
|
|
* [TimeZone](#kwork_api.client.TimeZone)
|
|
* [logger](#kwork_api.client.logger)
|
|
* [KworkClient](#kwork_api.client.KworkClient)
|
|
* [BASE\_URL](#kwork_api.client.KworkClient.BASE_URL)
|
|
* [LOGIN\_URL](#kwork_api.client.KworkClient.LOGIN_URL)
|
|
* [TOKEN\_URL](#kwork_api.client.KworkClient.TOKEN_URL)
|
|
* [\_\_init\_\_](#kwork_api.client.KworkClient.__init__)
|
|
* [login](#kwork_api.client.KworkClient.login)
|
|
* [close](#kwork_api.client.KworkClient.close)
|
|
* [\_\_aenter\_\_](#kwork_api.client.KworkClient.__aenter__)
|
|
* [\_\_aexit\_\_](#kwork_api.client.KworkClient.__aexit__)
|
|
* [CatalogAPI](#kwork_api.client.KworkClient.CatalogAPI)
|
|
* [ProjectsAPI](#kwork_api.client.KworkClient.ProjectsAPI)
|
|
* [UserAPI](#kwork_api.client.KworkClient.UserAPI)
|
|
* [ReferenceAPI](#kwork_api.client.KworkClient.ReferenceAPI)
|
|
* [NotificationsAPI](#kwork_api.client.KworkClient.NotificationsAPI)
|
|
* [OtherAPI](#kwork_api.client.KworkClient.OtherAPI)
|
|
* [catalog](#kwork_api.client.KworkClient.catalog)
|
|
* [projects](#kwork_api.client.KworkClient.projects)
|
|
* [user](#kwork_api.client.KworkClient.user)
|
|
* [reference](#kwork_api.client.KworkClient.reference)
|
|
* [notifications](#kwork_api.client.KworkClient.notifications)
|
|
* [other](#kwork_api.client.KworkClient.other)
|
|
* [kwork\_api.models](#kwork_api.models)
|
|
* [datetime](#kwork_api.models.datetime)
|
|
* [Any](#kwork_api.models.Any)
|
|
* [Optional](#kwork_api.models.Optional)
|
|
* [BaseModel](#kwork_api.models.BaseModel)
|
|
* [Field](#kwork_api.models.Field)
|
|
* [KworkUser](#kwork_api.models.KworkUser)
|
|
* [id](#kwork_api.models.KworkUser.id)
|
|
* [username](#kwork_api.models.KworkUser.username)
|
|
* [avatar\_url](#kwork_api.models.KworkUser.avatar_url)
|
|
* [is\_online](#kwork_api.models.KworkUser.is_online)
|
|
* [rating](#kwork_api.models.KworkUser.rating)
|
|
* [KworkCategory](#kwork_api.models.KworkCategory)
|
|
* [id](#kwork_api.models.KworkCategory.id)
|
|
* [name](#kwork_api.models.KworkCategory.name)
|
|
* [slug](#kwork_api.models.KworkCategory.slug)
|
|
* [parent\_id](#kwork_api.models.KworkCategory.parent_id)
|
|
* [Kwork](#kwork_api.models.Kwork)
|
|
* [id](#kwork_api.models.Kwork.id)
|
|
* [title](#kwork_api.models.Kwork.title)
|
|
* [description](#kwork_api.models.Kwork.description)
|
|
* [price](#kwork_api.models.Kwork.price)
|
|
* [currency](#kwork_api.models.Kwork.currency)
|
|
* [category\_id](#kwork_api.models.Kwork.category_id)
|
|
* [seller](#kwork_api.models.Kwork.seller)
|
|
* [images](#kwork_api.models.Kwork.images)
|
|
* [rating](#kwork_api.models.Kwork.rating)
|
|
* [reviews\_count](#kwork_api.models.Kwork.reviews_count)
|
|
* [created\_at](#kwork_api.models.Kwork.created_at)
|
|
* [updated\_at](#kwork_api.models.Kwork.updated_at)
|
|
* [KworkDetails](#kwork_api.models.KworkDetails)
|
|
* [full\_description](#kwork_api.models.KworkDetails.full_description)
|
|
* [requirements](#kwork_api.models.KworkDetails.requirements)
|
|
* [delivery\_time](#kwork_api.models.KworkDetails.delivery_time)
|
|
* [revisions](#kwork_api.models.KworkDetails.revisions)
|
|
* [features](#kwork_api.models.KworkDetails.features)
|
|
* [faq](#kwork_api.models.KworkDetails.faq)
|
|
* [PaginationInfo](#kwork_api.models.PaginationInfo)
|
|
* [current\_page](#kwork_api.models.PaginationInfo.current_page)
|
|
* [total\_pages](#kwork_api.models.PaginationInfo.total_pages)
|
|
* [total\_items](#kwork_api.models.PaginationInfo.total_items)
|
|
* [items\_per\_page](#kwork_api.models.PaginationInfo.items_per_page)
|
|
* [has\_next](#kwork_api.models.PaginationInfo.has_next)
|
|
* [has\_prev](#kwork_api.models.PaginationInfo.has_prev)
|
|
* [CatalogResponse](#kwork_api.models.CatalogResponse)
|
|
* [kworks](#kwork_api.models.CatalogResponse.kworks)
|
|
* [pagination](#kwork_api.models.CatalogResponse.pagination)
|
|
* [filters](#kwork_api.models.CatalogResponse.filters)
|
|
* [sort\_options](#kwork_api.models.CatalogResponse.sort_options)
|
|
* [Project](#kwork_api.models.Project)
|
|
* [id](#kwork_api.models.Project.id)
|
|
* [title](#kwork_api.models.Project.title)
|
|
* [description](#kwork_api.models.Project.description)
|
|
* [budget](#kwork_api.models.Project.budget)
|
|
* [budget\_type](#kwork_api.models.Project.budget_type)
|
|
* [category\_id](#kwork_api.models.Project.category_id)
|
|
* [customer](#kwork_api.models.Project.customer)
|
|
* [status](#kwork_api.models.Project.status)
|
|
* [created\_at](#kwork_api.models.Project.created_at)
|
|
* [updated\_at](#kwork_api.models.Project.updated_at)
|
|
* [bids\_count](#kwork_api.models.Project.bids_count)
|
|
* [skills](#kwork_api.models.Project.skills)
|
|
* [ProjectsResponse](#kwork_api.models.ProjectsResponse)
|
|
* [projects](#kwork_api.models.ProjectsResponse.projects)
|
|
* [pagination](#kwork_api.models.ProjectsResponse.pagination)
|
|
* [Review](#kwork_api.models.Review)
|
|
* [id](#kwork_api.models.Review.id)
|
|
* [rating](#kwork_api.models.Review.rating)
|
|
* [comment](#kwork_api.models.Review.comment)
|
|
* [author](#kwork_api.models.Review.author)
|
|
* [kwork\_id](#kwork_api.models.Review.kwork_id)
|
|
* [created\_at](#kwork_api.models.Review.created_at)
|
|
* [ReviewsResponse](#kwork_api.models.ReviewsResponse)
|
|
* [reviews](#kwork_api.models.ReviewsResponse.reviews)
|
|
* [pagination](#kwork_api.models.ReviewsResponse.pagination)
|
|
* [average\_rating](#kwork_api.models.ReviewsResponse.average_rating)
|
|
* [Notification](#kwork_api.models.Notification)
|
|
* [id](#kwork_api.models.Notification.id)
|
|
* [type](#kwork_api.models.Notification.type)
|
|
* [title](#kwork_api.models.Notification.title)
|
|
* [message](#kwork_api.models.Notification.message)
|
|
* [is\_read](#kwork_api.models.Notification.is_read)
|
|
* [created\_at](#kwork_api.models.Notification.created_at)
|
|
* [link](#kwork_api.models.Notification.link)
|
|
* [NotificationsResponse](#kwork_api.models.NotificationsResponse)
|
|
* [notifications](#kwork_api.models.NotificationsResponse.notifications)
|
|
* [unread\_count](#kwork_api.models.NotificationsResponse.unread_count)
|
|
* [Dialog](#kwork_api.models.Dialog)
|
|
* [id](#kwork_api.models.Dialog.id)
|
|
* [participant](#kwork_api.models.Dialog.participant)
|
|
* [last\_message](#kwork_api.models.Dialog.last_message)
|
|
* [unread\_count](#kwork_api.models.Dialog.unread_count)
|
|
* [updated\_at](#kwork_api.models.Dialog.updated_at)
|
|
* [AuthResponse](#kwork_api.models.AuthResponse)
|
|
* [success](#kwork_api.models.AuthResponse.success)
|
|
* [user\_id](#kwork_api.models.AuthResponse.user_id)
|
|
* [username](#kwork_api.models.AuthResponse.username)
|
|
* [web\_auth\_token](#kwork_api.models.AuthResponse.web_auth_token)
|
|
* [message](#kwork_api.models.AuthResponse.message)
|
|
* [ErrorDetail](#kwork_api.models.ErrorDetail)
|
|
* [code](#kwork_api.models.ErrorDetail.code)
|
|
* [message](#kwork_api.models.ErrorDetail.message)
|
|
* [field](#kwork_api.models.ErrorDetail.field)
|
|
* [APIErrorResponse](#kwork_api.models.APIErrorResponse)
|
|
* [success](#kwork_api.models.APIErrorResponse.success)
|
|
* [errors](#kwork_api.models.APIErrorResponse.errors)
|
|
* [message](#kwork_api.models.APIErrorResponse.message)
|
|
* [City](#kwork_api.models.City)
|
|
* [id](#kwork_api.models.City.id)
|
|
* [name](#kwork_api.models.City.name)
|
|
* [country\_id](#kwork_api.models.City.country_id)
|
|
* [Country](#kwork_api.models.Country)
|
|
* [id](#kwork_api.models.Country.id)
|
|
* [name](#kwork_api.models.Country.name)
|
|
* [code](#kwork_api.models.Country.code)
|
|
* [cities](#kwork_api.models.Country.cities)
|
|
* [TimeZone](#kwork_api.models.TimeZone)
|
|
* [id](#kwork_api.models.TimeZone.id)
|
|
* [name](#kwork_api.models.TimeZone.name)
|
|
* [offset](#kwork_api.models.TimeZone.offset)
|
|
* [Feature](#kwork_api.models.Feature)
|
|
* [id](#kwork_api.models.Feature.id)
|
|
* [name](#kwork_api.models.Feature.name)
|
|
* [description](#kwork_api.models.Feature.description)
|
|
* [price](#kwork_api.models.Feature.price)
|
|
* [type](#kwork_api.models.Feature.type)
|
|
* [Badge](#kwork_api.models.Badge)
|
|
* [id](#kwork_api.models.Badge.id)
|
|
* [name](#kwork_api.models.Badge.name)
|
|
* [description](#kwork_api.models.Badge.description)
|
|
* [icon\_url](#kwork_api.models.Badge.icon_url)
|
|
* [DataResponse](#kwork_api.models.DataResponse)
|
|
* [success](#kwork_api.models.DataResponse.success)
|
|
* [data](#kwork_api.models.DataResponse.data)
|
|
* [message](#kwork_api.models.DataResponse.message)
|
|
* [kwork\_api.errors](#kwork_api.errors)
|
|
* [Any](#kwork_api.errors.Any)
|
|
* [Optional](#kwork_api.errors.Optional)
|
|
* [KworkError](#kwork_api.errors.KworkError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkError.__init__)
|
|
* [\_\_str\_\_](#kwork_api.errors.KworkError.__str__)
|
|
* [KworkAuthError](#kwork_api.errors.KworkAuthError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkAuthError.__init__)
|
|
* [\_\_str\_\_](#kwork_api.errors.KworkAuthError.__str__)
|
|
* [KworkApiError](#kwork_api.errors.KworkApiError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkApiError.__init__)
|
|
* [\_\_str\_\_](#kwork_api.errors.KworkApiError.__str__)
|
|
* [KworkNotFoundError](#kwork_api.errors.KworkNotFoundError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkNotFoundError.__init__)
|
|
* [KworkRateLimitError](#kwork_api.errors.KworkRateLimitError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkRateLimitError.__init__)
|
|
* [KworkValidationError](#kwork_api.errors.KworkValidationError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkValidationError.__init__)
|
|
* [\_\_str\_\_](#kwork_api.errors.KworkValidationError.__str__)
|
|
* [KworkNetworkError](#kwork_api.errors.KworkNetworkError)
|
|
* [\_\_init\_\_](#kwork_api.errors.KworkNetworkError.__init__)
|
|
* [\_\_str\_\_](#kwork_api.errors.KworkNetworkError.__str__)
|
|
|
|
<a id="kwork_api"></a>
|
|
|
|
# Module kwork\_api
|
|
|
|
Kwork.ru API Client
|
|
|
|
Unofficial Python client for Kwork.ru API.
|
|
|
|
**Example**:
|
|
|
|
from kwork_api import KworkClient
|
|
|
|
# Login with credentials
|
|
client = await KworkClient.login("username", "password")
|
|
|
|
# Or restore from token
|
|
client = KworkClient(token="your_web_auth_token")
|
|
|
|
# Get catalog
|
|
catalog = await client.catalog.get_list(page=1)
|
|
|
|
<a id="kwork_api.KworkClient"></a>
|
|
|
|
## KworkClient
|
|
|
|
<a id="kwork_api.KworkError"></a>
|
|
|
|
## KworkError
|
|
|
|
<a id="kwork_api.KworkAuthError"></a>
|
|
|
|
## KworkAuthError
|
|
|
|
<a id="kwork_api.KworkApiError"></a>
|
|
|
|
## KworkApiError
|
|
|
|
<a id="kwork_api.__version__"></a>
|
|
|
|
#### \_\_version\_\_
|
|
|
|
<a id="kwork_api.__all__"></a>
|
|
|
|
#### \_\_all\_\_
|
|
|
|
<a id="kwork_api.client"></a>
|
|
|
|
# Module kwork\_api.client
|
|
|
|
Kwork API Client.
|
|
|
|
Main client class with authentication and all API endpoints.
|
|
|
|
<a id="kwork_api.client.logging"></a>
|
|
|
|
## logging
|
|
|
|
<a id="kwork_api.client.Any"></a>
|
|
|
|
## Any
|
|
|
|
<a id="kwork_api.client.Optional"></a>
|
|
|
|
## Optional
|
|
|
|
<a id="kwork_api.client.httpx"></a>
|
|
|
|
## httpx
|
|
|
|
<a id="kwork_api.client.HttpUrl"></a>
|
|
|
|
## HttpUrl
|
|
|
|
<a id="kwork_api.client.KworkApiError"></a>
|
|
|
|
## KworkApiError
|
|
|
|
<a id="kwork_api.client.KworkAuthError"></a>
|
|
|
|
## KworkAuthError
|
|
|
|
<a id="kwork_api.client.KworkError"></a>
|
|
|
|
## KworkError
|
|
|
|
<a id="kwork_api.client.KworkNetworkError"></a>
|
|
|
|
## KworkNetworkError
|
|
|
|
<a id="kwork_api.client.KworkNotFoundError"></a>
|
|
|
|
## KworkNotFoundError
|
|
|
|
<a id="kwork_api.client.KworkRateLimitError"></a>
|
|
|
|
## KworkRateLimitError
|
|
|
|
<a id="kwork_api.client.KworkValidationError"></a>
|
|
|
|
## KworkValidationError
|
|
|
|
<a id="kwork_api.client.APIErrorResponse"></a>
|
|
|
|
## APIErrorResponse
|
|
|
|
<a id="kwork_api.client.AuthResponse"></a>
|
|
|
|
## AuthResponse
|
|
|
|
<a id="kwork_api.client.Badge"></a>
|
|
|
|
## Badge
|
|
|
|
<a id="kwork_api.client.CatalogResponse"></a>
|
|
|
|
## CatalogResponse
|
|
|
|
<a id="kwork_api.client.City"></a>
|
|
|
|
## City
|
|
|
|
<a id="kwork_api.client.Country"></a>
|
|
|
|
## Country
|
|
|
|
<a id="kwork_api.client.DataResponse"></a>
|
|
|
|
## DataResponse
|
|
|
|
<a id="kwork_api.client.Dialog"></a>
|
|
|
|
## Dialog
|
|
|
|
<a id="kwork_api.client.Feature"></a>
|
|
|
|
## Feature
|
|
|
|
<a id="kwork_api.client.Kwork"></a>
|
|
|
|
## Kwork
|
|
|
|
<a id="kwork_api.client.KworkDetails"></a>
|
|
|
|
## KworkDetails
|
|
|
|
<a id="kwork_api.client.NotificationsResponse"></a>
|
|
|
|
## NotificationsResponse
|
|
|
|
<a id="kwork_api.client.Project"></a>
|
|
|
|
## Project
|
|
|
|
<a id="kwork_api.client.ProjectsResponse"></a>
|
|
|
|
## ProjectsResponse
|
|
|
|
<a id="kwork_api.client.Review"></a>
|
|
|
|
## Review
|
|
|
|
<a id="kwork_api.client.ReviewsResponse"></a>
|
|
|
|
## ReviewsResponse
|
|
|
|
<a id="kwork_api.client.TimeZone"></a>
|
|
|
|
## TimeZone
|
|
|
|
<a id="kwork_api.client.logger"></a>
|
|
|
|
#### logger
|
|
|
|
<a id="kwork_api.client.KworkClient"></a>
|
|
|
|
## KworkClient
|
|
|
|
```python
|
|
class KworkClient()
|
|
```
|
|
|
|
Kwork.ru API client.
|
|
|
|
Usage:
|
|
# Login with credentials
|
|
client = await KworkClient.login("username", "password")
|
|
|
|
# Or restore from token
|
|
client = KworkClient(token="your_web_auth_token")
|
|
|
|
# Make requests
|
|
catalog = await client.catalog.get_list(page=1)
|
|
|
|
<a id="kwork_api.client.KworkClient.BASE_URL"></a>
|
|
|
|
#### BASE\_URL
|
|
|
|
<a id="kwork_api.client.KworkClient.LOGIN_URL"></a>
|
|
|
|
#### LOGIN\_URL
|
|
|
|
<a id="kwork_api.client.KworkClient.TOKEN_URL"></a>
|
|
|
|
#### TOKEN\_URL
|
|
|
|
<a id="kwork_api.client.KworkClient.__init__"></a>
|
|
|
|
#### KworkClient.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(token: Optional[str] = None,
|
|
cookies: Optional[dict[str, str]] = None,
|
|
timeout: float = 30.0,
|
|
base_url: Optional[str] = None)
|
|
```
|
|
|
|
Initialize client.
|
|
|
|
**Arguments**:
|
|
|
|
- `token` - Web auth token (from getWebAuthToken)
|
|
- `cookies` - Session cookies (optional, will be set from token)
|
|
- `timeout` - Request timeout in seconds
|
|
- `base_url` - Custom base URL (for testing)
|
|
|
|
<a id="kwork_api.client.KworkClient.login"></a>
|
|
|
|
#### KworkClient.login
|
|
|
|
```python
|
|
@classmethod
|
|
async def login(cls,
|
|
username: str,
|
|
password: str,
|
|
timeout: float = 30.0) -> "KworkClient"
|
|
```
|
|
|
|
Login with username and password.
|
|
|
|
**Arguments**:
|
|
|
|
- `username` - Kwork username or email
|
|
- `password` - Kwork password
|
|
- `timeout` - Request timeout
|
|
|
|
|
|
**Returns**:
|
|
|
|
Authenticated KworkClient instance
|
|
|
|
|
|
**Raises**:
|
|
|
|
- `KworkAuthError` - If login fails
|
|
|
|
<a id="kwork_api.client.KworkClient.close"></a>
|
|
|
|
#### KworkClient.close
|
|
|
|
```python
|
|
async def close() -> None
|
|
```
|
|
|
|
Close HTTP client.
|
|
|
|
<a id="kwork_api.client.KworkClient.__aenter__"></a>
|
|
|
|
#### KworkClient.\_\_aenter\_\_
|
|
|
|
```python
|
|
async def __aenter__() -> "KworkClient"
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.__aexit__"></a>
|
|
|
|
#### KworkClient.\_\_aexit\_\_
|
|
|
|
```python
|
|
async def __aexit__(*args: Any) -> None
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.CatalogAPI"></a>
|
|
|
|
## CatalogAPI
|
|
|
|
```python
|
|
class CatalogAPI()
|
|
```
|
|
|
|
Catalog/Kworks API endpoints.
|
|
|
|
<a id="kwork_api.client.KworkClient.CatalogAPI.__init__"></a>
|
|
|
|
#### CatalogAPI.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(client: "KworkClient")
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.CatalogAPI.get_list"></a>
|
|
|
|
#### CatalogAPI.get\_list
|
|
|
|
```python
|
|
async def get_list(page: int = 1,
|
|
category_id: Optional[int] = None,
|
|
sort: str = "recommend") -> CatalogResponse
|
|
```
|
|
|
|
Get kworks catalog.
|
|
|
|
**Arguments**:
|
|
|
|
- `page` - Page number
|
|
- `category_id` - Category filter
|
|
- `sort` - Sort option (recommend, price_asc, price_desc, etc.)
|
|
|
|
|
|
**Returns**:
|
|
|
|
CatalogResponse with kworks and pagination
|
|
|
|
<a id="kwork_api.client.KworkClient.CatalogAPI.get_details"></a>
|
|
|
|
#### CatalogAPI.get\_details
|
|
|
|
```python
|
|
async def get_details(kwork_id: int) -> KworkDetails
|
|
```
|
|
|
|
Get kwork details.
|
|
|
|
**Arguments**:
|
|
|
|
- `kwork_id` - Kwork ID
|
|
|
|
|
|
**Returns**:
|
|
|
|
KworkDetails with full information
|
|
|
|
<a id="kwork_api.client.KworkClient.CatalogAPI.get_details_extra"></a>
|
|
|
|
#### CatalogAPI.get\_details\_extra
|
|
|
|
```python
|
|
async def get_details_extra(kwork_id: int) -> dict[str, Any]
|
|
```
|
|
|
|
Get additional kwork details.
|
|
|
|
**Arguments**:
|
|
|
|
- `kwork_id` - Kwork ID
|
|
|
|
|
|
**Returns**:
|
|
|
|
Extra details dict
|
|
|
|
<a id="kwork_api.client.KworkClient.ProjectsAPI"></a>
|
|
|
|
## ProjectsAPI
|
|
|
|
```python
|
|
class ProjectsAPI()
|
|
```
|
|
|
|
Projects (freelance orders) API endpoints.
|
|
|
|
<a id="kwork_api.client.KworkClient.ProjectsAPI.__init__"></a>
|
|
|
|
#### ProjectsAPI.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(client: "KworkClient")
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.ProjectsAPI.get_list"></a>
|
|
|
|
#### ProjectsAPI.get\_list
|
|
|
|
```python
|
|
async def get_list(page: int = 1,
|
|
category_id: Optional[int] = None) -> ProjectsResponse
|
|
```
|
|
|
|
Get projects list.
|
|
|
|
**Arguments**:
|
|
|
|
- `page` - Page number
|
|
- `category_id` - Category filter
|
|
|
|
|
|
**Returns**:
|
|
|
|
ProjectsResponse with projects and pagination
|
|
|
|
<a id="kwork_api.client.KworkClient.ProjectsAPI.get_payer_orders"></a>
|
|
|
|
#### ProjectsAPI.get\_payer\_orders
|
|
|
|
```python
|
|
async def get_payer_orders() -> list[Project]
|
|
```
|
|
|
|
Get orders where user is customer.
|
|
|
|
**Returns**:
|
|
|
|
List of projects
|
|
|
|
<a id="kwork_api.client.KworkClient.ProjectsAPI.get_worker_orders"></a>
|
|
|
|
#### ProjectsAPI.get\_worker\_orders
|
|
|
|
```python
|
|
async def get_worker_orders() -> list[Project]
|
|
```
|
|
|
|
Get orders where user is performer.
|
|
|
|
**Returns**:
|
|
|
|
List of projects
|
|
|
|
<a id="kwork_api.client.KworkClient.UserAPI"></a>
|
|
|
|
## UserAPI
|
|
|
|
```python
|
|
class UserAPI()
|
|
```
|
|
|
|
User API endpoints.
|
|
|
|
<a id="kwork_api.client.KworkClient.UserAPI.__init__"></a>
|
|
|
|
#### UserAPI.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(client: "KworkClient")
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.UserAPI.get_info"></a>
|
|
|
|
#### UserAPI.get\_info
|
|
|
|
```python
|
|
async def get_info() -> dict[str, Any]
|
|
```
|
|
|
|
Get current user info.
|
|
|
|
**Returns**:
|
|
|
|
User info dict
|
|
|
|
<a id="kwork_api.client.KworkClient.UserAPI.get_reviews"></a>
|
|
|
|
#### UserAPI.get\_reviews
|
|
|
|
```python
|
|
async def get_reviews(user_id: Optional[int] = None,
|
|
page: int = 1) -> ReviewsResponse
|
|
```
|
|
|
|
Get user reviews.
|
|
|
|
**Arguments**:
|
|
|
|
- `user_id` - User ID (None for current user)
|
|
- `page` - Page number
|
|
|
|
|
|
**Returns**:
|
|
|
|
ReviewsResponse
|
|
|
|
<a id="kwork_api.client.KworkClient.UserAPI.get_favorite_kworks"></a>
|
|
|
|
#### UserAPI.get\_favorite\_kworks
|
|
|
|
```python
|
|
async def get_favorite_kworks() -> list[Kwork]
|
|
```
|
|
|
|
Get favorite kworks.
|
|
|
|
**Returns**:
|
|
|
|
List of kworks
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI"></a>
|
|
|
|
## ReferenceAPI
|
|
|
|
```python
|
|
class ReferenceAPI()
|
|
```
|
|
|
|
Reference data (cities, countries, etc.) endpoints.
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.__init__"></a>
|
|
|
|
#### ReferenceAPI.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(client: "KworkClient")
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.get_cities"></a>
|
|
|
|
#### ReferenceAPI.get\_cities
|
|
|
|
```python
|
|
async def get_cities() -> list[City]
|
|
```
|
|
|
|
Get all cities.
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.get_countries"></a>
|
|
|
|
#### ReferenceAPI.get\_countries
|
|
|
|
```python
|
|
async def get_countries() -> list[Country]
|
|
```
|
|
|
|
Get all countries.
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.get_timezones"></a>
|
|
|
|
#### ReferenceAPI.get\_timezones
|
|
|
|
```python
|
|
async def get_timezones() -> list[TimeZone]
|
|
```
|
|
|
|
Get all timezones.
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.get_features"></a>
|
|
|
|
#### ReferenceAPI.get\_features
|
|
|
|
```python
|
|
async def get_features() -> list[Feature]
|
|
```
|
|
|
|
Get available features.
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.get_public_features"></a>
|
|
|
|
#### ReferenceAPI.get\_public\_features
|
|
|
|
```python
|
|
async def get_public_features() -> list[Feature]
|
|
```
|
|
|
|
Get public features.
|
|
|
|
<a id="kwork_api.client.KworkClient.ReferenceAPI.get_badges_info"></a>
|
|
|
|
#### ReferenceAPI.get\_badges\_info
|
|
|
|
```python
|
|
async def get_badges_info() -> list[Badge]
|
|
```
|
|
|
|
Get badges info.
|
|
|
|
<a id="kwork_api.client.KworkClient.NotificationsAPI"></a>
|
|
|
|
## NotificationsAPI
|
|
|
|
```python
|
|
class NotificationsAPI()
|
|
```
|
|
|
|
Notifications and messages endpoints.
|
|
|
|
<a id="kwork_api.client.KworkClient.NotificationsAPI.__init__"></a>
|
|
|
|
#### NotificationsAPI.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(client: "KworkClient")
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.NotificationsAPI.get_list"></a>
|
|
|
|
#### NotificationsAPI.get\_list
|
|
|
|
```python
|
|
async def get_list() -> NotificationsResponse
|
|
```
|
|
|
|
Get notifications list.
|
|
|
|
<a id="kwork_api.client.KworkClient.NotificationsAPI.fetch"></a>
|
|
|
|
#### NotificationsAPI.fetch
|
|
|
|
```python
|
|
async def fetch() -> NotificationsResponse
|
|
```
|
|
|
|
Fetch new notifications.
|
|
|
|
<a id="kwork_api.client.KworkClient.NotificationsAPI.get_dialogs"></a>
|
|
|
|
#### NotificationsAPI.get\_dialogs
|
|
|
|
```python
|
|
async def get_dialogs() -> list[Dialog]
|
|
```
|
|
|
|
Get dialogs list.
|
|
|
|
<a id="kwork_api.client.KworkClient.NotificationsAPI.get_blocked_dialogs"></a>
|
|
|
|
#### NotificationsAPI.get\_blocked\_dialogs
|
|
|
|
```python
|
|
async def get_blocked_dialogs() -> list[Dialog]
|
|
```
|
|
|
|
Get blocked dialogs.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI"></a>
|
|
|
|
## OtherAPI
|
|
|
|
```python
|
|
class OtherAPI()
|
|
```
|
|
|
|
Other API endpoints.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.__init__"></a>
|
|
|
|
#### OtherAPI.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(client: "KworkClient")
|
|
```
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_wants"></a>
|
|
|
|
#### OtherAPI.get\_wants
|
|
|
|
```python
|
|
async def get_wants() -> dict[str, Any]
|
|
```
|
|
|
|
Get user wants.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_wants_status"></a>
|
|
|
|
#### OtherAPI.get\_wants\_status
|
|
|
|
```python
|
|
async def get_wants_status() -> dict[str, Any]
|
|
```
|
|
|
|
Get wants status.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_kworks_status"></a>
|
|
|
|
#### OtherAPI.get\_kworks\_status
|
|
|
|
```python
|
|
async def get_kworks_status() -> dict[str, Any]
|
|
```
|
|
|
|
Get kworks status.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_offers"></a>
|
|
|
|
#### OtherAPI.get\_offers
|
|
|
|
```python
|
|
async def get_offers() -> dict[str, Any]
|
|
```
|
|
|
|
Get offers.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_exchange_info"></a>
|
|
|
|
#### OtherAPI.get\_exchange\_info
|
|
|
|
```python
|
|
async def get_exchange_info() -> dict[str, Any]
|
|
```
|
|
|
|
Get exchange info.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_channel"></a>
|
|
|
|
#### OtherAPI.get\_channel
|
|
|
|
```python
|
|
async def get_channel() -> dict[str, Any]
|
|
```
|
|
|
|
Get channel info.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_in_app_notification"></a>
|
|
|
|
#### OtherAPI.get\_in\_app\_notification
|
|
|
|
```python
|
|
async def get_in_app_notification() -> dict[str, Any]
|
|
```
|
|
|
|
Get in-app notification.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_security_user_data"></a>
|
|
|
|
#### OtherAPI.get\_security\_user\_data
|
|
|
|
```python
|
|
async def get_security_user_data() -> dict[str, Any]
|
|
```
|
|
|
|
Get security user data.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.is_dialog_allow"></a>
|
|
|
|
#### OtherAPI.is\_dialog\_allow
|
|
|
|
```python
|
|
async def is_dialog_allow(user_id: int) -> bool
|
|
```
|
|
|
|
Check if dialog is allowed.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_viewed_kworks"></a>
|
|
|
|
#### OtherAPI.get\_viewed\_kworks
|
|
|
|
```python
|
|
async def get_viewed_kworks() -> list[Kwork]
|
|
```
|
|
|
|
Get viewed kworks.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_favorite_categories"></a>
|
|
|
|
#### OtherAPI.get\_favorite\_categories
|
|
|
|
```python
|
|
async def get_favorite_categories() -> list[int]
|
|
```
|
|
|
|
Get favorite categories.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.update_settings"></a>
|
|
|
|
#### OtherAPI.update\_settings
|
|
|
|
```python
|
|
async def update_settings(settings: dict[str, Any]) -> dict[str, Any]
|
|
```
|
|
|
|
Update user settings.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.go_offline"></a>
|
|
|
|
#### OtherAPI.go\_offline
|
|
|
|
```python
|
|
async def go_offline() -> dict[str, Any]
|
|
```
|
|
|
|
Set user status to offline.
|
|
|
|
<a id="kwork_api.client.KworkClient.OtherAPI.get_actor"></a>
|
|
|
|
#### OtherAPI.get\_actor
|
|
|
|
```python
|
|
async def get_actor() -> dict[str, Any]
|
|
```
|
|
|
|
Get actor info.
|
|
|
|
<a id="kwork_api.client.KworkClient.catalog"></a>
|
|
|
|
#### KworkClient.catalog
|
|
|
|
```python
|
|
@property
|
|
def catalog() -> CatalogAPI
|
|
```
|
|
|
|
Catalog API.
|
|
|
|
<a id="kwork_api.client.KworkClient.projects"></a>
|
|
|
|
#### KworkClient.projects
|
|
|
|
```python
|
|
@property
|
|
def projects() -> ProjectsAPI
|
|
```
|
|
|
|
Projects API.
|
|
|
|
<a id="kwork_api.client.KworkClient.user"></a>
|
|
|
|
#### KworkClient.user
|
|
|
|
```python
|
|
@property
|
|
def user() -> UserAPI
|
|
```
|
|
|
|
User API.
|
|
|
|
<a id="kwork_api.client.KworkClient.reference"></a>
|
|
|
|
#### KworkClient.reference
|
|
|
|
```python
|
|
@property
|
|
def reference() -> ReferenceAPI
|
|
```
|
|
|
|
Reference data API.
|
|
|
|
<a id="kwork_api.client.KworkClient.notifications"></a>
|
|
|
|
#### KworkClient.notifications
|
|
|
|
```python
|
|
@property
|
|
def notifications() -> NotificationsAPI
|
|
```
|
|
|
|
Notifications API.
|
|
|
|
<a id="kwork_api.client.KworkClient.other"></a>
|
|
|
|
#### KworkClient.other
|
|
|
|
```python
|
|
@property
|
|
def other() -> OtherAPI
|
|
```
|
|
|
|
Other endpoints.
|
|
|
|
<a id="kwork_api.models"></a>
|
|
|
|
# Module kwork\_api.models
|
|
|
|
Pydantic models for Kwork API responses.
|
|
|
|
All models follow the structure found in the HAR dump analysis.
|
|
|
|
<a id="kwork_api.models.datetime"></a>
|
|
|
|
## datetime
|
|
|
|
<a id="kwork_api.models.Any"></a>
|
|
|
|
## Any
|
|
|
|
<a id="kwork_api.models.Optional"></a>
|
|
|
|
## Optional
|
|
|
|
<a id="kwork_api.models.BaseModel"></a>
|
|
|
|
## BaseModel
|
|
|
|
<a id="kwork_api.models.Field"></a>
|
|
|
|
## Field
|
|
|
|
<a id="kwork_api.models.KworkUser"></a>
|
|
|
|
## KworkUser
|
|
|
|
```python
|
|
class KworkUser(BaseModel)
|
|
```
|
|
|
|
User information.
|
|
|
|
<a id="kwork_api.models.KworkUser.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.KworkUser.username"></a>
|
|
|
|
#### username
|
|
|
|
<a id="kwork_api.models.KworkUser.avatar_url"></a>
|
|
|
|
#### avatar\_url
|
|
|
|
<a id="kwork_api.models.KworkUser.is_online"></a>
|
|
|
|
#### is\_online
|
|
|
|
<a id="kwork_api.models.KworkUser.rating"></a>
|
|
|
|
#### rating
|
|
|
|
<a id="kwork_api.models.KworkCategory"></a>
|
|
|
|
## KworkCategory
|
|
|
|
```python
|
|
class KworkCategory(BaseModel)
|
|
```
|
|
|
|
Category information.
|
|
|
|
<a id="kwork_api.models.KworkCategory.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.KworkCategory.name"></a>
|
|
|
|
#### name
|
|
|
|
<a id="kwork_api.models.KworkCategory.slug"></a>
|
|
|
|
#### slug
|
|
|
|
<a id="kwork_api.models.KworkCategory.parent_id"></a>
|
|
|
|
#### parent\_id
|
|
|
|
<a id="kwork_api.models.Kwork"></a>
|
|
|
|
## Kwork
|
|
|
|
```python
|
|
class Kwork(BaseModel)
|
|
```
|
|
|
|
Kwork (service) information.
|
|
|
|
<a id="kwork_api.models.Kwork.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Kwork.title"></a>
|
|
|
|
#### title
|
|
|
|
<a id="kwork_api.models.Kwork.description"></a>
|
|
|
|
#### description
|
|
|
|
<a id="kwork_api.models.Kwork.price"></a>
|
|
|
|
#### price
|
|
|
|
<a id="kwork_api.models.Kwork.currency"></a>
|
|
|
|
#### currency
|
|
|
|
<a id="kwork_api.models.Kwork.category_id"></a>
|
|
|
|
#### category\_id
|
|
|
|
<a id="kwork_api.models.Kwork.seller"></a>
|
|
|
|
#### seller
|
|
|
|
<a id="kwork_api.models.Kwork.images"></a>
|
|
|
|
#### images
|
|
|
|
<a id="kwork_api.models.Kwork.rating"></a>
|
|
|
|
#### rating
|
|
|
|
<a id="kwork_api.models.Kwork.reviews_count"></a>
|
|
|
|
#### reviews\_count
|
|
|
|
<a id="kwork_api.models.Kwork.created_at"></a>
|
|
|
|
#### created\_at
|
|
|
|
<a id="kwork_api.models.Kwork.updated_at"></a>
|
|
|
|
#### updated\_at
|
|
|
|
<a id="kwork_api.models.KworkDetails"></a>
|
|
|
|
## KworkDetails
|
|
|
|
```python
|
|
class KworkDetails(Kwork)
|
|
```
|
|
|
|
Extended kwork details.
|
|
|
|
<a id="kwork_api.models.KworkDetails.full_description"></a>
|
|
|
|
#### full\_description
|
|
|
|
<a id="kwork_api.models.KworkDetails.requirements"></a>
|
|
|
|
#### requirements
|
|
|
|
<a id="kwork_api.models.KworkDetails.delivery_time"></a>
|
|
|
|
#### delivery\_time
|
|
|
|
in days
|
|
|
|
<a id="kwork_api.models.KworkDetails.revisions"></a>
|
|
|
|
#### revisions
|
|
|
|
<a id="kwork_api.models.KworkDetails.features"></a>
|
|
|
|
#### features
|
|
|
|
<a id="kwork_api.models.KworkDetails.faq"></a>
|
|
|
|
#### faq
|
|
|
|
<a id="kwork_api.models.PaginationInfo"></a>
|
|
|
|
## PaginationInfo
|
|
|
|
```python
|
|
class PaginationInfo(BaseModel)
|
|
```
|
|
|
|
Pagination metadata.
|
|
|
|
<a id="kwork_api.models.PaginationInfo.current_page"></a>
|
|
|
|
#### current\_page
|
|
|
|
<a id="kwork_api.models.PaginationInfo.total_pages"></a>
|
|
|
|
#### total\_pages
|
|
|
|
<a id="kwork_api.models.PaginationInfo.total_items"></a>
|
|
|
|
#### total\_items
|
|
|
|
<a id="kwork_api.models.PaginationInfo.items_per_page"></a>
|
|
|
|
#### items\_per\_page
|
|
|
|
<a id="kwork_api.models.PaginationInfo.has_next"></a>
|
|
|
|
#### has\_next
|
|
|
|
<a id="kwork_api.models.PaginationInfo.has_prev"></a>
|
|
|
|
#### has\_prev
|
|
|
|
<a id="kwork_api.models.CatalogResponse"></a>
|
|
|
|
## CatalogResponse
|
|
|
|
```python
|
|
class CatalogResponse(BaseModel)
|
|
```
|
|
|
|
Catalog response with kworks and pagination.
|
|
|
|
<a id="kwork_api.models.CatalogResponse.kworks"></a>
|
|
|
|
#### kworks
|
|
|
|
<a id="kwork_api.models.CatalogResponse.pagination"></a>
|
|
|
|
#### pagination
|
|
|
|
<a id="kwork_api.models.CatalogResponse.filters"></a>
|
|
|
|
#### filters
|
|
|
|
<a id="kwork_api.models.CatalogResponse.sort_options"></a>
|
|
|
|
#### sort\_options
|
|
|
|
<a id="kwork_api.models.Project"></a>
|
|
|
|
## Project
|
|
|
|
```python
|
|
class Project(BaseModel)
|
|
```
|
|
|
|
Project (freelance order) information.
|
|
|
|
<a id="kwork_api.models.Project.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Project.title"></a>
|
|
|
|
#### title
|
|
|
|
<a id="kwork_api.models.Project.description"></a>
|
|
|
|
#### description
|
|
|
|
<a id="kwork_api.models.Project.budget"></a>
|
|
|
|
#### budget
|
|
|
|
<a id="kwork_api.models.Project.budget_type"></a>
|
|
|
|
#### budget\_type
|
|
|
|
fixed, hourly
|
|
|
|
<a id="kwork_api.models.Project.category_id"></a>
|
|
|
|
#### category\_id
|
|
|
|
<a id="kwork_api.models.Project.customer"></a>
|
|
|
|
#### customer
|
|
|
|
<a id="kwork_api.models.Project.status"></a>
|
|
|
|
#### status
|
|
|
|
open, in_progress, completed, cancelled
|
|
|
|
<a id="kwork_api.models.Project.created_at"></a>
|
|
|
|
#### created\_at
|
|
|
|
<a id="kwork_api.models.Project.updated_at"></a>
|
|
|
|
#### updated\_at
|
|
|
|
<a id="kwork_api.models.Project.bids_count"></a>
|
|
|
|
#### bids\_count
|
|
|
|
<a id="kwork_api.models.Project.skills"></a>
|
|
|
|
#### skills
|
|
|
|
<a id="kwork_api.models.ProjectsResponse"></a>
|
|
|
|
## ProjectsResponse
|
|
|
|
```python
|
|
class ProjectsResponse(BaseModel)
|
|
```
|
|
|
|
Projects list response.
|
|
|
|
<a id="kwork_api.models.ProjectsResponse.projects"></a>
|
|
|
|
#### projects
|
|
|
|
<a id="kwork_api.models.ProjectsResponse.pagination"></a>
|
|
|
|
#### pagination
|
|
|
|
<a id="kwork_api.models.Review"></a>
|
|
|
|
## Review
|
|
|
|
```python
|
|
class Review(BaseModel)
|
|
```
|
|
|
|
Review information.
|
|
|
|
<a id="kwork_api.models.Review.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Review.rating"></a>
|
|
|
|
#### rating
|
|
|
|
<a id="kwork_api.models.Review.comment"></a>
|
|
|
|
#### comment
|
|
|
|
<a id="kwork_api.models.Review.author"></a>
|
|
|
|
#### author
|
|
|
|
<a id="kwork_api.models.Review.kwork_id"></a>
|
|
|
|
#### kwork\_id
|
|
|
|
<a id="kwork_api.models.Review.created_at"></a>
|
|
|
|
#### created\_at
|
|
|
|
<a id="kwork_api.models.ReviewsResponse"></a>
|
|
|
|
## ReviewsResponse
|
|
|
|
```python
|
|
class ReviewsResponse(BaseModel)
|
|
```
|
|
|
|
Reviews list response.
|
|
|
|
<a id="kwork_api.models.ReviewsResponse.reviews"></a>
|
|
|
|
#### reviews
|
|
|
|
<a id="kwork_api.models.ReviewsResponse.pagination"></a>
|
|
|
|
#### pagination
|
|
|
|
<a id="kwork_api.models.ReviewsResponse.average_rating"></a>
|
|
|
|
#### average\_rating
|
|
|
|
<a id="kwork_api.models.Notification"></a>
|
|
|
|
## Notification
|
|
|
|
```python
|
|
class Notification(BaseModel)
|
|
```
|
|
|
|
Notification information.
|
|
|
|
<a id="kwork_api.models.Notification.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Notification.type"></a>
|
|
|
|
#### type
|
|
|
|
message, order, system, etc.
|
|
|
|
<a id="kwork_api.models.Notification.title"></a>
|
|
|
|
#### title
|
|
|
|
<a id="kwork_api.models.Notification.message"></a>
|
|
|
|
#### message
|
|
|
|
<a id="kwork_api.models.Notification.is_read"></a>
|
|
|
|
#### is\_read
|
|
|
|
<a id="kwork_api.models.Notification.created_at"></a>
|
|
|
|
#### created\_at
|
|
|
|
<a id="kwork_api.models.Notification.link"></a>
|
|
|
|
#### link
|
|
|
|
<a id="kwork_api.models.NotificationsResponse"></a>
|
|
|
|
## NotificationsResponse
|
|
|
|
```python
|
|
class NotificationsResponse(BaseModel)
|
|
```
|
|
|
|
Notifications list response.
|
|
|
|
<a id="kwork_api.models.NotificationsResponse.notifications"></a>
|
|
|
|
#### notifications
|
|
|
|
<a id="kwork_api.models.NotificationsResponse.unread_count"></a>
|
|
|
|
#### unread\_count
|
|
|
|
<a id="kwork_api.models.Dialog"></a>
|
|
|
|
## Dialog
|
|
|
|
```python
|
|
class Dialog(BaseModel)
|
|
```
|
|
|
|
Dialog (chat) information.
|
|
|
|
<a id="kwork_api.models.Dialog.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Dialog.participant"></a>
|
|
|
|
#### participant
|
|
|
|
<a id="kwork_api.models.Dialog.last_message"></a>
|
|
|
|
#### last\_message
|
|
|
|
<a id="kwork_api.models.Dialog.unread_count"></a>
|
|
|
|
#### unread\_count
|
|
|
|
<a id="kwork_api.models.Dialog.updated_at"></a>
|
|
|
|
#### updated\_at
|
|
|
|
<a id="kwork_api.models.AuthResponse"></a>
|
|
|
|
## AuthResponse
|
|
|
|
```python
|
|
class AuthResponse(BaseModel)
|
|
```
|
|
|
|
Authentication response.
|
|
|
|
<a id="kwork_api.models.AuthResponse.success"></a>
|
|
|
|
#### success
|
|
|
|
<a id="kwork_api.models.AuthResponse.user_id"></a>
|
|
|
|
#### user\_id
|
|
|
|
<a id="kwork_api.models.AuthResponse.username"></a>
|
|
|
|
#### username
|
|
|
|
<a id="kwork_api.models.AuthResponse.web_auth_token"></a>
|
|
|
|
#### web\_auth\_token
|
|
|
|
<a id="kwork_api.models.AuthResponse.message"></a>
|
|
|
|
#### message
|
|
|
|
<a id="kwork_api.models.ErrorDetail"></a>
|
|
|
|
## ErrorDetail
|
|
|
|
```python
|
|
class ErrorDetail(BaseModel)
|
|
```
|
|
|
|
Error detail from API.
|
|
|
|
<a id="kwork_api.models.ErrorDetail.code"></a>
|
|
|
|
#### code
|
|
|
|
<a id="kwork_api.models.ErrorDetail.message"></a>
|
|
|
|
#### message
|
|
|
|
<a id="kwork_api.models.ErrorDetail.field"></a>
|
|
|
|
#### field
|
|
|
|
<a id="kwork_api.models.APIErrorResponse"></a>
|
|
|
|
## APIErrorResponse
|
|
|
|
```python
|
|
class APIErrorResponse(BaseModel)
|
|
```
|
|
|
|
Standard API error response.
|
|
|
|
<a id="kwork_api.models.APIErrorResponse.success"></a>
|
|
|
|
#### success
|
|
|
|
<a id="kwork_api.models.APIErrorResponse.errors"></a>
|
|
|
|
#### errors
|
|
|
|
<a id="kwork_api.models.APIErrorResponse.message"></a>
|
|
|
|
#### message
|
|
|
|
<a id="kwork_api.models.City"></a>
|
|
|
|
## City
|
|
|
|
```python
|
|
class City(BaseModel)
|
|
```
|
|
|
|
City information.
|
|
|
|
<a id="kwork_api.models.City.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.City.name"></a>
|
|
|
|
#### name
|
|
|
|
<a id="kwork_api.models.City.country_id"></a>
|
|
|
|
#### country\_id
|
|
|
|
<a id="kwork_api.models.Country"></a>
|
|
|
|
## Country
|
|
|
|
```python
|
|
class Country(BaseModel)
|
|
```
|
|
|
|
Country information.
|
|
|
|
<a id="kwork_api.models.Country.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Country.name"></a>
|
|
|
|
#### name
|
|
|
|
<a id="kwork_api.models.Country.code"></a>
|
|
|
|
#### code
|
|
|
|
<a id="kwork_api.models.Country.cities"></a>
|
|
|
|
#### cities
|
|
|
|
<a id="kwork_api.models.TimeZone"></a>
|
|
|
|
## TimeZone
|
|
|
|
```python
|
|
class TimeZone(BaseModel)
|
|
```
|
|
|
|
Timezone information.
|
|
|
|
<a id="kwork_api.models.TimeZone.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.TimeZone.name"></a>
|
|
|
|
#### name
|
|
|
|
<a id="kwork_api.models.TimeZone.offset"></a>
|
|
|
|
#### offset
|
|
|
|
e.g., "+03:00"
|
|
|
|
<a id="kwork_api.models.Feature"></a>
|
|
|
|
## Feature
|
|
|
|
```python
|
|
class Feature(BaseModel)
|
|
```
|
|
|
|
Feature/addon information.
|
|
|
|
<a id="kwork_api.models.Feature.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Feature.name"></a>
|
|
|
|
#### name
|
|
|
|
<a id="kwork_api.models.Feature.description"></a>
|
|
|
|
#### description
|
|
|
|
<a id="kwork_api.models.Feature.price"></a>
|
|
|
|
#### price
|
|
|
|
<a id="kwork_api.models.Feature.type"></a>
|
|
|
|
#### type
|
|
|
|
extra, premium, etc.
|
|
|
|
<a id="kwork_api.models.Badge"></a>
|
|
|
|
## Badge
|
|
|
|
```python
|
|
class Badge(BaseModel)
|
|
```
|
|
|
|
User badge information.
|
|
|
|
<a id="kwork_api.models.Badge.id"></a>
|
|
|
|
#### id
|
|
|
|
<a id="kwork_api.models.Badge.name"></a>
|
|
|
|
#### name
|
|
|
|
<a id="kwork_api.models.Badge.description"></a>
|
|
|
|
#### description
|
|
|
|
<a id="kwork_api.models.Badge.icon_url"></a>
|
|
|
|
#### icon\_url
|
|
|
|
<a id="kwork_api.models.DataResponse"></a>
|
|
|
|
## DataResponse
|
|
|
|
```python
|
|
class DataResponse(BaseModel)
|
|
```
|
|
|
|
Generic data response wrapper.
|
|
|
|
<a id="kwork_api.models.DataResponse.success"></a>
|
|
|
|
#### success
|
|
|
|
<a id="kwork_api.models.DataResponse.data"></a>
|
|
|
|
#### data
|
|
|
|
<a id="kwork_api.models.DataResponse.message"></a>
|
|
|
|
#### message
|
|
|
|
<a id="kwork_api.errors"></a>
|
|
|
|
# Module kwork\_api.errors
|
|
|
|
Kwork API exceptions.
|
|
|
|
All exceptions provide clear error messages for debugging.
|
|
|
|
<a id="kwork_api.errors.Any"></a>
|
|
|
|
## Any
|
|
|
|
<a id="kwork_api.errors.Optional"></a>
|
|
|
|
## Optional
|
|
|
|
<a id="kwork_api.errors.KworkError"></a>
|
|
|
|
## KworkError
|
|
|
|
```python
|
|
class KworkError(Exception)
|
|
```
|
|
|
|
Base exception for all Kwork API errors.
|
|
|
|
<a id="kwork_api.errors.KworkError.__init__"></a>
|
|
|
|
#### KworkError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(message: str, response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkError.__str__"></a>
|
|
|
|
#### KworkError.\_\_str\_\_
|
|
|
|
```python
|
|
def __str__() -> str
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkAuthError"></a>
|
|
|
|
## KworkAuthError
|
|
|
|
```python
|
|
class KworkAuthError(KworkError)
|
|
```
|
|
|
|
Authentication/authorization error.
|
|
|
|
<a id="kwork_api.errors.KworkAuthError.__init__"></a>
|
|
|
|
#### KworkAuthError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(message: str = "Authentication failed",
|
|
response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkAuthError.__str__"></a>
|
|
|
|
#### KworkAuthError.\_\_str\_\_
|
|
|
|
```python
|
|
def __str__() -> str
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkApiError"></a>
|
|
|
|
## KworkApiError
|
|
|
|
```python
|
|
class KworkApiError(KworkError)
|
|
```
|
|
|
|
API request error (4xx, 5xx).
|
|
|
|
<a id="kwork_api.errors.KworkApiError.__init__"></a>
|
|
|
|
#### KworkApiError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(message: str,
|
|
status_code: Optional[int] = None,
|
|
response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkApiError.__str__"></a>
|
|
|
|
#### KworkApiError.\_\_str\_\_
|
|
|
|
```python
|
|
def __str__() -> str
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkNotFoundError"></a>
|
|
|
|
## KworkNotFoundError
|
|
|
|
```python
|
|
class KworkNotFoundError(KworkApiError)
|
|
```
|
|
|
|
Resource not found (404).
|
|
|
|
<a id="kwork_api.errors.KworkNotFoundError.__init__"></a>
|
|
|
|
#### KworkNotFoundError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(resource: str, response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkRateLimitError"></a>
|
|
|
|
## KworkRateLimitError
|
|
|
|
```python
|
|
class KworkRateLimitError(KworkApiError)
|
|
```
|
|
|
|
Rate limit exceeded (429).
|
|
|
|
<a id="kwork_api.errors.KworkRateLimitError.__init__"></a>
|
|
|
|
#### KworkRateLimitError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(message: str = "Rate limit exceeded",
|
|
response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkValidationError"></a>
|
|
|
|
## KworkValidationError
|
|
|
|
```python
|
|
class KworkValidationError(KworkApiError)
|
|
```
|
|
|
|
Validation error (400).
|
|
|
|
<a id="kwork_api.errors.KworkValidationError.__init__"></a>
|
|
|
|
#### KworkValidationError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(message: str = "Validation failed",
|
|
fields: Optional[dict[str, list[str]]] = None,
|
|
response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkValidationError.__str__"></a>
|
|
|
|
#### KworkValidationError.\_\_str\_\_
|
|
|
|
```python
|
|
def __str__() -> str
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkNetworkError"></a>
|
|
|
|
## KworkNetworkError
|
|
|
|
```python
|
|
class KworkNetworkError(KworkError)
|
|
```
|
|
|
|
Network/connection error.
|
|
|
|
<a id="kwork_api.errors.KworkNetworkError.__init__"></a>
|
|
|
|
#### KworkNetworkError.\_\_init\_\_
|
|
|
|
```python
|
|
def __init__(message: str = "Network error", response: Optional[Any] = None)
|
|
```
|
|
|
|
<a id="kwork_api.errors.KworkNetworkError.__str__"></a>
|
|
|
|
#### KworkNetworkError.\_\_str\_\_
|
|
|
|
```python
|
|
def __str__() -> str
|
|
```
|
|
|