Dognews Server client API
The openapi_client
package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python >= 3.6
This python library package is generated without supporting files like setup.py or requirements files
To be able to use it, you will need these dependencies in your own package that uses this library:
- urllib3 >= 1.25.3
- python-dateutil
In your own code, to use this library to connect and interact with openapi-client, you can run the following:
import time
import openapi_client
from pprint import pprint
from openapi_client.api import api_api
from openapi_client.model.token_obtain_pair import TokenObtainPair
from openapi_client.model.token_refresh import TokenRefresh
from openapi_client.model.token_verify import TokenVerify
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = openapi_client.Configuration(
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD'
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure Bearer authorization (JWT): jwtAuth
configuration = openapi_client.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = api_api.ApiApi(api_client)
format = "json" # str | (optional)
lang = "af" # str | (optional)
try:
api_response = api_instance.api_schema_retrieve(format=format, lang=lang)
pprint(api_response)
except openapi_client.ApiException as e:
print("Exception when calling ApiApi->api_schema_retrieve: %s\n" % e)
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
ApiApi | api_schema_retrieve | GET /api/schema/ | |
ApiApi | api_token_create | POST /api/token/ | |
ApiApi | api_token_refresh_create | POST /api/token/refresh/ | |
ApiApi | api_token_verify_create | POST /api/token/verify/ | |
ArticlesApi | articles_list | GET /articles | |
ArticlesApi | articles_retrieve | GET /articles/{id} | |
AuthApi | auth_login_create | POST /auth/login | |
FetchsApi | fetchs_create | POST /fetchs | |
FetchsApi | fetchs_destroy | DELETE /fetchs/{submission} | |
FetchsApi | fetchs_list | GET /fetchs | |
FetchsApi | fetchs_partial_update | PATCH /fetchs/{submission} | |
FetchsApi | fetchs_retrieve | GET /fetchs/{submission} | |
FetchsApi | fetchs_update | PUT /fetchs/{submission} | |
ModerationsApi | moderations_create | POST /moderations | |
ModerationsApi | moderations_destroy | DELETE /moderations/{submission} | |
ModerationsApi | moderations_list | GET /moderations | |
ModerationsApi | moderations_partial_update | PATCH /moderations/{submission} | |
ModerationsApi | moderations_retrieve | GET /moderations/{submission} | |
ModerationsApi | moderations_update | PUT /moderations/{submission} | |
SubmissionsApi | submissions_create | POST /submissions | |
SubmissionsApi | submissions_destroy | DELETE /submissions/{id} | |
SubmissionsApi | submissions_fetch_destroy | DELETE /submissions/{submission_id}/fetch | |
SubmissionsApi | submissions_fetch_retrieve | GET /submissions/{submission_id}/fetch | |
SubmissionsApi | submissions_fetch_update | PUT /submissions/{submission_id}/fetch | |
SubmissionsApi | submissions_list | GET /submissions | |
SubmissionsApi | submissions_moderation_destroy | DELETE /submissions/{submission_id}/moderation | |
SubmissionsApi | submissions_moderation_retrieve | GET /submissions/{submission_id}/moderation | |
SubmissionsApi | submissions_moderation_update | PUT /submissions/{submission_id}/moderation | |
SubmissionsApi | submissions_partial_update | PATCH /submissions/{id} | |
SubmissionsApi | submissions_retrieve | GET /submissions/{id} | |
SubmissionsApi | submissions_update | PUT /submissions/{id} | |
SubmissionsApi | submissions_votes_create | POST /submissions/{submission_id}/votes | |
SubmissionsApi | submissions_votes_list | GET /submissions/{submission_id}/votes | |
UsersApi | users_create | POST /users | |
UsersApi | users_destroy | DELETE /users/{id} | |
UsersApi | users_list | GET /users | |
UsersApi | users_partial_update | PATCH /users/{id} | |
UsersApi | users_retrieve | GET /users/{id} | |
UsersApi | users_update | PUT /users/{id} | |
VotesApi | votes_destroy | DELETE /votes/{id} | |
VotesApi | votes_retrieve | GET /votes/{id} |
- Article
- AuthToken
- Fetch
- FetchStatusEnum
- Moderation
- ModerationStatusEnum
- PaginatedArticleList
- PaginatedFetchList
- PaginatedModerationList
- PaginatedSubmissionList
- PaginatedUserList
- PaginatedVoteList
- PatchedFetch
- PatchedModeration
- PatchedSubmission
- PatchedUser
- Submission
- TokenObtainPair
- TokenRefresh
- TokenVerify
- User
- ValueEnum
- Vote
- Type: HTTP basic authentication
- Type: API key
- API key parameter name: Session
- Location:
- Type: Bearer authentication (JWT)
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
If the OpenAPI document is large, imports in openapi_client.apis and openapi_client.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1: Use specific imports for apis and models like:
from openapi_client.api.default_api import DefaultApi
from openapi_client.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import openapi_client
from openapi_client.apis import *
from openapi_client.models import *