|
| 1 | +/** |
| 2 | + * Arduino IoT Cloud API |
| 3 | + * Provides a set of endpoints to manage Arduino IoT Cloud **Devices**, **Things**, **Properties** and **Timeseries**. This API can be called just with any HTTP Client, or using one of these clients: * [Javascript NPM package](https://www.npmjs.com/package/@arduino/arduino-iot-client) * [Python PYPI Package](https://pypi.org/project/arduino-iot-client/) * [Golang Module](https://github.com/arduino/iot-client-go) |
| 4 | + * |
| 5 | + * The version of the OpenAPI document: 2.0 |
| 6 | + * |
| 7 | + * |
| 8 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 9 | + * https://openapi-generator.tech |
| 10 | + * Do not edit the class manually. |
28A5
| 11 | + * |
| 12 | + */ |
| 13 | + |
| 14 | + |
| 15 | +import ApiClient from "../ApiClient"; |
| 16 | +import ArduinoLoradevicev1 from '../model/ArduinoLoradevicev1'; |
| 17 | +import CreateLoraDevicesV1Payload from '../model/CreateLoraDevicesV1Payload'; |
| 18 | + |
| 19 | +/** |
| 20 | +* LoraDevicesV1 service. |
| 21 | +* @module api/LoraDevicesV1Api |
| 22 | +* @version 1.4.0 |
| 23 | +*/ |
| 24 | +export default class LoraDevicesV1Api { |
| 25 | + |
| 26 | + /** |
| 27 | + * Constructs a new LoraDevicesV1Api. |
| 28 | + * @alias module:api/LoraDevicesV1Api |
| 29 | + * @class |
| 30 | + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, |
| 31 | + * default to {@link module:ApiClient#instance} if unspecified. |
| 32 | + */ |
| 33 | + constructor(apiClient) { |
| 34 | + this.apiClient = apiClient || ApiClient.instance; |
| 35 | + } |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + /** |
| 40 | + * create lora_devices_v1 |
| 41 | + * Create a new lora device. Its info are saved on our database, and on the lora provider network. Creates a device_v2 automatically |
| 42 | + * @param {module:model/CreateLoraDevicesV1Payload} createLoraDevicesV1Payload |
| 43 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ArduinoLoradevicev1} and HTTP response |
| 44 | + */ |
| 45 | + loraDevicesV1CreateWithHttpInfo(createLoraDevicesV1Payload) { |
| 46 | + let postBody = createLoraDevicesV1Payload; |
| 47 | + // verify the required parameter 'createLoraDevicesV1Payload' is set |
| 48 | + if (createLoraDevicesV1Payload === undefined || createLoraDevicesV1Payload === null) { |
| 49 | + throw new Error("Missing the required parameter 'createLoraDevicesV1Payload' when calling loraDevicesV1Create"); |
| 50 | + } |
| 51 | + |
| 52 | + let pathParams = { |
| 53 | + }; |
| 54 | + let queryParams = { |
| 55 | + }; |
| 56 | + let headerParams = { |
| 57 | + }; |
| 58 | + let formParams = { |
| 59 | + }; |
| 60 | + |
| 61 | + let authNames = []; |
| 62 | + let contentTypes = ['application/json', 'application/x-www-form-urlencoded']; |
| 63 | + let accepts = ['application/json']; |
| 64 | + let returnType = ArduinoLoradevicev1; |
| 65 | + return this.apiClient.callApi( |
| 66 | + '/v1/lora-devices/', 'PUT', |
| 67 | + pathParams, queryParams, headerParams, formParams, postBody, |
| 68 | + authNames, contentTypes, accepts, returnType, null |
| 69 | + ); |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * create lora_devices_v1 |
| 74 | + * Create a new lora device. Its info are saved on our database, and on the lora provider network. Creates a device_v2 automatically |
| 75 | + * @param {module:model/CreateLoraDevicesV1Payload} createLoraDevicesV1Payload |
| 76 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ArduinoLoradevicev1} |
| 77 | + */ |
| 78 | + loraDevicesV1Create(createLoraDevicesV1Payload) { |
| 79 | + return this.loraDevicesV1CreateWithHttpInfo(createLoraDevicesV1Payload) |
| 80 | + .then(function(response_and_data) { |
| 81 | + return response_and_data.data; |
| 82 | + }); |
| 83 | + } |
| 84 | + |
| 85 | + |
| 86 | +} |
0 commit comments