diff --git a/.apigentools-info b/.apigentools-info index c65e89d..a62516e 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -1,8 +1,8 @@ { "additional_stamps": [], - "apigentools_version": "0.3.0", + "apigentools_version": "0.5.0", "codegen_version": "4.1.2", "info_version": "1", "image": null, - "spec_repo_commit": "1c67728" + "spec_repo_commit": "f300f13" } \ No newline at end of file diff --git a/README.md b/README.md index e09e599..a7bfb3b 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ from oauthlib.oauth2 import BackendApplicationClient from requests_oauthlib import OAuth2Session oauth_client = BackendApplicationClient(client_id=YOUR_CLIENT_ID) -token_url = "https://login.oniudra.cc/oauth/token" +token_url = "https://login.arduino.cc/oauth/token" oauth = OAuth2Session(client=oauth_client) token = oauth.fetch_token( token_url=token_url, client_id=YOUR_CLIENT_ID, client_secret=YOUR_CLIENT_SECRET, - audience="https://api.arduino.cc", + audience="https://api2.arduino.cc/iot", ) print(token.get("access_token")) @@ -52,7 +52,7 @@ from iot_api_client.rest import ApiException from iot_api_client.configuration import Configuration # configure and instance the API client -client_config = Configuration(host="http://api-dev.arduino.cc/iot") +client_config = Configuration(host="http://api2.arduino.cc/iot") client_config.access_token = YOUR_ACCESS_TOKEN client = iot.ApiClient(client_config) diff --git a/arduino_iot_rest/__init__.py b/arduino_iot_rest/__init__.py new file mode 100644 index 0000000..dea5656 --- /dev/null +++ b/arduino_iot_rest/__init__.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0-beta1" + +# import apis into sdk package +from arduino_iot_rest.api.devices_v2_api import DevicesV2Api +from arduino_iot_rest.api.properties_v2_api import PropertiesV2Api +from arduino_iot_rest.api.series_v2_api import SeriesV2Api +from arduino_iot_rest.api.things_v2_api import ThingsV2Api + +# import ApiClient +from arduino_iot_rest.api_client import ApiClient +from arduino_iot_rest.configuration import Configuration +from arduino_iot_rest.exceptions import OpenApiException +from arduino_iot_rest.exceptions import ApiTypeError +from arduino_iot_rest.exceptions import ApiValueError +from arduino_iot_rest.exceptions import ApiKeyError +from arduino_iot_rest.exceptions import ApiException +# import models into sdk package +from arduino_iot_rest.models.arduino_devicev2 import ArduinoDevicev2 +from arduino_iot_rest.models.arduino_devicev2_webhook import ArduinoDevicev2Webhook +from arduino_iot_rest.models.arduino_devicev2properties import ArduinoDevicev2properties +from arduino_iot_rest.models.arduino_devicev2propertyvalue import ArduinoDevicev2propertyvalue +from arduino_iot_rest.models.arduino_devicev2propertyvalue_value import ArduinoDevicev2propertyvalueValue +from arduino_iot_rest.models.arduino_devicev2propertyvalue_value_statistics import ArduinoDevicev2propertyvalueValueStatistics +from arduino_iot_rest.models.arduino_devicev2propertyvalues import ArduinoDevicev2propertyvalues +from arduino_iot_rest.models.arduino_devicev2propertyvalues_last_evaluated_key import ArduinoDevicev2propertyvaluesLastEvaluatedKey +from arduino_iot_rest.models.arduino_property import ArduinoProperty +from arduino_iot_rest.models.arduino_series_batch import ArduinoSeriesBatch +from arduino_iot_rest.models.arduino_series_raw_batch import ArduinoSeriesRawBatch +from arduino_iot_rest.models.arduino_series_raw_batch_lastvalue import ArduinoSeriesRawBatchLastvalue +from arduino_iot_rest.models.arduino_series_raw_last_value_response import ArduinoSeriesRawLastValueResponse +from arduino_iot_rest.models.arduino_series_raw_response import ArduinoSeriesRawResponse +from arduino_iot_rest.models.arduino_series_response import ArduinoSeriesResponse +from arduino_iot_rest.models.arduino_thing import ArduinoThing +from arduino_iot_rest.models.batch_last_value_requests_media_v1 import BatchLastValueRequestsMediaV1 +from arduino_iot_rest.models.batch_query_raw_last_value_request_media_v1 import BatchQueryRawLastValueRequestMediaV1 +from arduino_iot_rest.models.batch_query_raw_request_media_v1 import BatchQueryRawRequestMediaV1 +from arduino_iot_rest.models.batch_query_raw_requests_media_v1 import BatchQueryRawRequestsMediaV1 +from arduino_iot_rest.models.batch_query_raw_response_series_media_v1 import BatchQueryRawResponseSeriesMediaV1 +from arduino_iot_rest.models.batch_query_request_media_v1 import BatchQueryRequestMediaV1 +from arduino_iot_rest.models.batch_query_requests_media_v1 import BatchQueryRequestsMediaV1 +from arduino_iot_rest.models.create_devices_v2_payload import CreateDevicesV2Payload +from arduino_iot_rest.models.create_things_v2_payload import CreateThingsV2Payload +from arduino_iot_rest.models.devicev2 import Devicev2 +from arduino_iot_rest.models.error import Error +from arduino_iot_rest.models.model_property import ModelProperty +from arduino_iot_rest.models.properties_value import PropertiesValue +from arduino_iot_rest.models.properties_values import PropertiesValues +from arduino_iot_rest.models.property_value import PropertyValue +from arduino_iot_rest.models.thing import Thing +from arduino_iot_rest.models.thing_sketch import ThingSketch + diff --git a/arduino_iot_rest/api/__init__.py b/arduino_iot_rest/api/__init__.py new file mode 100644 index 0000000..b046f27 --- /dev/null +++ b/arduino_iot_rest/api/__init__.py @@ -0,0 +1,9 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from arduino_iot_rest.api.devices_v2_api import DevicesV2Api +from arduino_iot_rest.api.properties_v2_api import PropertiesV2Api +from arduino_iot_rest.api.series_v2_api import SeriesV2Api +from arduino_iot_rest.api.things_v2_api import ThingsV2Api diff --git a/arduino_iot_rest/api/devices_v2_api.py b/arduino_iot_rest/api/devices_v2_api.py new file mode 100644 index 0000000..16309d9 --- /dev/null +++ b/arduino_iot_rest/api/devices_v2_api.py @@ -0,0 +1,937 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from arduino_iot_rest.api_client import ApiClient +from arduino_iot_rest.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class DevicesV2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def devices_v2_create(self, create_devices_v2_payload, **kwargs): # noqa: E501 + """create devices_v2 # noqa: E501 + + Creates a new device associated to the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_create(create_devices_v2_payload, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateDevicesV2Payload create_devices_v2_payload: DeviceV2 describes a device. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoDevicev2 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_create_with_http_info(create_devices_v2_payload, **kwargs) # noqa: E501 + + def devices_v2_create_with_http_info(self, create_devices_v2_payload, **kwargs): # noqa: E501 + """create devices_v2 # noqa: E501 + + Creates a new device associated to the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_create_with_http_info(create_devices_v2_payload, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateDevicesV2Payload create_devices_v2_payload: DeviceV2 describes a device. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoDevicev2, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['create_devices_v2_payload'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_create" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'create_devices_v2_payload' is set + if ('create_devices_v2_payload' not in local_var_params or + local_var_params['create_devices_v2_payload'] is None): + raise ApiValueError("Missing the required parameter `create_devices_v2_payload` when calling `devices_v2_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'create_devices_v2_payload' in local_var_params: + body_params = local_var_params['create_devices_v2_payload'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.devicev2+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoDevicev2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_delete(self, id, **kwargs): # noqa: E501 + """delete devices_v2 # noqa: E501 + + Removes a device associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_delete_with_http_info(id, **kwargs) # noqa: E501 + + def devices_v2_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """delete devices_v2 # noqa: E501 + + Removes a device associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_delete" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `devices_v2_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_get_properties(self, id, **kwargs): # noqa: E501 + """getProperties devices_v2 # noqa: E501 + + GET device properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_get_properties(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param bool show_deleted: If true, shows the soft deleted properties + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoDevicev2properties + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_get_properties_with_http_info(id, **kwargs) # noqa: E501 + + def devices_v2_get_properties_with_http_info(self, id, **kwargs): # noqa: E501 + """getProperties devices_v2 # noqa: E501 + + GET device properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_get_properties_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param bool show_deleted: If true, shows the soft deleted properties + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoDevicev2properties, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'show_deleted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_get_properties" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `devices_v2_get_properties`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + if 'show_deleted' in local_var_params: + query_params.append(('show_deleted', local_var_params['show_deleted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.devicev2properties+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices/{id}/properties', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoDevicev2properties', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_list(self, **kwargs): # noqa: E501 + """list devices_v2 # noqa: E501 + + Returns the list of devices associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_list(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool across_user_ids: If true, returns all the devices + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: list[ArduinoDevicev2] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_list_with_http_info(**kwargs) # noqa: E501 + + def devices_v2_list_with_http_info(self, **kwargs): # noqa: E501 + """list devices_v2 # noqa: E501 + + Returns the list of devices associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool across_user_ids: If true, returns all the devices + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(list[ArduinoDevicev2], status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['across_user_ids'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_list" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'across_user_ids' in local_var_params: + query_params.append(('across_user_ids', local_var_params['across_user_ids'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.devicev2+json; type=collection']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ArduinoDevicev2]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_show(self, id, **kwargs): # noqa: E501 + """show devices_v2 # noqa: E501 + + Returns the device requested by the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_show(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoDevicev2 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_show_with_http_info(id, **kwargs) # noqa: E501 + + def devices_v2_show_with_http_info(self, id, **kwargs): # noqa: E501 + """show devices_v2 # noqa: E501 + + Returns the device requested by the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_show_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoDevicev2, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_show" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `devices_v2_show`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.devicev2+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoDevicev2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_timeseries(self, id, pid, **kwargs): # noqa: E501 + """timeseries devices_v2 # noqa: E501 + + GET device properties values in a range of time # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_timeseries(id, pid, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param str pid: The id of the property (required) + :param int limit: The number of properties to select + :param str start: The time at which to start selecting properties + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoDevicev2propertyvalues + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_timeseries_with_http_info(id, pid, **kwargs) # noqa: E501 + + def devices_v2_timeseries_with_http_info(self, id, pid, **kwargs): # noqa: E501 + """timeseries devices_v2 # noqa: E501 + + GET device properties values in a range of time # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_timeseries_with_http_info(id, pid, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param str pid: The id of the property (required) + :param int limit: The number of properties to select + :param str start: The time at which to start selecting properties + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoDevicev2propertyvalues, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'pid', 'limit', 'start'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_timeseries" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `devices_v2_timeseries`") # noqa: E501 + # verify the required parameter 'pid' is set + if ('pid' not in local_var_params or + local_var_params['pid'] is None): + raise ApiValueError("Missing the required parameter `pid` when calling `devices_v2_timeseries`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + if 'pid' in local_var_params: + path_params['pid'] = local_var_params['pid'] # noqa: E501 + + query_params = [] + if 'limit' in local_var_params: + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'start' in local_var_params: + query_params.append(('start', local_var_params['start'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.devicev2propertyvalues+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices/{id}/properties/{pid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoDevicev2propertyvalues', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_update(self, id, devicev2, **kwargs): # noqa: E501 + """update devices_v2 # noqa: E501 + + Updates a device associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_update(id, devicev2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param Devicev2 devicev2: DeviceV2 describes a device. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoDevicev2 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_update_with_http_info(id, devicev2, **kwargs) # noqa: E501 + + def devices_v2_update_with_http_info(self, id, devicev2, **kwargs): # noqa: E501 + """update devices_v2 # noqa: E501 + + Updates a device associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_update_with_http_info(id, devicev2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param Devicev2 devicev2: DeviceV2 describes a device. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoDevicev2, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'devicev2'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_update" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `devices_v2_update`") # noqa: E501 + # verify the required parameter 'devicev2' is set + if ('devicev2' not in local_var_params or + local_var_params['devicev2'] is None): + raise ApiValueError("Missing the required parameter `devicev2` when calling `devices_v2_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'devicev2' in local_var_params: + body_params = local_var_params['devicev2'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.devicev2+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoDevicev2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def devices_v2_update_properties(self, id, properties_values, **kwargs): # noqa: E501 + """updateProperties devices_v2 # noqa: E501 + + Update device properties last values # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_update_properties(id, properties_values, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param PropertiesValues properties_values: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.devices_v2_update_properties_with_http_info(id, properties_values, **kwargs) # noqa: E501 + + def devices_v2_update_properties_with_http_info(self, id, properties_values, **kwargs): # noqa: E501 + """updateProperties devices_v2 # noqa: E501 + + Update device properties last values # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.devices_v2_update_properties_with_http_info(id, properties_values, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the device (required) + :param PropertiesValues properties_values: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'properties_values'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method devices_v2_update_properties" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `devices_v2_update_properties`") # noqa: E501 + # verify the required parameter 'properties_values' is set + if ('properties_values' not in local_var_params or + local_var_params['properties_values'] is None): + raise ApiValueError("Missing the required parameter `properties_values` when calling `devices_v2_update_properties`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'properties_values' in local_var_params: + body_params = local_var_params['properties_values'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/devices/{id}/properties', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/arduino_iot_rest/api/properties_v2_api.py b/arduino_iot_rest/api/properties_v2_api.py new file mode 100644 index 0000000..186ed1d --- /dev/null +++ b/arduino_iot_rest/api/properties_v2_api.py @@ -0,0 +1,765 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from arduino_iot_rest.api_client import ApiClient +from arduino_iot_rest.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class PropertiesV2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def properties_v2_create(self, id, model_property, **kwargs): # noqa: E501 + """create properties_v2 # noqa: E501 + + Creates a new property associated to a thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_create(id, model_property, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param ModelProperty model_property: PropertyPayload describes a property of a thing. No field is mandatory (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoProperty + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.properties_v2_create_with_http_info(id, model_property, **kwargs) # noqa: E501 + + def properties_v2_create_with_http_info(self, id, model_property, **kwargs): # noqa: E501 + """create properties_v2 # noqa: E501 + + Creates a new property associated to a thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_create_with_http_info(id, model_property, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param ModelProperty model_property: PropertyPayload describes a property of a thing. No field is mandatory (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoProperty, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'model_property'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method properties_v2_create" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `properties_v2_create`") # noqa: E501 + # verify the required parameter 'model_property' is set + if ('model_property' not in local_var_params or + local_var_params['model_property'] is None): + raise ApiValueError("Missing the required parameter `model_property` when calling `properties_v2_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'model_property' in local_var_params: + body_params = local_var_params['model_property'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.property+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/properties', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoProperty', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def properties_v2_delete(self, id, pid, **kwargs): # noqa: E501 + """delete properties_v2 # noqa: E501 + + Removes a property associated to a thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_delete(id, pid, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param bool force: If true, hard delete the property + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.properties_v2_delete_with_http_info(id, pid, **kwargs) # noqa: E501 + + def properties_v2_delete_with_http_info(self, id, pid, **kwargs): # noqa: E501 + """delete properties_v2 # noqa: E501 + + Removes a property associated to a thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_delete_with_http_info(id, pid, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param bool force: If true, hard delete the property + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'pid', 'force'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method properties_v2_delete" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `properties_v2_delete`") # noqa: E501 + # verify the required parameter 'pid' is set + if ('pid' not in local_var_params or + local_var_params['pid'] is None): + raise ApiValueError("Missing the required parameter `pid` when calling `properties_v2_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + if 'pid' in local_var_params: + path_params['pid'] = local_var_params['pid'] # noqa: E501 + + query_params = [] + if 'force' in local_var_params: + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.goa.error+json', 'text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/properties/{pid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def properties_v2_list(self, id, **kwargs): # noqa: E501 + """list properties_v2 # noqa: E501 + + Returns the list of properties associated to the thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_list(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param bool show_deleted: If true, shows the soft deleted properties + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: list[ArduinoProperty] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.properties_v2_list_with_http_info(id, **kwargs) # noqa: E501 + + def properties_v2_list_with_http_info(self, id, **kwargs): # noqa: E501 + """list properties_v2 # noqa: E501 + + Returns the list of properties associated to the thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_list_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param bool show_deleted: If true, shows the soft deleted properties + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(list[ArduinoProperty], status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'show_deleted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method properties_v2_list" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `properties_v2_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + if 'show_deleted' in local_var_params: + query_params.append(('show_deleted', local_var_params['show_deleted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.property+json; type=collection', 'application/vnd.goa.error+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/properties', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ArduinoProperty]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def properties_v2_publish(self, id, pid, property_value, **kwargs): # noqa: E501 + """publish properties_v2 # noqa: E501 + + Publish a property value to MQTT # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_publish(id, pid, property_value, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param PropertyValue property_value: PropertyValuePayload describes a property value (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.properties_v2_publish_with_http_info(id, pid, property_value, **kwargs) # noqa: E501 + + def properties_v2_publish_with_http_info(self, id, pid, property_value, **kwargs): # noqa: E501 + """publish properties_v2 # noqa: E501 + + Publish a property value to MQTT # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_publish_with_http_info(id, pid, property_value, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param PropertyValue property_value: PropertyValuePayload describes a property value (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'pid', 'property_value'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method properties_v2_publish" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `properties_v2_publish`") # noqa: E501 + # verify the required parameter 'pid' is set + if ('pid' not in local_var_params or + local_var_params['pid'] is None): + raise ApiValueError("Missing the required parameter `pid` when calling `properties_v2_publish`") # noqa: E501 + # verify the required parameter 'property_value' is set + if ('property_value' not in local_var_params or + local_var_params['property_value'] is None): + raise ApiValueError("Missing the required parameter `property_value` when calling `properties_v2_publish`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + if 'pid' in local_var_params: + path_params['pid'] = local_var_params['pid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'property_value' in local_var_params: + body_params = local_var_params['property_value'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.goa.error+json', 'text/plain']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/properties/{pid}/publish', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def properties_v2_show(self, id, pid, **kwargs): # noqa: E501 + """show properties_v2 # noqa: E501 + + Returns the property requested by the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_show(id, pid, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param bool show_deleted: If true, shows the soft deleted properties + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoProperty + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.properties_v2_show_with_http_info(id, pid, **kwargs) # noqa: E501 + + def properties_v2_show_with_http_info(self, id, pid, **kwargs): # noqa: E501 + """show properties_v2 # noqa: E501 + + Returns the property requested by the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_show_with_http_info(id, pid, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param bool show_deleted: If true, shows the soft deleted properties + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoProperty, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'pid', 'show_deleted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method properties_v2_show" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `properties_v2_show`") # noqa: E501 + # verify the required parameter 'pid' is set + if ('pid' not in local_var_params or + local_var_params['pid'] is None): + raise ApiValueError("Missing the required parameter `pid` when calling `properties_v2_show`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + if 'pid' in local_var_params: + path_params['pid'] = local_var_params['pid'] # noqa: E501 + + query_params = [] + if 'show_deleted' in local_var_params: + query_params.append(('show_deleted', local_var_params['show_deleted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.property+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/properties/{pid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoProperty', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def properties_v2_update(self, id, pid, model_property, **kwargs): # noqa: E501 + """update properties_v2 # noqa: E501 + + Updates a property associated to a thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_update(id, pid, model_property, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param ModelProperty model_property: PropertyPayload describes a property of a thing. No field is mandatory (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoProperty + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.properties_v2_update_with_http_info(id, pid, model_property, **kwargs) # noqa: E501 + + def properties_v2_update_with_http_info(self, id, pid, model_property, **kwargs): # noqa: E501 + """update properties_v2 # noqa: E501 + + Updates a property associated to a thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.properties_v2_update_with_http_info(id, pid, model_property, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str pid: The id of the property (required) + :param ModelProperty model_property: PropertyPayload describes a property of a thing. No field is mandatory (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoProperty, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'pid', 'model_property'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method properties_v2_update" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `properties_v2_update`") # noqa: E501 + # verify the required parameter 'pid' is set + if ('pid' not in local_var_params or + local_var_params['pid'] is None): + raise ApiValueError("Missing the required parameter `pid` when calling `properties_v2_update`") # noqa: E501 + # verify the required parameter 'model_property' is set + if ('model_property' not in local_var_params or + local_var_params['model_property'] is None): + raise ApiValueError("Missing the required parameter `model_property` when calling `properties_v2_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + if 'pid' in local_var_params: + path_params['pid'] = local_var_params['pid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'model_property' in local_var_params: + body_params = local_var_params['model_property'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.property+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/properties/{pid}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoProperty', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/arduino_iot_rest/api/series_v2_api.py b/arduino_iot_rest/api/series_v2_api.py new file mode 100644 index 0000000..e83a350 --- /dev/null +++ b/arduino_iot_rest/api/series_v2_api.py @@ -0,0 +1,373 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from arduino_iot_rest.api_client import ApiClient +from arduino_iot_rest.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class SeriesV2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def series_v2_batch_query(self, batch_query_requests_media_v1, **kwargs): # noqa: E501 + """batch_query series_v2 # noqa: E501 + + Returns the batch of time-series data # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.series_v2_batch_query(batch_query_requests_media_v1, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param BatchQueryRequestsMediaV1 batch_query_requests_media_v1: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoSeriesBatch + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.series_v2_batch_query_with_http_info(batch_query_requests_media_v1, **kwargs) # noqa: E501 + + def series_v2_batch_query_with_http_info(self, batch_query_requests_media_v1, **kwargs): # noqa: E501 + """batch_query series_v2 # noqa: E501 + + Returns the batch of time-series data # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.series_v2_batch_query_with_http_info(batch_query_requests_media_v1, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param BatchQueryRequestsMediaV1 batch_query_requests_media_v1: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoSeriesBatch, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['batch_query_requests_media_v1'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method series_v2_batch_query" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'batch_query_requests_media_v1' is set + if ('batch_query_requests_media_v1' not in local_var_params or + local_var_params['batch_query_requests_media_v1'] is None): + raise ApiValueError("Missing the required parameter `batch_query_requests_media_v1` when calling `series_v2_batch_query`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'batch_query_requests_media_v1' in local_var_params: + body_params = local_var_params['batch_query_requests_media_v1'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.series.batch+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/series/batch_query', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoSeriesBatch', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def series_v2_batch_query_raw(self, batch_query_raw_requests_media_v1, **kwargs): # noqa: E501 + """batch_query_raw series_v2 # noqa: E501 + + Returns the batch of time-series data raw # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.series_v2_batch_query_raw(batch_query_raw_requests_media_v1, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param BatchQueryRawRequestsMediaV1 batch_query_raw_requests_media_v1: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoSeriesRawBatch + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.series_v2_batch_query_raw_with_http_info(batch_query_raw_requests_media_v1, **kwargs) # noqa: E501 + + def series_v2_batch_query_raw_with_http_info(self, batch_query_raw_requests_media_v1, **kwargs): # noqa: E501 + """batch_query_raw series_v2 # noqa: E501 + + Returns the batch of time-series data raw # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.series_v2_batch_query_raw_with_http_info(batch_query_raw_requests_media_v1, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param BatchQueryRawRequestsMediaV1 batch_query_raw_requests_media_v1: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoSeriesRawBatch, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['batch_query_raw_requests_media_v1'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method series_v2_batch_query_raw" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'batch_query_raw_requests_media_v1' is set + if ('batch_query_raw_requests_media_v1' not in local_var_params or + local_var_params['batch_query_raw_requests_media_v1'] is None): + raise ApiValueError("Missing the required parameter `batch_query_raw_requests_media_v1` when calling `series_v2_batch_query_raw`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'batch_query_raw_requests_media_v1' in local_var_params: + body_params = local_var_params['batch_query_raw_requests_media_v1'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.series.raw.batch+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/series/batch_query_raw', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoSeriesRawBatch', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def series_v2_batch_query_raw_last_value(self, batch_last_value_requests_media_v1, **kwargs): # noqa: E501 + """batch_query_raw_last_value series_v2 # noqa: E501 + + Returns the batch of time-series data raw # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.series_v2_batch_query_raw_last_value(batch_last_value_requests_media_v1, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param BatchLastValueRequestsMediaV1 batch_last_value_requests_media_v1: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoSeriesRawBatchLastvalue + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.series_v2_batch_query_raw_last_value_with_http_info(batch_last_value_requests_media_v1, **kwargs) # noqa: E501 + + def series_v2_batch_query_raw_last_value_with_http_info(self, batch_last_value_requests_media_v1, **kwargs): # noqa: E501 + """batch_query_raw_last_value series_v2 # noqa: E501 + + Returns the batch of time-series data raw # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.series_v2_batch_query_raw_last_value_with_http_info(batch_last_value_requests_media_v1, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param BatchLastValueRequestsMediaV1 batch_last_value_requests_media_v1: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoSeriesRawBatchLastvalue, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['batch_last_value_requests_media_v1'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method series_v2_batch_query_raw_last_value" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'batch_last_value_requests_media_v1' is set + if ('batch_last_value_requests_media_v1' not in local_var_params or + local_var_params['batch_last_value_requests_media_v1'] is None): + raise ApiValueError("Missing the required parameter `batch_last_value_requests_media_v1` when calling `series_v2_batch_query_raw_last_value`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'batch_last_value_requests_media_v1' in local_var_params: + body_params = local_var_params['batch_last_value_requests_media_v1'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.series.raw.batch.lastvalue+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/series/batch_query_raw/lastvalue', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoSeriesRawBatchLastvalue', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/arduino_iot_rest/api/things_v2_api.py b/arduino_iot_rest/api/things_v2_api.py new file mode 100644 index 0000000..56f11ca --- /dev/null +++ b/arduino_iot_rest/api/things_v2_api.py @@ -0,0 +1,951 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from arduino_iot_rest.api_client import ApiClient +from arduino_iot_rest.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class ThingsV2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def things_v2_create(self, create_things_v2_payload, **kwargs): # noqa: E501 + """create things_v2 # noqa: E501 + + Creates a new thing associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_create(create_things_v2_payload, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateThingsV2Payload create_things_v2_payload: ThingPayload describes a thing (required) + :param bool force: If true, detach device from the other thing, and attach to this thing + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoThing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_create_with_http_info(create_things_v2_payload, **kwargs) # noqa: E501 + + def things_v2_create_with_http_info(self, create_things_v2_payload, **kwargs): # noqa: E501 + """create things_v2 # noqa: E501 + + Creates a new thing associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_create_with_http_info(create_things_v2_payload, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateThingsV2Payload create_things_v2_payload: ThingPayload describes a thing (required) + :param bool force: If true, detach device from the other thing, and attach to this thing + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoThing, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['create_things_v2_payload', 'force'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_create" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'create_things_v2_payload' is set + if ('create_things_v2_payload' not in local_var_params or + local_var_params['create_things_v2_payload'] is None): + raise ApiValueError("Missing the required parameter `create_things_v2_payload` when calling `things_v2_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'force' in local_var_params: + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'create_things_v2_payload' in local_var_params: + body_params = local_var_params['create_things_v2_payload'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoThing', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_create_sketch(self, id, thing_sketch, **kwargs): # noqa: E501 + """createSketch things_v2 # noqa: E501 + + Creates a new sketch thing associated to the thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_create_sketch(id, thing_sketch, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param ThingSketch thing_sketch: ThingSketchPayload describes a sketch of a thing (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoThing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_create_sketch_with_http_info(id, thing_sketch, **kwargs) # noqa: E501 + + def things_v2_create_sketch_with_http_info(self, id, thing_sketch, **kwargs): # noqa: E501 + """createSketch things_v2 # noqa: E501 + + Creates a new sketch thing associated to the thing # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_create_sketch_with_http_info(id, thing_sketch, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param ThingSketch thing_sketch: ThingSketchPayload describes a sketch of a thing (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoThing, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'thing_sketch'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_create_sketch" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `things_v2_create_sketch`") # noqa: E501 + # verify the required parameter 'thing_sketch' is set + if ('thing_sketch' not in local_var_params or + local_var_params['thing_sketch'] is None): + raise ApiValueError("Missing the required parameter `thing_sketch` when calling `things_v2_create_sketch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'thing_sketch' in local_var_params: + body_params = local_var_params['thing_sketch'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/sketch', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoThing', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_delete(self, id, **kwargs): # noqa: E501 + """delete things_v2 # noqa: E501 + + Removes a thing associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param bool force: If true, hard delete the thing + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_delete_with_http_info(id, **kwargs) # noqa: E501 + + def things_v2_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """delete things_v2 # noqa: E501 + + Removes a thing associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param bool force: If true, hard delete the thing + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'force'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_delete" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `things_v2_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + if 'force' in local_var_params: + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_delete_sketch(self, id, **kwargs): # noqa: E501 + """deleteSketch things_v2 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_delete_sketch(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoThing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_delete_sketch_with_http_info(id, **kwargs) # noqa: E501 + + def things_v2_delete_sketch_with_http_info(self, id, **kwargs): # noqa: E501 + """deleteSketch things_v2 # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_delete_sketch_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoThing, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_delete_sketch" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `things_v2_delete_sketch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/sketch', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoThing', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_list(self, **kwargs): # noqa: E501 + """list things_v2 # noqa: E501 + + Returns the list of things associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_list(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool across_user_ids: If true, returns all the things + :param str device_id: The id of the device you want to filter + :param bool show_deleted: If true, shows the soft deleted things + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: list[ArduinoThing] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_list_with_http_info(**kwargs) # noqa: E501 + + def things_v2_list_with_http_info(self, **kwargs): # noqa: E501 + """list things_v2 # noqa: E501 + + Returns the list of things associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool across_user_ids: If true, returns all the things + :param str device_id: The id of the device you want to filter + :param bool show_deleted: If true, shows the soft deleted things + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(list[ArduinoThing], status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['across_user_ids', 'device_id', 'show_deleted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_list" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'across_user_ids' in local_var_params: + query_params.append(('across_user_ids', local_var_params['across_user_ids'])) # noqa: E501 + if 'device_id' in local_var_params: + query_params.append(('device_id', local_var_params['device_id'])) # noqa: E501 + if 'show_deleted' in local_var_params: + query_params.append(('show_deleted', local_var_params['show_deleted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json; type=collection']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ArduinoThing]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_show(self, id, **kwargs): # noqa: E501 + """show things_v2 # noqa: E501 + + Returns the thing requested by the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_show(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param bool show_deleted: If true, shows the soft deleted thing + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoThing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_show_with_http_info(id, **kwargs) # noqa: E501 + + def things_v2_show_with_http_info(self, id, **kwargs): # noqa: E501 + """show things_v2 # noqa: E501 + + Returns the thing requested by the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_show_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param bool show_deleted: If true, shows the soft deleted thing + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoThing, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'show_deleted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_show" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `things_v2_show`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + if 'show_deleted' in local_var_params: + query_params.append(('show_deleted', local_var_params['show_deleted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoThing', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_update(self, id, thing, **kwargs): # noqa: E501 + """update things_v2 # noqa: E501 + + Updates a thing associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_update(id, thing, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param Thing thing: ThingPayload describes a thing (required) + :param bool force: If true, detach device from the other thing, and attach to this thing + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoThing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_update_with_http_info(id, thing, **kwargs) # noqa: E501 + + def things_v2_update_with_http_info(self, id, thing, **kwargs): # noqa: E501 + """update things_v2 # noqa: E501 + + Updates a thing associated to the user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_update_with_http_info(id, thing, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param Thing thing: ThingPayload describes a thing (required) + :param bool force: If true, detach device from the other thing, and attach to this thing + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoThing, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'thing', 'force'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_update" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `things_v2_update`") # noqa: E501 + # verify the required parameter 'thing' is set + if ('thing' not in local_var_params or + local_var_params['thing'] is None): + raise ApiValueError("Missing the required parameter `thing` when calling `things_v2_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + + query_params = [] + if 'force' in local_var_params: + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'thing' in local_var_params: + body_params = local_var_params['thing'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoThing', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def things_v2_update_sketch(self, id, sketch_id, **kwargs): # noqa: E501 + """updateSketch things_v2 # noqa: E501 + + Update an existing thing sketch # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_update_sketch(id, sketch_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str sketch_id: The id of the sketch (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ArduinoThing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.things_v2_update_sketch_with_http_info(id, sketch_id, **kwargs) # noqa: E501 + + def things_v2_update_sketch_with_http_info(self, id, sketch_id, **kwargs): # noqa: E501 + """updateSketch things_v2 # noqa: E501 + + Update an existing thing sketch # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.things_v2_update_sketch_with_http_info(id, sketch_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str id: The id of the thing (required) + :param str sketch_id: The id of the sketch (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ArduinoThing, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['id', 'sketch_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method things_v2_update_sketch" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in local_var_params or + local_var_params['id'] is None): + raise ApiValueError("Missing the required parameter `id` when calling `things_v2_update_sketch`") # noqa: E501 + # verify the required parameter 'sketch_id' is set + if ('sketch_id' not in local_var_params or + local_var_params['sketch_id'] is None): + raise ApiValueError("Missing the required parameter `sketch_id` when calling `things_v2_update_sketch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in local_var_params: + path_params['id'] = local_var_params['id'] # noqa: E501 + if 'sketch_id' in local_var_params: + path_params['sketchId'] = local_var_params['sketch_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.arduino.thing+json', 'application/vnd.goa.error+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/things/{id}/sketch/{sketchId}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ArduinoThing', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/arduino_iot_rest/api_client.py b/arduino_iot_rest/api_client.py new file mode 100644 index 0000000..c38d339 --- /dev/null +++ b/arduino_iot_rest/api_client.py @@ -0,0 +1,640 @@ +# coding: utf-8 +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from arduino_iot_rest.configuration import Configuration +import arduino_iot_rest.models +from arduino_iot_rest import rest +from arduino_iot_rest.exceptions import ApiValueError + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI/1.0.0-beta1/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(arduino_iot_rest.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.openapi_types and not hasattr(klass, + 'get_real_child_model'): + return data + + kwargs = {} + if klass.openapi_types is not None: + for attr, attr_type in six.iteritems(klass.openapi_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/arduino_iot_rest/configuration.py b/arduino_iot_rest/configuration.py new file mode 100644 index 0000000..3e7c5e4 --- /dev/null +++ b/arduino_iot_rest/configuration.py @@ -0,0 +1,328 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls, **kwargs): + if cls._default is None: + cls._default = type.__call__(cls, **kwargs) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + """ + + def __init__(self, host="http://api2.arduino.cc/iot", + api_key={}, api_key_prefix={}, + username="", password=""): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = "" + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("arduino_iot_rest") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'oauth2': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2.0\n"\ + "SDK Package Version: 1.0.0-beta1".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://api2.arduino.cc/iot", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables={}): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + + servers = self.get_host_settings() + + # check array index out of bound + if index < 0 or index >= len(servers): + raise ValueError( + "Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501 + .format(index, len(servers))) + + server = servers[index] + url = server['url'] + + # go through variable and assign a value + for variable_name in server['variables']: + if variable_name in variables: + if variables[variable_name] in server['variables'][ + variable_name]['enum_values']: + url = url.replace("{" + variable_name + "}", + variables[variable_name]) + else: + raise ValueError( + "The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501 + .format( + variable_name, variables[variable_name], + server['variables'][variable_name]['enum_values'])) + else: + # use default value + url = url.replace( + "{" + variable_name + "}", + server['variables'][variable_name]['default_value']) + + return url diff --git a/arduino_iot_rest/exceptions.py b/arduino_iot_rest/exceptions.py new file mode 100644 index 0000000..347ad50 --- /dev/null +++ b/arduino_iot_rest/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/arduino_iot_rest/models/__init__.py b/arduino_iot_rest/models/__init__.py new file mode 100644 index 0000000..95632a8 --- /dev/null +++ b/arduino_iot_rest/models/__init__.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +# flake8: noqa +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from arduino_iot_rest.models.arduino_devicev2 import ArduinoDevicev2 +from arduino_iot_rest.models.arduino_devicev2_webhook import ArduinoDevicev2Webhook +from arduino_iot_rest.models.arduino_devicev2properties import ArduinoDevicev2properties +from arduino_iot_rest.models.arduino_devicev2propertyvalue import ArduinoDevicev2propertyvalue +from arduino_iot_rest.models.arduino_devicev2propertyvalue_value import ArduinoDevicev2propertyvalueValue +from arduino_iot_rest.models.arduino_devicev2propertyvalue_value_statistics import ArduinoDevicev2propertyvalueValueStatistics +from arduino_iot_rest.models.arduino_devicev2propertyvalues import ArduinoDevicev2propertyvalues +from arduino_iot_rest.models.arduino_devicev2propertyvalues_last_evaluated_key import ArduinoDevicev2propertyvaluesLastEvaluatedKey +from arduino_iot_rest.models.arduino_property import ArduinoProperty +from arduino_iot_rest.models.arduino_series_batch import ArduinoSeriesBatch +from arduino_iot_rest.models.arduino_series_raw_batch import ArduinoSeriesRawBatch +from arduino_iot_rest.models.arduino_series_raw_batch_lastvalue import ArduinoSeriesRawBatchLastvalue +from arduino_iot_rest.models.arduino_series_raw_last_value_response import ArduinoSeriesRawLastValueResponse +from arduino_iot_rest.models.arduino_series_raw_response import ArduinoSeriesRawResponse +from arduino_iot_rest.models.arduino_series_response import ArduinoSeriesResponse +from arduino_iot_rest.models.arduino_thing import ArduinoThing +from arduino_iot_rest.models.batch_last_value_requests_media_v1 import BatchLastValueRequestsMediaV1 +from arduino_iot_rest.models.batch_query_raw_last_value_request_media_v1 import BatchQueryRawLastValueRequestMediaV1 +from arduino_iot_rest.models.batch_query_raw_request_media_v1 import BatchQueryRawRequestMediaV1 +from arduino_iot_rest.models.batch_query_raw_requests_media_v1 import BatchQueryRawRequestsMediaV1 +from arduino_iot_rest.models.batch_query_raw_response_series_media_v1 import BatchQueryRawResponseSeriesMediaV1 +from arduino_iot_rest.models.batch_query_request_media_v1 import BatchQueryRequestMediaV1 +from arduino_iot_rest.models.batch_query_requests_media_v1 import BatchQueryRequestsMediaV1 +from arduino_iot_rest.models.create_devices_v2_payload import CreateDevicesV2Payload +from arduino_iot_rest.models.create_things_v2_payload import CreateThingsV2Payload +from arduino_iot_rest.models.devicev2 import Devicev2 +from arduino_iot_rest.models.error import Error +from arduino_iot_rest.models.model_property import ModelProperty +from arduino_iot_rest.models.properties_value import PropertiesValue +from arduino_iot_rest.models.properties_values import PropertiesValues +from arduino_iot_rest.models.property_value import PropertyValue +from arduino_iot_rest.models.thing import Thing +from arduino_iot_rest.models.thing_sketch import ThingSketch diff --git a/arduino_iot_rest/models/arduino_devicev2.py b/arduino_iot_rest/models/arduino_devicev2.py new file mode 100644 index 0000000..604982c --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'created_at': 'datetime', + 'href': 'str', + 'id': 'str', + 'metadata': 'dict(str, object)', + 'name': 'str', + 'serial': 'str', + 'type': 'str', + 'user_id': 'str', + 'webhooks': 'list[ArduinoDevicev2Webhook]' + } + + attribute_map = { + 'created_at': 'created_at', + 'href': 'href', + 'id': 'id', + 'metadata': 'metadata', + 'name': 'name', + 'serial': 'serial', + 'type': 'type', + 'user_id': 'user_id', + 'webhooks': 'webhooks' + } + + def __init__(self, created_at=None, href=None, id=None, metadata=None, name=None, serial=None, type=None, user_id=None, webhooks=None): # noqa: E501 + """ArduinoDevicev2 - a model defined in OpenAPI""" # noqa: E501 + + self._created_at = None + self._href = None + self._id = None + self._metadata = None + self._name = None + self._serial = None + self._type = None + self._user_id = None + self._webhooks = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + self.href = href + self.id = id + if metadata is not None: + self.metadata = metadata + self.name = name + self.serial = serial + self.type = type + self.user_id = user_id + if webhooks is not None: + self.webhooks = webhooks + + @property + def created_at(self): + """Gets the created_at of this ArduinoDevicev2. # noqa: E501 + + Creation date of the device # noqa: E501 + + :return: The created_at of this ArduinoDevicev2. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ArduinoDevicev2. + + Creation date of the device # noqa: E501 + + :param created_at: The created_at of this ArduinoDevicev2. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def href(self): + """Gets the href of this ArduinoDevicev2. # noqa: E501 + + The api reference of this device # noqa: E501 + + :return: The href of this ArduinoDevicev2. # noqa: E501 + :rtype: str + """ + return self._href + + @href.setter + def href(self, href): + """Sets the href of this ArduinoDevicev2. + + The api reference of this device # noqa: E501 + + :param href: The href of this ArduinoDevicev2. # noqa: E501 + :type: str + """ + if href is None: + raise ValueError("Invalid value for `href`, must not be `None`") # noqa: E501 + + self._href = href + + @property + def id(self): + """Gets the id of this ArduinoDevicev2. # noqa: E501 + + The arn of the device # noqa: E501 + + :return: The id of this ArduinoDevicev2. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ArduinoDevicev2. + + The arn of the device # noqa: E501 + + :param id: The id of this ArduinoDevicev2. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def metadata(self): + """Gets the metadata of this ArduinoDevicev2. # noqa: E501 + + The metadata of the device # noqa: E501 + + :return: The metadata of this ArduinoDevicev2. # noqa: E501 + :rtype: dict(str, object) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this ArduinoDevicev2. + + The metadata of the device # noqa: E501 + + :param metadata: The metadata of this ArduinoDevicev2. # noqa: E501 + :type: dict(str, object) + """ + + self._metadata = metadata + + @property + def name(self): + """Gets the name of this ArduinoDevicev2. # noqa: E501 + + The friendly name of the device # noqa: E501 + + :return: The name of this ArduinoDevicev2. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ArduinoDevicev2. + + The friendly name of the device # noqa: E501 + + :param name: The name of this ArduinoDevicev2. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def serial(self): + """Gets the serial of this ArduinoDevicev2. # noqa: E501 + + The serial uuid of the device # noqa: E501 + + :return: The serial of this ArduinoDevicev2. # noqa: E501 + :rtype: str + """ + return self._serial + + @serial.setter + def serial(self, serial): + """Sets the serial of this ArduinoDevicev2. + + The serial uuid of the device # noqa: E501 + + :param serial: The serial of this ArduinoDevicev2. # noqa: E501 + :type: str + """ + if serial is None: + raise ValueError("Invalid value for `serial`, must not be `None`") # noqa: E501 + + self._serial = serial + + @property + def type(self): + """Gets the type of this ArduinoDevicev2. # noqa: E501 + + The type of the device # noqa: E501 + + :return: The type of this ArduinoDevicev2. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ArduinoDevicev2. + + The type of the device # noqa: E501 + + :param type: The type of this ArduinoDevicev2. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def user_id(self): + """Gets the user_id of this ArduinoDevicev2. # noqa: E501 + + The id of the user # noqa: E501 + + :return: The user_id of this ArduinoDevicev2. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this ArduinoDevicev2. + + The id of the user # noqa: E501 + + :param user_id: The user_id of this ArduinoDevicev2. # noqa: E501 + :type: str + """ + if user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def webhooks(self): + """Gets the webhooks of this ArduinoDevicev2. # noqa: E501 + + ArduinoDevicev2WebhookCollection is the media type for an array of ArduinoDevicev2Webhook (default view) # noqa: E501 + + :return: The webhooks of this ArduinoDevicev2. # noqa: E501 + :rtype: list[ArduinoDevicev2Webhook] + """ + return self._webhooks + + @webhooks.setter + def webhooks(self, webhooks): + """Sets the webhooks of this ArduinoDevicev2. + + ArduinoDevicev2WebhookCollection is the media type for an array of ArduinoDevicev2Webhook (default view) # noqa: E501 + + :param webhooks: The webhooks of this ArduinoDevicev2. # noqa: E501 + :type: list[ArduinoDevicev2Webhook] + """ + + self._webhooks = webhooks + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2_webhook.py b/arduino_iot_rest/models/arduino_devicev2_webhook.py new file mode 100644 index 0000000..3711482 --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2_webhook.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2Webhook(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'active': 'bool', + 'id': 'str', + 'uri': 'str' + } + + attribute_map = { + 'active': 'active', + 'id': 'id', + 'uri': 'uri' + } + + def __init__(self, active=True, id=None, uri=None): # noqa: E501 + """ArduinoDevicev2Webhook - a model defined in OpenAPI""" # noqa: E501 + + self._active = None + self._id = None + self._uri = None + self.discriminator = None + + if active is not None: + self.active = active + self.id = id + self.uri = uri + + @property + def active(self): + """Gets the active of this ArduinoDevicev2Webhook. # noqa: E501 + + Whether the webhook is active # noqa: E501 + + :return: The active of this ArduinoDevicev2Webhook. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this ArduinoDevicev2Webhook. + + Whether the webhook is active # noqa: E501 + + :param active: The active of this ArduinoDevicev2Webhook. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def id(self): + """Gets the id of this ArduinoDevicev2Webhook. # noqa: E501 + + The uuid of the webhook # noqa: E501 + + :return: The id of this ArduinoDevicev2Webhook. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ArduinoDevicev2Webhook. + + The uuid of the webhook # noqa: E501 + + :param id: The id of this ArduinoDevicev2Webhook. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def uri(self): + """Gets the uri of this ArduinoDevicev2Webhook. # noqa: E501 + + The uri of the webhook # noqa: E501 + + :return: The uri of this ArduinoDevicev2Webhook. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this ArduinoDevicev2Webhook. + + The uri of the webhook # noqa: E501 + + :param uri: The uri of this ArduinoDevicev2Webhook. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2Webhook): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2properties.py b/arduino_iot_rest/models/arduino_devicev2properties.py new file mode 100644 index 0000000..7e35e8c --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2properties.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2properties(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data_retention_days': 'float', + 'device_id': 'str', + 'properties': 'list[ArduinoProperty]', + 'user_id': 'str' + } + + attribute_map = { + 'data_retention_days': 'data_retention_days', + 'device_id': 'deviceId', + 'properties': 'properties', + 'user_id': 'user_id' + } + + def __init__(self, data_retention_days=None, device_id=None, properties=None, user_id=None): # noqa: E501 + """ArduinoDevicev2properties - a model defined in OpenAPI""" # noqa: E501 + + self._data_retention_days = None + self._device_id = None + self._properties = None + self._user_id = None + self.discriminator = None + + self.data_retention_days = data_retention_days + self.device_id = device_id + self.properties = properties + self.user_id = user_id + + @property + def data_retention_days(self): + """Gets the data_retention_days of this ArduinoDevicev2properties. # noqa: E501 + + How many days the data will be kept # noqa: E501 + + :return: The data_retention_days of this ArduinoDevicev2properties. # noqa: E501 + :rtype: float + """ + return self._data_retention_days + + @data_retention_days.setter + def data_retention_days(self, data_retention_days): + """Sets the data_retention_days of this ArduinoDevicev2properties. + + How many days the data will be kept # noqa: E501 + + :param data_retention_days: The data_retention_days of this ArduinoDevicev2properties. # noqa: E501 + :type: float + """ + if data_retention_days is None: + raise ValueError("Invalid value for `data_retention_days`, must not be `None`") # noqa: E501 + + self._data_retention_days = data_retention_days + + @property + def device_id(self): + """Gets the device_id of this ArduinoDevicev2properties. # noqa: E501 + + The device of the property # noqa: E501 + + :return: The device_id of this ArduinoDevicev2properties. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this ArduinoDevicev2properties. + + The device of the property # noqa: E501 + + :param device_id: The device_id of this ArduinoDevicev2properties. # noqa: E501 + :type: str + """ + if device_id is None: + raise ValueError("Invalid value for `device_id`, must not be `None`") # noqa: E501 + + self._device_id = device_id + + @property + def properties(self): + """Gets the properties of this ArduinoDevicev2properties. # noqa: E501 + + ArduinoPropertyCollection is the media type for an array of ArduinoProperty (default view) # noqa: E501 + + :return: The properties of this ArduinoDevicev2properties. # noqa: E501 + :rtype: list[ArduinoProperty] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this ArduinoDevicev2properties. + + ArduinoPropertyCollection is the media type for an array of ArduinoProperty (default view) # noqa: E501 + + :param properties: The properties of this ArduinoDevicev2properties. # noqa: E501 + :type: list[ArduinoProperty] + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def user_id(self): + """Gets the user_id of this ArduinoDevicev2properties. # noqa: E501 + + The user id of the owner # noqa: E501 + + :return: The user_id of this ArduinoDevicev2properties. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this ArduinoDevicev2properties. + + The user id of the owner # noqa: E501 + + :param user_id: The user_id of this ArduinoDevicev2properties. # noqa: E501 + :type: str + """ + if user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2properties): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2propertyvalue.py b/arduino_iot_rest/models/arduino_devicev2propertyvalue.py new file mode 100644 index 0000000..f439042 --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2propertyvalue.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2propertyvalue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'created_at': 'datetime', + 'value': 'ArduinoDevicev2propertyvalueValue' + } + + attribute_map = { + 'created_at': 'created_at', + 'value': 'value' + } + + def __init__(self, created_at=None, value=None): # noqa: E501 + """ArduinoDevicev2propertyvalue - a model defined in OpenAPI""" # noqa: E501 + + self._created_at = None + self._value = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if value is not None: + self.value = value + + @property + def created_at(self): + """Gets the created_at of this ArduinoDevicev2propertyvalue. # noqa: E501 + + + :return: The created_at of this ArduinoDevicev2propertyvalue. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ArduinoDevicev2propertyvalue. + + + :param created_at: The created_at of this ArduinoDevicev2propertyvalue. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def value(self): + """Gets the value of this ArduinoDevicev2propertyvalue. # noqa: E501 + + + :return: The value of this ArduinoDevicev2propertyvalue. # noqa: E501 + :rtype: ArduinoDevicev2propertyvalueValue + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ArduinoDevicev2propertyvalue. + + + :param value: The value of this ArduinoDevicev2propertyvalue. # noqa: E501 + :type: ArduinoDevicev2propertyvalueValue + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2propertyvalue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2propertyvalue_value.py b/arduino_iot_rest/models/arduino_devicev2propertyvalue_value.py new file mode 100644 index 0000000..f94f90b --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2propertyvalue_value.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2propertyvalueValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'payload': 'str', + 'seqno': 'int', + 'statistics': 'ArduinoDevicev2propertyvalueValueStatistics' + } + + attribute_map = { + 'payload': 'payload', + 'seqno': 'seqno', + 'statistics': 'statistics' + } + + def __init__(self, payload=None, seqno=None, statistics=None): # noqa: E501 + """ArduinoDevicev2propertyvalueValue - a model defined in OpenAPI""" # noqa: E501 + + self._payload = None + self._seqno = None + self._statistics = None + self.discriminator = None + + if payload is not None: + self.payload = payload + if seqno is not None: + self.seqno = seqno + if statistics is not None: + self.statistics = statistics + + @property + def payload(self): + """Gets the payload of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + + + :return: The payload of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + :rtype: str + """ + return self._payload + + @payload.setter + def payload(self, payload): + """Sets the payload of this ArduinoDevicev2propertyvalueValue. + + + :param payload: The payload of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + :type: str + """ + + self._payload = payload + + @property + def seqno(self): + """Gets the seqno of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + + + :return: The seqno of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + :rtype: int + """ + return self._seqno + + @seqno.setter + def seqno(self, seqno): + """Sets the seqno of this ArduinoDevicev2propertyvalueValue. + + + :param seqno: The seqno of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + :type: int + """ + + self._seqno = seqno + + @property + def statistics(self): + """Gets the statistics of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + + + :return: The statistics of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + :rtype: ArduinoDevicev2propertyvalueValueStatistics + """ + return self._statistics + + @statistics.setter + def statistics(self, statistics): + """Sets the statistics of this ArduinoDevicev2propertyvalueValue. + + + :param statistics: The statistics of this ArduinoDevicev2propertyvalueValue. # noqa: E501 + :type: ArduinoDevicev2propertyvalueValueStatistics + """ + + self._statistics = statistics + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2propertyvalueValue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2propertyvalue_value_statistics.py b/arduino_iot_rest/models/arduino_devicev2propertyvalue_value_statistics.py new file mode 100644 index 0000000..9e9a8f7 --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2propertyvalue_value_statistics.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2propertyvalueValueStatistics(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'adr': 'float', + 'channel': 'float', + 'duplicate': 'float', + 'freq': 'float', + 'mod_bw': 'float', + 'rssi': 'float', + 'seqno': 'float', + 'sf': 'float', + 'snr': 'float', + 'time': 'float' + } + + attribute_map = { + 'adr': 'adr', + 'channel': 'channel', + 'duplicate': 'duplicate', + 'freq': 'freq', + 'mod_bw': 'modBW', + 'rssi': 'rssi', + 'seqno': 'seqno', + 'sf': 'sf', + 'snr': 'snr', + 'time': 'time' + } + + def __init__(self, adr=None, channel=None, duplicate=None, freq=None, mod_bw=None, rssi=None, seqno=None, sf=None, snr=None, time=None): # noqa: E501 + """ArduinoDevicev2propertyvalueValueStatistics - a model defined in OpenAPI""" # noqa: E501 + + self._adr = None + self._channel = None + self._duplicate = None + self._freq = None + self._mod_bw = None + self._rssi = None + self._seqno = None + self._sf = None + self._snr = None + self._time = None + self.discriminator = None + + if adr is not None: + self.adr = adr + if channel is not None: + self.channel = channel + if duplicate is not None: + self.duplicate = duplicate + if freq is not None: + self.freq = freq + if mod_bw is not None: + self.mod_bw = mod_bw + if rssi is not None: + self.rssi = rssi + if seqno is not None: + self.seqno = seqno + if sf is not None: + self.sf = sf + if snr is not None: + self.snr = snr + if time is not None: + self.time = time + + @property + def adr(self): + """Gets the adr of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The adr of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._adr + + @adr.setter + def adr(self, adr): + """Sets the adr of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param adr: The adr of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._adr = adr + + @property + def channel(self): + """Gets the channel of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The channel of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._channel + + @channel.setter + def channel(self, channel): + """Sets the channel of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param channel: The channel of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._channel = channel + + @property + def duplicate(self): + """Gets the duplicate of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The duplicate of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._duplicate + + @duplicate.setter + def duplicate(self, duplicate): + """Sets the duplicate of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param duplicate: The duplicate of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._duplicate = duplicate + + @property + def freq(self): + """Gets the freq of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The freq of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._freq + + @freq.setter + def freq(self, freq): + """Sets the freq of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param freq: The freq of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._freq = freq + + @property + def mod_bw(self): + """Gets the mod_bw of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The mod_bw of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._mod_bw + + @mod_bw.setter + def mod_bw(self, mod_bw): + """Sets the mod_bw of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param mod_bw: The mod_bw of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._mod_bw = mod_bw + + @property + def rssi(self): + """Gets the rssi of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The rssi of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._rssi + + @rssi.setter + def rssi(self, rssi): + """Sets the rssi of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param rssi: The rssi of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._rssi = rssi + + @property + def seqno(self): + """Gets the seqno of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The seqno of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._seqno + + @seqno.setter + def seqno(self, seqno): + """Sets the seqno of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param seqno: The seqno of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._seqno = seqno + + @property + def sf(self): + """Gets the sf of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The sf of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._sf + + @sf.setter + def sf(self, sf): + """Sets the sf of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param sf: The sf of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._sf = sf + + @property + def snr(self): + """Gets the snr of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The snr of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._snr + + @snr.setter + def snr(self, snr): + """Sets the snr of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param snr: The snr of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._snr = snr + + @property + def time(self): + """Gets the time of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + + + :return: The time of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :rtype: float + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this ArduinoDevicev2propertyvalueValueStatistics. + + + :param time: The time of this ArduinoDevicev2propertyvalueValueStatistics. # noqa: E501 + :type: float + """ + + self._time = time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2propertyvalueValueStatistics): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2propertyvalues.py b/arduino_iot_rest/models/arduino_devicev2propertyvalues.py new file mode 100644 index 0000000..bb6e6b7 --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2propertyvalues.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2propertyvalues(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'last_evaluated_key': 'ArduinoDevicev2propertyvaluesLastEvaluatedKey', + 'name': 'str', + 'values': 'list[ArduinoDevicev2propertyvalue]' + } + + attribute_map = { + 'id': 'id', + 'last_evaluated_key': 'last_evaluated_key', + 'name': 'name', + 'values': 'values' + } + + def __init__(self, id=None, last_evaluated_key=None, name=None, values=None): # noqa: E501 + """ArduinoDevicev2propertyvalues - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._last_evaluated_key = None + self._name = None + self._values = None + self.discriminator = None + + self.id = id + self.last_evaluated_key = last_evaluated_key + self.name = name + self.values = values + + @property + def id(self): + """Gets the id of this ArduinoDevicev2propertyvalues. # noqa: E501 + + + :return: The id of this ArduinoDevicev2propertyvalues. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ArduinoDevicev2propertyvalues. + + + :param id: The id of this ArduinoDevicev2propertyvalues. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def last_evaluated_key(self): + """Gets the last_evaluated_key of this ArduinoDevicev2propertyvalues. # noqa: E501 + + + :return: The last_evaluated_key of this ArduinoDevicev2propertyvalues. # noqa: E501 + :rtype: ArduinoDevicev2propertyvaluesLastEvaluatedKey + """ + return self._last_evaluated_key + + @last_evaluated_key.setter + def last_evaluated_key(self, last_evaluated_key): + """Sets the last_evaluated_key of this ArduinoDevicev2propertyvalues. + + + :param last_evaluated_key: The last_evaluated_key of this ArduinoDevicev2propertyvalues. # noqa: E501 + :type: ArduinoDevicev2propertyvaluesLastEvaluatedKey + """ + if last_evaluated_key is None: + raise ValueError("Invalid value for `last_evaluated_key`, must not be `None`") # noqa: E501 + + self._last_evaluated_key = last_evaluated_key + + @property + def name(self): + """Gets the name of this ArduinoDevicev2propertyvalues. # noqa: E501 + + + :return: The name of this ArduinoDevicev2propertyvalues. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ArduinoDevicev2propertyvalues. + + + :param name: The name of this ArduinoDevicev2propertyvalues. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def values(self): + """Gets the values of this ArduinoDevicev2propertyvalues. # noqa: E501 + + ArduinoDevicev2propertyvalueCollection is the media type for an array of ArduinoDevicev2propertyvalue (default view) # noqa: E501 + + :return: The values of this ArduinoDevicev2propertyvalues. # noqa: E501 + :rtype: list[ArduinoDevicev2propertyvalue] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this ArduinoDevicev2propertyvalues. + + ArduinoDevicev2propertyvalueCollection is the media type for an array of ArduinoDevicev2propertyvalue (default view) # noqa: E501 + + :param values: The values of this ArduinoDevicev2propertyvalues. # noqa: E501 + :type: list[ArduinoDevicev2propertyvalue] + """ + if values is None: + raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2propertyvalues): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_devicev2propertyvalues_last_evaluated_key.py b/arduino_iot_rest/models/arduino_devicev2propertyvalues_last_evaluated_key.py new file mode 100644 index 0000000..41c1acf --- /dev/null +++ b/arduino_iot_rest/models/arduino_devicev2propertyvalues_last_evaluated_key.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoDevicev2propertyvaluesLastEvaluatedKey(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'created_at': 'datetime', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'created_at': 'created_at', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, created_at=None, id=None, name=None): # noqa: E501 + """ArduinoDevicev2propertyvaluesLastEvaluatedKey - a model defined in OpenAPI""" # noqa: E501 + + self._created_at = None + self._id = None + self._name = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def created_at(self): + """Gets the created_at of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + + + :return: The created_at of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. + + + :param created_at: The created_at of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def id(self): + """Gets the id of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + + + :return: The id of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. + + + :param id: The id of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + + + :return: The name of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. + + + :param name: The name of this ArduinoDevicev2propertyvaluesLastEvaluatedKey. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoDevicev2propertyvaluesLastEvaluatedKey): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_property.py b/arduino_iot_rest/models/arduino_property.py new file mode 100644 index 0000000..d627eaf --- /dev/null +++ b/arduino_iot_rest/models/arduino_property.py @@ -0,0 +1,569 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoProperty(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'created_at': 'datetime', + 'deleted_at': 'datetime', + 'href': 'str', + 'id': 'str', + 'last_value': 'object', + 'max_value': 'float', + 'min_value': 'float', + 'name': 'str', + 'permission': 'str', + 'persist': 'bool', + 'thing_id': 'str', + 'type': 'str', + 'update_parameter': 'float', + 'update_strategy': 'str', + 'updated_at': 'datetime', + 'value_updated_at': 'datetime', + 'variable_name': 'str' + } + + attribute_map = { + 'created_at': 'created_at', + 'deleted_at': 'deleted_at', + 'href': 'href', + 'id': 'id', + 'last_value': 'last_value', + 'max_value': 'max_value', + 'min_value': 'min_value', + 'name': 'name', + 'permission': 'permission', + 'persist': 'persist', + 'thing_id': 'thing_id', + 'type': 'type', + 'update_parameter': 'update_parameter', + 'update_strategy': 'update_strategy', + 'updated_at': 'updated_at', + 'value_updated_at': 'value_updated_at', + 'variable_name': 'variable_name' + } + + def __init__(self, created_at=None, deleted_at=None, href=None, id=None, last_value=None, max_value=None, min_value=None, name=None, permission=None, persist=None, thing_id=None, type=None, update_parameter=None, update_strategy=None, updated_at=None, value_updated_at=None, variable_name=None): # noqa: E501 + """ArduinoProperty - a model defined in OpenAPI""" # noqa: E501 + + self._created_at = None + self._deleted_at = None + self._href = None + self._id = None + self._last_value = None + self._max_value = None + self._min_value = None + self._name = None + self._permission = None + self._persist = None + self._thing_id = None + self._type = None + self._update_parameter = None + self._update_strategy = None + self._updated_at = None + self._value_updated_at = None + self._variable_name = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if deleted_at is not None: + self.deleted_at = deleted_at + self.href = href + self.id = id + if last_value is not None: + self.last_value = last_value + if max_value is not None: + self.max_value = max_value + if min_value is not None: + self.min_value = min_value + self.name = name + self.permission = permission + if persist is not None: + self.persist = persist + self.thing_id = thing_id + self.type = type + if update_parameter is not None: + self.update_parameter = update_parameter + self.update_strategy = update_strategy + if updated_at is not None: + self.updated_at = updated_at + if value_updated_at is not None: + self.value_updated_at = value_updated_at + if variable_name is not None: + self.variable_name = variable_name + + @property + def created_at(self): + """Gets the created_at of this ArduinoProperty. # noqa: E501 + + Creation date of the property # noqa: E501 + + :return: The created_at of this ArduinoProperty. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ArduinoProperty. + + Creation date of the property # noqa: E501 + + :param created_at: The created_at of this ArduinoProperty. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def deleted_at(self): + """Gets the deleted_at of this ArduinoProperty. # noqa: E501 + + Delete date of the property # noqa: E501 + + :return: The deleted_at of this ArduinoProperty. # noqa: E501 + :rtype: datetime + """ + return self._deleted_at + + @deleted_at.setter + def deleted_at(self, deleted_at): + """Sets the deleted_at of this ArduinoProperty. + + Delete date of the property # noqa: E501 + + :param deleted_at: The deleted_at of this ArduinoProperty. # noqa: E501 + :type: datetime + """ + + self._deleted_at = deleted_at + + @property + def href(self): + """Gets the href of this ArduinoProperty. # noqa: E501 + + The api reference of this property # noqa: E501 + + :return: The href of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._href + + @href.setter + def href(self, href): + """Sets the href of this ArduinoProperty. + + The api reference of this property # noqa: E501 + + :param href: The href of this ArduinoProperty. # noqa: E501 + :type: str + """ + if href is None: + raise ValueError("Invalid value for `href`, must not be `None`") # noqa: E501 + + self._href = href + + @property + def id(self): + """Gets the id of this ArduinoProperty. # noqa: E501 + + The id of the property # noqa: E501 + + :return: The id of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ArduinoProperty. + + The id of the property # noqa: E501 + + :param id: The id of this ArduinoProperty. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def last_value(self): + """Gets the last_value of this ArduinoProperty. # noqa: E501 + + Last value of this property # noqa: E501 + + :return: The last_value of this ArduinoProperty. # noqa: E501 + :rtype: object + """ + return self._last_value + + @last_value.setter + def last_value(self, last_value): + """Sets the last_value of this ArduinoProperty. + + Last value of this property # noqa: E501 + + :param last_value: The last_value of this ArduinoProperty. # noqa: E501 + :type: object + """ + + self._last_value = last_value + + @property + def max_value(self): + """Gets the max_value of this ArduinoProperty. # noqa: E501 + + Maximum value of this property # noqa: E501 + + :return: The max_value of this ArduinoProperty. # noqa: E501 + :rtype: float + """ + return self._max_value + + @max_value.setter + def max_value(self, max_value): + """Sets the max_value of this ArduinoProperty. + + Maximum value of this property # noqa: E501 + + :param max_value: The max_value of this ArduinoProperty. # noqa: E501 + :type: float + """ + + self._max_value = max_value + + @property + def min_value(self): + """Gets the min_value of this ArduinoProperty. # noqa: E501 + + Minimum value of this property # noqa: E501 + + :return: The min_value of this ArduinoProperty. # noqa: E501 + :rtype: float + """ + return self._min_value + + @min_value.setter + def min_value(self, min_value): + """Sets the min_value of this ArduinoProperty. + + Minimum value of this property # noqa: E501 + + :param min_value: The min_value of this ArduinoProperty. # noqa: E501 + :type: float + """ + + self._min_value = min_value + + @property + def name(self): + """Gets the name of this ArduinoProperty. # noqa: E501 + + The friendly name of the property # noqa: E501 + + :return: The name of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ArduinoProperty. + + The friendly name of the property # noqa: E501 + + :param name: The name of this ArduinoProperty. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def permission(self): + """Gets the permission of this ArduinoProperty. # noqa: E501 + + The permission of the property # noqa: E501 + + :return: The permission of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._permission + + @permission.setter + def permission(self, permission): + """Sets the permission of this ArduinoProperty. + + The permission of the property # noqa: E501 + + :param permission: The permission of this ArduinoProperty. # noqa: E501 + :type: str + """ + if permission is None: + raise ValueError("Invalid value for `permission`, must not be `None`") # noqa: E501 + + self._permission = permission + + @property + def persist(self): + """Gets the persist of this ArduinoProperty. # noqa: E501 + + If true, data will persist into a timeseries database # noqa: E501 + + :return: The persist of this ArduinoProperty. # noqa: E501 + :rtype: bool + """ + return self._persist + + @persist.setter + def persist(self, persist): + """Sets the persist of this ArduinoProperty. + + If true, data will persist into a timeseries database # noqa: E501 + + :param persist: The persist of this ArduinoProperty. # noqa: E501 + :type: bool + """ + + self._persist = persist + + @property + def thing_id(self): + """Gets the thing_id of this ArduinoProperty. # noqa: E501 + + The id of the thing # noqa: E501 + + :return: The thing_id of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._thing_id + + @thing_id.setter + def thing_id(self, thing_id): + """Sets the thing_id of this ArduinoProperty. + + The id of the thing # noqa: E501 + + :param thing_id: The thing_id of this ArduinoProperty. # noqa: E501 + :type: str + """ + if thing_id is None: + raise ValueError("Invalid value for `thing_id`, must not be `None`") # noqa: E501 + + self._thing_id = thing_id + + @property + def type(self): + """Gets the type of this ArduinoProperty. # noqa: E501 + + The type of the property # noqa: E501 + + :return: The type of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ArduinoProperty. + + The type of the property # noqa: E501 + + :param type: The type of this ArduinoProperty. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def update_parameter(self): + """Gets the update_parameter of this ArduinoProperty. # noqa: E501 + + The update frequency in seconds, or the amount of the property has to change in order to trigger an update # noqa: E501 + + :return: The update_parameter of this ArduinoProperty. # noqa: E501 + :rtype: float + """ + return self._update_parameter + + @update_parameter.setter + def update_parameter(self, update_parameter): + """Sets the update_parameter of this ArduinoProperty. + + The update frequency in seconds, or the amount of the property has to change in order to trigger an update # noqa: E501 + + :param update_parameter: The update_parameter of this ArduinoProperty. # noqa: E501 + :type: float + """ + + self._update_parameter = update_parameter + + @property + def update_strategy(self): + """Gets the update_strategy of this ArduinoProperty. # noqa: E501 + + The update strategy for the property value # noqa: E501 + + :return: The update_strategy of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._update_strategy + + @update_strategy.setter + def update_strategy(self, update_strategy): + """Sets the update_strategy of this ArduinoProperty. + + The update strategy for the property value # noqa: E501 + + :param update_strategy: The update_strategy of this ArduinoProperty. # noqa: E501 + :type: str + """ + if update_strategy is None: + raise ValueError("Invalid value for `update_strategy`, must not be `None`") # noqa: E501 + + self._update_strategy = update_strategy + + @property + def updated_at(self): + """Gets the updated_at of this ArduinoProperty. # noqa: E501 + + Update date of the property # noqa: E501 + + :return: The updated_at of this ArduinoProperty. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this ArduinoProperty. + + Update date of the property # noqa: E501 + + :param updated_at: The updated_at of this ArduinoProperty. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + @property + def value_updated_at(self): + """Gets the value_updated_at of this ArduinoProperty. # noqa: E501 + + Last update timestamp of this property # noqa: E501 + + :return: The value_updated_at of this ArduinoProperty. # noqa: E501 + :rtype: datetime + """ + return self._value_updated_at + + @value_updated_at.setter + def value_updated_at(self, value_updated_at): + """Sets the value_updated_at of this ArduinoProperty. + + Last update timestamp of this property # noqa: E501 + + :param value_updated_at: The value_updated_at of this ArduinoProperty. # noqa: E501 + :type: datetime + """ + + self._value_updated_at = value_updated_at + + @property + def variable_name(self): + """Gets the variable_name of this ArduinoProperty. # noqa: E501 + + The sketch variable name of the property # noqa: E501 + + :return: The variable_name of this ArduinoProperty. # noqa: E501 + :rtype: str + """ + return self._variable_name + + @variable_name.setter + def variable_name(self, variable_name): + """Sets the variable_name of this ArduinoProperty. + + The sketch variable name of the property # noqa: E501 + + :param variable_name: The variable_name of this ArduinoProperty. # noqa: E501 + :type: str + """ + + self._variable_name = variable_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoProperty): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_series_batch.py b/arduino_iot_rest/models/arduino_series_batch.py new file mode 100644 index 0000000..a7e26a4 --- /dev/null +++ b/arduino_iot_rest/models/arduino_series_batch.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoSeriesBatch(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'resp_version': 'int', + 'responses': 'list[ArduinoSeriesResponse]' + } + + attribute_map = { + 'resp_version': 'resp_version', + 'responses': 'responses' + } + + def __init__(self, resp_version=None, responses=None): # noqa: E501 + """ArduinoSeriesBatch - a model defined in OpenAPI""" # noqa: E501 + + self._resp_version = None + self._responses = None + self.discriminator = None + + self.resp_version = resp_version + self.responses = responses + + @property + def resp_version(self): + """Gets the resp_version of this ArduinoSeriesBatch. # noqa: E501 + + Response version # noqa: E501 + + :return: The resp_version of this ArduinoSeriesBatch. # noqa: E501 + :rtype: int + """ + return self._resp_version + + @resp_version.setter + def resp_version(self, resp_version): + """Sets the resp_version of this ArduinoSeriesBatch. + + Response version # noqa: E501 + + :param resp_version: The resp_version of this ArduinoSeriesBatch. # noqa: E501 + :type: int + """ + if resp_version is None: + raise ValueError("Invalid value for `resp_version`, must not be `None`") # noqa: E501 + + self._resp_version = resp_version + + @property + def responses(self): + """Gets the responses of this ArduinoSeriesBatch. # noqa: E501 + + Responses of the request # noqa: E501 + + :return: The responses of this ArduinoSeriesBatch. # noqa: E501 + :rtype: list[ArduinoSeriesResponse] + """ + return self._responses + + @responses.setter + def responses(self, responses): + """Sets the responses of this ArduinoSeriesBatch. + + Responses of the request # noqa: E501 + + :param responses: The responses of this ArduinoSeriesBatch. # noqa: E501 + :type: list[ArduinoSeriesResponse] + """ + if responses is None: + raise ValueError("Invalid value for `responses`, must not be `None`") # noqa: E501 + + self._responses = responses + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoSeriesBatch): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_series_raw_batch.py b/arduino_iot_rest/models/arduino_series_raw_batch.py new file mode 100644 index 0000000..11df92f --- /dev/null +++ b/arduino_iot_rest/models/arduino_series_raw_batch.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoSeriesRawBatch(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'resp_version': 'int', + 'responses': 'list[ArduinoSeriesRawResponse]' + } + + attribute_map = { + 'resp_version': 'resp_version', + 'responses': 'responses' + } + + def __init__(self, resp_version=None, responses=None): # noqa: E501 + """ArduinoSeriesRawBatch - a model defined in OpenAPI""" # noqa: E501 + + self._resp_version = None + self._responses = None + self.discriminator = None + + self.resp_version = resp_version + self.responses = responses + + @property + def resp_version(self): + """Gets the resp_version of this ArduinoSeriesRawBatch. # noqa: E501 + + Response version # noqa: E501 + + :return: The resp_version of this ArduinoSeriesRawBatch. # noqa: E501 + :rtype: int + """ + return self._resp_version + + @resp_version.setter + def resp_version(self, resp_version): + """Sets the resp_version of this ArduinoSeriesRawBatch. + + Response version # noqa: E501 + + :param resp_version: The resp_version of this ArduinoSeriesRawBatch. # noqa: E501 + :type: int + """ + if resp_version is None: + raise ValueError("Invalid value for `resp_version`, must not be `None`") # noqa: E501 + + self._resp_version = resp_version + + @property + def responses(self): + """Gets the responses of this ArduinoSeriesRawBatch. # noqa: E501 + + Responses of the request # noqa: E501 + + :return: The responses of this ArduinoSeriesRawBatch. # noqa: E501 + :rtype: list[ArduinoSeriesRawResponse] + """ + return self._responses + + @responses.setter + def responses(self, responses): + """Sets the responses of this ArduinoSeriesRawBatch. + + Responses of the request # noqa: E501 + + :param responses: The responses of this ArduinoSeriesRawBatch. # noqa: E501 + :type: list[ArduinoSeriesRawResponse] + """ + if responses is None: + raise ValueError("Invalid value for `responses`, must not be `None`") # noqa: E501 + + self._responses = responses + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoSeriesRawBatch): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_series_raw_batch_lastvalue.py b/arduino_iot_rest/models/arduino_series_raw_batch_lastvalue.py new file mode 100644 index 0000000..01b8ee3 --- /dev/null +++ b/arduino_iot_rest/models/arduino_series_raw_batch_lastvalue.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoSeriesRawBatchLastvalue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'responses': 'list[ArduinoSeriesRawLastValueResponse]', + 'status': 'str' + } + + attribute_map = { + 'responses': 'responses', + 'status': 'status' + } + + def __init__(self, responses=None, status=None): # noqa: E501 + """ArduinoSeriesRawBatchLastvalue - a model defined in OpenAPI""" # noqa: E501 + + self._responses = None + self._status = None + self.discriminator = None + + self.responses = responses + self.status = status + + @property + def responses(self): + """Gets the responses of this ArduinoSeriesRawBatchLastvalue. # noqa: E501 + + Responses of the request # noqa: E501 + + :return: The responses of this ArduinoSeriesRawBatchLastvalue. # noqa: E501 + :rtype: list[ArduinoSeriesRawLastValueResponse] + """ + return self._responses + + @responses.setter + def responses(self, responses): + """Sets the responses of this ArduinoSeriesRawBatchLastvalue. + + Responses of the request # noqa: E501 + + :param responses: The responses of this ArduinoSeriesRawBatchLastvalue. # noqa: E501 + :type: list[ArduinoSeriesRawLastValueResponse] + """ + if responses is None: + raise ValueError("Invalid value for `responses`, must not be `None`") # noqa: E501 + + self._responses = responses + + @property + def status(self): + """Gets the status of this ArduinoSeriesRawBatchLastvalue. # noqa: E501 + + Status of the response # noqa: E501 + + :return: The status of this ArduinoSeriesRawBatchLastvalue. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ArduinoSeriesRawBatchLastvalue. + + Status of the response # noqa: E501 + + :param status: The status of this ArduinoSeriesRawBatchLastvalue. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoSeriesRawBatchLastvalue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_series_raw_last_value_response.py b/arduino_iot_rest/models/arduino_series_raw_last_value_response.py new file mode 100644 index 0000000..f0b429f --- /dev/null +++ b/arduino_iot_rest/models/arduino_series_raw_last_value_response.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoSeriesRawLastValueResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'count_values': 'int', + 'property_id': 'str', + 'thing_id': 'str', + 'times': 'list[datetime]', + 'values': 'list[object]' + } + + attribute_map = { + 'count_values': 'count_values', + 'property_id': 'property_id', + 'thing_id': 'thing_id', + 'times': 'times', + 'values': 'values' + } + + def __init__(self, count_values=None, property_id=None, thing_id=None, times=None, values=None): # noqa: E501 + """ArduinoSeriesRawLastValueResponse - a model defined in OpenAPI""" # noqa: E501 + + self._count_values = None + self._property_id = None + self._thing_id = None + self._times = None + self._values = None + self.discriminator = None + + self.count_values = count_values + self.property_id = property_id + self.thing_id = thing_id + self.times = times + self.values = values + + @property + def count_values(self): + """Gets the count_values of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + + Total number of values in the array 'values' # noqa: E501 + + :return: The count_values of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :rtype: int + """ + return self._count_values + + @count_values.setter + def count_values(self, count_values): + """Sets the count_values of this ArduinoSeriesRawLastValueResponse. + + Total number of values in the array 'values' # noqa: E501 + + :param count_values: The count_values of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :type: int + """ + if count_values is None: + raise ValueError("Invalid value for `count_values`, must not be `None`") # noqa: E501 + + self._count_values = count_values + + @property + def property_id(self): + """Gets the property_id of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + + Property id # noqa: E501 + + :return: The property_id of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :rtype: str + """ + return self._property_id + + @property_id.setter + def property_id(self, property_id): + """Sets the property_id of this ArduinoSeriesRawLastValueResponse. + + Property id # noqa: E501 + + :param property_id: The property_id of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :type: str + """ + if property_id is None: + raise ValueError("Invalid value for `property_id`, must not be `None`") # noqa: E501 + + self._property_id = property_id + + @property + def thing_id(self): + """Gets the thing_id of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + + Thing id # noqa: E501 + + :return: The thing_id of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :rtype: str + """ + return self._thing_id + + @thing_id.setter + def thing_id(self, thing_id): + """Sets the thing_id of this ArduinoSeriesRawLastValueResponse. + + Thing id # noqa: E501 + + :param thing_id: The thing_id of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :type: str + """ + if thing_id is None: + raise ValueError("Invalid value for `thing_id`, must not be `None`") # noqa: E501 + + self._thing_id = thing_id + + @property + def times(self): + """Gets the times of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + + Timestamp in RFC3339 # noqa: E501 + + :return: The times of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :rtype: list[datetime] + """ + return self._times + + @times.setter + def times(self, times): + """Sets the times of this ArduinoSeriesRawLastValueResponse. + + Timestamp in RFC3339 # noqa: E501 + + :param times: The times of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :type: list[datetime] + """ + if times is None: + raise ValueError("Invalid value for `times`, must not be `None`") # noqa: E501 + + self._times = times + + @property + def values(self): + """Gets the values of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + + Values can be in Float, String, Bool, Object # noqa: E501 + + :return: The values of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :rtype: list[object] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this ArduinoSeriesRawLastValueResponse. + + Values can be in Float, String, Bool, Object # noqa: E501 + + :param values: The values of this ArduinoSeriesRawLastValueResponse. # noqa: E501 + :type: list[object] + """ + if values is None: + raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoSeriesRawLastValueResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_series_raw_response.py b/arduino_iot_rest/models/arduino_series_raw_response.py new file mode 100644 index 0000000..c53367b --- /dev/null +++ b/arduino_iot_rest/models/arduino_series_raw_response.py @@ -0,0 +1,436 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoSeriesRawResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'count_values': 'int', + 'from_date': 'datetime', + 'message': 'str', + 'query': 'str', + 'resp_version': 'int', + 'series': 'BatchQueryRawResponseSeriesMediaV1', + 'series_limit': 'int', + 'sort': 'str', + 'status': 'str', + 'times': 'list[datetime]', + 'to_date': 'datetime', + 'values': 'list[object]' + } + + attribute_map = { + 'count_values': 'count_values', + 'from_date': 'from_date', + 'message': 'message', + 'query': 'query', + 'resp_version': 'resp_version', + 'series': 'series', + 'series_limit': 'series_limit', + 'sort': 'sort', + 'status': 'status', + 'times': 'times', + 'to_date': 'to_date', + 'values': 'values' + } + + def __init__(self, count_values=None, from_date=None, message='', query=None, resp_version=None, series=None, series_limit=None, sort=None, status=None, times=None, to_date=None, values=None): # noqa: E501 + """ArduinoSeriesRawResponse - a model defined in OpenAPI""" # noqa: E501 + + self._count_values = None + self._from_date = None + self._message = None + self._query = None + self._resp_version = None + self._series = None + self._series_limit = None + self._sort = None + self._status = None + self._times = None + self._to_date = None + self._values = None + self.discriminator = None + + self.count_values = count_values + self.from_date = from_date + if message is not None: + self.message = message + self.query = query + self.resp_version = resp_version + self.series = series + if series_limit is not None: + self.series_limit = series_limit + self.sort = sort + self.status = status + self.times = times + self.to_date = to_date + self.values = values + + @property + def count_values(self): + """Gets the count_values of this ArduinoSeriesRawResponse. # noqa: E501 + + Total number of values in the array 'values' # noqa: E501 + + :return: The count_values of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: int + """ + return self._count_values + + @count_values.setter + def count_values(self, count_values): + """Sets the count_values of this ArduinoSeriesRawResponse. + + Total number of values in the array 'values' # noqa: E501 + + :param count_values: The count_values of this ArduinoSeriesRawResponse. # noqa: E501 + :type: int + """ + if count_values is None: + raise ValueError("Invalid value for `count_values`, must not be `None`") # noqa: E501 + + self._count_values = count_values + + @property + def from_date(self): + """Gets the from_date of this ArduinoSeriesRawResponse. # noqa: E501 + + From date # noqa: E501 + + :return: The from_date of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: datetime + """ + return self._from_date + + @from_date.setter + def from_date(self, from_date): + """Sets the from_date of this ArduinoSeriesRawResponse. + + From date # noqa: E501 + + :param from_date: The from_date of this ArduinoSeriesRawResponse. # noqa: E501 + :type: datetime + """ + if from_date is None: + raise ValueError("Invalid value for `from_date`, must not be `None`") # noqa: E501 + + self._from_date = from_date + + @property + def message(self): + """Gets the message of this ArduinoSeriesRawResponse. # noqa: E501 + + If the response is different than 'ok' # noqa: E501 + + :return: The message of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ArduinoSeriesRawResponse. + + If the response is different than 'ok' # noqa: E501 + + :param message: The message of this ArduinoSeriesRawResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def query(self): + """Gets the query of this ArduinoSeriesRawResponse. # noqa: E501 + + Query of for the data # noqa: E501 + + :return: The query of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this ArduinoSeriesRawResponse. + + Query of for the data # noqa: E501 + + :param query: The query of this ArduinoSeriesRawResponse. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def resp_version(self): + """Gets the resp_version of this ArduinoSeriesRawResponse. # noqa: E501 + + Response version # noqa: E501 + + :return: The resp_version of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: int + """ + return self._resp_version + + @resp_version.setter + def resp_version(self, resp_version): + """Sets the resp_version of this ArduinoSeriesRawResponse. + + Response version # noqa: E501 + + :param resp_version: The resp_version of this ArduinoSeriesRawResponse. # noqa: E501 + :type: int + """ + if resp_version is None: + raise ValueError("Invalid value for `resp_version`, must not be `None`") # noqa: E501 + + self._resp_version = resp_version + + @property + def series(self): + """Gets the series of this ArduinoSeriesRawResponse. # noqa: E501 + + + :return: The series of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: BatchQueryRawResponseSeriesMediaV1 + """ + return self._series + + @series.setter + def series(self, series): + """Sets the series of this ArduinoSeriesRawResponse. + + + :param series: The series of this ArduinoSeriesRawResponse. # noqa: E501 + :type: BatchQueryRawResponseSeriesMediaV1 + """ + if series is None: + raise ValueError("Invalid value for `series`, must not be `None`") # noqa: E501 + + self._series = series + + @property + def series_limit(self): + """Gets the series_limit of this ArduinoSeriesRawResponse. # noqa: E501 + + Max of values # noqa: E501 + + :return: The series_limit of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: int + """ + return self._series_limit + + @series_limit.setter + def series_limit(self, series_limit): + """Sets the series_limit of this ArduinoSeriesRawResponse. + + Max of values # noqa: E501 + + :param series_limit: The series_limit of this ArduinoSeriesRawResponse. # noqa: E501 + :type: int + """ + + self._series_limit = series_limit + + @property + def sort(self): + """Gets the sort of this ArduinoSeriesRawResponse. # noqa: E501 + + Sorting # noqa: E501 + + :return: The sort of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: str + """ + return self._sort + + @sort.setter + def sort(self, sort): + """Sets the sort of this ArduinoSeriesRawResponse. + + Sorting # noqa: E501 + + :param sort: The sort of this ArduinoSeriesRawResponse. # noqa: E501 + :type: str + """ + if sort is None: + raise ValueError("Invalid value for `sort`, must not be `None`") # noqa: E501 + allowed_values = ["ASC", "DESC"] # noqa: E501 + if sort not in allowed_values: + raise ValueError( + "Invalid value for `sort` ({0}), must be one of {1}" # noqa: E501 + .format(sort, allowed_values) + ) + + self._sort = sort + + @property + def status(self): + """Gets the status of this ArduinoSeriesRawResponse. # noqa: E501 + + Status of the response # noqa: E501 + + :return: The status of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ArduinoSeriesRawResponse. + + Status of the response # noqa: E501 + + :param status: The status of this ArduinoSeriesRawResponse. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def times(self): + """Gets the times of this ArduinoSeriesRawResponse. # noqa: E501 + + Timestamp in RFC3339 # noqa: E501 + + :return: The times of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: list[datetime] + """ + return self._times + + @times.setter + def times(self, times): + """Sets the times of this ArduinoSeriesRawResponse. + + Timestamp in RFC3339 # noqa: E501 + + :param times: The times of this ArduinoSeriesRawResponse. # noqa: E501 + :type: list[datetime] + """ + if times is None: + raise ValueError("Invalid value for `times`, must not be `None`") # noqa: E501 + + self._times = times + + @property + def to_date(self): + """Gets the to_date of this ArduinoSeriesRawResponse. # noqa: E501 + + To date # noqa: E501 + + :return: The to_date of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: datetime + """ + return self._to_date + + @to_date.setter + def to_date(self, to_date): + """Sets the to_date of this ArduinoSeriesRawResponse. + + To date # noqa: E501 + + :param to_date: The to_date of this ArduinoSeriesRawResponse. # noqa: E501 + :type: datetime + """ + if to_date is None: + raise ValueError("Invalid value for `to_date`, must not be `None`") # noqa: E501 + + self._to_date = to_date + + @property + def values(self): + """Gets the values of this ArduinoSeriesRawResponse. # noqa: E501 + + Values can be in Float, String, Bool, Object # noqa: E501 + + :return: The values of this ArduinoSeriesRawResponse. # noqa: E501 + :rtype: list[object] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this ArduinoSeriesRawResponse. + + Values can be in Float, String, Bool, Object # noqa: E501 + + :param values: The values of this ArduinoSeriesRawResponse. # noqa: E501 + :type: list[object] + """ + if values is None: + raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoSeriesRawResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_series_response.py b/arduino_iot_rest/models/arduino_series_response.py new file mode 100644 index 0000000..d4ed535 --- /dev/null +++ b/arduino_iot_rest/models/arduino_series_response.py @@ -0,0 +1,403 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoSeriesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'count_values': 'int', + 'from_date': 'datetime', + 'interval': 'int', + 'message': 'str', + 'query': 'str', + 'resp_version': 'int', + 'series_limit': 'int', + 'status': 'str', + 'times': 'list[datetime]', + 'to_date': 'datetime', + 'values': 'list[float]' + } + + attribute_map = { + 'count_values': 'count_values', + 'from_date': 'from_date', + 'interval': 'interval', + 'message': 'message', + 'query': 'query', + 'resp_version': 'resp_version', + 'series_limit': 'series_limit', + 'status': 'status', + 'times': 'times', + 'to_date': 'to_date', + 'values': 'values' + } + + def __init__(self, count_values=None, from_date=None, interval=None, message='', query=None, resp_version=None, series_limit=None, status=None, times=None, to_date=None, values=None): # noqa: E501 + """ArduinoSeriesResponse - a model defined in OpenAPI""" # noqa: E501 + + self._count_values = None + self._from_date = None + self._interval = None + self._message = None + self._query = None + self._resp_version = None + self._series_limit = None + self._status = None + self._times = None + self._to_date = None + self._values = None + self.discriminator = None + + self.count_values = count_values + self.from_date = from_date + self.interval = interval + if message is not None: + self.message = message + self.query = query + self.resp_version = resp_version + if series_limit is not None: + self.series_limit = series_limit + self.status = status + self.times = times + self.to_date = to_date + self.values = values + + @property + def count_values(self): + """Gets the count_values of this ArduinoSeriesResponse. # noqa: E501 + + Total number of values in the array 'values' # noqa: E501 + + :return: The count_values of this ArduinoSeriesResponse. # noqa: E501 + :rtype: int + """ + return self._count_values + + @count_values.setter + def count_values(self, count_values): + """Sets the count_values of this ArduinoSeriesResponse. + + Total number of values in the array 'values' # noqa: E501 + + :param count_values: The count_values of this ArduinoSeriesResponse. # noqa: E501 + :type: int + """ + if count_values is None: + raise ValueError("Invalid value for `count_values`, must not be `None`") # noqa: E501 + + self._count_values = count_values + + @property + def from_date(self): + """Gets the from_date of this ArduinoSeriesResponse. # noqa: E501 + + From date # noqa: E501 + + :return: The from_date of this ArduinoSeriesResponse. # noqa: E501 + :rtype: datetime + """ + return self._from_date + + @from_date.setter + def from_date(self, from_date): + """Sets the from_date of this ArduinoSeriesResponse. + + From date # noqa: E501 + + :param from_date: The from_date of this ArduinoSeriesResponse. # noqa: E501 + :type: datetime + """ + if from_date is None: + raise ValueError("Invalid value for `from_date`, must not be `None`") # noqa: E501 + + self._from_date = from_date + + @property + def interval(self): + """Gets the interval of this ArduinoSeriesResponse. # noqa: E501 + + Resolution in seconds # noqa: E501 + + :return: The interval of this ArduinoSeriesResponse. # noqa: E501 + :rtype: int + """ + return self._interval + + @interval.setter + def interval(self, interval): + """Sets the interval of this ArduinoSeriesResponse. + + Resolution in seconds # noqa: E501 + + :param interval: The interval of this ArduinoSeriesResponse. # noqa: E501 + :type: int + """ + if interval is None: + raise ValueError("Invalid value for `interval`, must not be `None`") # noqa: E501 + + self._interval = interval + + @property + def message(self): + """Gets the message of this ArduinoSeriesResponse. # noqa: E501 + + If the response is different than 'ok' # noqa: E501 + + :return: The message of this ArduinoSeriesResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ArduinoSeriesResponse. + + If the response is different than 'ok' # noqa: E501 + + :param message: The message of this ArduinoSeriesResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def query(self): + """Gets the query of this ArduinoSeriesResponse. # noqa: E501 + + Query of for the data # noqa: E501 + + :return: The query of this ArduinoSeriesResponse. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this ArduinoSeriesResponse. + + Query of for the data # noqa: E501 + + :param query: The query of this ArduinoSeriesResponse. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def resp_version(self): + """Gets the resp_version of this ArduinoSeriesResponse. # noqa: E501 + + Response version # noqa: E501 + + :return: The resp_version of this ArduinoSeriesResponse. # noqa: E501 + :rtype: int + """ + return self._resp_version + + @resp_version.setter + def resp_version(self, resp_version): + """Sets the resp_version of this ArduinoSeriesResponse. + + Response version # noqa: E501 + + :param resp_version: The resp_version of this ArduinoSeriesResponse. # noqa: E501 + :type: int + """ + if resp_version is None: + raise ValueError("Invalid value for `resp_version`, must not be `None`") # noqa: E501 + + self._resp_version = resp_version + + @property + def series_limit(self): + """Gets the series_limit of this ArduinoSeriesResponse. # noqa: E501 + + Max of values # noqa: E501 + + :return: The series_limit of this ArduinoSeriesResponse. # noqa: E501 + :rtype: int + """ + return self._series_limit + + @series_limit.setter + def series_limit(self, series_limit): + """Sets the series_limit of this ArduinoSeriesResponse. + + Max of values # noqa: E501 + + :param series_limit: The series_limit of this ArduinoSeriesResponse. # noqa: E501 + :type: int + """ + + self._series_limit = series_limit + + @property + def status(self): + """Gets the status of this ArduinoSeriesResponse. # noqa: E501 + + Status of the response # noqa: E501 + + :return: The status of this ArduinoSeriesResponse. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ArduinoSeriesResponse. + + Status of the response # noqa: E501 + + :param status: The status of this ArduinoSeriesResponse. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def times(self): + """Gets the times of this ArduinoSeriesResponse. # noqa: E501 + + Timestamp in RFC3339 # noqa: E501 + + :return: The times of this ArduinoSeriesResponse. # noqa: E501 + :rtype: list[datetime] + """ + return self._times + + @times.setter + def times(self, times): + """Sets the times of this ArduinoSeriesResponse. + + Timestamp in RFC3339 # noqa: E501 + + :param times: The times of this ArduinoSeriesResponse. # noqa: E501 + :type: list[datetime] + """ + if times is None: + raise ValueError("Invalid value for `times`, must not be `None`") # noqa: E501 + + self._times = times + + @property + def to_date(self): + """Gets the to_date of this ArduinoSeriesResponse. # noqa: E501 + + To date # noqa: E501 + + :return: The to_date of this ArduinoSeriesResponse. # noqa: E501 + :rtype: datetime + """ + return self._to_date + + @to_date.setter + def to_date(self, to_date): + """Sets the to_date of this ArduinoSeriesResponse. + + To date # noqa: E501 + + :param to_date: The to_date of this ArduinoSeriesResponse. # noqa: E501 + :type: datetime + """ + if to_date is None: + raise ValueError("Invalid value for `to_date`, must not be `None`") # noqa: E501 + + self._to_date = to_date + + @property + def values(self): + """Gets the values of this ArduinoSeriesResponse. # noqa: E501 + + Values in Float # noqa: E501 + + :return: The values of this ArduinoSeriesResponse. # noqa: E501 + :rtype: list[float] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this ArduinoSeriesResponse. + + Values in Float # noqa: E501 + + :param values: The values of this ArduinoSeriesResponse. # noqa: E501 + :type: list[float] + """ + if values is None: + raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoSeriesResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/arduino_thing.py b/arduino_iot_rest/models/arduino_thing.py new file mode 100644 index 0000000..ba81f8b --- /dev/null +++ b/arduino_iot_rest/models/arduino_thing.py @@ -0,0 +1,454 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArduinoThing(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'created_at': 'datetime', + 'deleted_at': 'datetime', + 'device_id': 'str', + 'href': 'str', + 'id': 'str', + 'name': 'str', + 'properties': 'list[ArduinoProperty]', + 'properties_count': 'float', + 'sketch_id': 'str', + 'updated_at': 'datetime', + 'user_id': 'str', + 'webhook_active': 'bool', + 'webhook_uri': 'str' + } + + attribute_map = { + 'created_at': 'created_at', + 'deleted_at': 'deleted_at', + 'device_id': 'device_id', + 'href': 'href', + 'id': 'id', + 'name': 'name', + 'properties': 'properties', + 'properties_count': 'properties_count', + 'sketch_id': 'sketch_id', + 'updated_at': 'updated_at', + 'user_id': 'user_id', + 'webhook_active': 'webhook_active', + 'webhook_uri': 'webhook_uri' + } + + def __init__(self, created_at=None, deleted_at=None, device_id=None, href=None, id=None, name=None, properties=None, properties_count=None, sketch_id=None, updated_at=None, user_id=None, webhook_active=None, webhook_uri=None): # noqa: E501 + """ArduinoThing - a model defined in OpenAPI""" # noqa: E501 + + self._created_at = None + self._deleted_at = None + self._device_id = None + self._href = None + self._id = None + self._name = None + self._properties = None + self._properties_count = None + self._sketch_id = None + self._updated_at = None + self._user_id = None + self._webhook_active = None + self._webhook_uri = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if deleted_at is not None: + self.deleted_at = deleted_at + if device_id is not None: + self.device_id = device_id + self.href = href + self.id = id + self.name = name + if properties is not None: + self.properties = properties + if properties_count is not None: + self.properties_count = properties_count + if sketch_id is not None: + self.sketch_id = sketch_id + if updated_at is not None: + self.updated_at = updated_at + self.user_id = user_id + if webhook_active is not None: + self.webhook_active = webhook_active + if webhook_uri is not None: + self.webhook_uri = webhook_uri + + @property + def created_at(self): + """Gets the created_at of this ArduinoThing. # noqa: E501 + + Creation date of the thing # noqa: E501 + + :return: The created_at of this ArduinoThing. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ArduinoThing. + + Creation date of the thing # noqa: E501 + + :param created_at: The created_at of this ArduinoThing. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def deleted_at(self): + """Gets the deleted_at of this ArduinoThing. # noqa: E501 + + Delete date of the thing # noqa: E501 + + :return: The deleted_at of this ArduinoThing. # noqa: E501 + :rtype: datetime + """ + return self._deleted_at + + @deleted_at.setter + def deleted_at(self, deleted_at): + """Sets the deleted_at of this ArduinoThing. + + Delete date of the thing # noqa: E501 + + :param deleted_at: The deleted_at of this ArduinoThing. # noqa: E501 + :type: datetime + """ + + self._deleted_at = deleted_at + + @property + def device_id(self): + """Gets the device_id of this ArduinoThing. # noqa: E501 + + The arn of the device # noqa: E501 + + :return: The device_id of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this ArduinoThing. + + The arn of the device # noqa: E501 + + :param device_id: The device_id of this ArduinoThing. # noqa: E501 + :type: str + """ + + self._device_id = device_id + + @property + def href(self): + """Gets the href of this ArduinoThing. # noqa: E501 + + The api reference of this thing # noqa: E501 + + :return: The href of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._href + + @href.setter + def href(self, href): + """Sets the href of this ArduinoThing. + + The api reference of this thing # noqa: E501 + + :param href: The href of this ArduinoThing. # noqa: E501 + :type: str + """ + if href is None: + raise ValueError("Invalid value for `href`, must not be `None`") # noqa: E501 + + self._href = href + + @property + def id(self): + """Gets the id of this ArduinoThing. # noqa: E501 + + The id of the thing # noqa: E501 + + :return: The id of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ArduinoThing. + + The id of the thing # noqa: E501 + + :param id: The id of this ArduinoThing. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ArduinoThing. # noqa: E501 + + The friendly name of the thing # noqa: E501 + + :return: The name of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ArduinoThing. + + The friendly name of the thing # noqa: E501 + + :param name: The name of this ArduinoThing. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def properties(self): + """Gets the properties of this ArduinoThing. # noqa: E501 + + ArduinoPropertyCollection is the media type for an array of ArduinoProperty (default view) # noqa: E501 + + :return: The properties of this ArduinoThing. # noqa: E501 + :rtype: list[ArduinoProperty] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this ArduinoThing. + + ArduinoPropertyCollection is the media type for an array of ArduinoProperty (default view) # noqa: E501 + + :param properties: The properties of this ArduinoThing. # noqa: E501 + :type: list[ArduinoProperty] + """ + + self._properties = properties + + @property + def properties_count(self): + """Gets the properties_count of this ArduinoThing. # noqa: E501 + + The number of properties of the thing # noqa: E501 + + :return: The properties_count of this ArduinoThing. # noqa: E501 + :rtype: float + """ + return self._properties_count + + @properties_count.setter + def properties_count(self, properties_count): + """Sets the properties_count of this ArduinoThing. + + The number of properties of the thing # noqa: E501 + + :param properties_count: The properties_count of this ArduinoThing. # noqa: E501 + :type: float + """ + + self._properties_count = properties_count + + @property + def sketch_id(self): + """Gets the sketch_id of this ArduinoThing. # noqa: E501 + + The id of the attached sketch # noqa: E501 + + :return: The sketch_id of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._sketch_id + + @sketch_id.setter + def sketch_id(self, sketch_id): + """Sets the sketch_id of this ArduinoThing. + + The id of the attached sketch # noqa: E501 + + :param sketch_id: The sketch_id of this ArduinoThing. # noqa: E501 + :type: str + """ + + self._sketch_id = sketch_id + + @property + def updated_at(self): + """Gets the updated_at of this ArduinoThing. # noqa: E501 + + Update date of the thing # noqa: E501 + + :return: The updated_at of this ArduinoThing. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this ArduinoThing. + + Update date of the thing # noqa: E501 + + :param updated_at: The updated_at of this ArduinoThing. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + @property + def user_id(self): + """Gets the user_id of this ArduinoThing. # noqa: E501 + + The user id of the owner # noqa: E501 + + :return: The user_id of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this ArduinoThing. + + The user id of the owner # noqa: E501 + + :param user_id: The user_id of this ArduinoThing. # noqa: E501 + :type: str + """ + if user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def webhook_active(self): + """Gets the webhook_active of this ArduinoThing. # noqa: E501 + + Webhook uri # noqa: E501 + + :return: The webhook_active of this ArduinoThing. # noqa: E501 + :rtype: bool + """ + return self._webhook_active + + @webhook_active.setter + def webhook_active(self, webhook_active): + """Sets the webhook_active of this ArduinoThing. + + Webhook uri # noqa: E501 + + :param webhook_active: The webhook_active of this ArduinoThing. # noqa: E501 + :type: bool + """ + + self._webhook_active = webhook_active + + @property + def webhook_uri(self): + """Gets the webhook_uri of this ArduinoThing. # noqa: E501 + + Webhook uri # noqa: E501 + + :return: The webhook_uri of this ArduinoThing. # noqa: E501 + :rtype: str + """ + return self._webhook_uri + + @webhook_uri.setter + def webhook_uri(self, webhook_uri): + """Sets the webhook_uri of this ArduinoThing. + + Webhook uri # noqa: E501 + + :param webhook_uri: The webhook_uri of this ArduinoThing. # noqa: E501 + :type: str + """ + + self._webhook_uri = webhook_uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArduinoThing): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_last_value_requests_media_v1.py b/arduino_iot_rest/models/batch_last_value_requests_media_v1.py new file mode 100644 index 0000000..7beb8a4 --- /dev/null +++ b/arduino_iot_rest/models/batch_last_value_requests_media_v1.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchLastValueRequestsMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'requests': 'list[BatchQueryRawLastValueRequestMediaV1]' + } + + attribute_map = { + 'requests': 'requests' + } + + def __init__(self, requests=None): # noqa: E501 + """BatchLastValueRequestsMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self._requests = None + self.discriminator = None + + self.requests = requests + + @property + def requests(self): + """Gets the requests of this BatchLastValueRequestsMediaV1. # noqa: E501 + + Requests # noqa: E501 + + :return: The requests of this BatchLastValueRequestsMediaV1. # noqa: E501 + :rtype: list[BatchQueryRawLastValueRequestMediaV1] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this BatchLastValueRequestsMediaV1. + + Requests # noqa: E501 + + :param requests: The requests of this BatchLastValueRequestsMediaV1. # noqa: E501 + :type: list[BatchQueryRawLastValueRequestMediaV1] + """ + if requests is None: + raise ValueError("Invalid value for `requests`, must not be `None`") # noqa: E501 + + self._requests = requests + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchLastValueRequestsMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_query_raw_last_value_request_media_v1.py b/arduino_iot_rest/models/batch_query_raw_last_value_request_media_v1.py new file mode 100644 index 0000000..497a624 --- /dev/null +++ b/arduino_iot_rest/models/batch_query_raw_last_value_request_media_v1.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchQueryRawLastValueRequestMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'property_id': 'str', + 'thing_id': 'str' + } + + attribute_map = { + 'property_id': 'property_id', + 'thing_id': 'thing_id' + } + + def __init__(self, property_id=None, thing_id=None): # noqa: E501 + """BatchQueryRawLastValueRequestMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self._property_id = None + self._thing_id = None + self.discriminator = None + + self.property_id = property_id + self.thing_id = thing_id + + @property + def property_id(self): + """Gets the property_id of this BatchQueryRawLastValueRequestMediaV1. # noqa: E501 + + Property id # noqa: E501 + + :return: The property_id of this BatchQueryRawLastValueRequestMediaV1. # noqa: E501 + :rtype: str + """ + return self._property_id + + @property_id.setter + def property_id(self, property_id): + """Sets the property_id of this BatchQueryRawLastValueRequestMediaV1. + + Property id # noqa: E501 + + :param property_id: The property_id of this BatchQueryRawLastValueRequestMediaV1. # noqa: E501 + :type: str + """ + if property_id is None: + raise ValueError("Invalid value for `property_id`, must not be `None`") # noqa: E501 + + self._property_id = property_id + + @property + def thing_id(self): + """Gets the thing_id of this BatchQueryRawLastValueRequestMediaV1. # noqa: E501 + + Thing id # noqa: E501 + + :return: The thing_id of this BatchQueryRawLastValueRequestMediaV1. # noqa: E501 + :rtype: str + """ + return self._thing_id + + @thing_id.setter + def thing_id(self, thing_id): + """Sets the thing_id of this BatchQueryRawLastValueRequestMediaV1. + + Thing id # noqa: E501 + + :param thing_id: The thing_id of this BatchQueryRawLastValueRequestMediaV1. # noqa: E501 + :type: str + """ + if thing_id is None: + raise ValueError("Invalid value for `thing_id`, must not be `None`") # noqa: E501 + + self._thing_id = thing_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchQueryRawLastValueRequestMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_query_raw_request_media_v1.py b/arduino_iot_rest/models/batch_query_raw_request_media_v1.py new file mode 100644 index 0000000..5cc73c8 --- /dev/null +++ b/arduino_iot_rest/models/batch_query_raw_request_media_v1.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchQueryRawRequestMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_from': 'datetime', + 'q': 'str', + 'series_limit': 'int', + 'sort': 'str', + 'to': 'datetime' + } + + attribute_map = { + '_from': 'from', + 'q': 'q', + 'series_limit': 'series_limit', + 'sort': 'sort', + 'to': 'to' + } + + def __init__(self, _from=None, q=None, series_limit=None, sort='DESC', to=None): # noqa: E501 + """BatchQueryRawRequestMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self.__from = None + self._q = None + self._series_limit = None + self._sort = None + self._to = None + self.discriminator = None + + if _from is not None: + self._from = _from + self.q = q + if series_limit is not None: + self.series_limit = series_limit + if sort is not None: + self.sort = sort + if to is not None: + self.to = to + + @property + def _from(self): + """Gets the _from of this BatchQueryRawRequestMediaV1. # noqa: E501 + + From timestamp # noqa: E501 + + :return: The _from of this BatchQueryRawRequestMediaV1. # noqa: E501 + :rtype: datetime + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this BatchQueryRawRequestMediaV1. + + From timestamp # noqa: E501 + + :param _from: The _from of this BatchQueryRawRequestMediaV1. # noqa: E501 + :type: datetime + """ + + self.__from = _from + + @property + def q(self): + """Gets the q of this BatchQueryRawRequestMediaV1. # noqa: E501 + + Query # noqa: E501 + + :return: The q of this BatchQueryRawRequestMediaV1. # noqa: E501 + :rtype: str + """ + return self._q + + @q.setter + def q(self, q): + """Sets the q of this BatchQueryRawRequestMediaV1. + + Query # noqa: E501 + + :param q: The q of this BatchQueryRawRequestMediaV1. # noqa: E501 + :type: str + """ + if q is None: + raise ValueError("Invalid value for `q`, must not be `None`") # noqa: E501 + + self._q = q + + @property + def series_limit(self): + """Gets the series_limit of this BatchQueryRawRequestMediaV1. # noqa: E501 + + Max of values # noqa: E501 + + :return: The series_limit of this BatchQueryRawRequestMediaV1. # noqa: E501 + :rtype: int + """ + return self._series_limit + + @series_limit.setter + def series_limit(self, series_limit): + """Sets the series_limit of this BatchQueryRawRequestMediaV1. + + Max of values # noqa: E501 + + :param series_limit: The series_limit of this BatchQueryRawRequestMediaV1. # noqa: E501 + :type: int + """ + + self._series_limit = series_limit + + @property + def sort(self): + """Gets the sort of this BatchQueryRawRequestMediaV1. # noqa: E501 + + Sorting # noqa: E501 + + :return: The sort of this BatchQueryRawRequestMediaV1. # noqa: E501 + :rtype: str + """ + return self._sort + + @sort.setter + def sort(self, sort): + """Sets the sort of this BatchQueryRawRequestMediaV1. + + Sorting # noqa: E501 + + :param sort: The sort of this BatchQueryRawRequestMediaV1. # noqa: E501 + :type: str + """ + allowed_values = ["ASC", "DESC"] # noqa: E501 + if sort not in allowed_values: + raise ValueError( + "Invalid value for `sort` ({0}), must be one of {1}" # noqa: E501 + .format(sort, allowed_values) + ) + + self._sort = sort + + @property + def to(self): + """Gets the to of this BatchQueryRawRequestMediaV1. # noqa: E501 + + To timestamp # noqa: E501 + + :return: The to of this BatchQueryRawRequestMediaV1. # noqa: E501 + :rtype: datetime + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this BatchQueryRawRequestMediaV1. + + To timestamp # noqa: E501 + + :param to: The to of this BatchQueryRawRequestMediaV1. # noqa: E501 + :type: datetime + """ + + self._to = to + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchQueryRawRequestMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_query_raw_requests_media_v1.py b/arduino_iot_rest/models/batch_query_raw_requests_media_v1.py new file mode 100644 index 0000000..b2465da --- /dev/null +++ b/arduino_iot_rest/models/batch_query_raw_requests_media_v1.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchQueryRawRequestsMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'requests': 'list[BatchQueryRawRequestMediaV1]', + 'resp_version': 'int' + } + + attribute_map = { + 'requests': 'requests', + 'resp_version': 'resp_version' + } + + def __init__(self, requests=None, resp_version=None): # noqa: E501 + """BatchQueryRawRequestsMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self._requests = None + self._resp_version = None + self.discriminator = None + + self.requests = requests + self.resp_version = resp_version + + @property + def requests(self): + """Gets the requests of this BatchQueryRawRequestsMediaV1. # noqa: E501 + + Requests # noqa: E501 + + :return: The requests of this BatchQueryRawRequestsMediaV1. # noqa: E501 + :rtype: list[BatchQueryRawRequestMediaV1] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this BatchQueryRawRequestsMediaV1. + + Requests # noqa: E501 + + :param requests: The requests of this BatchQueryRawRequestsMediaV1. # noqa: E501 + :type: list[BatchQueryRawRequestMediaV1] + """ + if requests is None: + raise ValueError("Invalid value for `requests`, must not be `None`") # noqa: E501 + + self._requests = requests + + @property + def resp_version(self): + """Gets the resp_version of this BatchQueryRawRequestsMediaV1. # noqa: E501 + + Response version # noqa: E501 + + :return: The resp_version of this BatchQueryRawRequestsMediaV1. # noqa: E501 + :rtype: int + """ + return self._resp_version + + @resp_version.setter + def resp_version(self, resp_version): + """Sets the resp_version of this BatchQueryRawRequestsMediaV1. + + Response version # noqa: E501 + + :param resp_version: The resp_version of this BatchQueryRawRequestsMediaV1. # noqa: E501 + :type: int + """ + if resp_version is None: + raise ValueError("Invalid value for `resp_version`, must not be `None`") # noqa: E501 + + self._resp_version = resp_version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchQueryRawRequestsMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_query_raw_response_series_media_v1.py b/arduino_iot_rest/models/batch_query_raw_response_series_media_v1.py new file mode 100644 index 0000000..7549ee0 --- /dev/null +++ b/arduino_iot_rest/models/batch_query_raw_response_series_media_v1.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchQueryRawResponseSeriesMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'metric': 'str' + } + + attribute_map = { + 'metric': 'metric' + } + + def __init__(self, metric=None): # noqa: E501 + """BatchQueryRawResponseSeriesMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self._metric = None + self.discriminator = None + + self.metric = metric + + @property + def metric(self): + """Gets the metric of this BatchQueryRawResponseSeriesMediaV1. # noqa: E501 + + Metric name # noqa: E501 + + :return: The metric of this BatchQueryRawResponseSeriesMediaV1. # noqa: E501 + :rtype: str + """ + return self._metric + + @metric.setter + def metric(self, metric): + """Sets the metric of this BatchQueryRawResponseSeriesMediaV1. + + Metric name # noqa: E501 + + :param metric: The metric of this BatchQueryRawResponseSeriesMediaV1. # noqa: E501 + :type: str + """ + if metric is None: + raise ValueError("Invalid value for `metric`, must not be `None`") # noqa: E501 + + self._metric = metric + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchQueryRawResponseSeriesMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_query_request_media_v1.py b/arduino_iot_rest/models/batch_query_request_media_v1.py new file mode 100644 index 0000000..b0494a4 --- /dev/null +++ b/arduino_iot_rest/models/batch_query_request_media_v1.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchQueryRequestMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_from': 'datetime', + 'interval': 'int', + 'q': 'str', + 'series_limit': 'int', + 'to': 'datetime' + } + + attribute_map = { + '_from': 'from', + 'interval': 'interval', + 'q': 'q', + 'series_limit': 'series_limit', + 'to': 'to' + } + + def __init__(self, _from=None, interval=None, q=None, series_limit=None, to=None): # noqa: E501 + """BatchQueryRequestMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self.__from = None + self._interval = None + self._q = None + self._series_limit = None + self._to = None + self.discriminator = None + + self._from = _from + if interval is not None: + self.interval = interval + self.q = q + if series_limit is not None: + self.series_limit = series_limit + self.to = to + + @property + def _from(self): + """Gets the _from of this BatchQueryRequestMediaV1. # noqa: E501 + + From timestamp # noqa: E501 + + :return: The _from of this BatchQueryRequestMediaV1. # noqa: E501 + :rtype: datetime + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this BatchQueryRequestMediaV1. + + From timestamp # noqa: E501 + + :param _from: The _from of this BatchQueryRequestMediaV1. # noqa: E501 + :type: datetime + """ + if _from is None: + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def interval(self): + """Gets the interval of this BatchQueryRequestMediaV1. # noqa: E501 + + Resolution in seconds # noqa: E501 + + :return: The interval of this BatchQueryRequestMediaV1. # noqa: E501 + :rtype: int + """ + return self._interval + + @interval.setter + def interval(self, interval): + """Sets the interval of this BatchQueryRequestMediaV1. + + Resolution in seconds # noqa: E501 + + :param interval: The interval of this BatchQueryRequestMediaV1. # noqa: E501 + :type: int + """ + + self._interval = interval + + @property + def q(self): + """Gets the q of this BatchQueryRequestMediaV1. # noqa: E501 + + Query # noqa: E501 + + :return: The q of this BatchQueryRequestMediaV1. # noqa: E501 + :rtype: str + """ + return self._q + + @q.setter + def q(self, q): + """Sets the q of this BatchQueryRequestMediaV1. + + Query # noqa: E501 + + :param q: The q of this BatchQueryRequestMediaV1. # noqa: E501 + :type: str + """ + if q is None: + raise ValueError("Invalid value for `q`, must not be `None`") # noqa: E501 + + self._q = q + + @property + def series_limit(self): + """Gets the series_limit of this BatchQueryRequestMediaV1. # noqa: E501 + + Max of values # noqa: E501 + + :return: The series_limit of this BatchQueryRequestMediaV1. # noqa: E501 + :rtype: int + """ + return self._series_limit + + @series_limit.setter + def series_limit(self, series_limit): + """Sets the series_limit of this BatchQueryRequestMediaV1. + + Max of values # noqa: E501 + + :param series_limit: The series_limit of this BatchQueryRequestMediaV1. # noqa: E501 + :type: int + """ + + self._series_limit = series_limit + + @property + def to(self): + """Gets the to of this BatchQueryRequestMediaV1. # noqa: E501 + + To timestamp # noqa: E501 + + :return: The to of this BatchQueryRequestMediaV1. # noqa: E501 + :rtype: datetime + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this BatchQueryRequestMediaV1. + + To timestamp # noqa: E501 + + :param to: The to of this BatchQueryRequestMediaV1. # noqa: E501 + :type: datetime + """ + if to is None: + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchQueryRequestMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/batch_query_requests_media_v1.py b/arduino_iot_rest/models/batch_query_requests_media_v1.py new file mode 100644 index 0000000..9108bb5 --- /dev/null +++ b/arduino_iot_rest/models/batch_query_requests_media_v1.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BatchQueryRequestsMediaV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'requests': 'list[BatchQueryRequestMediaV1]', + 'resp_version': 'int' + } + + attribute_map = { + 'requests': 'requests', + 'resp_version': 'resp_version' + } + + def __init__(self, requests=None, resp_version=None): # noqa: E501 + """BatchQueryRequestsMediaV1 - a model defined in OpenAPI""" # noqa: E501 + + self._requests = None + self._resp_version = None + self.discriminator = None + + self.requests = requests + self.resp_version = resp_version + + @property + def requests(self): + """Gets the requests of this BatchQueryRequestsMediaV1. # noqa: E501 + + Requests # noqa: E501 + + :return: The requests of this BatchQueryRequestsMediaV1. # noqa: E501 + :rtype: list[BatchQueryRequestMediaV1] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this BatchQueryRequestsMediaV1. + + Requests # noqa: E501 + + :param requests: The requests of this BatchQueryRequestsMediaV1. # noqa: E501 + :type: list[BatchQueryRequestMediaV1] + """ + if requests is None: + raise ValueError("Invalid value for `requests`, must not be `None`") # noqa: E501 + + self._requests = requests + + @property + def resp_version(self): + """Gets the resp_version of this BatchQueryRequestsMediaV1. # noqa: E501 + + Response version # noqa: E501 + + :return: The resp_version of this BatchQueryRequestsMediaV1. # noqa: E501 + :rtype: int + """ + return self._resp_version + + @resp_version.setter + def resp_version(self, resp_version): + """Sets the resp_version of this BatchQueryRequestsMediaV1. + + Response version # noqa: E501 + + :param resp_version: The resp_version of this BatchQueryRequestsMediaV1. # noqa: E501 + :type: int + """ + if resp_version is None: + raise ValueError("Invalid value for `resp_version`, must not be `None`") # noqa: E501 + + self._resp_version = resp_version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchQueryRequestsMediaV1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/create_devices_v2_payload.py b/arduino_iot_rest/models/create_devices_v2_payload.py new file mode 100644 index 0000000..10e659d --- /dev/null +++ b/arduino_iot_rest/models/create_devices_v2_payload.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CreateDevicesV2Payload(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'name': 'str', + 'serial': 'str', + 'type': 'str', + 'user_id': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'serial': 'serial', + 'type': 'type', + 'user_id': 'user_id' + } + + def __init__(self, id=None, name=None, serial=None, type=None, user_id=None): # noqa: E501 + """CreateDevicesV2Payload - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._name = None + self._serial = None + self._type = None + self._user_id = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + if serial is not None: + self.serial = serial + self.type = type + if user_id is not None: + self.user_id = user_id + + @property + def id(self): + """Gets the id of this CreateDevicesV2Payload. # noqa: E501 + + The UUID of the device # noqa: E501 + + :return: The id of this CreateDevicesV2Payload. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateDevicesV2Payload. + + The UUID of the device # noqa: E501 + + :param id: The id of this CreateDevicesV2Payload. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this CreateDevicesV2Payload. # noqa: E501 + + The friendly name of the device # noqa: E501 + + :return: The name of this CreateDevicesV2Payload. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreateDevicesV2Payload. + + The friendly name of the device # noqa: E501 + + :param name: The name of this CreateDevicesV2Payload. # noqa: E501 + :type: str + """ + if name is not None and len(name) > 64: + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if name is not None and not re.search(r'[a-zA-Z0-9_.@-]+', name): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._name = name + + @property + def serial(self): + """Gets the serial of this CreateDevicesV2Payload. # noqa: E501 + + The serial uuid of the device # noqa: E501 + + :return: The serial of this CreateDevicesV2Payload. # noqa: E501 + :rtype: str + """ + return self._serial + + @serial.setter + def serial(self, serial): + """Sets the serial of this CreateDevicesV2Payload. + + The serial uuid of the device # noqa: E501 + + :param serial: The serial of this CreateDevicesV2Payload. # noqa: E501 + :type: str + """ + if serial is not None and len(serial) > 64: + raise ValueError("Invalid value for `serial`, length must be less than or equal to `64`") # noqa: E501 + if serial is not None and not re.search(r'[a-zA-Z0-9_.@-]+', serial): # noqa: E501 + raise ValueError(r"Invalid value for `serial`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._serial = serial + + @property + def type(self): + """Gets the type of this CreateDevicesV2Payload. # noqa: E501 + + The type of the device # noqa: E501 + + :return: The type of this CreateDevicesV2Payload. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CreateDevicesV2Payload. + + The type of the device # noqa: E501 + + :param type: The type of this CreateDevicesV2Payload. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + if type is not None and len(type) > 64: + raise ValueError("Invalid value for `type`, length must be less than or equal to `64`") # noqa: E501 + if type is not None and not re.search(r'[a-zA-Z0-9_.@-]+', type): # noqa: E501 + raise ValueError(r"Invalid value for `type`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._type = type + + @property + def user_id(self): + """Gets the user_id of this CreateDevicesV2Payload. # noqa: E501 + + The user_id associated to the device. If absent it will be inferred from the authentication header # noqa: E501 + + :return: The user_id of this CreateDevicesV2Payload. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CreateDevicesV2Payload. + + The user_id associated to the device. If absent it will be inferred from the authentication header # noqa: E501 + + :param user_id: The user_id of this CreateDevicesV2Payload. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateDevicesV2Payload): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/create_things_v2_payload.py b/arduino_iot_rest/models/create_things_v2_payload.py new file mode 100644 index 0000000..1492d0d --- /dev/null +++ b/arduino_iot_rest/models/create_things_v2_payload.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CreateThingsV2Payload(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'device_id': 'str', + 'id': 'str', + 'name': 'str', + 'webhook_active': 'bool', + 'webhook_uri': 'str' + } + + attribute_map = { + 'device_id': 'device_id', + 'id': 'id', + 'name': 'name', + 'webhook_active': 'webhook_active', + 'webhook_uri': 'webhook_uri' + } + + def __init__(self, device_id=None, id=None, name=None, webhook_active=None, webhook_uri=None): # noqa: E501 + """CreateThingsV2Payload - a model defined in OpenAPI""" # noqa: E501 + + self._device_id = None + self._id = None + self._name = None + self._webhook_active = None + self._webhook_uri = None + self.discriminator = None + + if device_id is not None: + self.device_id = device_id + if id is not None: + self.id = id + self.name = name + if webhook_active is not None: + self.webhook_active = webhook_active + if webhook_uri is not None: + self.webhook_uri = webhook_uri + + @property + def device_id(self): + """Gets the device_id of this CreateThingsV2Payload. # noqa: E501 + + The arn of the associated device # noqa: E501 + + :return: The device_id of this CreateThingsV2Payload. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this CreateThingsV2Payload. + + The arn of the associated device # noqa: E501 + + :param device_id: The device_id of this CreateThingsV2Payload. # noqa: E501 + :type: str + """ + + self._device_id = device_id + + @property + def id(self): + """Gets the id of this CreateThingsV2Payload. # noqa: E501 + + The id of the thing # noqa: E501 + + :return: The id of this CreateThingsV2Payload. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateThingsV2Payload. + + The id of the thing # noqa: E501 + + :param id: The id of this CreateThingsV2Payload. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this CreateThingsV2Payload. # noqa: E501 + + The friendly name of the thing # noqa: E501 + + :return: The name of this CreateThingsV2Payload. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreateThingsV2Payload. + + The friendly name of the thing # noqa: E501 + + :param name: The name of this CreateThingsV2Payload. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if name is not None and len(name) > 64: + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if name is not None and not re.search(r'[a-zA-Z0-9_.@-]+', name): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._name = name + + @property + def webhook_active(self): + """Gets the webhook_active of this CreateThingsV2Payload. # noqa: E501 + + Webhook uri # noqa: E501 + + :return: The webhook_active of this CreateThingsV2Payload. # noqa: E501 + :rtype: bool + """ + return self._webhook_active + + @webhook_active.setter + def webhook_active(self, webhook_active): + """Sets the webhook_active of this CreateThingsV2Payload. + + Webhook uri # noqa: E501 + + :param webhook_active: The webhook_active of this CreateThingsV2Payload. # noqa: E501 + :type: bool + """ + + self._webhook_active = webhook_active + + @property + def webhook_uri(self): + """Gets the webhook_uri of this CreateThingsV2Payload. # noqa: E501 + + Webhook uri # noqa: E501 + + :return: The webhook_uri of this CreateThingsV2Payload. # noqa: E501 + :rtype: str + """ + return self._webhook_uri + + @webhook_uri.setter + def webhook_uri(self, webhook_uri): + """Sets the webhook_uri of this CreateThingsV2Payload. + + Webhook uri # noqa: E501 + + :param webhook_uri: The webhook_uri of this CreateThingsV2Payload. # noqa: E501 + :type: str + """ + + self._webhook_uri = webhook_uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateThingsV2Payload): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/devicev2.py b/arduino_iot_rest/models/devicev2.py new file mode 100644 index 0000000..d7bdfe0 --- /dev/null +++ b/arduino_iot_rest/models/devicev2.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Devicev2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'name': 'str', + 'serial': 'str', + 'type': 'str', + 'user_id': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'serial': 'serial', + 'type': 'type', + 'user_id': 'user_id' + } + + def __init__(self, id=None, name=None, serial=None, type=None, user_id=None): # noqa: E501 + """Devicev2 - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._name = None + self._serial = None + self._type = None + self._user_id = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + if serial is not None: + self.serial = serial + if type is not None: + self.type = type + if user_id is not None: + self.user_id = user_id + + @property + def id(self): + """Gets the id of this Devicev2. # noqa: E501 + + The UUID of the device # noqa: E501 + + :return: The id of this Devicev2. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Devicev2. + + The UUID of the device # noqa: E501 + + :param id: The id of this Devicev2. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Devicev2. # noqa: E501 + + The friendly name of the device # noqa: E501 + + :return: The name of this Devicev2. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Devicev2. + + The friendly name of the device # noqa: E501 + + :param name: The name of this Devicev2. # noqa: E501 + :type: str + """ + if name is not None and len(name) > 64: + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if name is not None and not re.search(r'[a-zA-Z0-9_.@-]+', name): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._name = name + + @property + def serial(self): + """Gets the serial of this Devicev2. # noqa: E501 + + The serial uuid of the device # noqa: E501 + + :return: The serial of this Devicev2. # noqa: E501 + :rtype: str + """ + return self._serial + + @serial.setter + def serial(self, serial): + """Sets the serial of this Devicev2. + + The serial uuid of the device # noqa: E501 + + :param serial: The serial of this Devicev2. # noqa: E501 + :type: str + """ + if serial is not None and len(serial) > 64: + raise ValueError("Invalid value for `serial`, length must be less than or equal to `64`") # noqa: E501 + if serial is not None and not re.search(r'[a-zA-Z0-9_.@-]+', serial): # noqa: E501 + raise ValueError(r"Invalid value for `serial`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._serial = serial + + @property + def type(self): + """Gets the type of this Devicev2. # noqa: E501 + + The type of the device # noqa: E501 + + :return: The type of this Devicev2. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Devicev2. + + The type of the device # noqa: E501 + + :param type: The type of this Devicev2. # noqa: E501 + :type: str + """ + if type is not None and len(type) > 64: + raise ValueError("Invalid value for `type`, length must be less than or equal to `64`") # noqa: E501 + if type is not None and not re.search(r'[a-zA-Z0-9_.@-]+', type): # noqa: E501 + raise ValueError(r"Invalid value for `type`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._type = type + + @property + def user_id(self): + """Gets the user_id of this Devicev2. # noqa: E501 + + The user_id associated to the device. If absent it will be inferred from the authentication header # noqa: E501 + + :return: The user_id of this Devicev2. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this Devicev2. + + The user_id associated to the device. If absent it will be inferred from the authentication header # noqa: E501 + + :param user_id: The user_id of this Devicev2. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Devicev2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/error.py b/arduino_iot_rest/models/error.py new file mode 100644 index 0000000..69b4d5d --- /dev/null +++ b/arduino_iot_rest/models/error.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Error(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'str', + 'detail': 'str', + 'id': 'str', + 'meta': 'dict(str, object)', + 'status': 'int' + } + + attribute_map = { + 'code': 'code', + 'detail': 'detail', + 'id': 'id', + 'meta': 'meta', + 'status': 'status' + } + + def __init__(self, code=None, detail=None, id=None, meta=None, status=None): # noqa: E501 + """Error - a model defined in OpenAPI""" # noqa: E501 + + self._code = None + self._detail = None + self._id = None + self._meta = None + self._status = None + self.discriminator = None + + if code is not None: + self.code = code + if detail is not None: + self.detail = detail + if id is not None: + self.id = id + if meta is not None: + self.meta = meta + if status is not None: + self.status = status + + @property + def code(self): + """Gets the code of this Error. # noqa: E501 + + an application-specific error code, expressed as a string value. # noqa: E501 + + :return: The code of this Error. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this Error. + + an application-specific error code, expressed as a string value. # noqa: E501 + + :param code: The code of this Error. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def detail(self): + """Gets the detail of this Error. # noqa: E501 + + a human-readable explanation specific to this occurrence of the problem. # noqa: E501 + + :return: The detail of this Error. # noqa: E501 + :rtype: str + """ + return self._detail + + @detail.setter + def detail(self, detail): + """Sets the detail of this Error. + + a human-readable explanation specific to this occurrence of the problem. # noqa: E501 + + :param detail: The detail of this Error. # noqa: E501 + :type: str + """ + + self._detail = detail + + @property + def id(self): + """Gets the id of this Error. # noqa: E501 + + a unique identifier for this particular occurrence of the problem. # noqa: E501 + + :return: The id of this Error. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Error. + + a unique identifier for this particular occurrence of the problem. # noqa: E501 + + :param id: The id of this Error. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def meta(self): + """Gets the meta of this Error. # noqa: E501 + + a meta object containing non-standard meta-information about the error. # noqa: E501 + + :return: The meta of this Error. # noqa: E501 + :rtype: dict(str, object) + """ + return self._meta + + @meta.setter + def meta(self, meta): + """Sets the meta of this Error. + + a meta object containing non-standard meta-information about the error. # noqa: E501 + + :param meta: The meta of this Error. # noqa: E501 + :type: dict(str, object) + """ + + self._meta = meta + + @property + def status(self): + """Gets the status of this Error. # noqa: E501 + + the HTTP status code applicable to this problem # noqa: E501 + + :return: The status of this Error. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Error. + + the HTTP status code applicable to this problem # noqa: E501 + + :param status: The status of this Error. # noqa: E501 + :type: int + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Error): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/model_property.py b/arduino_iot_rest/models/model_property.py new file mode 100644 index 0000000..78c5935 --- /dev/null +++ b/arduino_iot_rest/models/model_property.py @@ -0,0 +1,364 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ModelProperty(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'max_value': 'float', + 'min_value': 'float', + 'name': 'str', + 'permission': 'str', + 'persist': 'bool', + 'type': 'str', + 'update_parameter': 'float', + 'update_strategy': 'str', + 'variable_name': 'str' + } + + attribute_map = { + 'max_value': 'max_value', + 'min_value': 'min_value', + 'name': 'name', + 'permission': 'permission', + 'persist': 'persist', + 'type': 'type', + 'update_parameter': 'update_parameter', + 'update_strategy': 'update_strategy', + 'variable_name': 'variable_name' + } + + def __init__(self, max_value=None, min_value=None, name=None, permission=None, persist=False, type=None, update_parameter=None, update_strategy=None, variable_name=None): # noqa: E501 + """ModelProperty - a model defined in OpenAPI""" # noqa: E501 + + self._max_value = None + self._min_value = None + self._name = None + self._permission = None + self._persist = None + self._type = None + self._update_parameter = None + self._update_strategy = None + self._variable_name = None + self.discriminator = None + + if max_value is not None: + self.max_value = max_value + if min_value is not None: + self.min_value = min_value + self.name = name + self.permission = permission + if persist is not None: + self.persist = persist + self.type = type + if update_parameter is not None: + self.update_parameter = update_parameter + self.update_strategy = update_strategy + if variable_name is not None: + self.variable_name = variable_name + + @property + def max_value(self): + """Gets the max_value of this ModelProperty. # noqa: E501 + + Maximum value of this property # noqa: E501 + + :return: The max_value of this ModelProperty. # noqa: E501 + :rtype: float + """ + return self._max_value + + @max_value.setter + def max_value(self, max_value): + """Sets the max_value of this ModelProperty. + + Maximum value of this property # noqa: E501 + + :param max_value: The max_value of this ModelProperty. # noqa: E501 + :type: float + """ + + self._max_value = max_value + + @property + def min_value(self): + """Gets the min_value of this ModelProperty. # noqa: E501 + + Minimum value of this property # noqa: E501 + + :return: The min_value of this ModelProperty. # noqa: E501 + :rtype: float + """ + return self._min_value + + @min_value.setter + def min_value(self, min_value): + """Sets the min_value of this ModelProperty. + + Minimum value of this property # noqa: E501 + + :param min_value: The min_value of this ModelProperty. # noqa: E501 + :type: float + """ + + self._min_value = min_value + + @property + def name(self): + """Gets the name of this ModelProperty. # noqa: E501 + + The friendly name of the property # noqa: E501 + + :return: The name of this ModelProperty. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ModelProperty. + + The friendly name of the property # noqa: E501 + + :param name: The name of this ModelProperty. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def permission(self): + """Gets the permission of this ModelProperty. # noqa: E501 + + The permission of the property # noqa: E501 + + :return: The permission of this ModelProperty. # noqa: E501 + :rtype: str + """ + return self._permission + + @permission.setter + def permission(self, permission): + """Sets the permission of this ModelProperty. + + The permission of the property # noqa: E501 + + :param permission: The permission of this ModelProperty. # noqa: E501 + :type: str + """ + if permission is None: + raise ValueError("Invalid value for `permission`, must not be `None`") # noqa: E501 + allowed_values = ["READ_ONLY", "READ_WRITE"] # noqa: E501 + if permission not in allowed_values: + raise ValueError( + "Invalid value for `permission` ({0}), must be one of {1}" # noqa: E501 + .format(permission, allowed_values) + ) + + self._permission = permission + + @property + def persist(self): + """Gets the persist of this ModelProperty. # noqa: E501 + + If true, data will persist into a timeseries database # noqa: E501 + + :return: The persist of this ModelProperty. # noqa: E501 + :rtype: bool + """ + return self._persist + + @persist.setter + def persist(self, persist): + """Sets the persist of this ModelProperty. + + If true, data will persist into a timeseries database # noqa: E501 + + :param persist: The persist of this ModelProperty. # noqa: E501 + :type: bool + """ + + self._persist = persist + + @property + def type(self): + """Gets the type of this ModelProperty. # noqa: E501 + + The type of the property # noqa: E501 + + :return: The type of this ModelProperty. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ModelProperty. + + The type of the property # noqa: E501 + + :param type: The type of this ModelProperty. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["ANALOG", "CHARSTRING", "FLOAT", "INT", "LENGHT_C", "LENGHT_I", "LENGHT_M", "PERCENTAGE", "STATUS", "TEMPERATURE_C", "TEMPERATURE_F", "METER", "KILOGRAM", "GRAM", "SECOND", "AMPERE", "KELVIN", "CANDELA", "MOLE", "HERTZ", "RADIAN", "STERADIAN", "NEWTON", "PASCAL", "JOULE", "WATT", "COULOMB", "VOLT", "FARAD", "OHM", "SIEMENS", "WEBER", "TESLA", "HENRY", "DEGREES_CELSIUS", "LUMEN", "LUX", "BECQUEREL", "GRAY", "SIEVERT", "KATAL", "SQUARE_METER", "CUBIC_METER", "LITER", "METER_PER_SECOND", "METER_PER_SQUARE_SECOND", "CUBIC_METER_PER_SECOND", "LITER_PER_SECOND", "WATT_PER_SQUARE_METER", "CANDELA_PER_SQUARE_METER", "BIT", "BIT_PER_SECOND", "DEGREES_LATITUDE", "DEGREES_LONGITUDE", "PH_VALUE", "DECIBEL", "DECIBEL_1W", "BEL", "COUNT", "RATIO_DIV", "RATIO_MOD", "PERCENTAGE_RELATIVE_HUMIDITY", "PERCENTAGE_BATTERY_LEVEL", "SECONDS_BATTERY_LEVEL", "EVENT_RATE_SECOND", "EVENT_RATE_MINUTE", "HEART_RATE", "HEART_BEATS", "SIEMENS_PER_METER", "LOCATION", "COLOR_HSB", "COLOR_RGB", "GENERIC_COMPLEX_PROPERTY", "HOME_COLORED_LIGHT", "HOME_DIMMERED_LIGHT", "HOME_LIGHT", "HOME_CONTACT_SENSOR", "HOME_MOTION_SENSOR", "HOME_SMART_PLUG", "HOME_TEMPERATURE", "HOME_SWITCH"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def update_parameter(self): + """Gets the update_parameter of this ModelProperty. # noqa: E501 + + The update frequency in seconds, or the amount of the property has to change in order to trigger an update # noqa: E501 + + :return: The update_parameter of this ModelProperty. # noqa: E501 + :rtype: float + """ + return self._update_parameter + + @update_parameter.setter + def update_parameter(self, update_parameter): + """Sets the update_parameter of this ModelProperty. + + The update frequency in seconds, or the amount of the property has to change in order to trigger an update # noqa: E501 + + :param update_parameter: The update_parameter of this ModelProperty. # noqa: E501 + :type: float + """ + + self._update_parameter = update_parameter + + @property + def update_strategy(self): + """Gets the update_strategy of this ModelProperty. # noqa: E501 + + The update strategy for the property value # noqa: E501 + + :return: The update_strategy of this ModelProperty. # noqa: E501 + :rtype: str + """ + return self._update_strategy + + @update_strategy.setter + def update_strategy(self, update_strategy): + """Sets the update_strategy of this ModelProperty. + + The update strategy for the property value # noqa: E501 + + :param update_strategy: The update_strategy of this ModelProperty. # noqa: E501 + :type: str + """ + if update_strategy is None: + raise ValueError("Invalid value for `update_strategy`, must not be `None`") # noqa: E501 + allowed_values = ["ON_CHANGE", "TIMED"] # noqa: E501 + if update_strategy not in allowed_values: + raise ValueError( + "Invalid value for `update_strategy` ({0}), must be one of {1}" # noqa: E501 + .format(update_strategy, allowed_values) + ) + + self._update_strategy = update_strategy + + @property + def variable_name(self): + """Gets the variable_name of this ModelProperty. # noqa: E501 + + The sketch variable name of the property # noqa: E501 + + :return: The variable_name of this ModelProperty. # noqa: E501 + :rtype: str + """ + return self._variable_name + + @variable_name.setter + def variable_name(self, variable_name): + """Sets the variable_name of this ModelProperty. + + The sketch variable name of the property # noqa: E501 + + :param variable_name: The variable_name of this ModelProperty. # noqa: E501 + :type: str + """ + if variable_name is not None and len(variable_name) > 64: + raise ValueError("Invalid value for `variable_name`, length must be less than or equal to `64`") # noqa: E501 + if variable_name is not None and not re.search(r'^[a-zA-Z_][a-zA-Z0-9_]*$', variable_name): # noqa: E501 + raise ValueError(r"Invalid value for `variable_name`, must be a follow pattern or equal to `/^[a-zA-Z_][a-zA-Z0-9_]*$/`") # noqa: E501 + + self._variable_name = variable_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ModelProperty): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/properties_value.py b/arduino_iot_rest/models/properties_value.py new file mode 100644 index 0000000..cc0f18f --- /dev/null +++ b/arduino_iot_rest/models/properties_value.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PropertiesValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'type': 'str', + 'value': 'object' + } + + attribute_map = { + 'name': 'name', + 'type': 'type', + 'value': 'value' + } + + def __init__(self, name=None, type='infer', value=None): # noqa: E501 + """PropertiesValue - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self._type = None + self._value = None + self.discriminator = None + + self.name = name + self.type = type + self.value = value + + @property + def name(self): + """Gets the name of this PropertiesValue. # noqa: E501 + + The name of the property # noqa: E501 + + :return: The name of this PropertiesValue. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PropertiesValue. + + The name of the property # noqa: E501 + + :param name: The name of this PropertiesValue. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def type(self): + """Gets the type of this PropertiesValue. # noqa: E501 + + The type of the property # noqa: E501 + + :return: The type of this PropertiesValue. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PropertiesValue. + + The type of the property # noqa: E501 + + :param type: The type of this PropertiesValue. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["infer", "base64", "hex", "json"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def value(self): + """Gets the value of this PropertiesValue. # noqa: E501 + + The last value of the property # noqa: E501 + + :return: The value of this PropertiesValue. # noqa: E501 + :rtype: object + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this PropertiesValue. + + The last value of the property # noqa: E501 + + :param value: The value of this PropertiesValue. # noqa: E501 + :type: object + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PropertiesValue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/properties_values.py b/arduino_iot_rest/models/properties_values.py new file mode 100644 index 0000000..7ca3aed --- /dev/null +++ b/arduino_iot_rest/models/properties_values.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PropertiesValues(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'properties': 'list[PropertiesValue]' + } + + attribute_map = { + 'properties': 'properties' + } + + def __init__(self, properties=None): # noqa: E501 + """PropertiesValues - a model defined in OpenAPI""" # noqa: E501 + + self._properties = None + self.discriminator = None + + self.properties = properties + + @property + def properties(self): + """Gets the properties of this PropertiesValues. # noqa: E501 + + + :return: The properties of this PropertiesValues. # noqa: E501 + :rtype: list[PropertiesValue] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this PropertiesValues. + + + :param properties: The properties of this PropertiesValues. # noqa: E501 + :type: list[PropertiesValue] + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PropertiesValues): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/property_value.py b/arduino_iot_rest/models/property_value.py new file mode 100644 index 0000000..f78c50a --- /dev/null +++ b/arduino_iot_rest/models/property_value.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PropertyValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'device_id': 'str', + 'value': 'object' + } + + attribute_map = { + 'device_id': 'device_id', + 'value': 'value' + } + + def __init__(self, device_id=None, value=None): # noqa: E501 + """PropertyValue - a model defined in OpenAPI""" # noqa: E501 + + self._device_id = None + self._value = None + self.discriminator = None + + if device_id is not None: + self.device_id = device_id + self.value = value + + @property + def device_id(self): + """Gets the device_id of this PropertyValue. # noqa: E501 + + The device who send the property # noqa: E501 + + :return: The device_id of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this PropertyValue. + + The device who send the property # noqa: E501 + + :param device_id: The device_id of this PropertyValue. # noqa: E501 + :type: str + """ + + self._device_id = device_id + + @property + def value(self): + """Gets the value of this PropertyValue. # noqa: E501 + + The property value # noqa: E501 + + :return: The value of this PropertyValue. # noqa: E501 + :rtype: object + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this PropertyValue. + + The property value # noqa: E501 + + :param value: The value of this PropertyValue. # noqa: E501 + :type: object + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PropertyValue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/thing.py b/arduino_iot_rest/models/thing.py new file mode 100644 index 0000000..80748a7 --- /dev/null +++ b/arduino_iot_rest/models/thing.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Thing(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'device_id': 'str', + 'id': 'str', + 'name': 'str', + 'webhook_active': 'bool', + 'webhook_uri': 'str' + } + + attribute_map = { + 'device_id': 'device_id', + 'id': 'id', + 'name': 'name', + 'webhook_active': 'webhook_active', + 'webhook_uri': 'webhook_uri' + } + + def __init__(self, device_id=None, id=None, name=None, webhook_active=None, webhook_uri=None): # noqa: E501 + """Thing - a model defined in OpenAPI""" # noqa: E501 + + self._device_id = None + self._id = None + self._name = None + self._webhook_active = None + self._webhook_uri = None + self.discriminator = None + + if device_id is not None: + self.device_id = device_id + if id is not None: + self.id = id + if name is not None: + self.name = name + if webhook_active is not None: + self.webhook_active = webhook_active + if webhook_uri is not None: + self.webhook_uri = webhook_uri + + @property + def device_id(self): + """Gets the device_id of this Thing. # noqa: E501 + + The arn of the associated device # noqa: E501 + + :return: The device_id of this Thing. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this Thing. + + The arn of the associated device # noqa: E501 + + :param device_id: The device_id of this Thing. # noqa: E501 + :type: str + """ + + self._device_id = device_id + + @property + def id(self): + """Gets the id of this Thing. # noqa: E501 + + The id of the thing # noqa: E501 + + :return: The id of this Thing. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Thing. + + The id of the thing # noqa: E501 + + :param id: The id of this Thing. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Thing. # noqa: E501 + + The friendly name of the thing # noqa: E501 + + :return: The name of this Thing. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Thing. + + The friendly name of the thing # noqa: E501 + + :param name: The name of this Thing. # noqa: E501 + :type: str + """ + if name is not None and len(name) > 64: + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if name is not None and not re.search(r'[a-zA-Z0-9_.@-]+', name): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/[a-zA-Z0-9_.@-]+/`") # noqa: E501 + + self._name = name + + @property + def webhook_active(self): + """Gets the webhook_active of this Thing. # noqa: E501 + + Webhook uri # noqa: E501 + + :return: The webhook_active of this Thing. # noqa: E501 + :rtype: bool + """ + return self._webhook_active + + @webhook_active.setter + def webhook_active(self, webhook_active): + """Sets the webhook_active of this Thing. + + Webhook uri # noqa: E501 + + :param webhook_active: The webhook_active of this Thing. # noqa: E501 + :type: bool + """ + + self._webhook_active = webhook_active + + @property + def webhook_uri(self): + """Gets the webhook_uri of this Thing. # noqa: E501 + + Webhook uri # noqa: E501 + + :return: The webhook_uri of this Thing. # noqa: E501 + :rtype: str + """ + return self._webhook_uri + + @webhook_uri.setter + def webhook_uri(self, webhook_uri): + """Sets the webhook_uri of this Thing. + + Webhook uri # noqa: E501 + + :param webhook_uri: The webhook_uri of this Thing. # noqa: E501 + :type: str + """ + + self._webhook_uri = webhook_uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Thing): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/models/thing_sketch.py b/arduino_iot_rest/models/thing_sketch.py new file mode 100644 index 0000000..08ee7ad --- /dev/null +++ b/arduino_iot_rest/models/thing_sketch.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ThingSketch(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_pass': 'str', + 'ssid': 'str' + } + + attribute_map = { + '_pass': 'pass', + 'ssid': 'ssid' + } + + def __init__(self, _pass=None, ssid=None): # noqa: E501 + """ThingSketch - a model defined in OpenAPI""" # noqa: E501 + + self.__pass = None + self._ssid = None + self.discriminator = None + + if _pass is not None: + self._pass = _pass + if ssid is not None: + self.ssid = ssid + + @property + def _pass(self): + """Gets the _pass of this ThingSketch. # noqa: E501 + + The wifi password # noqa: E501 + + :return: The _pass of this ThingSketch. # noqa: E501 + :rtype: str + """ + return self.__pass + + @_pass.setter + def _pass(self, _pass): + """Sets the _pass of this ThingSketch. + + The wifi password # noqa: E501 + + :param _pass: The _pass of this ThingSketch. # noqa: E501 + :type: str + """ + + self.__pass = _pass + + @property + def ssid(self): + """Gets the ssid of this ThingSketch. # noqa: E501 + + The wifi ssid to connect # noqa: E501 + + :return: The ssid of this ThingSketch. # noqa: E501 + :rtype: str + """ + return self._ssid + + @ssid.setter + def ssid(self, ssid): + """Sets the ssid of this ThingSketch. + + The wifi ssid to connect # noqa: E501 + + :param ssid: The ssid of this ThingSketch. # noqa: E501 + :type: str + """ + + self._ssid = ssid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ThingSketch): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/arduino_iot_rest/rest.py b/arduino_iot_rest/rest.py new file mode 100644 index 0000000..bb4db09 --- /dev/null +++ b/arduino_iot_rest/rest.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + Iot API + + Collection of all public API endpoints. # noqa: E501 + + The version of the OpenAPI document: 2.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from arduino_iot_rest.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/docs/DevicesV2Api.md b/docs/DevicesV2Api.md index e59c8db..2ffd560 100644 --- a/docs/DevicesV2Api.md +++ b/docs/DevicesV2Api.md @@ -1,6 +1,6 @@ -# iot_api_client.DevicesV2Api +# arduino_iot_rest.DevicesV2Api -All URIs are relative to *http://api-dev.arduino.cc/iot* +All URIs are relative to *http://api2.arduino.cc/iot* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -27,18 +27,18 @@ Creates a new device associated to the user. ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) -create_devices_v2_payload = iot_api_client.CreateDevicesV2Payload() # CreateDevicesV2Payload | DeviceV2 describes a device. +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) +create_devices_v2_payload = arduino_iot_rest.CreateDevicesV2Payload() # CreateDevicesV2Payload | DeviceV2 describes a device. try: # create devices_v2 @@ -88,17 +88,17 @@ Removes a device associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the device try: @@ -147,17 +147,17 @@ GET device properties ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the device show_deleted = False # bool | If true, shows the soft deleted properties (optional) (default to False) @@ -210,17 +210,17 @@ Returns the list of devices associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) across_user_ids = False # bool | If true, returns all the devices (optional) (default to False) try: @@ -270,17 +270,17 @@ Returns the device requested by the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the device try: @@ -330,17 +330,17 @@ GET device properties values in a range of time ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the device pid = 'pid_example' # str | The id of the property limit = 56 # int | The number of properties to select (optional) @@ -397,19 +397,19 @@ Updates a device associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the device -devicev2 = iot_api_client.Devicev2() # Devicev2 | DeviceV2 describes a device. +devicev2 = arduino_iot_rest.Devicev2() # Devicev2 | DeviceV2 describes a device. try: # update devices_v2 @@ -461,19 +461,19 @@ Update device properties last values ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.DevicesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.DevicesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the device -properties_values = iot_api_client.PropertiesValues() # PropertiesValues | +properties_values = arduino_iot_rest.PropertiesValues() # PropertiesValues | try: # updateProperties devices_v2 diff --git a/docs/PropertiesV2Api.md b/docs/PropertiesV2Api.md index 64a170f..7b0c57c 100644 --- a/docs/PropertiesV2Api.md +++ b/docs/PropertiesV2Api.md @@ -1,6 +1,6 @@ -# iot_api_client.PropertiesV2Api +# arduino_iot_rest.PropertiesV2Api -All URIs are relative to *http://api-dev.arduino.cc/iot* +All URIs are relative to *http://api2.arduino.cc/iot* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -25,19 +25,19 @@ Creates a new property associated to a thing ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.PropertiesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.PropertiesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing -model_property = iot_api_client.ModelProperty() # ModelProperty | PropertyPayload describes a property of a thing. No field is mandatory +model_property = arduino_iot_rest.ModelProperty() # ModelProperty | PropertyPayload describes a property of a thing. No field is mandatory try: # create properties_v2 @@ -90,17 +90,17 @@ Removes a property associated to a thing ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.PropertiesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.PropertiesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing pid = 'pid_example' # str | The id of the property force = False # bool | If true, hard delete the property (optional) (default to False) @@ -155,17 +155,17 @@ Returns the list of properties associated to the thing ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.PropertiesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.PropertiesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing show_deleted = False # bool | If true, shows the soft deleted properties (optional) (default to False) @@ -219,20 +219,20 @@ Publish a property value to MQTT ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.PropertiesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.PropertiesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing pid = 'pid_example' # str | The id of the property -property_value = iot_api_client.PropertyValue() # PropertyValue | PropertyValuePayload describes a property value +property_value = arduino_iot_rest.PropertyValue() # PropertyValue | PropertyValuePayload describes a property value try: # publish properties_v2 @@ -285,17 +285,17 @@ Returns the property requested by the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.PropertiesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.PropertiesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing pid = 'pid_example' # str | The id of the property show_deleted = False # bool | If true, shows the soft deleted properties (optional) (default to False) @@ -351,20 +351,20 @@ Updates a property associated to a thing ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.PropertiesV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.PropertiesV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing pid = 'pid_example' # str | The id of the property -model_property = iot_api_client.ModelProperty() # ModelProperty | PropertyPayload describes a property of a thing. No field is mandatory +model_property = arduino_iot_rest.ModelProperty() # ModelProperty | PropertyPayload describes a property of a thing. No field is mandatory try: # update properties_v2 diff --git a/docs/SeriesV2Api.md b/docs/SeriesV2Api.md index d411518..089d664 100644 --- a/docs/SeriesV2Api.md +++ b/docs/SeriesV2Api.md @@ -1,6 +1,6 @@ -# iot_api_client.SeriesV2Api +# arduino_iot_rest.SeriesV2Api -All URIs are relative to *http://api-dev.arduino.cc/iot* +All URIs are relative to *http://api2.arduino.cc/iot* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,18 +22,18 @@ Returns the batch of time-series data ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.SeriesV2Api(iot_api_client.ApiClient(configuration)) -batch_query_requests_media_v1 = iot_api_client.BatchQueryRequestsMediaV1() # BatchQueryRequestsMediaV1 | +api_instance = arduino_iot_rest.SeriesV2Api(arduino_iot_rest.ApiClient(configuration)) +batch_query_requests_media_v1 = arduino_iot_rest.BatchQueryRequestsMediaV1() # BatchQueryRequestsMediaV1 | try: # batch_query series_v2 @@ -86,18 +86,18 @@ Returns the batch of time-series data raw ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.SeriesV2Api(iot_api_client.ApiClient(configuration)) -batch_query_raw_requests_media_v1 = iot_api_client.BatchQueryRawRequestsMediaV1() # BatchQueryRawRequestsMediaV1 | +api_instance = arduino_iot_rest.SeriesV2Api(arduino_iot_rest.ApiClient(configuration)) +batch_query_raw_requests_media_v1 = arduino_iot_rest.BatchQueryRawRequestsMediaV1() # BatchQueryRawRequestsMediaV1 | try: # batch_query_raw series_v2 @@ -150,18 +150,18 @@ Returns the batch of time-series data raw ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.SeriesV2Api(iot_api_client.ApiClient(configuration)) -batch_last_value_requests_media_v1 = iot_api_client.BatchLastValueRequestsMediaV1() # BatchLastValueRequestsMediaV1 | +api_instance = arduino_iot_rest.SeriesV2Api(arduino_iot_rest.ApiClient(configuration)) +batch_last_value_requests_media_v1 = arduino_iot_rest.BatchLastValueRequestsMediaV1() # BatchLastValueRequestsMediaV1 | try: # batch_query_raw_last_value series_v2 diff --git a/docs/ThingsV2Api.md b/docs/ThingsV2Api.md index 65e0b66..3f35e59 100644 --- a/docs/ThingsV2Api.md +++ b/docs/ThingsV2Api.md @@ -1,6 +1,6 @@ -# iot_api_client.ThingsV2Api +# arduino_iot_rest.ThingsV2Api -All URIs are relative to *http://api-dev.arduino.cc/iot* +All URIs are relative to *http://api2.arduino.cc/iot* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -27,18 +27,18 @@ Creates a new thing associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) -create_things_v2_payload = iot_api_client.CreateThingsV2Payload() # CreateThingsV2Payload | ThingPayload describes a thing +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) +create_things_v2_payload = arduino_iot_rest.CreateThingsV2Payload() # CreateThingsV2Payload | ThingPayload describes a thing force = False # bool | If true, detach device from the other thing, and attach to this thing (optional) (default to False) try: @@ -92,19 +92,19 @@ Creates a new sketch thing associated to the thing ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing -thing_sketch = iot_api_client.ThingSketch() # ThingSketch | ThingSketchPayload describes a sketch of a thing +thing_sketch = arduino_iot_rest.ThingSketch() # ThingSketch | ThingSketchPayload describes a sketch of a thing try: # createSketch things_v2 @@ -157,17 +157,17 @@ Removes a thing associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing force = False # bool | If true, hard delete the thing (optional) (default to False) @@ -218,17 +218,17 @@ deleteSketch things_v2 ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing try: @@ -280,17 +280,17 @@ Returns the list of things associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) across_user_ids = False # bool | If true, returns all the things (optional) (default to False) device_id = 'device_id_example' # str | The id of the device you want to filter (optional) show_deleted = False # bool | If true, shows the soft deleted things (optional) (default to False) @@ -345,17 +345,17 @@ Returns the thing requested by the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing show_deleted = False # bool | If true, shows the soft deleted thing (optional) (default to False) @@ -410,19 +410,19 @@ Updates a thing associated to the user ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing -thing = iot_api_client.Thing() # Thing | ThingPayload describes a thing +thing = arduino_iot_rest.Thing() # Thing | ThingPayload describes a thing force = False # bool | If true, detach device from the other thing, and attach to this thing (optional) (default to False) try: @@ -478,17 +478,17 @@ Update an existing thing sketch ```python from __future__ import print_function import time -import iot_api_client -from iot_api_client.rest import ApiException +import arduino_iot_rest +from arduino_iot_rest.rest import ApiException from pprint import pprint -configuration = iot_api_client.Configuration() +configuration = arduino_iot_rest.Configuration() # Configure OAuth2 access token for authorization: oauth2 configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://api-dev.arduino.cc/iot -configuration.host = "http://api-dev.arduino.cc/iot" +# Defining host is optional and default to http://api2.arduino.cc/iot +configuration.host = "http://api2.arduino.cc/iot" # Create an instance of the API class -api_instance = iot_api_client.ThingsV2Api(iot_api_client.ApiClient(configuration)) +api_instance = arduino_iot_rest.ThingsV2Api(arduino_iot_rest.ApiClient(configuration)) id = 'id_example' # str | The id of the thing sketch_id = 'sketch_id_example' # str | The id of the sketch diff --git a/setup.py b/setup.py index 0331b97..980b20e 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,8 @@ from setuptools import setup, find_packages # noqa: H301 -NAME = "iot_api" -VERSION = "0.0.1" +NAME = "arduino-iot-client" +VERSION = "1.0.0-beta1" # To install the library, run the following # # python setup.py install