8000 Regenerate client from commit b1c0a60 of spec repo (#7) · arduino/iot-client-js@8c6a826 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8c6a826

Browse files
github-actions[bot]Massimiliano Pippi
authored and
Massimiliano Pippi
committed
Regenerate client from commit b1c0a60 of spec repo (#7)
1 parent 44c9b45 commit 8c6a826

15 files changed

+287
-81
lines changed

.apigentools-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"additional_stamps": [],
33
"apigentools_version": "0.3.0.dev1",
4-
"codegen_version": "4.1.1",
4+
"codegen_version": "4.1.2",
55
"info_version": "1",
66
"image": null,
7-
"spec_repo_commit": "92e0697"
7+
"spec_repo_commit": "b1c0a60"
88
}

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.1
1+
4.1.2

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55
For the time being and untile we publish a package on Npm, install it via:
66

77
```shell
8-
npm install bcmi-labs/clients-iot-api --save
8+
git clone git@github.com:bcmi-labs/iot-api-client-js.git
9+
cd iot-api-client-js
10+
npm install
11+
npm run build
12+
npm link
13+
```
14+
15+
Then, go to your project folder and
16+
17+
```shell
18+
npm link iot_api
919
```
1020

1121
### For browser
@@ -51,15 +61,12 @@ var client = IotApi.ApiClient.instance;
5161
var oauth2 = client.authentications['oauth2'];
5262
oauth2.accessToken = "YOUR ACCESS TOKEN";
5363

54-
var api = new IotApi.DevicesV2Api(client)
55-
var callback = function (error, data, response) {
56-
if (error) {
57-
console.error(response.error);
58-
} else {
59-
console.log(data);
60-
}
61-
};
62-
api.devicesV2List(null, callback);
64+
var api = new IotApi.DevicesV2Api(client);
65+
api.devicesV2List(null).then(devices => {
66+
console.log(devices);
67+
}, error => {
68+
console.error(error);
69+
});
6370
```
6471

6572
For a working example, see [the example folder](./example) in this repo.
@@ -92,4 +99,4 @@ try {
9299
catch (error) {
93100
console.error("Failed getting an access token: " + error)
94101
}
95-
```
102+
```

docs/ArduinoSeriesBatch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**respVersion** | **Number** | Response version |
78
**responses** | [**[ArduinoSeriesResponse]**](ArduinoSeriesResponse.md) | Responses of the request |
89

910

docs/ArduinoSeriesResponse.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**countValues** | **Number** | Total number of values in the array 'values' |
78
**fromDate** | **Date** | From date |
89
**interval** | **Number** | Resolution in seconds |
10+
**message** | **String** | If the response is different than 'ok' | [optional] [default to '']
911
**query** | **String** | Query of for the data |
1012
**respVersion** | **Number** | Response version |
11-
**series** | [**[BatchQueryResponseSeriesMediaV1]**](BatchQueryResponseSeriesMediaV1.md) | Series information |
13+
**seriesLimit** | **Number** | Max of values | [optional]
1214
**status** | **String** | Status of the response |
1315
**times** | **[Date]** | Timestamp in RFC3339 |
1416
**toDate** | **Date** | To date |
15-
**values** | **[[Number]]** | Values in Float |
17+
**values** | **[Number]** | Values in Float |
1618

1719

docs/PropertiesV1Api.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Method | HTTP request | Description
77
[**propertiesV1Create**](PropertiesV1Api.md#propertiesV1Create) | **PUT** /v1/things/{id}/properties | create properties_v1
88
[**propertiesV1Delete**](PropertiesV1Api.md#propertiesV1Delete) | **DELETE** /v1/things/{id}/properties/{pid} | delete properties_v1
99
[**propertiesV1List**](PropertiesV1Api.md#propertiesV1List) | **GET** /v1/things/{id}/properties | list properties_v1
10-
[**propertiesV1Publish**](PropertiesV1Api.md#propertiesV1Publish) | **PUT** /v1/things/{id}/properties/{pid}/publish | publish properties_v1
10+
[**propertiesV1Send**](PropertiesV1Api.md#propertiesV1Send) | **PUT** /v1/things/{id}/properties/{pid}/send | send properties_v1
1111
[**propertiesV1Show**](PropertiesV1Api.md#propertiesV1Show) | **GET** /v1/things/{id}/properties/{pid} | show properties_v1
1212
[**propertiesV1Update**](PropertiesV1Api.md#propertiesV1Update) | **POST** /v1/things/{id}/properties/{pid} | update properties_v1
1313

@@ -169,13 +169,13 @@ Name | Type | Description | Notes
169169
- **Accept**: application/vnd.arduino.property+json; type=collection, application/vnd.goa.error+json
170170

171171

172-
## propertiesV1Publish
172+
## propertiesV1Send
173173

174-
> propertiesV1Publish(id, pid, propertyValue)
174+
> propertiesV1Send(id, pid, propertyStringValue)
175175
176-
publish properties_v1
176+
send properties_v1
177177

178-
Publish a property value to MQTT
178+
Publish a property value to MQTT, as string
179179

180180
### Example
181181

@@ -189,8 +189,8 @@ oauth2.accessToken = 'YOUR ACCESS TOKEN';
189189
let apiInstance = new IotApi.PropertiesV1Api();
190190
let id = "id_example"; // String | The id of the thing
191191
let pid = "pid_example"; // String | The id of the property
192-
let propertyValue = new IotApi.PropertyValue(); // PropertyValue | PropertyValuePayload describes a property value
193-
apiInstance.propertiesV1Publish(id, pid, propertyValue).then(() => {
192+
let propertyStringValue = new IotApi.PropertyStringValue(); // PropertyStringValue | PropertyStringValuePayload describes a property value
193+
apiInstance.propertiesV1Send(id, pid, propertyStringValue).then(() => {
194194
console.log('API called successfully.');
195195
}, (error) => {
196196
console.error(error);
@@ -205,7 +205,7 @@ Name | Type | Description | Notes
205205
------------- | ------------- | ------------- | -------------
206206
**id** | **String**| The id of the thing |
207207
**pid** | **String**| The id of the property |
208-
**propertyValue** | [**PropertyValue**](PropertyValue.md)| PropertyValuePayload describes a property value |
208+
**propertyStringValue** | [**PropertyStringValue**](PropertyStringValue.md)| PropertyStringValuePayload describes a property value |
209209

210210
### Return type
211211

docs/PropertyStringValue.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IotApi.PropertyStringValue
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**deviceId** | **String** | The device who send the property | [optional]
8+
**value** | **String** | The property value, as string |
9+
10+

example/main.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ async function run() {
3030
var oauth2 = client.authentications['oauth2'];
3131
oauth2.accessToken = await getToken();
3232

33-
var api = new IotApi.DevicesV2Api(client)
34-
api.devicesV2List(null).then(devices => {
35-
console.log(devices);
36-
}, error => {
37-
console.error(error);
38-
});
33+
var api = new IotApi.DevicesV2Api(client)
34+
var callback = function (error, data, response) {
35+
if (error) {
36+
console.error(response.error);
37+
} else {
38+
console.log(data);
39+
}
40+
};
41+
api.devicesV2List(null, callback);
3942
}
4043

4144
run();

git_push.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="github.com"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="GIT_USER_ID"
@@ -28,25 +34,25 @@ git init
2834
# Adds the files in the local repository and stages them for commit.
2935
git add .
3036

31-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
37+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
3238
git commit -m "$release_note"
3339

3440
# Sets the new remote
3541
git_remote=`git remote`
3642
if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
39-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
45+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

src/api/PropertiesV1Api.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import ApiClient from "../ApiClient";
1616
import ArduinoProperty from '../model/ArduinoProperty';
1717
import Error from '../model/Error';
1818
import Property from '../model/Property';
19-
import PropertyValue from '../model/PropertyValue';
19+
import PropertyStringValue from '../model/PropertyStringValue';
2020

2121
/**
2222
* PropertiesV1 service.
@@ -208,26 +208,26 @@ export default class PropertiesV1Api {
208208

209209

210210
/**
211< 10000 code class="diff-text syntax-highlighted-line deletion">-
* publish properties_v1
212-
* Publish a property value to MQTT
211+
* send properties_v1
212+
* Publish a property value to MQTT, as string
213213
* @param {String} id The id of the thing
214214
* @param {String} pid The id of the property
215-
* @param {module:model/PropertyValue} propertyValue PropertyValuePayload describes a property value
215+
* @param {module:model/PropertyStringValue} propertyStringValue PropertyStringValuePayload describes a property value
216216
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
217217
*/
218-
propertiesV1PublishWithHttpInfo(id, pid, propertyValue) {
219-
let postBody = propertyValue;
218+
propertiesV1SendWithHttpInfo(id, pid, propertyStringValue) {
219+
let postBody = propertyStringValue;
220220
// verify the required parameter 'id' is set
221221
if (id === undefined || id === null) {
222-
throw new Error("Missing the required parameter 'id' when calling propertiesV1Publish");
222+
throw new Error("Missing the required parameter 'id' when calling propertiesV1Send");
223223
}
224224
// verify the required parameter 'pid' is set
225225
if (pid === undefined || pid === null) {
226-
throw new Error("Missing the required parameter 'pid' when calling propertiesV1Publish");
226+
throw new Error("Missing the required parameter 'pid' when calling propertiesV1Send");
227227
}
228-
// verify the required parameter 'propertyValue' is set
229-
if (propertyValue === undefined || propertyValue === null) {
230-
throw new Error("Missing the required parameter 'propertyValue' when calling propertiesV1Publish");
228+
// verify the required parameter 'propertyStringValue' is set
229+
if (propertyStringValue === undefined || propertyStringValue === null) {
230+
throw new Error("Missing the required parameter 'propertyStringValue' when calling propertiesV1Send");
231231
}
232232

233233
let pathParams = {
@@ -246,22 +246,22 @@ export default class PropertiesV1Api {
246246
let accepts = ['application/vnd.goa.error+json', 'text/plain'];
247247
let returnType = null;
248248
return this.apiClient.callApi(
249-
'/v1/things/{id}/properties/{pid}/publish', 'PUT',
249+
'/v1/things/{id}/properties/{pid}/send', 'PUT',
250250
pathParams, queryParams, headerParams, formParams, postBody,
251251
authNames, contentTypes, accepts, returnType, null
252252
);
253253
}
254254

255255
/**
256-
* publish properties_v1
257-
* Publish a property value to MQTT
256+
* send properties_v1
257+
* Publish a property value to MQTT, as string
258258
* @param {String} id The id of the thing
259259
* @param {String} pid The id of the property
260-
* @param {module:model/PropertyValue} propertyValue PropertyValuePayload describes a property value
260+
* @param {module:model/PropertyStringValue} propertyStringValue PropertyStringValuePayload describes a property value
261261
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
262262
*/
263-
propertiesV1Publish(id, pid, propertyValue) {
264-
return this.propertiesV1PublishWithHttpInfo(id, pid, propertyValue)
263+
propertiesV1Send(id, pid, propertyStringValue) {
264+
return this.propertiesV1SendWithHttpInfo(id, pid, propertyStringValue)
265265
.then(function(response_and_data) {
266266
return response_and_data.data;
267267
});

src/index.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ import BatchQueryRawRequestsMediaV1 from './model/BatchQueryRawRequestsMediaV1';
3333
import BatchQueryRawResponseSeriesMediaV1 from './model/BatchQueryRawResponseSeriesMediaV1';
3434
import BatchQueryRequestMediaV1 from './model/BatchQueryRequestMediaV1';
3535
import BatchQueryRequestsMediaV1 from './model/BatchQueryRequestsMediaV1';
36-
import BatchQueryResponseSeriesMediaV1 from './model/BatchQueryResponseSeriesMediaV1';
3736
import CreateDevicesV2Payload from './model/CreateDevicesV2Payload';
3837
import CreateThingsV1Payload from './model/CreateThingsV1Payload';
3938
import Devicev2 from './model/Devicev2';
4039
import Error from './model/Error';
4140
import PropertiesValue from './model/PropertiesValue';
4241
import PropertiesValues from './model/PropertiesValues';
4342
import Property from './model/Property';
44-
import PropertyValue from './model/PropertyValue';
43+
import PropertyStringValue from './model/PropertyStringValue';
4544
import Thing from './model/Thing';
4645
import ThingSketch from './model/ThingSketch';
4746
import DevicesV2Api from './api/DevicesV2Api';
@@ -208,12 +207,6 @@ export {
208207
*/
209208
BatchQueryRequestsMediaV1,
210209

211-
/**
212-
* The BatchQueryResponseSeriesMediaV1 model constructor.
213-
* @property {module:model/BatchQueryResponseSeriesMediaV1}
214-
*/
215-
BatchQueryResponseSeriesMediaV1,
216-
217210
/**
218211
* The CreateDevicesV2Payload model constructor.
219212
* @property {module:model/CreateDevicesV2Payload}
@@ -257,10 +250,10 @@ export {
257250
Property,
258251

259252
/**
260-
* The PropertyValue model constructor.
261-
* @property {module:model/PropertyValue}
253+
* The PropertyStringValue model constructor.
254+
* @property {module:model/PropertyStringValue}
262255
*/
263-
PropertyValue,
256+
PropertyStringValue,
264257

265258
/**
266259
* The Thing model constructor.

src/model/ArduinoSeriesBatch.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@ class ArduinoSeriesBatch {
2424
* Constructs a new <code>ArduinoSeriesBatch</code>.
2525
* ArduinoSeriesBatch media type (default view)
2626
* @alias module:model/ArduinoSeriesBatch
27+
* @param respVersion {Number} Response version
2728
* @param responses {Array.<module:model/ArduinoSeriesResponse>} Responses of the request
2829
*/
29-
constructor(responses) {
30+
constructor(respVersion, responses) {
3031

31-
ArduinoSeriesBatch.initialize(this, responses);
32+
ArduinoSeriesBatch.initialize(this, respVersion, responses);
3233
}
3334

3435
/**
3536
* Initializes the fields of this object.
3637
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
3738
* Only for internal use.
3839
*/
39-
static initialize(obj, responses) {
40+
static initialize(obj, respVersion, responses) {
41+
obj['resp_version'] = respVersion;
4042
obj['responses'] = responses;
4143
}
4244

@@ -51,6 +53,9 @@ class ArduinoSeriesBatch {
5153
if (data) {
5254
obj = obj || new ArduinoSeriesBatch();
5355

56+
if (data.hasOwnProperty('resp_version')) {
57+
obj['resp_version'] = ApiClient.convertToType(data['resp_version'], 'Number');
58+
}
5459
if (data.hasOwnProperty('responses')) {
5560
obj['responses'] = ApiClient.convertToType(data['responses'], [ArduinoSeriesResponse]);
5661
}
@@ -61,6 +66,12 @@ class ArduinoSeriesBatch {
6166

6267
}
6368

69+
/**
70+
* Response version
71+
* @member {Number} resp_version
72+
*/
73+
ArduinoSeriesBatch.prototype['resp_version'] = undefined;
74+
6475
/**
6576
* Responses of the request
6677
* @member {Array.<module:model/ArduinoSeriesResponse>} responses

0 commit comments

Comments
 (0)
0