Skip to content

Commit 3e7ae84

Browse files
author
Paolo Calao
authored
Update swagger 16 Nov 2021 (#74)
* Update swagger * Bump client version to 1.4.0
1 parent 1e2d832 commit 3e7ae84

File tree

5 files changed

+246
-25
lines changed

5 files changed

+246
-25
lines changed

config/languages/go_v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"gitRepoId": "iot-client-go",
44
"isGoSubmodule": false,
55
"packageName": "iot",
6-
"packageVersion": "1.3.9",
6+
"packageVersion": "1.4.0",
77
"withGoCodegenComment": true
88
}

config/languages/html2_v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"packageName": "iot",
3-
"packageVersion": "1.3.9",
3+
"packageVersion": "1.4.0",
44
"usePromises": true
55
}

config/languages/javascript_v2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"projectName": "@arduino/arduino-iot-client",
33
"moduleName": "ArduinoIotClient",
4-
"projectVersion": "1.3.9",
5-
"packageVersion": "1.3.9",
4+
"projectVersion": "1.4.0",
5+
"packageVersion": "1.4.0",
66
"usePromises": true,
77
"licenseName":"GPLv3",
88
"generateSourceCodeOnly": true

config/languages/python_v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packageName": "arduino_iot_rest",
33
"projectName": "arduino-iot-client",
4-
"packageVersion": "1.3.9",
4+
"packageVersion": "1.4.0",
55
"generateSourceCodeOnly": true
66
}

spec/v2/swagger.yaml

Lines changed: 241 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ components:
438438
thing_name:
439439
description: The name of the related thing
440440
type: string
441+
thing_timezone:
442+
$ref: '#/components/schemas/ArduinoTimezone'
441443
type:
442444
description: The type of the variable
443445
type: string
@@ -460,6 +462,58 @@ components:
460462
$ref: '#/components/schemas/ArduinoLinkedvariable'
461463
title: 'Mediatype identifier: application/vnd.arduino.linkedvariable+json; type=collection; view=default'
462464
type: array
465+
ArduinoLoradevicev1:
466+
description: ArduinoLoradevicev1 media type (default view)
467+
properties:
468+
app_eui:
469+
description: The eui of the app
470+
type: string
471+
app_key:
472+
description: The key of the device
473+
type: string
474+
device_id:
475+
description: The id of the device
476+
format: uuid
477+
type: string
478+
eui:
479+
description: The eui of the lora device
480+
example: "71619230301"
481+
type: string
482+
required:
483+
- eui
484+
- device_id
485+
- app_eui
486+
- app_key
487+
title: 'Mediatype identifier: application/vnd.arduino.loradevicev1+json; view=default'
488+
type: object
489+
ArduinoLorafreqplansv1:
490+
description: ArduinoLorafreqplansv1 media type (default view)
491+
properties:
492+
frequency_plans:
493+
description: The list of frequency plans
494+
items:
495+
$ref: '#/components/schemas/ArduinoLorafreqplanv1'
496+
type: array
497+
title: 'Mediatype identifier: application/vnd.arduino.lorafreqplansv1+json; view=default'
498+
type: object
499+
ArduinoLorafreqplanv1:
500+
description: ArduinoLorafreqplanv1 media type (default view)
501+
properties:
502+
advanced:
503+
description: Frequency plan only for advanced users
504+
type: boolean
505+
id:
506+
description: The ID of the frequency paln
507+
type: string
508+
name:
509+
description: The name of the frequency plan
510+
type: string
511+
required:
512+
- name
513+
- id
514+
- advanced
515+
title: 'Mediatype identifier: application/vnd.arduino.lorafreqplanv1+json; view=default'
516+
type: object
463517
ArduinoProperty:
464518
description: ArduinoProperty media type (default view)
465519
properties:
@@ -807,6 +861,9 @@ components:
807861
additionalProperties: true
808862
description: Tags of the thing
809863
type: object
864+
timezone:
865+
description: Time zone of the thing
866+
type: string
810867
updated_at:
811868
description: Update date of the thing
812869
format: date-time
@@ -826,6 +883,7 @@ components:
826883
- user_id
827884
- name
828885
- href
886+
- timezone
829887
title: 'Mediatype identifier: application/vnd.arduino.thing+json; view=default'
830888
type: object
831889
ArduinoThingCollection:
@@ -845,6 +903,21 @@ components:
845903
- data
846904
title: 'Mediatype identifier: application/vnd.arduino.timeseriesmedia+json; view=default'
847905
type: object
906+
ArduinoTimezone:
907+
description: ArduinoTimezone media type (default view)
908+
properties:
909+
name:
910+
description: Name of the time zone.
911+
type: string
912+
offset:
913+
description: Current UTC DST offset in seconds.
914+
format: int64
915+
type: integer
916+
required:
917+
- name
918+
- offset
919+
title: 'Mediatype identifier: application/vnd.arduino.timezone+json; view=default'
920+
type: object
848921
ArduinoVariableslinks:
849922
description: ArduinoVariableslinks media type (default view)
850923
properties:
@@ -1129,6 +1202,63 @@ components:
11291202
- type
11301203
title: CreateDevicesV2Payload
11311204
type: object
1205+
CreateLoraDevicesV1Payload:
1206+
properties:
1207+
app:
1208+
description: The app name
1209+
type: string
1210+
app_eui:
1211+
description: The app eui of the lora device
1212+
pattern: '[0-9a-z]{16}'
1213+
type: string
1214+
app_key:
1215+
description: The app key of the lora device
1216+
pattern: '[0-9a-z]{16}'
1217+
type: string
1218+
eui:
1219+
description: The eui of the lora device
1220+
pattern: '[0-9a-z]{16}'
1221+
type: string
1222+
frequency_plan:
1223+
description: 'The frequency plan required by your country '
1224+
enum:
1225+
- EU_863_870_TTN
1226+
- US_902_928_FSB_2
1227+
- EU_433
1228+
- AU_915_928_FSB_2
1229+
- CN_470_510_FSB_11
1230+
- AS_920_923
1231+
- AS_920_923_TTN_AU
1232+
- AS_923_925
1233+
- AS_923_925_TTN_AU
1234+
- KR_920_923_TTN
1235+
- IN_865_867
1236+
type: string
1237+
name:
1238+
description: A common name for the device
1239+
type: string
1240+
serial:
1241+
description: The optional serial number
1242+
type: string
1243+
type:
1244+
description: The type of device
1245+
enum:
1246+
- lora-device
1247+
- mkrwan1300
1248+
- mkrwan1310
1249+
type: string
1250+
user_id:
1251+
description: The id of the user. Can be the special string 'me'
1252+
type: string
1253+
required:
1254+
- name
1255+
- eui
1256+
- frequency_plan
1257+
- user_id
1258+
- app
1259+
- type
1260+
title: CreateLoraDevicesV1Payload
1261+
type: object
11321262
HistoricDataRequest:
11331263
properties:
11341264
from:
@@ -1152,6 +1282,41 @@ components:
11521282
- to
11531283
title: HistoricDataRequest
11541284
type: object
1285+
ThingCreate:
1286+
description: Payload to create a new thing
1287+
properties:
1288+
device_id:
1289+
description: The arn of the associated device
1290+
format: uuid
1291+
type: string
1292+
id:
1293+
description: The id of the thing
1294+
format: uuid
1295+
type: string
1296+
name:
1297+
description: The friendly name of the thing
1298+
maxLength: 64
1299+
pattern: ^[a-zA-Z0-9_.@ -]+$
1300+
type: string
1301+
properties:
1302+
description: The properties of the thing
1303+
items:
1304+
$ref: '#/components/schemas/property'
1305+
type: array
1306+
timezone:
1307+
default: America/New_York
1308+
description: |-
1309+
A time zone name
1310+
Check /v2/timezones for a list of valid names.
1311+
type: string
1312+
webhook_active:
1313+
description: Webhook uri
1314+
type: boolean
1315+
webhook_uri:
1316+
description: Webhook uri
1317+
type: string
1318+
title: ThingCreate
1319+
type: object
11551320
TimeseriesDataPoint:
11561321
properties:
11571322
time:
@@ -1477,6 +1642,7 @@ components:
14771642
- LOGARITHMIC_QUANTITY
14781643
- PRESSURE
14791644
- INFORMATION_CONTENT
1645+
- SCHEDULE
14801646
type: string
14811647
update_parameter:
14821648
description: The update frequency in seconds, or the amount of the property has to change in order to trigger an update
@@ -1537,8 +1703,19 @@ components:
15371703
- value
15381704
title: tag
15391705
type: object
1540-
thing:
1541-
description: ThingPayload describes a thing
1706+
thingSketch:
1707+
description: ThingSketchPayload describes a sketch of a thing
1708+
properties:
1709+
sketch_version:
1710+
description: The autogenerated sketch version
1711+
enum:
1712+
- v1
1713+
- v2
1714+
type: string
1715+
title: thingSketch
1716+
type: object
1717+
thingUpdate:
1718+
description: Payload to update an existing thing
15421719
properties:
15431720
device_id:
15441721
description: The arn of the associated device
@@ -1558,24 +1735,18 @@ components:
15581735
items:
15591736
$ref: '#/components/schemas/property'
15601737
type: array
1738+
timezone:
1739+
description: |-
1740+
A time zone name.
1741+
Check /v2/timezones for a list of valid names.
1742+
type: string
15611743
webhook_active:
15621744
description: Webhook uri
15631745
type: boolean
15641746
webhook_uri:
15651747
description: Webhook uri
15661748
type: string
1567-
title: thing
1568-
type: object
1569-
thingSketch:
1570-
description: ThingSketchPayload describes a sketch of a thing
1571-
properties:
1572-
sketch_version:
1573-
description: The autogenerated sketch version
1574-
enum:
1575-
- v1
1576-
- v2
1577-
type: string
1578-
title: thingSketch
1749+
title: thingUpdate
15791750
type: object
15801751
updateSketch:
15811752
properties:
@@ -1674,6 +1845,56 @@ info:
16741845
version: "2.0"
16751846
openapi: 3.0.3
16761847
paths:
1848+
/v1/lora-devices/:
1849+
put:
1850+
description: Create a new lora device. Its info are saved on our database, and on the lora provider network. Creates a device_v2 automatically
1851+
operationId: lora_devices_v1#create
1852+
requestBody:
1853+
content:
1854+
application/json:
1855+
schema:
1856+
$ref: '#/components/schemas/CreateLoraDevicesV1Payload'
1857+
application/x-www-form-urlencoded:
1858+
schema:
1859+
$ref: '#/components/schemas/CreateLoraDevicesV1Payload'
1860+
required: true
1861+
x-originalParamName: payload
1862+
responses:
1863+
"201":
1864+
content:
1865+
application/json:
1866+
schema:
1867+
$ref: '#/components/schemas/ArduinoLoradevicev1'
1868+
description: Created
1869+
summary: create lora_devices_v1
1870+
tags:
1871+
- lora_devices_v1
1872+
/v1/lora-freq-plans/:
1873+
get:
1874+
description: List the lora frequency plans supported
1875+
operationId: lora_freq_plan_v1#list
1876+
responses:
1877+
"200":
1878+
content:
1879+
application/json:
1880+
schema:
1881+
$ref: '#/components/schemas/ArduinoLorafreqplansv1'
1882+
description: OK
1883+
"401":
1884+
content:
1885+
application/json:
1886+
schema:
1887+
$ref: '#/components/schemas/error'
1888+
description: Unauthorized
1889+
"500":
1890+
content:
1891+
application/json:
1892+
schema:
1893+
$ref: '#/components/schemas/error'
1894+
description: Internal Server Error
1895+
summary: list lora_freq_plan_v1
1896+
tags:
1897+
- lora_freq_plan_v1
16771898
/v2/dashboards:
16781899
get:
16791900
description: Returns the list of dashboards
@@ -3407,11 +3628,11 @@ paths:
34073628
content:
34083629
application/json:
34093630
schema:
3410-
$ref: '#/components/schemas/thing'
3631+
$ref: '#/components/schemas/ThingCreate'
34113632
application/x-www-form-urlencoded:
34123633
schema:
3413-
$ref: '#/components/schemas/thing'
3414-
description: ThingPayload describes a thing
3634+
$ref: '#/components/schemas/ThingCreate'
3635+
description: Payload to create a new thing
34153636
required: true
34163637
x-originalParamName: payload
34173638
responses:
@@ -3555,11 +3776,11 @@ paths:
35553776
content:
35563777
application/json:
35573778
schema:
3558-
$ref: '#/components/schemas/thing'
3779+
$ref: '#/components/schemas/thingUpdate'
35593780
application/x-www-form-urlencoded:
35603781
schema:
3561-
$ref: '#/components/schemas/thing'
3562-
description: ThingPayload describes a thing
3782+
$ref: '#/components/schemas/thingUpdate'
3783+
description: Payload to update an existing thing
35633784
required: true
35643785
x-originalParamName: payload
35653786
responses:

0 commit comments

Comments
 (0)