|
| 1 | +# Go API client for iot |
| 2 | + |
| 3 | +Collection of all public API endpoints. |
| 4 | + |
| 5 | +## Overview |
| 6 | +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. |
| 7 | + |
| 8 | +- API version: 2.0 |
| 9 | +- Package version: 0.0.1 |
| 10 | +- Build package: org.openapitools.codegen.languages.GoClientCodegen |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +Install the following dependencies: |
| 15 | + |
| 16 | +```shell |
| 17 | +go get github.com/stretchr/testify/assert |
| 18 | +go get golang.org/x/oauth2 |
| 19 | +go get golang.org/x/net/context |
| 20 | +go get github.com/antihax/optional |
| 21 | +``` |
| 22 | + |
| 23 | +Put the package under your project folder and add the following in import: |
| 24 | + |
| 25 | +```golang |
| 26 | +import "./iot" |
| 27 | +``` |
| 28 | + |
| 29 | +## Documentation for API Endpoints |
| 30 | + |
| 31 | +All URIs are relative to *http://api-dev.arduino.cc* |
| 32 | + |
| 33 | +Class | Method | HTTP request | Description |
| 34 | +------------ | ------------- | ------------- | ------------- |
| 35 | +*DevicesV2Api* | [**DevicesV2Create**](docs/DevicesV2Api.md#devicesv2create) | **Put** /v2/devices | create devices_v2 |
| 36 | +*DevicesV2Api* | [**DevicesV2Delete**](docs/DevicesV2Api.md#devicesv2delete) | **Delete** /v2/devices/{id} | delete devices_v2 |
| 37 | +*DevicesV2Api* | [**DevicesV2GetProperties**](docs/DevicesV2Api.md#devicesv2getproperties) | **Get** /v2/devices/{id}/properties | getProperties devices_v2 |
| 38 | +*DevicesV2Api* | [**DevicesV2List**](docs/DevicesV2Api.md#devicesv2list) | **Get** /v2/devices | list devices_v2 |
| 39 | +*DevicesV2Api* | [**DevicesV2Show**](docs/DevicesV2Api.md#devicesv2show) | **Get** /v2/devices/{id} | show devices_v2 |
| 40 | +*DevicesV2Api* | [**DevicesV2Timeseries**](docs/DevicesV2Api.md#devicesv2timeseries) | **Get** /v2/devices/{id}/properties/{pid} | timeseries devices_v2 |
| 41 | +*DevicesV2Api* | [**DevicesV2Update**](docs/DevicesV2Api.md#devicesv2update) | **Post** /v2/devices/{id} | update devices_v2 |
| 42 | +*DevicesV2Api* | [**DevicesV2UpdateProperties**](docs/DevicesV2Api.md#devicesv2updateproperties) | **Put** /v2/devices/{id}/properties | updateProperties devices_v2 |
| 43 | +*PropertiesV1Api* | [**PropertiesV1Create**](docs/PropertiesV1Api.md#propertiesv1create) | **Put** /v1/things/{id}/properties | create properties_v1 |
| 44 | +*PropertiesV1Api* | [**PropertiesV1Delete**](docs/PropertiesV1Api.md#propertiesv1delete) | **Delete** /v1/things/{id}/properties/{pid} | delete properties_v1 |
| 45 | +*PropertiesV1Api* | [**PropertiesV1List**](docs/PropertiesV1Api.md#propertiesv1list) | **Get** /v1/things/{id}/properties | list properties_v1 |
| 46 | +*PropertiesV1Api* | [**PropertiesV1Publish**](docs/PropertiesV1Api.md#propertiesv1publish) | **Put** /v1/things/{id}/properties/{pid}/publish | publish properties_v1 |
| 47 | +*PropertiesV1Api* | [**PropertiesV1Show**](docs/PropertiesV1Api.md#propertiesv1show) | **Get** /v1/things/{id}/properties/{pid} | show properties_v1 |
| 48 | +*PropertiesV1Api* | [**PropertiesV1Update**](docs/PropertiesV1Api.md#propertiesv1update) | **Post** /v1/things/{id}/properties/{pid} | update properties_v1 |
| 49 | +*SeriesV1Api* | [**SeriesV1BatchQuery**](docs/SeriesV1Api.md#seriesv1batchquery) | **Post** /v1/series/batch_query | batch_query series_v1 |
| 50 | +*SeriesV1Api* | [**SeriesV1BatchQueryRaw**](docs/SeriesV1Api.md#seriesv1batchqueryraw) | **Post** /v1/series/batch_query_raw | batch_query_raw series_v1 |
| 51 | +*ThingsV1Api* | [**ThingsV1Create**](docs/ThingsV1Api.md#thingsv1create) | **Put** /v1/things | create things_v1 |
| 52 | +*ThingsV1Api* | [**ThingsV1CreateSketch**](docs/ThingsV1Api.md#thingsv1createsketch) | **Put** /v1/things/{id}/sketch | createSketch things_v1 |
| 53 | +*ThingsV1Api* | [**ThingsV1Delete**](docs/ThingsV1Api.md#thingsv1delete) | **Delete** /v1/things/{id} | delete things_v1 |
| 54 | +*ThingsV1Api* | [**ThingsV1DeleteSketch**](docs/ThingsV1Api.md#thingsv1deletesketch) | **Delete** /v1/things/{id}/sketch | deleteSketch things_v1 |
| 55 | +*ThingsV1Api* | [**ThingsV1Layout**](docs/ThingsV1Api.md#thingsv1layout) | **Get** /v1/things/{id}/layout | layout things_v1 |
| 56 | +*ThingsV1Api* | [**ThingsV1List**](docs/ThingsV1Api.md#thingsv1list) | **Get** /v1/things | list things_v1 |
| 57 | +*ThingsV1Api* | [**ThingsV1Show**](docs/ThingsV1Api.md#thingsv1show) | **Get** /v1/things/{id} | show things_v1 |
| 58 | +*ThingsV1Api* | [**ThingsV1Update**](docs/ThingsV1Api.md#thingsv1update) | **Post** /v1/things/{id} | update things_v1 |
| 59 | +*ThingsV1Api* | [**ThingsV1UpdateSketch**](docs/ThingsV1Api.md#thingsv1updatesketch) | **Put** /v1/things/{id}/sketch/{sketchId} | updateSketch things_v1 |
| 60 | + |
| 61 | + |
| 62 | +## Documentation For Models |
| 63 | + |
| 64 | + - [ArduinoDevicev2](docs/ArduinoDevicev2.md) |
| 65 | + - [ArduinoDevicev2Webhook](docs/ArduinoDevicev2Webhook.md) |
| 66 | + - [ArduinoDevicev2properties](docs/ArduinoDevicev2properties.md) |
| 67 | + - [ArduinoDevicev2propertyvalue](docs/ArduinoDevicev2propertyvalue.md) |
| 68 | + - [ArduinoDevicev2propertyvalueValue](docs/ArduinoDevicev2propertyvalueValue.md) |
| 69 | + - [ArduinoDevicev2propertyvalueValueStatistics](docs/ArduinoDevicev2propertyvalueValueStatistics.md) |
| 70 | + - [ArduinoDevicev2propertyvalues](docs/ArduinoDevicev2propertyvalues.md) |
| 71 | + - [ArduinoDevicev2propertyvaluesLastEvaluatedKey](docs/ArduinoDevicev2propertyvaluesLastEvaluatedKey.md) |
| 72 | + - [ArduinoProperty](docs/ArduinoProperty.md) |
| 73 | + - [ArduinoSeriesBatch](docs/ArduinoSeriesBatch.md) |
| 74 | + - [ArduinoSeriesRawBatch](docs/ArduinoSeriesRawBatch.md) |
| 75 | + - [ArduinoSeriesRawResponse](docs/ArduinoSeriesRawResponse.md) |
| 76 | + - [ArduinoSeriesResponse](docs/ArduinoSeriesResponse.md) |
| 77 | + - [ArduinoThing](docs/ArduinoThing.md) |
| 78 | + - [ArduinoThinglayout](docs/ArduinoThinglayout.md) |
| 79 | + - [BatchQueryRawRequestMediaV1](docs/BatchQueryRawRequestMediaV1.md) |
| 80 | + - [BatchQueryRawRequestsMediaV1](docs/BatchQueryRawRequestsMediaV1.md) |
| 81 | + - [BatchQueryRawResponseSeriesMediaV1](docs/BatchQueryRawResponseSeriesMediaV1.md) |
| 82 | + - [BatchQueryRequestMediaV1](docs/BatchQueryRequestMediaV1.md) |
| 83 | + - [BatchQueryRequestsMediaV1](docs/BatchQueryRequestsMediaV1.md) |
| 84 | + - [BatchQueryResponseSeriesMediaV1](docs/BatchQueryResponseSeriesMediaV1.md) |
| 85 | + - [CreateDevicesV2Payload](docs/CreateDevicesV2Payload.md) |
| 86 | + - [CreateThingsV1Payload](docs/CreateThingsV1Payload.md) |
| 87 | + - [Devicev2](docs/Devicev2.md) |
| 88 | + - [ModelError](docs/ModelError.md) |
| 89 | + - [PropertiesValue](docs/PropertiesValue.md) |
| 90 | + - [PropertiesValues](docs/PropertiesValues.md) |
| 91 | + - [Property](docs/Property.md) |
| 92 | + - [PropertyValue](docs/PropertyValue.md) |
| 93 | + - [Thing](docs/Thing.md) |
| 94 | + - [ThingSketch](docs/ThingSketch.md) |
| 95 | + |
| 96 | + |
| 97 | +## Documentation For Authorization |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +## oauth2 |
| 102 | + |
| 103 | + |
| 104 | +- **Type**: OAuth |
| 105 | +- **Flow**: application |
| 106 | +- **Authorization URL**: |
| 107 | +- **Scopes**: |
| 108 | + - **iot:devices**: Read and write my devices |
| 109 | + - **iot:things**: Read and write my things |
| 110 | + |
| 111 | +Example |
| 112 | + |
| 113 | +```golang |
| 114 | +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") |
| 115 | +r, err := client.Service.Operation(auth, args) |
| 116 | +``` |
| 117 | + |
| 118 | +Or via OAuth2 module to automatically refresh tokens and perform user authentication. |
| 119 | + |
| 120 | +```golang |
| 121 | +import "golang.org/x/oauth2" |
| 122 | + |
| 123 | +/* Perform OAuth2 round trip request and obtain a token */ |
| 124 | + |
| 125 | +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) |
| 126 | +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) |
| 127 | +r, err := client.Service.Operation(auth, args) |
| 128 | +``` |
| 129 | + |
| 130 | + |
| 131 | +## Author |
| 132 | + |
| 133 | + |
| 134 | + |
0 commit comments