Skip to main content

Client for OpenAPI Petstore

Project description

acme-python-sdk@1.0.0

This is a sample server Petstore server. For this sample, you can use the api key special-key to test the authorization filters.

Requirements

Python >=3.7

Installing

pip install acme-python-sdk==1.0.0

Getting Started

from pprint import pprint
from acme_client import Acme, ApiException

acme = Acme(
    # Defining the host is optional and defaults to http://petstore.swagger.io/v2
    # See configuration.py for a list of all supported configuration parameters.
    host="http://petstore.swagger.io/v2",
)

try:
    # Pagination sandbox
    paginate_response = acme.miscellaneous.paginate(
        first=1,  # optional
        after="string_example",  # optional
    )
    pprint(paginate_response.body)
    pprint(paginate_response.body["edges"])
    pprint(paginate_response.body["page_info"])
    pprint(paginate_response.headers)
    pprint(paginate_response.status)
    pprint(paginate_response.round_trip_time)
except ApiException as e:
    print("Exception when calling MiscellaneousApi.paginate: %s\n" % e)
    pprint(e.body)
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Async

async support is available by prepending a to any method.

import asyncio
from pprint import pprint
from acme_client import Acme, ApiException

acme = Acme(
    # Defining the host is optional and defaults to http://petstore.swagger.io/v2
    # See configuration.py for a list of all supported configuration parameters.
    host="http://petstore.swagger.io/v2",
)


async def main():
    try:
        # Pagination sandbox
        paginate_response = await acme.miscellaneous.apaginate(
            first=1,  # optional
            after="string_example",  # optional
        )
        pprint(paginate_response.body)
        pprint(paginate_response.body["edges"])
        pprint(paginate_response.body["page_info"])
        pprint(paginate_response.headers)
        pprint(paginate_response.status)
        pprint(paginate_response.round_trip_time)
    except ApiException as e:
        print("Exception when calling MiscellaneousApi.paginate: %s\n" % e)
        pprint(e.body)
        pprint(e.headers)
        pprint(e.status)
        pprint(e.reason)
        pprint(e.round_trip_time)


asyncio.run(main())

Documentation for API Endpoints

All URIs are relative to http://petstore.swagger.io/v2

Class Method HTTP request Description
MiscellaneousApi paginate get /pagination Pagination sandbox
PetApi add post /pet Add a new pet to the store
PetApi delete delete /pet/{petId} Deletes a pet
PetApi find_by_status get /pet/findByStatus Finds Pets by status
PetApi find_by_tags get /pet/findByTags Finds Pets by tags
PetApi get_by_id get /pet/{petId} Find pet by ID
PetApi update put /pet Update an existing pet
PetApi update_with_form post /pet/{petId} Updates a pet in the store with form data
PetApi upload_image post /pet/{petId}/uploadImage uploads an image
StoreApi delete_order delete /store/order/{orderId} Delete purchase order by ID
StoreApi get_inventory get /store/inventory Returns pet inventories by status
StoreApi get_order_by_id get /store/order/{orderId} Find purchase order by ID
StoreApi place_order post /store/order Place an order for a pet
UserApi create post /user Create user
UserApi create_with_array post /user/createWithArray Creates list of users with given input array
UserApi create_with_list post /user/createWithList Creates list of users with given input array
UserApi delete delete /user/{username} Delete user
UserApi get_by_name get /user/{username} Get user by user name
UserApi login get /user/login Logs user into the system
UserApi logout get /user/logout Logs out current logged in user session
UserApi update put /user/{username} Updated user

Documentation For Models

Author

This Python package is automatically generated by Konfig

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acme_python_sdk-1.0.0.tar.gz (75.6 kB view hashes)

Uploaded Source

Built Distribution

acme_python_sdk-1.0.0-py3-none-any.whl (217.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page