Skip to main content

Smartworks API SDK for Python

Reason this release was yanked:

not available

Project description

swx_sdk

Digital Model API documentation

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.8.12
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >= 3.6

Installation & Usage

pip install

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 swx_sdk

Setuptools

Install 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 swx_sdk

Getting Started

Please follow the installation procedure and then run the following:

import time
import swx_sdk
from pprint import pprint
from swx_sdk.api import actions_api
from swx_sdk.model.action_delay_list_response import ActionDelayListResponse
from swx_sdk.model.action_delete_response import ActionDeleteResponse
from swx_sdk.model.action_list_response import ActionListResponse
from swx_sdk.model.action_request import ActionRequest
from swx_sdk.model.action_response_element1 import ActionResponseElement1
from swx_sdk.model.action_update_request import ActionUpdateRequest
from swx_sdk.model.action_update_response import ActionUpdateResponse
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = swx_sdk.Configuration(
    host = "http://localhost"
)



# Enter a context with an instance of the API client
with swx_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = actions_api.ActionsApi(api_client)
    space = "altair" # str | 
collection_name = "ElectronicBoards" # str | 
thing_id = "01edb9j75vymj8p7qppm19h8nx" # str | 
action = "delay" # str | 
action_request = ActionRequest(
        delay=ActionRequestDelay(
            input=ActionRequestDelayInput(
                delay=5,
            ),
        ),
    ) # ActionRequest | Create a new action

    try:
        # Request action
        api_response = api_instance.add_action(space, collection_name, thing_id, action, action_request)
        pprint(api_response)
    except swx_sdk.ApiException as e:
        print("Exception when calling ActionsApi->add_action: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
ActionsApi add_action POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action} Request action
ActionsApi delete_action DELETE /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Delete Action
ActionsApi list_actions GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions Lists all the action queues for a thing
ActionsApi list_actions_by_name GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action} List the queue of actions from a thing
ActionsApi show_action GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Show action requested
ActionsApi update_action PUT /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Update action inside a queue
CollectionsApi add_collection POST /spaces/{space}/collections Create collection
CollectionsApi delete_collection DELETE /spaces/{space}/collections/{collection-name} Delete collection
CollectionsApi list_collections GET /spaces/{space}/collections List collections
CollectionsApi show_collection GET /spaces/{space}/collections/{collection-name} Show collection
CollectionsApi update_collection PUT /spaces/{space}/collections/{collection-name} Update collection
EventsApi add_event POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event} Add event
EventsApi list_events GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events List history of all events
EventsApi list_events_by_name GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event} List history of one type of event
EventsApi show_event GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event}/{event-id} Show event
ItemsApi list_items GET /spaces/{space}/collections/{collection-name}/things-status List items
ItemsApi show_item GET /spaces/{space}/collections/{collection-name}/things-status/{thing-id} Show item
ModelVersionsApi add_version POST /spaces/{space}/collections/{collection-name}/models/{model-name}/versions Create version
ModelVersionsApi delete_version DELETE /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Delete version
ModelVersionsApi list_version GET /spaces/{space}/collections/{collection-name}/models/{model-name}/versions List version
ModelVersionsApi show_version GET /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Show version
ModelVersionsApi update_version PUT /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Update version
ModelsApi add_model POST /spaces/{space}/collections/{collection-name}/models Create model
ModelsApi delete_model DELETE /spaces/{space}/collections/{collection-name}/models/{model-name} Delete model
ModelsApi list_models GET /spaces/{space}/collections/{collection-name}/models List models
ModelsApi show_model GET /spaces/{space}/collections/{collection-name}/models/{model-name} Show model
ModelsApi update_model PUT /spaces/{space}/collections/{collection-name}/models/{model-name} Update model
PropertiesApi list_properties GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties List properties
PropertiesApi show_property GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties/{property} Show property
PropertiesApi update_property PUT /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties/{property} Update property
ThingsApi add_thing POST /spaces/{space}/collections/{collection-name}/things Add a thing description
ThingsApi delete_thing DELETE /spaces/{space}/collections/{collection-name}/things/{thing-id} Delete thing
ThingsApi list_things GET /spaces/{space}/collections/{collection-name}/things List thing descriptions
ThingsApi reset_client_secret POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/reset-secret Reset Client Secret
ThingsApi show_thing GET /spaces/{space}/collections/{collection-name}/things/{thing-id} Show thing
ThingsApi update_thing PUT /spaces/{space}/collections/{collection-name}/things/{thing-id} Update thing description

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in swx_sdk.apis and swx_sdk.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 swx_sdk.api.default_api import DefaultApi
  • from swx_sdk.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import swx_sdk
from swx_sdk.apis import *
from swx_sdk.models import *

LICENSE This project is licensed under the MIT License - see the license file for details. LICENSE This project is licensed under the MIT License - see the license file for details. LICENSE This project is licensed under the MIT License - see the license file for details. LICENSE This project is licensed under the MIT License - see the license file for details. LICENSE This project is licensed under the MIT License - see the license file for details. LICENSE This project is licensed under the MIT License - see the license file for details.

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

SWX-API-Python-SDK-0.16.tar.gz (66.9 kB view hashes)

Uploaded Source

Built Distribution

SWX_API_Python_SDK-0.16-py3-none-any.whl (294.2 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