These are API's to easily manage your Thy Street device public pages. Thy Street APIs are completely RESTful and all our responses are returned in JSON.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 0.0.2
- Package version: 0.0.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/thystreet/thystreet/discussions
Python >=3.6
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import thystreetInstall via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import thystreetPlease follow the installation procedure and then run the following:
import time
import thystreet
from pprint import pprint
from thystreet.api import device_api
from thystreet.model.device_token_dto import DeviceTokenDto
from thystreet.model.set_device_details_dto import SetDeviceDetailsDto
# Defining the host is optional and defaults to https://cheffy-api.thystreet.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = thystreet.Configuration(
host = "https://cheffy-api.thystreet.com/api/v1"
)
# 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: thystreetAuth
configuration = thystreet.Configuration(
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD'
)
# Enter a context with an instance of the API client
with thystreet.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = device_api.DeviceApi(api_client)
device_id = "deviceId_example" # str |
try:
api_instance.generate_token(device_id)
except thystreet.ApiException as e:
print("Exception when calling DeviceApi->generate_token: %s\n" % e)All URIs are relative to https://cheffy-api.thystreet.com/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DeviceApi | generate_token | GET /device/generate/{deviceId} | |
| DeviceApi | set_details | PUT /device/details | Toggle your device tariff when your device goes online using this api. |
| DeviceApi | set_token | PUT /device/token | |
| OrderApi | get_order_by_id | GET /order/params/{orderToken} | |
| OrderApi | set_status | PUT /order/status/{orderToken} |
- Type: HTTP basic authentication
If the OpenAPI document is large, imports in thystreet.apis and thystreet.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 thystreet.api.default_api import DefaultApifrom thystreet.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import thystreet
from thystreet.apis import *
from thystreet.models import *