From 66c35761d5658f303ecca85e3042a90f13ef3181 Mon Sep 17 00:00:00 2001 From: ArduinoBot Date: Wed, 31 Jan 2024 14:27:00 +0000 Subject: [PATCH] Regenerate client from commit 138c42b of spec repo --- .apigentools-info | 4 +- .openapi-generator/FILES | 20 + api/openapi.yaml | 895 +++++++++++++++++++++- api_dashboards_v2.go | 310 ++++++++ api_devices_v2.go | 175 +++++ api_properties_v2.go | 80 ++ api_series_v2.go | 4 +- api_things_v2.go | 267 +++++++ docs/ArduinoDashboardv2template.md | 77 ++ docs/ArduinoDevicev2.md | 26 + docs/ArduinoDevicev2StatusEvent.md | 72 ++ docs/ArduinoDevicev2StatusEvents.md | 72 ++ docs/ArduinoProperty.md | 8 +- docs/ArduinoSeriesResponse.md | 28 +- docs/ArduinoTemplateproperty.md | 166 ++++ docs/ArduinoTemplatevariable.md | 161 ++++ docs/ArduinoThingtemplate.md | 176 +++++ docs/ArduinoTimezone.md | 9 +- docs/ArduinoWidgetv2template.md | 312 ++++++++ docs/BatchQueryRawRequestMediaV1.md | 2 +- docs/BatchQueryRequestMediaV1.md | 32 +- docs/Clone.md | 56 ++ docs/DashboardsV2Api.md | 148 ++++ docs/DevicesV2Api.md | 77 ++ docs/Override.md | 72 ++ docs/PropertiesV2Api.md | 44 +- docs/Property.md | 8 +- docs/ThingClone.md | 77 ++ docs/ThingCreate.md | 26 + docs/ThingsV2Api.md | 148 ++++ model_arduino_dashboardv2template.go | 155 ++++ model_arduino_devicev2.go | 37 + model_arduino_devicev2_status_event.go | 147 ++++ model_arduino_devicev2_status_events.go | 146 ++++ model_arduino_property.go | 12 +- model_arduino_series_response.go | 39 +- model_arduino_templateproperty.go | 276 +++++++ model_arduino_templatevariable.go | 266 +++++++ model_arduino_thingtemplate.go | 294 +++++++ model_arduino_timezone.go | 35 +- model_arduino_widgetv2.go | 2 +- model_arduino_widgetv2template.go | 480 ++++++++++++ model_batch_query_raw_request_media_v1.go | 2 +- model_batch_query_request_media_v1.go | 43 +- model_clone.go | 127 +++ model_override.go | 146 ++++ model_property.go | 12 +- model_thing_clone.go | 155 ++++ model_thing_create.go | 37 + 49 files changed, 5843 insertions(+), 120 deletions(-) create mode 100644 docs/ArduinoDashboardv2template.md create mode 100644 docs/ArduinoDevicev2StatusEvent.md create mode 100644 docs/ArduinoDevicev2StatusEvents.md create mode 100644 docs/ArduinoTemplateproperty.md create mode 100644 docs/ArduinoTemplatevariable.md create mode 100644 docs/ArduinoThingtemplate.md create mode 100644 docs/ArduinoWidgetv2template.md create mode 100644 docs/Clone.md create mode 100644 docs/Override.md create mode 100644 docs/ThingClone.md create mode 100644 model_arduino_dashboardv2template.go create mode 100644 model_arduino_devicev2_status_event.go create mode 100644 model_arduino_devicev2_status_events.go create mode 100644 model_arduino_templateproperty.go create mode 100644 model_arduino_templatevariable.go create mode 100644 model_arduino_thingtemplate.go create mode 100644 model_arduino_widgetv2template.go create mode 100644 model_clone.go create mode 100644 model_override.go create mode 100644 model_thing_clone.go diff --git a/.apigentools-info b/.apigentools-info index d9027e5..0ae968c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,8 +4,8 @@ "spec_versions": { "v2": { "apigentools_version": "1.1.0", - "regenerated": "2023-09-22 12:38:22.852111", - "spec_repo_commit": "4c87660" + "regenerated": "2024-01-31 14:21:03.657126", + "spec_repo_commit": "138c42b" } } } \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index e5cf78a..22d4393 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -20,11 +20,14 @@ docs/ArduinoCompressedv2.md docs/ArduinoDashboardowner.md docs/ArduinoDashboardshare.md docs/ArduinoDashboardv2.md +docs/ArduinoDashboardv2template.md docs/ArduinoDevicev2.md docs/ArduinoDevicev2Cert.md docs/ArduinoDevicev2EventProperties.md docs/ArduinoDevicev2Pass.md docs/ArduinoDevicev2SimpleProperties.md +docs/ArduinoDevicev2StatusEvent.md +docs/ArduinoDevicev2StatusEvents.md docs/ArduinoDevicev2Webhook.md docs/ArduinoDevicev2properties.md docs/ArduinoDevicev2propertyvalue.md @@ -44,11 +47,15 @@ docs/ArduinoSeriesRawLastValueResponse.md docs/ArduinoSeriesRawResponse.md docs/ArduinoSeriesResponse.md docs/ArduinoTags.md +docs/ArduinoTemplateproperty.md +docs/ArduinoTemplatevariable.md docs/ArduinoThing.md +docs/ArduinoThingtemplate.md docs/ArduinoTimeseriesmedia.md docs/ArduinoTimezone.md docs/ArduinoVariableslinks.md docs/ArduinoWidgetv2.md +docs/ArduinoWidgetv2template.md docs/BatchLastValueRequestsMediaV1.md docs/BatchQueryRawLastValueRequestMediaV1.md docs/BatchQueryRawRequestMediaV1.md @@ -57,6 +64,7 @@ docs/BatchQueryRawResponseSeriesMediaV1.md docs/BatchQueryRequestMediaV1.md docs/BatchQueryRequestsMediaV1.md docs/CheckDevicesV2PassPayload.md +docs/Clone.md docs/CreateDevicesV2CertsPayload.md docs/CreateDevicesV2Payload.md docs/CreateLoraDevicesV1Payload.md @@ -76,6 +84,7 @@ docs/HistoricDataRequest.md docs/LoraDevicesV1Api.md docs/LoraFreqPlanV1Api.md docs/ModelError.md +docs/Override.md docs/PropertiesV2Api.md docs/PropertiesValue.md docs/PropertiesValues.md @@ -84,6 +93,7 @@ docs/PropertyValue.md docs/SeriesV2Api.md docs/Sharerequest.md docs/Tag.md +docs/ThingClone.md docs/ThingCreate.md docs/ThingSketch.md docs/ThingUpdate.md @@ -100,11 +110,14 @@ model_arduino_compressedv2.go model_arduino_dashboardowner.go model_arduino_dashboardshare.go model_arduino_dashboardv2.go +model_arduino_dashboardv2template.go model_arduino_devicev2.go model_arduino_devicev2_cert.go model_arduino_devicev2_event_properties.go model_arduino_devicev2_pass.go model_arduino_devicev2_simple_properties.go +model_arduino_devicev2_status_event.go +model_arduino_devicev2_status_events.go model_arduino_devicev2_webhook.go model_arduino_devicev2properties.go model_arduino_devicev2propertyvalue.go @@ -124,11 +137,15 @@ model_arduino_series_raw_last_value_response.go model_arduino_series_raw_response.go model_arduino_series_response.go model_arduino_tags.go +model_arduino_templateproperty.go +model_arduino_templatevariable.go model_arduino_thing.go +model_arduino_thingtemplate.go model_arduino_timeseriesmedia.go model_arduino_timezone.go model_arduino_variableslinks.go model_arduino_widgetv2.go +model_arduino_widgetv2template.go model_batch_last_value_requests_media_v1.go model_batch_query_raw_last_value_request_media_v1.go model_batch_query_raw_request_media_v1.go @@ -137,6 +154,7 @@ model_batch_query_raw_response_series_media_v1.go model_batch_query_request_media_v1.go model_batch_query_requests_media_v1.go model_check_devices_v2_pass_payload.go +model_clone.go model_create_devices_v2_certs_payload.go model_create_devices_v2_payload.go model_create_lora_devices_v1_payload.go @@ -148,12 +166,14 @@ model_devicev2_otabinaryurl.go model_devicev2_pass.go model_error.go model_historic_data_request.go +model_override.go model_properties_value.go model_properties_values.go model_property.go model_property_value.go model_sharerequest.go model_tag.go +model_thing_clone.go model_thing_create.go model_thing_sketch.go model_thing_update.go diff --git a/api/openapi.yaml b/api/openapi.yaml index 742fa84..c7a5cb6 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -304,6 +304,15 @@ paths: schema: $ref: '#/components/schemas/error' description: Unauthorized + "403": + content: + application/vnd.arduino.dashboardv2+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Forbidden "404": description: Not Found "500": @@ -394,6 +403,80 @@ paths: summary: update dashboards_v2 tags: - dashboards_v2 + /v2/dashboards/{id}/clone: + put: + description: Clone an existing dashboard + operationId: dashboards_v2#clone + parameters: + - description: The id of the dashboard + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + - explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/clone' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/clone' + required: true + x-originalParamName: payload + responses: + "201": + content: + application/vnd.arduino.dashboardv2+json: + schema: + $ref: '#/components/schemas/ArduinoDashboardv2' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/ArduinoDashboardv2' + description: Created + "400": + content: + application/vnd.arduino.dashboardv2+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Bad Request + "401": + content: + application/vnd.arduino.dashboardv2+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Unauthorized + "404": + description: Not Found + "500": + content: + application/vnd.arduino.dashboardv2+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Internal Server Error + security: + - oauth2: [] + summary: clone dashboards_v2 + tags: + - dashboards_v2 /v2/dashboards/{id}/share_request: put: description: Request access to a dashboard @@ -656,6 +739,70 @@ paths: summary: deleteShare dashboards_v2 tags: - dashboards_v2 + /v2/dashboards/{id}/template: + get: + description: Get a template of the dashboard + operationId: dashboards_v2#template + parameters: + - description: The id of the dashboard + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + - explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/vnd.arduino.dashboardv2template+json: + schema: + $ref: '#/components/schemas/ArduinoDashboardv2template' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/ArduinoDashboardv2template' + description: OK + "400": + content: + application/vnd.arduino.dashboardv2template+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Bad Request + "401": + content: + application/vnd.arduino.dashboardv2template+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Unauthorized + "404": + description: Not Found + "500": + content: + application/vnd.arduino.dashboardv2template+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Internal Server Error + security: + - oauth2: [] + summary: template dashboards_v2 + tags: + - dashboards_v2 /v2/dashboards/{id}/widgets/{widgetId}/variables: put: description: Link or detach widget variables @@ -1942,6 +2089,94 @@ paths: summary: timeseries devices_v2 tags: - devices_v2 + /v2/devices/{id}/status: + get: + description: GET connection status events + operationId: devices_v2#GetStatusEvents + parameters: + - description: The id of the device + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + - description: The number of events to select + explode: true + in: query + name: limit + required: false + schema: + default: 30 + type: integer + style: form + - description: The time at which to start selecting events + explode: true + in: query + name: start + required: false + schema: + type: string + style: form + - explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/vnd.arduino.devicev2.status.events+json: + schema: + $ref: '#/components/schemas/ArduinoDevicev2StatusEvents' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/ArduinoDevicev2StatusEvents' + description: OK + "400": + content: + application/vnd.arduino.devicev2.status.events+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Bad Request + "401": + content: + application/vnd.arduino.devicev2.status.events+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Unauthorized + "500": + content: + application/vnd.arduino.devicev2.status.events+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Internal Server Error + "503": + content: + application/vnd.arduino.devicev2.status.events+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Service Unavailable + security: + - oauth2: [] + summary: GetStatusEvents devices_v2 + tags: + - devices_v2 /v2/devices/{id}/tags: get: description: List tags associated to the device. @@ -2105,7 +2340,7 @@ paths: - devices_v2_tags /v2/series/batch_query: post: - description: Returns the batch of time-series data + description: Returns the batch of time-series aggregated samples operationId: series_v2#batch_query requestBody: content: @@ -2165,7 +2400,7 @@ paths: - series_v2 /v2/series/batch_query_raw: post: - description: Returns the batch of time-series data raw + description: Returns the batch of time-series raw samples operationId: series_v2#batch_query_raw requestBody: content: @@ -2720,10 +2955,10 @@ paths: summary: update things_v2 tags: - things_v2 - /v2/things/{id}/properties: - get: - description: Returns the list of properties associated to the thing - operationId: properties_v2#list + /v2/things/{id}/clone: + put: + description: Clone a given thing + operationId: things_v2#clone parameters: - description: The id of the thing explode: false @@ -2733,46 +2968,50 @@ paths: schema: type: string style: simple - - description: "If true, shows the soft deleted properties" - explode: true - in: query - name: show_deleted + - explode: false + in: header + name: X-Organization required: false schema: - default: false - type: boolean - style: form + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ThingClone' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/ThingClone' + description: Payload to clone a new thing from an existing one + required: true + x-originalParamName: payload responses: - "200": + "201": content: - application/vnd.arduino.property+json; type=collection: + application/vnd.arduino.thing+json: schema: - $ref: '#/components/schemas/ArduinoPropertyCollection' + $ref: '#/components/schemas/ArduinoThing' application/vnd.goa.error+json: schema: - $ref: '#/components/schemas/ArduinoPropertyCollection' + $ref: '#/components/schemas/ArduinoThing' description: OK - "401": + "400": content: - application/vnd.arduino.property+json; type=collection: + application/vnd.arduino.thing+json: schema: $ref: '#/components/schemas/error' application/vnd.goa.error+json: schema: $ref: '#/components/schemas/error' + description: Bad Request + "401": description: Unauthorized "404": - content: - application/vnd.arduino.property+json; type=collection: - schema: - $ref: '#/components/schemas/error' - application/vnd.goa.error+json: - schema: - $ref: '#/components/schemas/error' description: Not Found "500": content: - application/vnd.arduino.property+json; type=collection: + application/vnd.arduino.thing+json: schema: $ref: '#/components/schemas/error' application/vnd.goa.error+json: @@ -2781,9 +3020,81 @@ paths: description: Internal Server Error security: - oauth2: [] - summary: list properties_v2 + summary: clone things_v2 tags: - - properties_v2 + - things_v2 + /v2/things/{id}/properties: + get: + description: Returns the list of properties associated to the thing + operationId: properties_v2#list + parameters: + - description: The id of the thing + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + - description: "If true, shows the soft deleted properties" + explode: true + in: query + name: show_deleted + required: false + schema: + default: false + type: boolean + style: form + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/vnd.arduino.property+json; type=collection: + schema: + $ref: '#/components/schemas/ArduinoPropertyCollection' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/ArduinoPropertyCollection' + description: OK + "401": + content: + application/vnd.arduino.property+json; type=collection: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Unauthorized + "404": + content: + application/vnd.arduino.property+json; type=collection: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Not Found + "500": + content: + application/vnd.arduino.property+json; type=collection: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Internal Server Error + security: + - oauth2: [] + summary: list properties_v2 + tags: + - properties_v2 put: description: Creates a new property associated to a thing operationId: properties_v2#create @@ -2796,6 +3107,14 @@ paths: schema: type: string style: simple + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple requestBody: content: application/json: @@ -2891,6 +3210,14 @@ paths: schema: type: string style: simple + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple responses: "200": description: OK @@ -2948,6 +3275,14 @@ paths: default: false type: boolean style: form + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple responses: "200": content: @@ -3010,6 +3345,14 @@ paths: schema: type: string style: simple + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple requestBody: content: application/json: @@ -3094,6 +3437,14 @@ paths: schema: type: string style: simple + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple requestBody: content: application/json: @@ -3149,6 +3500,27 @@ paths: \ 1000 otherwise the result will be truncated)" operationId: properties_v2#timeseries parameters: + - description: Samples aggregation statistic. Supported aggregations AVG|MAX|MIN|COUNT|SUM|PCT_99|PCT_95|PCT_90|PCT_75|PCT_50|PCT_15|PCT_5 + explode: true + in: query + name: aggregation + required: false + schema: + enum: + - AVG + - MIN + - MAX + - SUM + - COUNT + - PCT_99 + - PCT_95 + - PCT_90 + - PCT_75 + - PCT_50 + - PCT_15 + - PCT_5 + type: string + style: form - description: Whether data's ordering (by time) should be descending explode: true in: query @@ -3202,6 +3574,14 @@ paths: schema: type: string style: form + - description: The id of the organization + explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple responses: "200": content: @@ -3612,6 +3992,54 @@ paths: summary: delete things_v2_tags tags: - things_v2_tags + /v2/things/{id}/template: + get: + description: Extract template from the given thing + operationId: things_v2#template + parameters: + - description: The id of the thing + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + - explode: false + in: header + name: X-Organization + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/vnd.arduino.thingtemplate+json: + schema: + $ref: '#/components/schemas/ArduinoThingtemplate' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/ArduinoThingtemplate' + description: OK + "401": + description: Unauthorized + "404": + description: Not Found + "500": + content: + application/vnd.arduino.thingtemplate+json: + schema: + $ref: '#/components/schemas/error' + application/vnd.goa.error+json: + schema: + $ref: '#/components/schemas/error' + description: Internal Server Error + security: + - oauth2: [] + summary: template things_v2 + tags: + - things_v2 components: callbacks: {} examples: {} @@ -3757,6 +4185,25 @@ components: title: "Mediatype identifier: application/vnd.arduino.dashboardv2+json; type=collection;\ \ view=default" type: array + ArduinoDashboardv2template: + description: ArduinoDashboardv2template media type (default view) + properties: + name: + description: The friendly name of the dashboard + type: string + widgets: + description: ArduinoWidgetv2templateCollection is the media type for an + array of ArduinoWidgetv2template (default view) + items: + $ref: '#/components/schemas/ArduinoWidgetv2template' + title: "Mediatype identifier: application/vnd.arduino.widgetv2template+json;\ + \ type=collection; view=default" + type: array + required: + - name + title: "Mediatype identifier: application/vnd.arduino.dashboardv2template+json;\ + \ view=default" + type: object ArduinoDevicev2: description: ArduinoDevicev2 media type (default view) properties: @@ -3775,6 +4222,13 @@ components: description: Creation date of the device format: date-time type: string + device_status: + description: The connection status of the device + enum: + - ONLINE + - OFFLINE + - UNKNOWN + type: string events: description: ArduinoDevicev2SimplePropertiesCollection is the media type for an array of ArduinoDevicev2SimpleProperties (default view) @@ -3991,6 +4445,54 @@ components: title: "Mediatype identifier: application/vnd.arduino.devicev2.simple.properties+json;\ \ type=collection; view=default" type: array + ArduinoDevicev2StatusEvent: + description: ArduinoDevicev2StatusEvent media type (default view) + properties: + updated_at: + description: Update timestamp of the status event + format: date-time + type: string + value: + description: The status event of the device + enum: + - CONNECTED + - DISCONNECTED + type: string + required: + - updated_at + - value + title: "Mediatype identifier: application/vnd.arduino.devicev2.status.event+json;\ + \ view=default" + type: object + ArduinoDevicev2StatusEventCollection: + description: ArduinoDevicev2StatusEventCollection is the media type for an array + of ArduinoDevicev2StatusEvent (default view) + items: + $ref: '#/components/schemas/ArduinoDevicev2StatusEvent' + title: "Mediatype identifier: application/vnd.arduino.devicev2.status.event+json;\ + \ type=collection; view=default" + type: array + ArduinoDevicev2StatusEvents: + description: ArduinoDevicev2StatusEvents media type (default view) + properties: + events: + description: ArduinoDevicev2StatusEventCollection is the media type for + an array of ArduinoDevicev2StatusEvent (default view) + items: + $ref: '#/components/schemas/ArduinoDevicev2StatusEvent' + title: "Mediatype identifier: application/vnd.arduino.devicev2.status.event+json;\ + \ type=collection; view=default" + type: array + id: + description: The id of the device + format: uuid + type: string + required: + - events + - id + title: "Mediatype identifier: application/vnd.arduino.devicev2.status.events+json;\ + \ view=default" + type: object ArduinoDevicev2Webhook: description: DeviceWebhookV2 describes a webhook associated to the device (default view) @@ -4248,8 +4750,8 @@ components: type: string tag: description: The integer id of the property - format: double - type: number + format: int64 + type: integer thing_id: description: The id of the thing format: uuid @@ -4451,6 +4953,28 @@ components: ArduinoSeriesResponse: description: ArduinoSeriesResponse media type (default view) properties: + aggregation: + description: |- + Aggregation statistic function. + For numeric values, AVG statistic is used by default. PCT_X compute the Xth approximate percentile (e.g. PCT_95 is the 95th approximate percentile). + For boolean, BOOL_OR statistic is used as default. + enum: + - AVG + - MIN + - MAX + - SUM + - COUNT + - PCT_99 + - PCT_95 + - PCT_90 + - PCT_75 + - PCT_50 + - PCT_15 + - PCT_5 + - BOOL_OR + - BOOL_AND + example: AVG + type: string count_values: description: Total number of values in the array 'values' format: int64 @@ -4475,7 +4999,8 @@ components: format: int64 type: integer series_limit: - description: Max of values + description: "Maximum number of values returned after data aggregation,\ + \ if any" format: int64 type: integer status: @@ -4521,6 +5046,82 @@ components: - tags title: "Mediatype identifier: application/vnd.arduino.tags+json; view=default" type: object + ArduinoTemplateproperty: + description: ArduinoTemplateproperty media type (default view) + properties: + name: + description: The friendly name of the property + type: string + permission: + description: The permission of the property + type: string + type: + description: The type of the property + type: string + update_parameter: + description: "The update frequency in seconds, or the amount of the property\ + \ has to change in order to trigger an update" + format: double + type: number + update_strategy: + description: The update strategy for the property value + type: string + variable_name: + description: The sketch variable name of the property + type: string + required: + - name + - permission + - type + - update_strategy + title: "Mediatype identifier: application/vnd.arduino.templateproperty+json;\ + \ view=default" + type: object + ArduinoTemplatepropertyCollection: + description: ArduinoTemplatepropertyCollection is the media type for an array + of ArduinoTemplateproperty (default view) + items: + $ref: '#/components/schemas/ArduinoTemplateproperty' + title: "Mediatype identifier: application/vnd.arduino.templateproperty+json;\ + \ type=collection; view=default" + type: array + ArduinoTemplatevariable: + description: ArduinoTemplatevariable media type (default view) + properties: + name: + description: The name of the variable + type: string + permission: + description: The permission of the linked variable + type: string + thing_id: + description: The name of the related thing + type: string + thing_timezone: + $ref: '#/components/schemas/ArduinoTimezone' + type: + description: The type of the variable + type: string + variable_id: + description: The name of the variable in the code + type: string + required: + - name + - permission + - thing_id + - type + - variable_id + title: "Mediatype identifier: application/vnd.arduino.templatevariable+json;\ + \ view=default" + type: object + ArduinoTemplatevariableCollection: + description: ArduinoTemplatevariableCollection is the media type for an array + of ArduinoTemplatevariable (default view) + items: + $ref: '#/components/schemas/ArduinoTemplatevariable' + title: "Mediatype identifier: application/vnd.arduino.templatevariable+json;\ + \ type=collection; view=default" + type: array ArduinoThing: description: ArduinoThing media type (default view) properties: @@ -4612,6 +5213,40 @@ components: title: "Mediatype identifier: application/vnd.arduino.thing+json; type=collection;\ \ view=default" type: array + ArduinoThingtemplate: + description: ArduinoThingtemplate media type (default view) + properties: + name: + description: The friendly name of the thing + type: string + organization_id: + description: Id of the organization the thing belongs to + format: uuid + type: string + properties: + description: ArduinoTemplatepropertyCollection is the media type for an + array of ArduinoTemplateproperty (default view) + items: + $ref: '#/components/schemas/ArduinoTemplateproperty' + title: "Mediatype identifier: application/vnd.arduino.templateproperty+json;\ + \ type=collection; view=default" + type: array + tags: + description: Tags of the thing + items: + $ref: '#/components/schemas/tag' + type: array + timezone: + description: Time zone of the thing + type: string + webhook_uri: + description: Webhook uri + type: string + required: + - name + - timezone + title: "Mediatype identifier: application/vnd.arduino.thingtemplate+json; view=default" + type: object ArduinoTimeseriesmedia: description: ArduinoTimeseriesmedia media type (default view) properties: @@ -4641,6 +5276,7 @@ components: required: - name - offset + - until title: "Mediatype identifier: application/vnd.arduino.timezone+json; view=default" type: object ArduinoVariableslinks: @@ -4657,7 +5293,7 @@ components: title: "Mediatype identifier: application/vnd.arduino.variableslinks+json; view=default" type: object ArduinoWidgetv2: - description: Widget describes a dashboard widget (default view) + description: ArduinoWidgetv2 media type (default view) properties: has_permission_incompatibility: description: True if the linked variables permissions are incompatible with @@ -4744,6 +5380,77 @@ components: title: "Mediatype identifier: application/vnd.arduino.widgetv2+json; type=collection;\ \ view=default" type: array + ArduinoWidgetv2template: + description: ArduinoWidgetv2template media type (default view) + properties: + height: + description: Widget current height for desktop + format: int64 + type: integer + height_mobile: + description: Widget current height for mobile + format: int64 + type: integer + name: + description: The name of the widget + type: string + options: + additionalProperties: true + description: Widget options + type: object + type: + description: The type of the widget + type: string + variables: + description: ArduinoTemplatevariableCollection is the media type for an + array of ArduinoTemplatevariable (default view) + items: + $ref: '#/components/schemas/ArduinoTemplatevariable' + title: "Mediatype identifier: application/vnd.arduino.templatevariable+json;\ + \ type=collection; view=default" + type: array + width: + description: Widget current width for desktop + format: int64 + type: integer + width_mobile: + description: Widget current width for mobile + format: int64 + type: integer + x: + description: Widget x position for desktop + format: int64 + type: integer + x_mobile: + description: Widget x position for mobile + format: int64 + type: integer + "y": + description: Widget y position for desktop + format: int64 + type: integer + y_mobile: + description: Widget y position for mobile + format: int64 + type: integer + required: + - height + - options + - type + - width + - x + - "y" + title: "Mediatype identifier: application/vnd.arduino.widgetv2template+json;\ + \ view=default" + type: object + ArduinoWidgetv2templateCollection: + description: ArduinoWidgetv2templateCollection is the media type for an array + of ArduinoWidgetv2template (default view) + items: + $ref: '#/components/schemas/ArduinoWidgetv2template' + title: "Mediatype identifier: application/vnd.arduino.widgetv2template+json;\ + \ type=collection; view=default" + type: array BatchLastValueRequestsMediaV1: example: requests: @@ -4792,7 +5499,7 @@ components: format: date-time type: string q: - description: Query + description: Data selection query (e.g. property.2a99729d-2556-4220-a139-023348a1e6b5) type: string series_limit: description: Max of values @@ -4855,23 +5562,47 @@ components: example: q: q series_limit: 6 + aggregation: AVG from: 2000-01-23T04:56:07.000+00:00 interval: 0 to: 2000-01-23T04:56:07.000+00:00 properties: + aggregation: + description: |- + Aggregation statistic function. + For numeric values, AVG statistic is used by default. PCT_X compute the Xth approximate percentile (e.g. PCT_95 is the 95th approximate percentile). + For boolean, BOOL_OR statistic is used as default. + enum: + - AVG + - MIN + - MAX + - SUM + - COUNT + - PCT_99 + - PCT_95 + - PCT_90 + - PCT_75 + - PCT_50 + - PCT_15 + - PCT_5 + - BOOL_OR + - BOOL_AND + example: AVG + type: string from: description: From timestamp format: date-time type: string interval: - description: Resolution in seconds + description: "Resolution in seconds (max allowed: 86400)" format: int64 type: integer q: - description: Query + description: Data selection query (e.g. property.2a99729d-2556-4220-a139-023348a1e6b5) type: string series_limit: - description: Max of values + description: "Maximum number of values returned after data aggregation,\ + \ if any (default: 300, limit: 1000)" format: int64 type: integer to: @@ -4890,11 +5621,13 @@ components: requests: - q: q series_limit: 6 + aggregation: AVG from: 2000-01-23T04:56:07.000+00:00 interval: 0 to: 2000-01-23T04:56:07.000+00:00 - q: q series_limit: 6 + aggregation: AVG from: 2000-01-23T04:56:07.000+00:00 interval: 0 to: 2000-01-23T04:56:07.000+00:00 @@ -5133,6 +5866,24 @@ components: - to title: HistoricDataRequest type: object + ThingClone: + description: Payload to clone a new thing from an existing one + example: + name: name + include_tags: true + properties: + include_tags: + description: Include tags in clone procedure + type: boolean + name: + description: The friendly name of the thing + maxLength: 64 + pattern: "^[a-zA-Z0-9_.@ -]+$" + type: string + required: + - name + title: ThingClone + type: object ThingCreate: description: Payload to create a new thing example: @@ -5149,7 +5900,7 @@ components: update_parameter: 5.962133916683182 permission: READ_ONLY persist: true - tag: 1.4658129805029452 + tag: 1 variable_name: variable_name type: ANALOG max_value: 0.8008281904610115 @@ -5159,10 +5910,15 @@ components: update_parameter: 5.962133916683182 permission: READ_ONLY persist: true - tag: 1.4658129805029452 + tag: 1 variable_name: variable_name type: ANALOG max_value: 0.8008281904610115 + tags: + - value: value + key: key + - value: value + key: key properties: device_id: description: The arn of the associated device @@ -5182,6 +5938,11 @@ components: items: $ref: '#/components/schemas/property' type: array + tags: + description: Optional set of tags + items: + $ref: '#/components/schemas/tag' + type: array timezone: default: America/New_York description: |- @@ -5211,6 +5972,17 @@ components: - value title: TimeseriesDataPoint type: object + clone: + properties: + overrides: + description: "The overrides to apply to the cloned dashboard. An override\ + \ is a tuple of ids: the id of the thing to override and the id of the\ + \ new thing to link" + items: + $ref: '#/components/schemas/override' + type: array + title: clone + type: object dashboardshare: properties: user_id: @@ -5383,6 +6155,21 @@ components: type: integer title: "Mediatype identifier: application/vnd.goa.error+json; view=default" type: object + override: + properties: + new_thing_id: + description: The id of the new thing to link + format: uuid + type: string + old_thing_id: + description: The id of the thing to override + format: uuid + type: string + required: + - new_thing_id + - old_thing_id + title: override + type: object propertiesValue: properties: name: @@ -5428,7 +6215,7 @@ components: update_parameter: 5.962133916683182 permission: READ_ONLY persist: true - tag: 1.4658129805029452 + tag: 1 variable_name: variable_name type: ANALOG max_value: 0.8008281904610115 @@ -5456,8 +6243,8 @@ components: type: boolean tag: description: The integer id of the property - format: double - type: number + format: int64 + type: integer type: description: The type of the property enum: @@ -5545,6 +6332,27 @@ components: - HOME_TEMPERATURE_F - HOME_SWITCH - HOME_TELEVISION + - GOOGLE_HOME_COLORED_LIGHT + - GOOGLE_HOME_DIMMED_LIGHT + - GOOGLE_HOME_LIGHT + - GOOGLE_HOME_CONTACT_SENSOR + - GOOGLE_HOME_MOTION_SENSOR + - GOOGLE_HOME_SMART_PLUG + - GOOGLE_HOME_TEMPERATURE + - GOOGLE_HOME_TEMPERATURE_C + - GOOGLE_HOME_TEMPERATURE_F + - GOOGLE_HOME_SWITCH + - SMART_HOME_COLORED_LIGHT + - SMART_HOME_DIMMED_LIGHT + - SMART_HOME_LIGHT + - SMART_HOME_CONTACT_SENSOR + - SMART_HOME_MOTION_SENSOR + - SMART_HOME_SMART_PLUG + - SMART_HOME_TEMPERATURE + - SMART_HOME_TEMPERATURE_C + - SMART_HOME_TEMPERATURE_F + - SMART_HOME_SWITCH + - SMART_HOME_TELEVISION - ENERGY - FORCE - TEMPERATURE @@ -5617,6 +6425,9 @@ components: title: sharerequest type: object tag: + example: + value: value + key: key properties: key: description: Key of the tag diff --git a/api_dashboards_v2.go b/api_dashboards_v2.go index d41198b..400afbe 100644 --- a/api_dashboards_v2.go +++ b/api_dashboards_v2.go @@ -23,6 +23,161 @@ import ( // DashboardsV2ApiService DashboardsV2Api service type DashboardsV2ApiService service +type ApiDashboardsV2CloneRequest struct { + ctx context.Context + ApiService *DashboardsV2ApiService + id string + clone *Clone + xOrganization *string +} + +func (r ApiDashboardsV2CloneRequest) Clone(clone Clone) ApiDashboardsV2CloneRequest { + r.clone = &clone + return r +} + +func (r ApiDashboardsV2CloneRequest) XOrganization(xOrganization string) ApiDashboardsV2CloneRequest { + r.xOrganization = &xOrganization + return r +} + +func (r ApiDashboardsV2CloneRequest) Execute() (*ArduinoDashboardv2, *http.Response, error) { + return r.ApiService.DashboardsV2CloneExecute(r) +} + +/* +DashboardsV2Clone clone dashboards_v2 + +Clone an existing dashboard + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The id of the dashboard + @return ApiDashboardsV2CloneRequest +*/ +func (a *DashboardsV2ApiService) DashboardsV2Clone(ctx context.Context, id string) ApiDashboardsV2CloneRequest { + return ApiDashboardsV2CloneRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return ArduinoDashboardv2 +func (a *DashboardsV2ApiService) DashboardsV2CloneExecute(r ApiDashboardsV2CloneRequest) (*ArduinoDashboardv2, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ArduinoDashboardv2 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardsV2ApiService.DashboardsV2Clone") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/dashboards/{id}/clone" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clone == nil { + return localVarReturnValue, nil, reportError("clone is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.arduino.dashboardv2+json", "application/vnd.goa.error+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } + // body params + localVarPostBody = r.clone + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiDashboardsV2CreateRequest struct { ctx context.Context ApiService *DashboardsV2ApiService @@ -1293,6 +1448,161 @@ func (a *DashboardsV2ApiService) DashboardsV2ShowExecute(r ApiDashboardsV2ShowRe newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDashboardsV2TemplateRequest struct { + ctx context.Context + ApiService *DashboardsV2ApiService + id string + xOrganization *string +} + +func (r ApiDashboardsV2TemplateRequest) XOrganization(xOrganization string) ApiDashboardsV2TemplateRequest { + r.xOrganization = &xOrganization + return r +} + +func (r ApiDashboardsV2TemplateRequest) Execute() (*ArduinoDashboardv2template, *http.Response, error) { + return r.ApiService.DashboardsV2TemplateExecute(r) +} + +/* +DashboardsV2Template template dashboards_v2 + +Get a template of the dashboard + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The id of the dashboard + @return ApiDashboardsV2TemplateRequest +*/ +func (a *DashboardsV2ApiService) DashboardsV2Template(ctx context.Context, id string) ApiDashboardsV2TemplateRequest { + return ApiDashboardsV2TemplateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return ArduinoDashboardv2template +func (a *DashboardsV2ApiService) DashboardsV2TemplateExecute(r ApiDashboardsV2TemplateRequest) (*ArduinoDashboardv2template, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ArduinoDashboardv2template + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardsV2ApiService.DashboardsV2Template") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/dashboards/{id}/template" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.arduino.dashboardv2template+json", "application/vnd.goa.error+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v ModelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) diff --git a/api_devices_v2.go b/api_devices_v2.go index de07a55..f6c011b 100644 --- a/api_devices_v2.go +++ b/api_devices_v2.go @@ -605,6 +605,181 @@ func (a *DevicesV2ApiService) DevicesV2GetPropertiesExecute(r ApiDevicesV2GetPro return localVarReturnValue, localVarHTTPResponse, nil } +type ApiDevicesV2GetStatusEventsRequest struct { + ctx context.Context + ApiService *DevicesV2ApiService + id string + limit *int32 + start *string + xOrganization *string +} + +// The number of events to select +func (r ApiDevicesV2GetStatusEventsRequest) Limit(limit int32) ApiDevicesV2GetStatusEventsRequest { + r.limit = &limit + return r +} + +// The time at which to start selecting events +func (r ApiDevicesV2GetStatusEventsRequest) Start(start string) ApiDevicesV2GetStatusEventsRequest { + r.start = &start + return r +} + +func (r ApiDevicesV2GetStatusEventsRequest) XOrganization(xOrganization string) ApiDevicesV2GetStatusEventsRequest { + r.xOrganization = &xOrganization + return r +} + +func (r ApiDevicesV2GetStatusEventsRequest) Execute() (*ArduinoDevicev2StatusEvents, *http.Response, error) { + return r.ApiService.DevicesV2GetStatusEventsExecute(r) +} + +/* +DevicesV2GetStatusEvents GetStatusEvents devices_v2 + +GET connection status events + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The id of the device + @return ApiDevicesV2GetStatusEventsRequest +*/ +func (a *DevicesV2ApiService) DevicesV2GetStatusEvents(ctx context.Context, id string) ApiDevicesV2GetStatusEventsRequest { + return ApiDevicesV2GetStatusEventsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return ArduinoDevicev2StatusEvents +func (a *DevicesV2ApiService) DevicesV2GetStatusEventsExecute(r ApiDevicesV2GetStatusEventsRequest) (*ArduinoDevicev2StatusEvents, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ArduinoDevicev2StatusEvents + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesV2ApiService.DevicesV2GetStatusEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/devices/{id}/status" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.start != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start", r.start, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.arduino.devicev2.status.events+json", "application/vnd.goa.error+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiDevicesV2ListRequest struct { ctx context.Context ApiService *DevicesV2ApiService diff --git a/api_properties_v2.go b/api_properties_v2.go index dae0f78..15dcd5b 100644 --- a/api_properties_v2.go +++ b/api_properties_v2.go @@ -28,6 +28,7 @@ type ApiPropertiesV2CreateRequest struct { ApiService *PropertiesV2ApiService id string property *Property + xOrganization *string } // PropertyPayload describes a property of a thing. No field is mandatory @@ -36,6 +37,12 @@ func (r ApiPropertiesV2CreateRequest) Property(property Property) ApiPropertiesV return r } +// The id of the organization +func (r ApiPropertiesV2CreateRequest) XOrganization(xOrganization string) ApiPropertiesV2CreateRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2CreateRequest) Execute() (*ArduinoProperty, *http.Response, error) { return r.ApiService.PropertiesV2CreateExecute(r) } @@ -99,6 +106,9 @@ func (a *PropertiesV2ApiService) PropertiesV2CreateExecute(r ApiPropertiesV2Crea if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } // body params localVarPostBody = r.property req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) @@ -187,6 +197,7 @@ type ApiPropertiesV2DeleteRequest struct { id string pid string force *bool + xOrganization *string } // If true, hard delete the property @@ -195,6 +206,12 @@ func (r ApiPropertiesV2DeleteRequest) Force(force bool) ApiPropertiesV2DeleteReq return r } +// The id of the organization +func (r ApiPropertiesV2DeleteRequest) XOrganization(xOrganization string) ApiPropertiesV2DeleteRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2DeleteRequest) Execute() (*http.Response, error) { return r.ApiService.PropertiesV2DeleteExecute(r) } @@ -259,6 +276,9 @@ func (a *PropertiesV2ApiService) PropertiesV2DeleteExecute(r ApiPropertiesV2Dele if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -313,6 +333,7 @@ type ApiPropertiesV2ListRequest struct { ApiService *PropertiesV2ApiService id string showDeleted *bool + xOrganization *string } // If true, shows the soft deleted properties @@ -321,6 +342,12 @@ func (r ApiPropertiesV2ListRequest) ShowDeleted(showDeleted bool) ApiPropertiesV return r } +// The id of the organization +func (r ApiPropertiesV2ListRequest) XOrganization(xOrganization string) ApiPropertiesV2ListRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2ListRequest) Execute() ([]ArduinoProperty, *http.Response, error) { return r.ApiService.PropertiesV2ListExecute(r) } @@ -384,6 +411,9 @@ func (a *PropertiesV2ApiService) PropertiesV2ListExecute(r ApiPropertiesV2ListRe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -459,6 +489,7 @@ type ApiPropertiesV2PublishRequest struct { id string pid string propertyValue *PropertyValue + xOrganization *string } // PropertyValuePayload describes a property value @@ -467,6 +498,12 @@ func (r ApiPropertiesV2PublishRequest) PropertyValue(propertyValue PropertyValue return r } +// The id of the organization +func (r ApiPropertiesV2PublishRequest) XOrganization(xOrganization string) ApiPropertiesV2PublishRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2PublishRequest) Execute() (*http.Response, error) { return r.ApiService.PropertiesV2PublishExecute(r) } @@ -531,6 +568,9 @@ func (a *PropertiesV2ApiService) PropertiesV2PublishExecute(r ApiPropertiesV2Pub if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } // body params localVarPostBody = r.propertyValue req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) @@ -599,6 +639,7 @@ type ApiPropertiesV2ShowRequest struct { id string pid string showDeleted *bool + xOrganization *string } // If true, shows the soft deleted properties @@ -607,6 +648,12 @@ func (r ApiPropertiesV2ShowRequest) ShowDeleted(showDeleted bool) ApiPropertiesV return r } +// The id of the organization +func (r ApiPropertiesV2ShowRequest) XOrganization(xOrganization string) ApiPropertiesV2ShowRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2ShowRequest) Execute() (*ArduinoProperty, *http.Response, error) { return r.ApiService.PropertiesV2ShowExecute(r) } @@ -673,6 +720,9 @@ func (a *PropertiesV2ApiService) PropertiesV2ShowExecute(r ApiPropertiesV2ShowRe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -747,10 +797,18 @@ type ApiPropertiesV2TimeseriesRequest struct { ApiService *PropertiesV2ApiService id string pid string + aggregation *string desc *bool from *string interval *int32 to *string + xOrganization *string +} + +// Samples aggregation statistic. Supported aggregations AVG|MAX|MIN|COUNT|SUM|PCT_99|PCT_95|PCT_90|PCT_75|PCT_50|PCT_15|PCT_5 +func (r ApiPropertiesV2TimeseriesRequest) Aggregation(aggregation string) ApiPropertiesV2TimeseriesRequest { + r.aggregation = &aggregation + return r } // Whether data's ordering (by time) should be descending @@ -777,6 +835,12 @@ func (r ApiPropertiesV2TimeseriesRequest) To(to string) ApiPropertiesV2Timeserie return r } +// The id of the organization +func (r ApiPropertiesV2TimeseriesRequest) XOrganization(xOrganization string) ApiPropertiesV2TimeseriesRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2TimeseriesRequest) Execute() (*ArduinoTimeseriesmedia, *http.Response, error) { return r.ApiService.PropertiesV2TimeseriesExecute(r) } @@ -823,6 +887,9 @@ func (a *PropertiesV2ApiService) PropertiesV2TimeseriesExecute(r ApiPropertiesV2 localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.aggregation != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "aggregation", r.aggregation, "") + } if r.desc != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "") } @@ -852,6 +919,9 @@ func (a *PropertiesV2ApiService) PropertiesV2TimeseriesExecute(r ApiPropertiesV2 if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -916,6 +986,7 @@ type ApiPropertiesV2UpdateRequest struct { id string pid string property *Property + xOrganization *string } // PropertyPayload describes a property of a thing. No field is mandatory @@ -924,6 +995,12 @@ func (r ApiPropertiesV2UpdateRequest) Property(property Property) ApiPropertiesV return r } +// The id of the organization +func (r ApiPropertiesV2UpdateRequest) XOrganization(xOrganization string) ApiPropertiesV2UpdateRequest { + r.xOrganization = &xOrganization + return r +} + func (r ApiPropertiesV2UpdateRequest) Execute() (*ArduinoProperty, *http.Response, error) { return r.ApiService.PropertiesV2UpdateExecute(r) } @@ -990,6 +1067,9 @@ func (a *PropertiesV2ApiService) PropertiesV2UpdateExecute(r ApiPropertiesV2Upda if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } // body params localVarPostBody = r.property req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) diff --git a/api_series_v2.go b/api_series_v2.go index d098e41..09c37ea 100644 --- a/api_series_v2.go +++ b/api_series_v2.go @@ -40,7 +40,7 @@ func (r ApiSeriesV2BatchQueryRequest) Execute() (*ArduinoSeriesBatch, *http.Resp /* SeriesV2BatchQuery batch_query series_v2 -Returns the batch of time-series data +Returns the batch of time-series aggregated samples @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiSeriesV2BatchQueryRequest @@ -182,7 +182,7 @@ func (r ApiSeriesV2BatchQueryRawRequest) Execute() (*ArduinoSeriesRawBatch, *htt /* SeriesV2BatchQueryRaw batch_query_raw series_v2 -Returns the batch of time-series data raw +Returns the batch of time-series raw samples @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiSeriesV2BatchQueryRawRequest diff --git a/api_things_v2.go b/api_things_v2.go index 152e654..eaa90ee 100644 --- a/api_things_v2.go +++ b/api_things_v2.go @@ -24,6 +24,151 @@ import ( // ThingsV2ApiService ThingsV2Api service type ThingsV2ApiService service +type ApiThingsV2CloneRequest struct { + ctx context.Context + ApiService *ThingsV2ApiService + id string + thingClone *ThingClone + xOrganization *string +} + +// Payload to clone a new thing from an existing one +func (r ApiThingsV2CloneRequest) ThingClone(thingClone ThingClone) ApiThingsV2CloneRequest { + r.thingClone = &thingClone + return r +} + +func (r ApiThingsV2CloneRequest) XOrganization(xOrganization string) ApiThingsV2CloneRequest { + r.xOrganization = &xOrganization + return r +} + +func (r ApiThingsV2CloneRequest) Execute() (*ArduinoThing, *http.Response, error) { + return r.ApiService.ThingsV2CloneExecute(r) +} + +/* +ThingsV2Clone clone things_v2 + +Clone a given thing + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The id of the thing + @return ApiThingsV2CloneRequest +*/ +func (a *ThingsV2ApiService) ThingsV2Clone(ctx context.Context, id string) ApiThingsV2CloneRequest { + return ApiThingsV2CloneRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return ArduinoThing +func (a *ThingsV2ApiService) ThingsV2CloneExecute(r ApiThingsV2CloneRequest) (*ArduinoThing, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ArduinoThing + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ThingsV2ApiService.ThingsV2Clone") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/things/{id}/clone" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.thingClone == nil { + return localVarReturnValue, nil, reportError("thingClone is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.arduino.thing+json", "application/vnd.goa.error+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } + // body params + localVarPostBody = r.thingClone + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiThingsV2CreateRequest struct { ctx context.Context ApiService *ThingsV2ApiService @@ -953,6 +1098,128 @@ func (a *ThingsV2ApiService) ThingsV2ShowExecute(r ApiThingsV2ShowRequest) (*Ard return localVarReturnValue, localVarHTTPResponse, nil } +type ApiThingsV2TemplateRequest struct { + ctx context.Context + ApiService *ThingsV2ApiService + id string + xOrganization *string +} + +func (r ApiThingsV2TemplateRequest) XOrganization(xOrganization string) ApiThingsV2TemplateRequest { + r.xOrganization = &xOrganization + return r +} + +func (r ApiThingsV2TemplateRequest) Execute() (*ArduinoThingtemplate, *http.Response, error) { + return r.ApiService.ThingsV2TemplateExecute(r) +} + +/* +ThingsV2Template template things_v2 + +Extract template from the given thing + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The id of the thing + @return ApiThingsV2TemplateRequest +*/ +func (a *ThingsV2ApiService) ThingsV2Template(ctx context.Context, id string) ApiThingsV2TemplateRequest { + return ApiThingsV2TemplateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return ArduinoThingtemplate +func (a *ThingsV2ApiService) ThingsV2TemplateExecute(r ApiThingsV2TemplateRequest) (*ArduinoThingtemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ArduinoThingtemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ThingsV2ApiService.ThingsV2Template") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/things/{id}/template" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.arduino.thingtemplate+json", "application/vnd.goa.error+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrganization != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Organization", r.xOrganization, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiThingsV2UpdateRequest struct { ctx context.Context ApiService *ThingsV2ApiService diff --git a/docs/ArduinoDashboardv2template.md b/docs/ArduinoDashboardv2template.md new file mode 100644 index 0000000..c091bed --- /dev/null +++ b/docs/ArduinoDashboardv2template.md @@ -0,0 +1,77 @@ +# ArduinoDashboardv2template + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The friendly name of the dashboard | +**Widgets** | Pointer to [**[]ArduinoWidgetv2template**](ArduinoWidgetv2template.md) | ArduinoWidgetv2templateCollection is the media type for an array of ArduinoWidgetv2template (default view) | [optional] + +## Methods + +### NewArduinoDashboardv2template + +`func NewArduinoDashboardv2template(name string, ) *ArduinoDashboardv2template` + +NewArduinoDashboardv2template instantiates a new ArduinoDashboardv2template object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoDashboardv2templateWithDefaults + +`func NewArduinoDashboardv2templateWithDefaults() *ArduinoDashboardv2template` + +NewArduinoDashboardv2templateWithDefaults instantiates a new ArduinoDashboardv2template object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ArduinoDashboardv2template) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ArduinoDashboardv2template) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ArduinoDashboardv2template) SetName(v string)` + +SetName sets Name field to given value. + + +### GetWidgets + +`func (o *ArduinoDashboardv2template) GetWidgets() []ArduinoWidgetv2template` + +GetWidgets returns the Widgets field if non-nil, zero value otherwise. + +### GetWidgetsOk + +`func (o *ArduinoDashboardv2template) GetWidgetsOk() (*[]ArduinoWidgetv2template, bool)` + +GetWidgetsOk returns a tuple with the Widgets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWidgets + +`func (o *ArduinoDashboardv2template) SetWidgets(v []ArduinoWidgetv2template)` + +SetWidgets sets Widgets field to given value. + +### HasWidgets + +`func (o *ArduinoDashboardv2template) HasWidgets() bool` + +HasWidgets returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ArduinoDevicev2.md b/docs/ArduinoDevicev2.md index 0279900..c1006a2 100644 --- a/docs/ArduinoDevicev2.md +++ b/docs/ArduinoDevicev2.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ConnectionType** | Pointer to **string** | The type of the connections selected by the user when multiple connections are available | [optional] **CreatedAt** | Pointer to **time.Time** | Creation date of the device | [optional] +**DeviceStatus** | Pointer to **string** | The connection status of the device | [optional] **Events** | Pointer to [**[]ArduinoDevicev2SimpleProperties**](ArduinoDevicev2SimpleProperties.md) | ArduinoDevicev2SimplePropertiesCollection is the media type for an array of ArduinoDevicev2SimpleProperties (default view) | [optional] **Fqbn** | Pointer to **string** | The fully qualified board name | [optional] **Href** | **string** | The api reference of this device | @@ -97,6 +98,31 @@ SetCreatedAt sets CreatedAt field to given value. HasCreatedAt returns a boolean if a field has been set. +### GetDeviceStatus + +`func (o *ArduinoDevicev2) GetDeviceStatus() string` + +GetDeviceStatus returns the DeviceStatus field if non-nil, zero value otherwise. + +### GetDeviceStatusOk + +`func (o *ArduinoDevicev2) GetDeviceStatusOk() (*string, bool)` + +GetDeviceStatusOk returns a tuple with the DeviceStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceStatus + +`func (o *ArduinoDevicev2) SetDeviceStatus(v string)` + +SetDeviceStatus sets DeviceStatus field to given value. + +### HasDeviceStatus + +`func (o *ArduinoDevicev2) HasDeviceStatus() bool` + +HasDeviceStatus returns a boolean if a field has been set. + ### GetEvents `func (o *ArduinoDevicev2) GetEvents() []ArduinoDevicev2SimpleProperties` diff --git a/docs/ArduinoDevicev2StatusEvent.md b/docs/ArduinoDevicev2StatusEvent.md new file mode 100644 index 0000000..e8f8a9f --- /dev/null +++ b/docs/ArduinoDevicev2StatusEvent.md @@ -0,0 +1,72 @@ +# ArduinoDevicev2StatusEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UpdatedAt** | **time.Time** | Update timestamp of the status event | +**Value** | **string** | The status event of the device | + +## Methods + +### NewArduinoDevicev2StatusEvent + +`func NewArduinoDevicev2StatusEvent(updatedAt time.Time, value string, ) *ArduinoDevicev2StatusEvent` + +NewArduinoDevicev2StatusEvent instantiates a new ArduinoDevicev2StatusEvent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoDevicev2StatusEventWithDefaults + +`func NewArduinoDevicev2StatusEventWithDefaults() *ArduinoDevicev2StatusEvent` + +NewArduinoDevicev2StatusEventWithDefaults instantiates a new ArduinoDevicev2StatusEvent object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUpdatedAt + +`func (o *ArduinoDevicev2StatusEvent) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *ArduinoDevicev2StatusEvent) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *ArduinoDevicev2StatusEvent) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + + +### GetValue + +`func (o *ArduinoDevicev2StatusEvent) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *ArduinoDevicev2StatusEvent) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *ArduinoDevicev2StatusEvent) SetValue(v string)` + +SetValue sets Value field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ArduinoDevicev2StatusEvents.md b/docs/ArduinoDevicev2StatusEvents.md new file mode 100644 index 0000000..bbf285c --- /dev/null +++ b/docs/ArduinoDevicev2StatusEvents.md @@ -0,0 +1,72 @@ +# ArduinoDevicev2StatusEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Events** | [**[]ArduinoDevicev2StatusEvent**](ArduinoDevicev2StatusEvent.md) | ArduinoDevicev2StatusEventCollection is the media type for an array of ArduinoDevicev2StatusEvent (default view) | +**Id** | **string** | The id of the device | + +## Methods + +### NewArduinoDevicev2StatusEvents + +`func NewArduinoDevicev2StatusEvents(events []ArduinoDevicev2StatusEvent, id string, ) *ArduinoDevicev2StatusEvents` + +NewArduinoDevicev2StatusEvents instantiates a new ArduinoDevicev2StatusEvents object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoDevicev2StatusEventsWithDefaults + +`func NewArduinoDevicev2StatusEventsWithDefaults() *ArduinoDevicev2StatusEvents` + +NewArduinoDevicev2StatusEventsWithDefaults instantiates a new ArduinoDevicev2StatusEvents object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEvents + +`func (o *ArduinoDevicev2StatusEvents) GetEvents() []ArduinoDevicev2StatusEvent` + +GetEvents returns the Events field if non-nil, zero value otherwise. + +### GetEventsOk + +`func (o *ArduinoDevicev2StatusEvents) GetEventsOk() (*[]ArduinoDevicev2StatusEvent, bool)` + +GetEventsOk returns a tuple with the Events field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvents + +`func (o *ArduinoDevicev2StatusEvents) SetEvents(v []ArduinoDevicev2StatusEvent)` + +SetEvents sets Events field to given value. + + +### GetId + +`func (o *ArduinoDevicev2StatusEvents) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ArduinoDevicev2StatusEvents) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ArduinoDevicev2StatusEvents) SetId(v string)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ArduinoProperty.md b/docs/ArduinoProperty.md index d0b7b3e..5022848 100644 --- a/docs/ArduinoProperty.md +++ b/docs/ArduinoProperty.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **Permission** | **string** | The permission of the property | **Persist** | Pointer to **bool** | If true, data will persist into a timeseries database | [optional] **SyncId** | Pointer to **string** | The id of the sync pool | [optional] -**Tag** | Pointer to **float64** | The integer id of the property | [optional] +**Tag** | Pointer to **int64** | The integer id of the property | [optional] **ThingId** | **string** | The id of the thing | **ThingName** | Pointer to **string** | The name of the associated thing | [optional] **Type** | **string** | The type of the property | @@ -337,20 +337,20 @@ HasSyncId returns a boolean if a field has been set. ### GetTag -`func (o *ArduinoProperty) GetTag() float64` +`func (o *ArduinoProperty) GetTag() int64` GetTag returns the Tag field if non-nil, zero value otherwise. ### GetTagOk -`func (o *ArduinoProperty) GetTagOk() (*float64, bool)` +`func (o *ArduinoProperty) GetTagOk() (*int64, bool)` GetTagOk returns a tuple with the Tag field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTag -`func (o *ArduinoProperty) SetTag(v float64)` +`func (o *ArduinoProperty) SetTag(v int64)` SetTag sets Tag field to given value. diff --git a/docs/ArduinoSeriesResponse.md b/docs/ArduinoSeriesResponse.md index fc51e60..9b715e1 100644 --- a/docs/ArduinoSeriesResponse.md +++ b/docs/ArduinoSeriesResponse.md @@ -4,13 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Aggregation** | Pointer to **string** | Aggregation statistic function. For numeric values, AVG statistic is used by default. PCT_X compute the Xth approximate percentile (e.g. PCT_95 is the 95th approximate percentile). For boolean, BOOL_OR statistic is used as default. | [optional] **CountValues** | **int64** | Total number of values in the array 'values' | **FromDate** | **time.Time** | From date | **Interval** | **int64** | Resolution in seconds | **Message** | Pointer to **string** | If the response is different than 'ok' | [optional] [default to ""] **Query** | **string** | Query of for the data | **RespVersion** | **int64** | Response version | -**SeriesLimit** | Pointer to **int64** | Max of values | [optional] +**SeriesLimit** | Pointer to **int64** | Maximum number of values returned after data aggregation, if any | [optional] **Status** | **string** | Status of the response | **Times** | [**[]time.Time**](time.Time.md) | Timestamp in RFC3339 | **ToDate** | **time.Time** | To date | @@ -35,6 +36,31 @@ NewArduinoSeriesResponseWithDefaults instantiates a new ArduinoSeriesResponse ob This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetAggregation + +`func (o *ArduinoSeriesResponse) GetAggregation() string` + +GetAggregation returns the Aggregation field if non-nil, zero value otherwise. + +### GetAggregationOk + +`func (o *ArduinoSeriesResponse) GetAggregationOk() (*string, bool)` + +GetAggregationOk returns a tuple with the Aggregation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAggregation + +`func (o *ArduinoSeriesResponse) SetAggregation(v string)` + +SetAggregation sets Aggregation field to given value. + +### HasAggregation + +`func (o *ArduinoSeriesResponse) HasAggregation() bool` + +HasAggregation returns a boolean if a field has been set. + ### GetCountValues `func (o *ArduinoSeriesResponse) GetCountValues() int64` diff --git a/docs/ArduinoTemplateproperty.md b/docs/ArduinoTemplateproperty.md new file mode 100644 index 0000000..f656c84 --- /dev/null +++ b/docs/ArduinoTemplateproperty.md @@ -0,0 +1,166 @@ +# ArduinoTemplateproperty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The friendly name of the property | +**Permission** | **string** | The permission of the property | +**Type** | **string** | The type of the property | +**UpdateParameter** | Pointer to **float64** | The update frequency in seconds, or the amount of the property has to change in order to trigger an update | [optional] +**UpdateStrategy** | **string** | The update strategy for the property value | +**VariableName** | Pointer to **string** | The sketch variable name of the property | [optional] + +## Methods + +### NewArduinoTemplateproperty + +`func NewArduinoTemplateproperty(name string, permission string, type_ string, updateStrategy string, ) *ArduinoTemplateproperty` + +NewArduinoTemplateproperty instantiates a new ArduinoTemplateproperty object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoTemplatepropertyWithDefaults + +`func NewArduinoTemplatepropertyWithDefaults() *ArduinoTemplateproperty` + +NewArduinoTemplatepropertyWithDefaults instantiates a new ArduinoTemplateproperty object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ArduinoTemplateproperty) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ArduinoTemplateproperty) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ArduinoTemplateproperty) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPermission + +`func (o *ArduinoTemplateproperty) GetPermission() string` + +GetPermission returns the Permission field if non-nil, zero value otherwise. + +### GetPermissionOk + +`func (o *ArduinoTemplateproperty) GetPermissionOk() (*string, bool)` + +GetPermissionOk returns a tuple with the Permission field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermission + +`func (o *ArduinoTemplateproperty) SetPermission(v string)` + +SetPermission sets Permission field to given value. + + +### GetType + +`func (o *ArduinoTemplateproperty) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ArduinoTemplateproperty) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ArduinoTemplateproperty) SetType(v string)` + +SetType sets Type field to given value. + + +### GetUpdateParameter + +`func (o *ArduinoTemplateproperty) GetUpdateParameter() float64` + +GetUpdateParameter returns the UpdateParameter field if non-nil, zero value otherwise. + +### GetUpdateParameterOk + +`func (o *ArduinoTemplateproperty) GetUpdateParameterOk() (*float64, bool)` + +GetUpdateParameterOk returns a tuple with the UpdateParameter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdateParameter + +`func (o *ArduinoTemplateproperty) SetUpdateParameter(v float64)` + +SetUpdateParameter sets UpdateParameter field to given value. + +### HasUpdateParameter + +`func (o *ArduinoTemplateproperty) HasUpdateParameter() bool` + +HasUpdateParameter returns a boolean if a field has been set. + +### GetUpdateStrategy + +`func (o *ArduinoTemplateproperty) GetUpdateStrategy() string` + +GetUpdateStrategy returns the UpdateStrategy field if non-nil, zero value otherwise. + +### GetUpdateStrategyOk + +`func (o *ArduinoTemplateproperty) GetUpdateStrategyOk() (*string, bool)` + +GetUpdateStrategyOk returns a tuple with the UpdateStrategy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdateStrategy + +`func (o *ArduinoTemplateproperty) SetUpdateStrategy(v string)` + +SetUpdateStrategy sets UpdateStrategy field to given value. + + +### GetVariableName + +`func (o *ArduinoTemplateproperty) GetVariableName() string` + +GetVariableName returns the VariableName field if non-nil, zero value otherwise. + +### GetVariableNameOk + +`func (o *ArduinoTemplateproperty) GetVariableNameOk() (*string, bool)` + +GetVariableNameOk returns a tuple with the VariableName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVariableName + +`func (o *ArduinoTemplateproperty) SetVariableName(v string)` + +SetVariableName sets VariableName field to given value. + +### HasVariableName + +`func (o *ArduinoTemplateproperty) HasVariableName() bool` + +HasVariableName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ArduinoTemplatevariable.md b/docs/ArduinoTemplatevariable.md new file mode 100644 index 0000000..a1860bc --- /dev/null +++ b/docs/ArduinoTemplatevariable.md @@ -0,0 +1,161 @@ +# ArduinoTemplatevariable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the variable | +**Permission** | **string** | The permission of the linked variable | +**ThingId** | **string** | The name of the related thing | +**ThingTimezone** | Pointer to [**ArduinoTimezone**](ArduinoTimezone.md) | | [optional] +**Type** | **string** | The type of the variable | +**VariableId** | **string** | The name of the variable in the code | + +## Methods + +### NewArduinoTemplatevariable + +`func NewArduinoTemplatevariable(name string, permission string, thingId string, type_ string, variableId string, ) *ArduinoTemplatevariable` + +NewArduinoTemplatevariable instantiates a new ArduinoTemplatevariable object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoTemplatevariableWithDefaults + +`func NewArduinoTemplatevariableWithDefaults() *ArduinoTemplatevariable` + +NewArduinoTemplatevariableWithDefaults instantiates a new ArduinoTemplatevariable object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ArduinoTemplatevariable) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ArduinoTemplatevariable) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ArduinoTemplatevariable) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPermission + +`func (o *ArduinoTemplatevariable) GetPermission() string` + +GetPermission returns the Permission field if non-nil, zero value otherwise. + +### GetPermissionOk + +`func (o *ArduinoTemplatevariable) GetPermissionOk() (*string, bool)` + +GetPermissionOk returns a tuple with the Permission field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermission + +`func (o *ArduinoTemplatevariable) SetPermission(v string)` + +SetPermission sets Permission field to given value. + + +### GetThingId + +`func (o *ArduinoTemplatevariable) GetThingId() string` + +GetThingId returns the ThingId field if non-nil, zero value otherwise. + +### GetThingIdOk + +`func (o *ArduinoTemplatevariable) GetThingIdOk() (*string, bool)` + +GetThingIdOk returns a tuple with the ThingId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThingId + +`func (o *ArduinoTemplatevariable) SetThingId(v string)` + +SetThingId sets ThingId field to given value. + + +### GetThingTimezone + +`func (o *ArduinoTemplatevariable) GetThingTimezone() ArduinoTimezone` + +GetThingTimezone returns the ThingTimezone field if non-nil, zero value otherwise. + +### GetThingTimezoneOk + +`func (o *ArduinoTemplatevariable) GetThingTimezoneOk() (*ArduinoTimezone, bool)` + +GetThingTimezoneOk returns a tuple with the ThingTimezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThingTimezone + +`func (o *ArduinoTemplatevariable) SetThingTimezone(v ArduinoTimezone)` + +SetThingTimezone sets ThingTimezone field to given value. + +### HasThingTimezone + +`func (o *ArduinoTemplatevariable) HasThingTimezone() bool` + +HasThingTimezone returns a boolean if a field has been set. + +### GetType + +`func (o *ArduinoTemplatevariable) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ArduinoTemplatevariable) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ArduinoTemplatevariable) SetType(v string)` + +SetType sets Type field to given value. + + +### GetVariableId + +`func (o *ArduinoTemplatevariable) GetVariableId() string` + +GetVariableId returns the VariableId field if non-nil, zero value otherwise. + +### GetVariableIdOk + +`func (o *ArduinoTemplatevariable) GetVariableIdOk() (*string, bool)` + +GetVariableIdOk returns a tuple with the VariableId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVariableId + +`func (o *ArduinoTemplatevariable) SetVariableId(v string)` + +SetVariableId sets VariableId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ArduinoThingtemplate.md b/docs/ArduinoThingtemplate.md new file mode 100644 index 0000000..70bee7e --- /dev/null +++ b/docs/ArduinoThingtemplate.md @@ -0,0 +1,176 @@ +# ArduinoThingtemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The friendly name of the thing | +**OrganizationId** | Pointer to **string** | Id of the organization the thing belongs to | [optional] +**Properties** | Pointer to [**[]ArduinoTemplateproperty**](ArduinoTemplateproperty.md) | ArduinoTemplatepropertyCollection is the media type for an array of ArduinoTemplateproperty (default view) | [optional] +**Tags** | Pointer to [**[]Tag**](Tag.md) | Tags of the thing | [optional] +**Timezone** | **string** | Time zone of the thing | +**WebhookUri** | Pointer to **string** | Webhook uri | [optional] + +## Methods + +### NewArduinoThingtemplate + +`func NewArduinoThingtemplate(name string, timezone string, ) *ArduinoThingtemplate` + +NewArduinoThingtemplate instantiates a new ArduinoThingtemplate object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoThingtemplateWithDefaults + +`func NewArduinoThingtemplateWithDefaults() *ArduinoThingtemplate` + +NewArduinoThingtemplateWithDefaults instantiates a new ArduinoThingtemplate object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ArduinoThingtemplate) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ArduinoThingtemplate) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ArduinoThingtemplate) SetName(v string)` + +SetName sets Name field to given value. + + +### GetOrganizationId + +`func (o *ArduinoThingtemplate) GetOrganizationId() string` + +GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise. + +### GetOrganizationIdOk + +`func (o *ArduinoThingtemplate) GetOrganizationIdOk() (*string, bool)` + +GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizationId + +`func (o *ArduinoThingtemplate) SetOrganizationId(v string)` + +SetOrganizationId sets OrganizationId field to given value. + +### HasOrganizationId + +`func (o *ArduinoThingtemplate) HasOrganizationId() bool` + +HasOrganizationId returns a boolean if a field has been set. + +### GetProperties + +`func (o *ArduinoThingtemplate) GetProperties() []ArduinoTemplateproperty` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *ArduinoThingtemplate) GetPropertiesOk() (*[]ArduinoTemplateproperty, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *ArduinoThingtemplate) SetProperties(v []ArduinoTemplateproperty)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *ArduinoThingtemplate) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + +### GetTags + +`func (o *ArduinoThingtemplate) GetTags() []Tag` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *ArduinoThingtemplate) GetTagsOk() (*[]Tag, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *ArduinoThingtemplate) SetTags(v []Tag)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *ArduinoThingtemplate) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTimezone + +`func (o *ArduinoThingtemplate) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *ArduinoThingtemplate) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *ArduinoThingtemplate) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + + +### GetWebhookUri + +`func (o *ArduinoThingtemplate) GetWebhookUri() string` + +GetWebhookUri returns the WebhookUri field if non-nil, zero value otherwise. + +### GetWebhookUriOk + +`func (o *ArduinoThingtemplate) GetWebhookUriOk() (*string, bool)` + +GetWebhookUriOk returns a tuple with the WebhookUri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebhookUri + +`func (o *ArduinoThingtemplate) SetWebhookUri(v string)` + +SetWebhookUri sets WebhookUri field to given value. + +### HasWebhookUri + +`func (o *ArduinoThingtemplate) HasWebhookUri() bool` + +HasWebhookUri returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ArduinoTimezone.md b/docs/ArduinoTimezone.md index 8571b98..e8d5bd8 100644 --- a/docs/ArduinoTimezone.md +++ b/docs/ArduinoTimezone.md @@ -6,13 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | Name of the time zone. | **Offset** | **int64** | Current UTC DST offset in seconds. | -**Until** | Pointer to **time.Time** | Date until the offset is valid. | [optional] +**Until** | **time.Time** | Date until the offset is valid. | ## Methods ### NewArduinoTimezone -`func NewArduinoTimezone(name string, offset int64, ) *ArduinoTimezone` +`func NewArduinoTimezone(name string, offset int64, until time.Time, ) *ArduinoTimezone` NewArduinoTimezone instantiates a new ArduinoTimezone object This constructor will assign default values to properties that have it defined, @@ -86,11 +86,6 @@ and a boolean to check if the value has been set. SetUntil sets Until field to given value. -### HasUntil - -`func (o *ArduinoTimezone) HasUntil() bool` - -HasUntil returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ArduinoWidgetv2template.md b/docs/ArduinoWidgetv2template.md new file mode 100644 index 0000000..2eec79b --- /dev/null +++ b/docs/ArduinoWidgetv2template.md @@ -0,0 +1,312 @@ +# ArduinoWidgetv2template + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Height** | **int64** | Widget current height for desktop | +**HeightMobile** | Pointer to **int64** | Widget current height for mobile | [optional] +**Name** | Pointer to **string** | The name of the widget | [optional] +**Options** | **map[string]interface{}** | Widget options | +**Type** | **string** | The type of the widget | +**Variables** | Pointer to [**[]ArduinoTemplatevariable**](ArduinoTemplatevariable.md) | ArduinoTemplatevariableCollection is the media type for an array of ArduinoTemplatevariable (default view) | [optional] +**Width** | **int64** | Widget current width for desktop | +**WidthMobile** | Pointer to **int64** | Widget current width for mobile | [optional] +**X** | **int64** | Widget x position for desktop | +**XMobile** | Pointer to **int64** | Widget x position for mobile | [optional] +**Y** | **int64** | Widget y position for desktop | +**YMobile** | Pointer to **int64** | Widget y position for mobile | [optional] + +## Methods + +### NewArduinoWidgetv2template + +`func NewArduinoWidgetv2template(height int64, options map[string]interface{}, type_ string, width int64, x int64, y int64, ) *ArduinoWidgetv2template` + +NewArduinoWidgetv2template instantiates a new ArduinoWidgetv2template object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArduinoWidgetv2templateWithDefaults + +`func NewArduinoWidgetv2templateWithDefaults() *ArduinoWidgetv2template` + +NewArduinoWidgetv2templateWithDefaults instantiates a new ArduinoWidgetv2template object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHeight + +`func (o *ArduinoWidgetv2template) GetHeight() int64` + +GetHeight returns the Height field if non-nil, zero value otherwise. + +### GetHeightOk + +`func (o *ArduinoWidgetv2template) GetHeightOk() (*int64, bool)` + +GetHeightOk returns a tuple with the Height field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeight + +`func (o *ArduinoWidgetv2template) SetHeight(v int64)` + +SetHeight sets Height field to given value. + + +### GetHeightMobile + +`func (o *ArduinoWidgetv2template) GetHeightMobile() int64` + +GetHeightMobile returns the HeightMobile field if non-nil, zero value otherwise. + +### GetHeightMobileOk + +`func (o *ArduinoWidgetv2template) GetHeightMobileOk() (*int64, bool)` + +GetHeightMobileOk returns a tuple with the HeightMobile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeightMobile + +`func (o *ArduinoWidgetv2template) SetHeightMobile(v int64)` + +SetHeightMobile sets HeightMobile field to given value. + +### HasHeightMobile + +`func (o *ArduinoWidgetv2template) HasHeightMobile() bool` + +HasHeightMobile returns a boolean if a field has been set. + +### GetName + +`func (o *ArduinoWidgetv2template) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ArduinoWidgetv2template) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ArduinoWidgetv2template) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ArduinoWidgetv2template) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOptions + +`func (o *ArduinoWidgetv2template) GetOptions() map[string]interface{}` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *ArduinoWidgetv2template) GetOptionsOk() (*map[string]interface{}, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *ArduinoWidgetv2template) SetOptions(v map[string]interface{})` + +SetOptions sets Options field to given value. + + +### GetType + +`func (o *ArduinoWidgetv2template) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ArduinoWidgetv2template) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ArduinoWidgetv2template) SetType(v string)` + +SetType sets Type field to given value. + + +### GetVariables + +`func (o *ArduinoWidgetv2template) GetVariables() []ArduinoTemplatevariable` + +GetVariables returns the Variables field if non-nil, zero value otherwise. + +### GetVariablesOk + +`func (o *ArduinoWidgetv2template) GetVariablesOk() (*[]ArduinoTemplatevariable, bool)` + +GetVariablesOk returns a tuple with the Variables field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVariables + +`func (o *ArduinoWidgetv2template) SetVariables(v []ArduinoTemplatevariable)` + +SetVariables sets Variables field to given value. + +### HasVariables + +`func (o *ArduinoWidgetv2template) HasVariables() bool` + +HasVariables returns a boolean if a field has been set. + +### GetWidth + +`func (o *ArduinoWidgetv2template) GetWidth() int64` + +GetWidth returns the Width field if non-nil, zero value otherwise. + +### GetWidthOk + +`func (o *ArduinoWidgetv2template) GetWidthOk() (*int64, bool)` + +GetWidthOk returns a tuple with the Width field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWidth + +`func (o *ArduinoWidgetv2template) SetWidth(v int64)` + +SetWidth sets Width field to given value. + + +### GetWidthMobile + +`func (o *ArduinoWidgetv2template) GetWidthMobile() int64` + +GetWidthMobile returns the WidthMobile field if non-nil, zero value otherwise. + +### GetWidthMobileOk + +`func (o *ArduinoWidgetv2template) GetWidthMobileOk() (*int64, bool)` + +GetWidthMobileOk returns a tuple with the WidthMobile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWidthMobile + +`func (o *ArduinoWidgetv2template) SetWidthMobile(v int64)` + +SetWidthMobile sets WidthMobile field to given value. + +### HasWidthMobile + +`func (o *ArduinoWidgetv2template) HasWidthMobile() bool` + +HasWidthMobile returns a boolean if a field has been set. + +### GetX + +`func (o *ArduinoWidgetv2template) GetX() int64` + +GetX returns the X field if non-nil, zero value otherwise. + +### GetXOk + +`func (o *ArduinoWidgetv2template) GetXOk() (*int64, bool)` + +GetXOk returns a tuple with the X field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetX + +`func (o *ArduinoWidgetv2template) SetX(v int64)` + +SetX sets X field to given value. + + +### GetXMobile + +`func (o *ArduinoWidgetv2template) GetXMobile() int64` + +GetXMobile returns the XMobile field if non-nil, zero value otherwise. + +### GetXMobileOk + +`func (o *ArduinoWidgetv2template) GetXMobileOk() (*int64, bool)` + +GetXMobileOk returns a tuple with the XMobile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetXMobile + +`func (o *ArduinoWidgetv2template) SetXMobile(v int64)` + +SetXMobile sets XMobile field to given value. + +### HasXMobile + +`func (o *ArduinoWidgetv2template) HasXMobile() bool` + +HasXMobile returns a boolean if a field has been set. + +### GetY + +`func (o *ArduinoWidgetv2template) GetY() int64` + +GetY returns the Y field if non-nil, zero value otherwise. + +### GetYOk + +`func (o *ArduinoWidgetv2template) GetYOk() (*int64, bool)` + +GetYOk returns a tuple with the Y field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetY + +`func (o *ArduinoWidgetv2template) SetY(v int64)` + +SetY sets Y field to given value. + + +### GetYMobile + +`func (o *ArduinoWidgetv2template) GetYMobile() int64` + +GetYMobile returns the YMobile field if non-nil, zero value otherwise. + +### GetYMobileOk + +`func (o *ArduinoWidgetv2template) GetYMobileOk() (*int64, bool)` + +GetYMobileOk returns a tuple with the YMobile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetYMobile + +`func (o *ArduinoWidgetv2template) SetYMobile(v int64)` + +SetYMobile sets YMobile field to given value. + +### HasYMobile + +`func (o *ArduinoWidgetv2template) HasYMobile() bool` + +HasYMobile returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchQueryRawRequestMediaV1.md b/docs/BatchQueryRawRequestMediaV1.md index 97be211..134bbec 100644 --- a/docs/BatchQueryRawRequestMediaV1.md +++ b/docs/BatchQueryRawRequestMediaV1.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **From** | Pointer to **time.Time** | From timestamp | [optional] -**Q** | **string** | Query | +**Q** | **string** | Data selection query (e.g. property.2a99729d-2556-4220-a139-023348a1e6b5) | **SeriesLimit** | Pointer to **int64** | Max of values | [optional] **Sort** | Pointer to **string** | Sorting | [optional] [default to "DESC"] **To** | Pointer to **time.Time** | To timestamp | [optional] diff --git a/docs/BatchQueryRequestMediaV1.md b/docs/BatchQueryRequestMediaV1.md index ab2e076..f86607b 100644 --- a/docs/BatchQueryRequestMediaV1.md +++ b/docs/BatchQueryRequestMediaV1.md @@ -4,10 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Aggregation** | Pointer to **string** | Aggregation statistic function. For numeric values, AVG statistic is used by default. PCT_X compute the Xth approximate percentile (e.g. PCT_95 is the 95th approximate percentile). For boolean, BOOL_OR statistic is used as default. | [optional] **From** | **time.Time** | From timestamp | -**Interval** | Pointer to **int64** | Resolution in seconds | [optional] -**Q** | **string** | Query | -**SeriesLimit** | Pointer to **int64** | Max of values | [optional] +**Interval** | Pointer to **int64** | Resolution in seconds (max allowed: 86400) | [optional] +**Q** | **string** | Data selection query (e.g. property.2a99729d-2556-4220-a139-023348a1e6b5) | +**SeriesLimit** | Pointer to **int64** | Maximum number of values returned after data aggregation, if any (default: 300, limit: 1000) | [optional] **To** | **time.Time** | To timestamp | ## Methods @@ -29,6 +30,31 @@ NewBatchQueryRequestMediaV1WithDefaults instantiates a new BatchQueryRequestMedi This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetAggregation + +`func (o *BatchQueryRequestMediaV1) GetAggregation() string` + +GetAggregation returns the Aggregation field if non-nil, zero value otherwise. + +### GetAggregationOk + +`func (o *BatchQueryRequestMediaV1) GetAggregationOk() (*string, bool)` + +GetAggregationOk returns a tuple with the Aggregation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAggregation + +`func (o *BatchQueryRequestMediaV1) SetAggregation(v string)` + +SetAggregation sets Aggregation field to given value. + +### HasAggregation + +`func (o *BatchQueryRequestMediaV1) HasAggregation() bool` + +HasAggregation returns a boolean if a field has been set. + ### GetFrom `func (o *BatchQueryRequestMediaV1) GetFrom() time.Time` diff --git a/docs/Clone.md b/docs/Clone.md new file mode 100644 index 0000000..f98213f --- /dev/null +++ b/docs/Clone.md @@ -0,0 +1,56 @@ +# Clone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Overrides** | Pointer to [**[]Override**](Override.md) | The overrides to apply to the cloned dashboard. An override is a tuple of ids: the id of the thing to override and the id of the new thing to link | [optional] + +## Methods + +### NewClone + +`func NewClone() *Clone` + +NewClone instantiates a new Clone object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCloneWithDefaults + +`func NewCloneWithDefaults() *Clone` + +NewCloneWithDefaults instantiates a new Clone object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOverrides + +`func (o *Clone) GetOverrides() []Override` + +GetOverrides returns the Overrides field if non-nil, zero value otherwise. + +### GetOverridesOk + +`func (o *Clone) GetOverridesOk() (*[]Override, bool)` + +GetOverridesOk returns a tuple with the Overrides field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOverrides + +`func (o *Clone) SetOverrides(v []Override)` + +SetOverrides sets Overrides field to given value. + +### HasOverrides + +`func (o *Clone) HasOverrides() bool` + +HasOverrides returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DashboardsV2Api.md b/docs/DashboardsV2Api.md index cca9537..4692e07 100644 --- a/docs/DashboardsV2Api.md +++ b/docs/DashboardsV2Api.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api2.arduino.cc/iot* Method | HTTP request | Description ------------- | ------------- | ------------- +[**DashboardsV2Clone**](DashboardsV2Api.md#DashboardsV2Clone) | **Put** /v2/dashboards/{id}/clone | clone dashboards_v2 [**DashboardsV2Create**](DashboardsV2Api.md#DashboardsV2Create) | **Post** /v2/dashboards | create dashboards_v2 [**DashboardsV2Delete**](DashboardsV2Api.md#DashboardsV2Delete) | **Delete** /v2/dashboards/{id} | delete dashboards_v2 [**DashboardsV2DeleteShare**](DashboardsV2Api.md#DashboardsV2DeleteShare) | **Delete** /v2/dashboards/{id}/shares/{user_id} | deleteShare dashboards_v2 @@ -13,10 +14,85 @@ Method | HTTP request | Description [**DashboardsV2RequestAccess**](DashboardsV2Api.md#DashboardsV2RequestAccess) | **Put** /v2/dashboards/{id}/share_request | requestAccess dashboards_v2 [**DashboardsV2Share**](DashboardsV2Api.md#DashboardsV2Share) | **Put** /v2/dashboards/{id}/shares | share dashboards_v2 [**DashboardsV2Show**](DashboardsV2Api.md#DashboardsV2Show) | **Get** /v2/dashboards/{id} | show dashboards_v2 +[**DashboardsV2Template**](DashboardsV2Api.md#DashboardsV2Template) | **Get** /v2/dashboards/{id}/template | template dashboards_v2 [**DashboardsV2Update**](DashboardsV2Api.md#DashboardsV2Update) | **Put** /v2/dashboards/{id} | update dashboards_v2 +## DashboardsV2Clone + +> ArduinoDashboardv2 DashboardsV2Clone(ctx, id).Clone(clone).XOrganization(xOrganization).Execute() + +clone dashboards_v2 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/arduino/iot-client-go" +) + +func main() { + id := "id_example" // string | The id of the dashboard + clone := *openapiclient.NewClone() // Clone | + xOrganization := "xOrganization_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DashboardsV2Api.DashboardsV2Clone(context.Background(), id).Clone(clone).XOrganization(xOrganization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsV2Api.DashboardsV2Clone``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DashboardsV2Clone`: ArduinoDashboardv2 + fmt.Fprintf(os.Stdout, "Response from `DashboardsV2Api.DashboardsV2Clone`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The id of the dashboard | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDashboardsV2CloneRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **clone** | [**Clone**](Clone.md) | | + **xOrganization** | **string** | | + +### Return type + +[**ArduinoDashboardv2**](ArduinoDashboardv2.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.arduino.dashboardv2+json, application/vnd.goa.error+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## DashboardsV2Create > ArduinoDashboardv2 DashboardsV2Create(ctx).Dashboardv2(dashboardv2).XOrganization(xOrganization).Execute() @@ -663,6 +739,78 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## DashboardsV2Template + +> ArduinoDashboardv2template DashboardsV2Template(ctx, id).XOrganization(xOrganization).Execute() + +template dashboards_v2 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/arduino/iot-client-go" +) + +func main() { + id := "id_example" // string | The id of the dashboard + xOrganization := "xOrganization_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DashboardsV2Api.DashboardsV2Template(context.Background(), id).XOrganization(xOrganization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsV2Api.DashboardsV2Template``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DashboardsV2Template`: ArduinoDashboardv2template + fmt.Fprintf(os.Stdout, "Response from `DashboardsV2Api.DashboardsV2Template`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The id of the dashboard | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDashboardsV2TemplateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrganization** | **string** | | + +### Return type + +[**ArduinoDashboardv2template**](ArduinoDashboardv2template.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.arduino.dashboardv2template+json, application/vnd.goa.error+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## DashboardsV2Update > ArduinoDashboardv2 DashboardsV2Update(ctx, id).Dashboardv2(dashboardv2).XOrganization(xOrganization).Execute() diff --git a/docs/DevicesV2Api.md b/docs/DevicesV2Api.md index d8d1b20..6f468ab 100644 --- a/docs/DevicesV2Api.md +++ b/docs/DevicesV2Api.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**DevicesV2Delete**](DevicesV2Api.md#DevicesV2Delete) | **Delete** /v2/devices/{id} | delete devices_v2 [**DevicesV2GetEvents**](DevicesV2Api.md#DevicesV2GetEvents) | **Get** /v2/devices/{id}/events | getEvents devices_v2 [**DevicesV2GetProperties**](DevicesV2Api.md#DevicesV2GetProperties) | **Get** /v2/devices/{id}/properties | getProperties devices_v2 +[**DevicesV2GetStatusEvents**](DevicesV2Api.md#DevicesV2GetStatusEvents) | **Get** /v2/devices/{id}/status | GetStatusEvents devices_v2 [**DevicesV2List**](DevicesV2Api.md#DevicesV2List) | **Get** /v2/devices | list devices_v2 [**DevicesV2Show**](DevicesV2Api.md#DevicesV2Show) | **Get** /v2/devices/{id} | show devices_v2 [**DevicesV2Timeseries**](DevicesV2Api.md#DevicesV2Timeseries) | **Get** /v2/devices/{id}/properties/{pid} | timeseries devices_v2 @@ -304,6 +305,82 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## DevicesV2GetStatusEvents + +> ArduinoDevicev2StatusEvents DevicesV2GetStatusEvents(ctx, id).Limit(limit).Start(start).XOrganization(xOrganization).Execute() + +GetStatusEvents devices_v2 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/arduino/iot-client-go" +) + +func main() { + id := "id_example" // string | The id of the device + limit := int32(56) // int32 | The number of events to select (optional) (default to 30) + start := "start_example" // string | The time at which to start selecting events (optional) + xOrganization := "xOrganization_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesV2Api.DevicesV2GetStatusEvents(context.Background(), id).Limit(limit).Start(start).XOrganization(xOrganization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesV2Api.DevicesV2GetStatusEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DevicesV2GetStatusEvents`: ArduinoDevicev2StatusEvents + fmt.Fprintf(os.Stdout, "Response from `DevicesV2Api.DevicesV2GetStatusEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The id of the device | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDevicesV2GetStatusEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **int32** | The number of events to select | [default to 30] + **start** | **string** | The time at which to start selecting events | + **xOrganization** | **string** | | + +### Return type + +[**ArduinoDevicev2StatusEvents**](ArduinoDevicev2StatusEvents.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.arduino.devicev2.status.events+json, application/vnd.goa.error+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## DevicesV2List > []ArduinoDevicev2 DevicesV2List(ctx).AcrossUserIds(acrossUserIds).Serial(serial).Tags(tags).XOrganization(xOrganization).Execute() diff --git a/docs/Override.md b/docs/Override.md new file mode 100644 index 0000000..c017407 --- /dev/null +++ b/docs/Override.md @@ -0,0 +1,72 @@ +# Override + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NewThingId** | **string** | The id of the new thing to link | +**OldThingId** | **string** | The id of the thing to override | + +## Methods + +### NewOverride + +`func NewOverride(newThingId string, oldThingId string, ) *Override` + +NewOverride instantiates a new Override object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverrideWithDefaults + +`func NewOverrideWithDefaults() *Override` + +NewOverrideWithDefaults instantiates a new Override object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNewThingId + +`func (o *Override) GetNewThingId() string` + +GetNewThingId returns the NewThingId field if non-nil, zero value otherwise. + +### GetNewThingIdOk + +`func (o *Override) GetNewThingIdOk() (*string, bool)` + +GetNewThingIdOk returns a tuple with the NewThingId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNewThingId + +`func (o *Override) SetNewThingId(v string)` + +SetNewThingId sets NewThingId field to given value. + + +### GetOldThingId + +`func (o *Override) GetOldThingId() string` + +GetOldThingId returns the OldThingId field if non-nil, zero value otherwise. + +### GetOldThingIdOk + +`func (o *Override) GetOldThingIdOk() (*string, bool)` + +GetOldThingIdOk returns a tuple with the OldThingId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOldThingId + +`func (o *Override) SetOldThingId(v string)` + +SetOldThingId sets OldThingId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PropertiesV2Api.md b/docs/PropertiesV2Api.md index 3da3db9..c5a2e21 100644 --- a/docs/PropertiesV2Api.md +++ b/docs/PropertiesV2Api.md @@ -16,7 +16,7 @@ Method | HTTP request | Description ## PropertiesV2Create -> ArduinoProperty PropertiesV2Create(ctx, id).Property(property).Execute() +> ArduinoProperty PropertiesV2Create(ctx, id).Property(property).XOrganization(xOrganization).Execute() create properties_v2 @@ -37,10 +37,11 @@ import ( func main() { id := "id_example" // string | The id of the thing property := *openapiclient.NewProperty("Name_example", "Permission_example", "Type_example", "UpdateStrategy_example") // Property | PropertyPayload describes a property of a thing. No field is mandatory + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Create(context.Background(), id).Property(property).Execute() + resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Create(context.Background(), id).Property(property).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2Create``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -67,6 +68,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **property** | [**Property**](Property.md) | PropertyPayload describes a property of a thing. No field is mandatory | + **xOrganization** | **string** | The id of the organization | ### Return type @@ -88,7 +90,7 @@ Name | Type | Description | Notes ## PropertiesV2Delete -> PropertiesV2Delete(ctx, id, pid).Force(force).Execute() +> PropertiesV2Delete(ctx, id, pid).Force(force).XOrganization(xOrganization).Execute() delete properties_v2 @@ -110,10 +112,11 @@ func main() { id := "id_example" // string | The id of the thing pid := "pid_example" // string | The id of the property force := true // bool | If true, hard delete the property (optional) (default to false) + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PropertiesV2Api.PropertiesV2Delete(context.Background(), id, pid).Force(force).Execute() + r, err := apiClient.PropertiesV2Api.PropertiesV2Delete(context.Background(), id, pid).Force(force).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2Delete``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -140,6 +143,7 @@ Name | Type | Description | Notes **force** | **bool** | If true, hard delete the property | [default to false] + **xOrganization** | **string** | The id of the organization | ### Return type @@ -161,7 +165,7 @@ Name | Type | Description | Notes ## PropertiesV2List -> []ArduinoProperty PropertiesV2List(ctx, id).ShowDeleted(showDeleted).Execute() +> []ArduinoProperty PropertiesV2List(ctx, id).ShowDeleted(showDeleted).XOrganization(xOrganization).Execute() list properties_v2 @@ -182,10 +186,11 @@ import ( func main() { id := "id_example" // string | The id of the thing showDeleted := true // bool | If true, shows the soft deleted properties (optional) (default to false) + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PropertiesV2Api.PropertiesV2List(context.Background(), id).ShowDeleted(showDeleted).Execute() + resp, r, err := apiClient.PropertiesV2Api.PropertiesV2List(context.Background(), id).ShowDeleted(showDeleted).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2List``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -212,6 +217,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **showDeleted** | **bool** | If true, shows the soft deleted properties | [default to false] + **xOrganization** | **string** | The id of the organization | ### Return type @@ -233,7 +239,7 @@ Name | Type | Description | Notes ## PropertiesV2Publish -> PropertiesV2Publish(ctx, id, pid).PropertyValue(propertyValue).Execute() +> PropertiesV2Publish(ctx, id, pid).PropertyValue(propertyValue).XOrganization(xOrganization).Execute() publish properties_v2 @@ -255,10 +261,11 @@ func main() { id := "id_example" // string | The id of the thing pid := "pid_example" // string | The id of the property propertyValue := *openapiclient.NewPropertyValue(interface{}(123)) // PropertyValue | PropertyValuePayload describes a property value + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PropertiesV2Api.PropertiesV2Publish(context.Background(), id, pid).PropertyValue(propertyValue).Execute() + r, err := apiClient.PropertiesV2Api.PropertiesV2Publish(context.Background(), id, pid).PropertyValue(propertyValue).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2Publish``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -285,6 +292,7 @@ Name | Type | Description | Notes **propertyValue** | [**PropertyValue**](PropertyValue.md) | PropertyValuePayload describes a property value | + **xOrganization** | **string** | The id of the organization | ### Return type @@ -306,7 +314,7 @@ Name | Type | Description | Notes ## PropertiesV2Show -> ArduinoProperty PropertiesV2Show(ctx, id, pid).ShowDeleted(showDeleted).Execute() +> ArduinoProperty PropertiesV2Show(ctx, id, pid).ShowDeleted(showDeleted).XOrganization(xOrganization).Execute() show properties_v2 @@ -328,10 +336,11 @@ func main() { id := "id_example" // string | The id of the thing pid := "pid_example" // string | The id of the property showDeleted := true // bool | If true, shows the soft deleted properties (optional) (default to false) + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Show(context.Background(), id, pid).ShowDeleted(showDeleted).Execute() + resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Show(context.Background(), id, pid).ShowDeleted(showDeleted).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2Show``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -360,6 +369,7 @@ Name | Type | Description | Notes **showDeleted** | **bool** | If true, shows the soft deleted properties | [default to false] + **xOrganization** | **string** | The id of the organization | ### Return type @@ -381,7 +391,7 @@ Name | Type | Description | Notes ## PropertiesV2Timeseries -> ArduinoTimeseriesmedia PropertiesV2Timeseries(ctx, id, pid).Desc(desc).From(from).Interval(interval).To(to).Execute() +> ArduinoTimeseriesmedia PropertiesV2Timeseries(ctx, id, pid).Aggregation(aggregation).Desc(desc).From(from).Interval(interval).To(to).XOrganization(xOrganization).Execute() timeseries properties_v2 @@ -402,14 +412,16 @@ import ( func main() { id := "id_example" // string | The id of the thing pid := "pid_example" // string | ID of a numerical property + aggregation := "aggregation_example" // string | Samples aggregation statistic. Supported aggregations AVG|MAX|MIN|COUNT|SUM|PCT_99|PCT_95|PCT_90|PCT_75|PCT_50|PCT_15|PCT_5 (optional) desc := true // bool | Whether data's ordering (by time) should be descending (optional) (default to false) from := "from_example" // string | Get data with a timestamp >= to this date (default: 2 weeks ago, min: 1842-01-01T00:00:00Z, max: 2242-01-01T00:00:00Z) (optional) interval := int32(56) // int32 | Binning interval in seconds (defaut: the smallest possible value compatibly with the limit of 1000 data points in the response) (optional) to := "to_example" // string | Get data with a timestamp < to this date (default: now, min: 1842-01-01T00:00:00Z, max: 2242-01-01T00:00:00Z) (optional) + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Timeseries(context.Background(), id, pid).Desc(desc).From(from).Interval(interval).To(to).Execute() + resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Timeseries(context.Background(), id, pid).Aggregation(aggregation).Desc(desc).From(from).Interval(interval).To(to).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2Timeseries``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -437,10 +449,12 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **aggregation** | **string** | Samples aggregation statistic. Supported aggregations AVG|MAX|MIN|COUNT|SUM|PCT_99|PCT_95|PCT_90|PCT_75|PCT_50|PCT_15|PCT_5 | **desc** | **bool** | Whether data's ordering (by time) should be descending | [default to false] **from** | **string** | Get data with a timestamp >= to this date (default: 2 weeks ago, min: 1842-01-01T00:00:00Z, max: 2242-01-01T00:00:00Z) | **interval** | **int32** | Binning interval in seconds (defaut: the smallest possible value compatibly with the limit of 1000 data points in the response) | **to** | **string** | Get data with a timestamp < to this date (default: now, min: 1842-01-01T00:00:00Z, max: 2242-01-01T00:00:00Z) | + **xOrganization** | **string** | The id of the organization | ### Return type @@ -462,7 +476,7 @@ Name | Type | Description | Notes ## PropertiesV2Update -> ArduinoProperty PropertiesV2Update(ctx, id, pid).Property(property).Execute() +> ArduinoProperty PropertiesV2Update(ctx, id, pid).Property(property).XOrganization(xOrganization).Execute() update properties_v2 @@ -484,10 +498,11 @@ func main() { id := "id_example" // string | The id of the thing pid := "pid_example" // string | The id of the property property := *openapiclient.NewProperty("Name_example", "Permission_example", "Type_example", "UpdateStrategy_example") // Property | PropertyPayload describes a property of a thing. No field is mandatory + xOrganization := "xOrganization_example" // string | The id of the organization (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Update(context.Background(), id, pid).Property(property).Execute() + resp, r, err := apiClient.PropertiesV2Api.PropertiesV2Update(context.Background(), id, pid).Property(property).XOrganization(xOrganization).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PropertiesV2Api.PropertiesV2Update``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -516,6 +531,7 @@ Name | Type | Description | Notes **property** | [**Property**](Property.md) | PropertyPayload describes a property of a thing. No field is mandatory | + **xOrganization** | **string** | The id of the organization | ### Return type diff --git a/docs/Property.md b/docs/Property.md index 92d2a84..8252c87 100644 --- a/docs/Property.md +++ b/docs/Property.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **Name** | **string** | The friendly name of the property | **Permission** | **string** | The permission of the property | **Persist** | Pointer to **bool** | If true, data will persist into a timeseries database | [optional] [default to true] -**Tag** | Pointer to **float64** | The integer id of the property | [optional] +**Tag** | Pointer to **int64** | The integer id of the property | [optional] **Type** | **string** | The type of the property | **UpdateParameter** | Pointer to **float64** | The update frequency in seconds, or the amount of the property has to change in order to trigger an update | [optional] **UpdateStrategy** | **string** | The update strategy for the property value | @@ -151,20 +151,20 @@ HasPersist returns a boolean if a field has been set. ### GetTag -`func (o *Property) GetTag() float64` +`func (o *Property) GetTag() int64` GetTag returns the Tag field if non-nil, zero value otherwise. ### GetTagOk -`func (o *Property) GetTagOk() (*float64, bool)` +`func (o *Property) GetTagOk() (*int64, bool)` GetTagOk returns a tuple with the Tag field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTag -`func (o *Property) SetTag(v float64)` +`func (o *Property) SetTag(v int64)` SetTag sets Tag field to given value. diff --git a/docs/ThingClone.md b/docs/ThingClone.md new file mode 100644 index 0000000..694fcb6 --- /dev/null +++ b/docs/ThingClone.md @@ -0,0 +1,77 @@ +# ThingClone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IncludeTags** | Pointer to **bool** | Include tags in clone procedure | [optional] +**Name** | **string** | The friendly name of the thing | + +## Methods + +### NewThingClone + +`func NewThingClone(name string, ) *ThingClone` + +NewThingClone instantiates a new ThingClone object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewThingCloneWithDefaults + +`func NewThingCloneWithDefaults() *ThingClone` + +NewThingCloneWithDefaults instantiates a new ThingClone object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIncludeTags + +`func (o *ThingClone) GetIncludeTags() bool` + +GetIncludeTags returns the IncludeTags field if non-nil, zero value otherwise. + +### GetIncludeTagsOk + +`func (o *ThingClone) GetIncludeTagsOk() (*bool, bool)` + +GetIncludeTagsOk returns a tuple with the IncludeTags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeTags + +`func (o *ThingClone) SetIncludeTags(v bool)` + +SetIncludeTags sets IncludeTags field to given value. + +### HasIncludeTags + +`func (o *ThingClone) HasIncludeTags() bool` + +HasIncludeTags returns a boolean if a field has been set. + +### GetName + +`func (o *ThingClone) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ThingClone) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ThingClone) SetName(v string)` + +SetName sets Name field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ThingCreate.md b/docs/ThingCreate.md index c90d6b4..6dc04b6 100644 --- a/docs/ThingCreate.md +++ b/docs/ThingCreate.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Id** | Pointer to **string** | The id of the thing | [optional] **Name** | Pointer to **string** | The friendly name of the thing | [optional] **Properties** | Pointer to [**[]Property**](Property.md) | The properties of the thing | [optional] +**Tags** | Pointer to [**[]Tag**](Tag.md) | Optional set of tags | [optional] **Timezone** | Pointer to **string** | A time zone name Check /v2/timezones for a list of valid names. | [optional] [default to "America/New_York"] **WebhookActive** | Pointer to **bool** | Webhook uri | [optional] **WebhookUri** | Pointer to **string** | Webhook uri | [optional] @@ -131,6 +132,31 @@ SetProperties sets Properties field to given value. HasProperties returns a boolean if a field has been set. +### GetTags + +`func (o *ThingCreate) GetTags() []Tag` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *ThingCreate) GetTagsOk() (*[]Tag, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *ThingCreate) SetTags(v []Tag)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *ThingCreate) HasTags() bool` + +HasTags returns a boolean if a field has been set. + ### GetTimezone `func (o *ThingCreate) GetTimezone() string` diff --git a/docs/ThingsV2Api.md b/docs/ThingsV2Api.md index 57f4c8e..69aa6ae 100644 --- a/docs/ThingsV2Api.md +++ b/docs/ThingsV2Api.md @@ -4,17 +4,93 @@ All URIs are relative to *https://api2.arduino.cc/iot* Method | HTTP request | Description ------------- | ------------- | ------------- +[**ThingsV2Clone**](ThingsV2Api.md#ThingsV2Clone) | **Put** /v2/things/{id}/clone | clone things_v2 [**ThingsV2Create**](ThingsV2Api.md#ThingsV2Create) | **Put** /v2/things | create things_v2 [**ThingsV2CreateSketch**](ThingsV2Api.md#ThingsV2CreateSketch) | **Put** /v2/things/{id}/sketch | createSketch things_v2 [**ThingsV2Delete**](ThingsV2Api.md#ThingsV2Delete) | **Delete** /v2/things/{id} | delete things_v2 [**ThingsV2DeleteSketch**](ThingsV2Api.md#ThingsV2DeleteSketch) | **Delete** /v2/things/{id}/sketch | deleteSketch things_v2 [**ThingsV2List**](ThingsV2Api.md#ThingsV2List) | **Get** /v2/things | list things_v2 [**ThingsV2Show**](ThingsV2Api.md#ThingsV2Show) | **Get** /v2/things/{id} | show things_v2 +[**ThingsV2Template**](ThingsV2Api.md#ThingsV2Template) | **Get** /v2/things/{id}/template | template things_v2 [**ThingsV2Update**](ThingsV2Api.md#ThingsV2Update) | **Post** /v2/things/{id} | update things_v2 [**ThingsV2UpdateSketch**](ThingsV2Api.md#ThingsV2UpdateSketch) | **Put** /v2/things/{id}/sketch/{sketchId} | updateSketch things_v2 +## ThingsV2Clone + +> ArduinoThing ThingsV2Clone(ctx, id).ThingClone(thingClone).XOrganization(xOrganization).Execute() + +clone things_v2 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/arduino/iot-client-go" +) + +func main() { + id := "id_example" // string | The id of the thing + thingClone := *openapiclient.NewThingClone("Name_example") // ThingClone | Payload to clone a new thing from an existing one + xOrganization := "xOrganization_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ThingsV2Api.ThingsV2Clone(context.Background(), id).ThingClone(thingClone).XOrganization(xOrganization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ThingsV2Api.ThingsV2Clone``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ThingsV2Clone`: ArduinoThing + fmt.Fprintf(os.Stdout, "Response from `ThingsV2Api.ThingsV2Clone`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The id of the thing | + +### Other Parameters + +Other parameters are passed through a pointer to a apiThingsV2CloneRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **thingClone** | [**ThingClone**](ThingClone.md) | Payload to clone a new thing from an existing one | + **xOrganization** | **string** | | + +### Return type + +[**ArduinoThing**](ArduinoThing.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.arduino.thing+json, application/vnd.goa.error+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## ThingsV2Create > ArduinoThing ThingsV2Create(ctx).ThingCreate(thingCreate).Force(force).XOrganization(xOrganization).Execute() @@ -453,6 +529,78 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## ThingsV2Template + +> ArduinoThingtemplate ThingsV2Template(ctx, id).XOrganization(xOrganization).Execute() + +template things_v2 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/arduino/iot-client-go" +) + +func main() { + id := "id_example" // string | The id of the thing + xOrganization := "xOrganization_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ThingsV2Api.ThingsV2Template(context.Background(), id).XOrganization(xOrganization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ThingsV2Api.ThingsV2Template``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ThingsV2Template`: ArduinoThingtemplate + fmt.Fprintf(os.Stdout, "Response from `ThingsV2Api.ThingsV2Template`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The id of the thing | + +### Other Parameters + +Other parameters are passed through a pointer to a apiThingsV2TemplateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrganization** | **string** | | + +### Return type + +[**ArduinoThingtemplate**](ArduinoThingtemplate.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.arduino.thingtemplate+json, application/vnd.goa.error+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## ThingsV2Update > ArduinoThing ThingsV2Update(ctx, id).ThingUpdate(thingUpdate).Force(force).XOrganization(xOrganization).Execute() diff --git a/model_arduino_dashboardv2template.go b/model_arduino_dashboardv2template.go new file mode 100644 index 0000000..b97d6d5 --- /dev/null +++ b/model_arduino_dashboardv2template.go @@ -0,0 +1,155 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ArduinoDashboardv2template type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoDashboardv2template{} + +// ArduinoDashboardv2template ArduinoDashboardv2template media type (default view) +type ArduinoDashboardv2template struct { + // The friendly name of the dashboard + Name string `json:"name"` + // ArduinoWidgetv2templateCollection is the media type for an array of ArduinoWidgetv2template (default view) + Widgets []ArduinoWidgetv2template `json:"widgets,omitempty"` +} + +// NewArduinoDashboardv2template instantiates a new ArduinoDashboardv2template object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoDashboardv2template(name string) *ArduinoDashboardv2template { + this := ArduinoDashboardv2template{} + this.Name = name + return &this +} + +// NewArduinoDashboardv2templateWithDefaults instantiates a new ArduinoDashboardv2template object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoDashboardv2templateWithDefaults() *ArduinoDashboardv2template { + this := ArduinoDashboardv2template{} + return &this +} + +// GetName returns the Name field value +func (o *ArduinoDashboardv2template) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ArduinoDashboardv2template) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ArduinoDashboardv2template) SetName(v string) { + o.Name = v +} + +// GetWidgets returns the Widgets field value if set, zero value otherwise. +func (o *ArduinoDashboardv2template) GetWidgets() []ArduinoWidgetv2template { + if o == nil || IsNil(o.Widgets) { + var ret []ArduinoWidgetv2template + return ret + } + return o.Widgets +} + +// GetWidgetsOk returns a tuple with the Widgets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoDashboardv2template) GetWidgetsOk() ([]ArduinoWidgetv2template, bool) { + if o == nil || IsNil(o.Widgets) { + return nil, false + } + return o.Widgets, true +} + +// HasWidgets returns a boolean if a field has been set. +func (o *ArduinoDashboardv2template) HasWidgets() bool { + if o != nil && !IsNil(o.Widgets) { + return true + } + + return false +} + +// SetWidgets gets a reference to the given []ArduinoWidgetv2template and assigns it to the Widgets field. +func (o *ArduinoDashboardv2template) SetWidgets(v []ArduinoWidgetv2template) { + o.Widgets = v +} + +func (o ArduinoDashboardv2template) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoDashboardv2template) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Widgets) { + toSerialize["widgets"] = o.Widgets + } + return toSerialize, nil +} + +type NullableArduinoDashboardv2template struct { + value *ArduinoDashboardv2template + isSet bool +} + +func (v NullableArduinoDashboardv2template) Get() *ArduinoDashboardv2template { + return v.value +} + +func (v *NullableArduinoDashboardv2template) Set(val *ArduinoDashboardv2template) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoDashboardv2template) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoDashboardv2template) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoDashboardv2template(val *ArduinoDashboardv2template) *NullableArduinoDashboardv2template { + return &NullableArduinoDashboardv2template{value: val, isSet: true} +} + +func (v NullableArduinoDashboardv2template) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoDashboardv2template) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_arduino_devicev2.go b/model_arduino_devicev2.go index 1c18b0f..4478553 100644 --- a/model_arduino_devicev2.go +++ b/model_arduino_devicev2.go @@ -24,6 +24,8 @@ type ArduinoDevicev2 struct { ConnectionType *string `json:"connection_type,omitempty"` // Creation date of the device CreatedAt *time.Time `json:"created_at,omitempty"` + // The connection status of the device + DeviceStatus *string `json:"device_status,omitempty"` // ArduinoDevicev2SimplePropertiesCollection is the media type for an array of ArduinoDevicev2SimpleProperties (default view) Events []ArduinoDevicev2SimpleProperties `json:"events,omitempty"` // The fully qualified board name @@ -155,6 +157,38 @@ func (o *ArduinoDevicev2) SetCreatedAt(v time.Time) { o.CreatedAt = &v } +// GetDeviceStatus returns the DeviceStatus field value if set, zero value otherwise. +func (o *ArduinoDevicev2) GetDeviceStatus() string { + if o == nil || IsNil(o.DeviceStatus) { + var ret string + return ret + } + return *o.DeviceStatus +} + +// GetDeviceStatusOk returns a tuple with the DeviceStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoDevicev2) GetDeviceStatusOk() (*string, bool) { + if o == nil || IsNil(o.DeviceStatus) { + return nil, false + } + return o.DeviceStatus, true +} + +// HasDeviceStatus returns a boolean if a field has been set. +func (o *ArduinoDevicev2) HasDeviceStatus() bool { + if o != nil && !IsNil(o.DeviceStatus) { + return true + } + + return false +} + +// SetDeviceStatus gets a reference to the given string and assigns it to the DeviceStatus field. +func (o *ArduinoDevicev2) SetDeviceStatus(v string) { + o.DeviceStatus = &v +} + // GetEvents returns the Events field value if set, zero value otherwise. func (o *ArduinoDevicev2) GetEvents() []ArduinoDevicev2SimpleProperties { if o == nil || IsNil(o.Events) { @@ -787,6 +821,9 @@ func (o ArduinoDevicev2) ToMap() (map[string]interface{}, error) { if !IsNil(o.CreatedAt) { toSerialize["created_at"] = o.CreatedAt } + if !IsNil(o.DeviceStatus) { + toSerialize["device_status"] = o.DeviceStatus + } if !IsNil(o.Events) { toSerialize["events"] = o.Events } diff --git a/model_arduino_devicev2_status_event.go b/model_arduino_devicev2_status_event.go new file mode 100644 index 0000000..37213c3 --- /dev/null +++ b/model_arduino_devicev2_status_event.go @@ -0,0 +1,147 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" + "time" +) + +// checks if the ArduinoDevicev2StatusEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoDevicev2StatusEvent{} + +// ArduinoDevicev2StatusEvent ArduinoDevicev2StatusEvent media type (default view) +type ArduinoDevicev2StatusEvent struct { + // Update timestamp of the status event + UpdatedAt time.Time `json:"updated_at"` + // The status event of the device + Value string `json:"value"` +} + +// NewArduinoDevicev2StatusEvent instantiates a new ArduinoDevicev2StatusEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoDevicev2StatusEvent(updatedAt time.Time, value string) *ArduinoDevicev2StatusEvent { + this := ArduinoDevicev2StatusEvent{} + this.UpdatedAt = updatedAt + this.Value = value + return &this +} + +// NewArduinoDevicev2StatusEventWithDefaults instantiates a new ArduinoDevicev2StatusEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoDevicev2StatusEventWithDefaults() *ArduinoDevicev2StatusEvent { + this := ArduinoDevicev2StatusEvent{} + return &this +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *ArduinoDevicev2StatusEvent) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *ArduinoDevicev2StatusEvent) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *ArduinoDevicev2StatusEvent) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetValue returns the Value field value +func (o *ArduinoDevicev2StatusEvent) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ArduinoDevicev2StatusEvent) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *ArduinoDevicev2StatusEvent) SetValue(v string) { + o.Value = v +} + +func (o ArduinoDevicev2StatusEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoDevicev2StatusEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["updated_at"] = o.UpdatedAt + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableArduinoDevicev2StatusEvent struct { + value *ArduinoDevicev2StatusEvent + isSet bool +} + +func (v NullableArduinoDevicev2StatusEvent) Get() *ArduinoDevicev2StatusEvent { + return v.value +} + +func (v *NullableArduinoDevicev2StatusEvent) Set(val *ArduinoDevicev2StatusEvent) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoDevicev2StatusEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoDevicev2StatusEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoDevicev2StatusEvent(val *ArduinoDevicev2StatusEvent) *NullableArduinoDevicev2StatusEvent { + return &NullableArduinoDevicev2StatusEvent{value: val, isSet: true} +} + +func (v NullableArduinoDevicev2StatusEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoDevicev2StatusEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_arduino_devicev2_status_events.go b/model_arduino_devicev2_status_events.go new file mode 100644 index 0000000..7177b80 --- /dev/null +++ b/model_arduino_devicev2_status_events.go @@ -0,0 +1,146 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ArduinoDevicev2StatusEvents type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoDevicev2StatusEvents{} + +// ArduinoDevicev2StatusEvents ArduinoDevicev2StatusEvents media type (default view) +type ArduinoDevicev2StatusEvents struct { + // ArduinoDevicev2StatusEventCollection is the media type for an array of ArduinoDevicev2StatusEvent (default view) + Events []ArduinoDevicev2StatusEvent `json:"events"` + // The id of the device + Id string `json:"id"` +} + +// NewArduinoDevicev2StatusEvents instantiates a new ArduinoDevicev2StatusEvents object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoDevicev2StatusEvents(events []ArduinoDevicev2StatusEvent, id string) *ArduinoDevicev2StatusEvents { + this := ArduinoDevicev2StatusEvents{} + this.Events = events + this.Id = id + return &this +} + +// NewArduinoDevicev2StatusEventsWithDefaults instantiates a new ArduinoDevicev2StatusEvents object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoDevicev2StatusEventsWithDefaults() *ArduinoDevicev2StatusEvents { + this := ArduinoDevicev2StatusEvents{} + return &this +} + +// GetEvents returns the Events field value +func (o *ArduinoDevicev2StatusEvents) GetEvents() []ArduinoDevicev2StatusEvent { + if o == nil { + var ret []ArduinoDevicev2StatusEvent + return ret + } + + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value +// and a boolean to check if the value has been set. +func (o *ArduinoDevicev2StatusEvents) GetEventsOk() ([]ArduinoDevicev2StatusEvent, bool) { + if o == nil { + return nil, false + } + return o.Events, true +} + +// SetEvents sets field value +func (o *ArduinoDevicev2StatusEvents) SetEvents(v []ArduinoDevicev2StatusEvent) { + o.Events = v +} + +// GetId returns the Id field value +func (o *ArduinoDevicev2StatusEvents) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ArduinoDevicev2StatusEvents) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ArduinoDevicev2StatusEvents) SetId(v string) { + o.Id = v +} + +func (o ArduinoDevicev2StatusEvents) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoDevicev2StatusEvents) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["events"] = o.Events + toSerialize["id"] = o.Id + return toSerialize, nil +} + +type NullableArduinoDevicev2StatusEvents struct { + value *ArduinoDevicev2StatusEvents + isSet bool +} + +func (v NullableArduinoDevicev2StatusEvents) Get() *ArduinoDevicev2StatusEvents { + return v.value +} + +func (v *NullableArduinoDevicev2StatusEvents) Set(val *ArduinoDevicev2StatusEvents) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoDevicev2StatusEvents) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoDevicev2StatusEvents) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoDevicev2StatusEvents(val *ArduinoDevicev2StatusEvents) *NullableArduinoDevicev2StatusEvents { + return &NullableArduinoDevicev2StatusEvents{value: val, isSet: true} +} + +func (v NullableArduinoDevicev2StatusEvents) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoDevicev2StatusEvents) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_arduino_property.go b/model_arduino_property.go index 211b8e0..7641c37 100644 --- a/model_arduino_property.go +++ b/model_arduino_property.go @@ -45,7 +45,7 @@ type ArduinoProperty struct { // The id of the sync pool SyncId *string `json:"sync_id,omitempty"` // The integer id of the property - Tag *float64 `json:"tag,omitempty"` + Tag *int64 `json:"tag,omitempty"` // The id of the thing ThingId string `json:"thing_id"` // The name of the associated thing @@ -442,9 +442,9 @@ func (o *ArduinoProperty) SetSyncId(v string) { } // GetTag returns the Tag field value if set, zero value otherwise. -func (o *ArduinoProperty) GetTag() float64 { +func (o *ArduinoProperty) GetTag() int64 { if o == nil || IsNil(o.Tag) { - var ret float64 + var ret int64 return ret } return *o.Tag @@ -452,7 +452,7 @@ func (o *ArduinoProperty) GetTag() float64 { // GetTagOk returns a tuple with the Tag field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArduinoProperty) GetTagOk() (*float64, bool) { +func (o *ArduinoProperty) GetTagOk() (*int64, bool) { if o == nil || IsNil(o.Tag) { return nil, false } @@ -468,8 +468,8 @@ func (o *ArduinoProperty) HasTag() bool { return false } -// SetTag gets a reference to the given float64 and assigns it to the Tag field. -func (o *ArduinoProperty) SetTag(v float64) { +// SetTag gets a reference to the given int64 and assigns it to the Tag field. +func (o *ArduinoProperty) SetTag(v int64) { o.Tag = &v } diff --git a/model_arduino_series_response.go b/model_arduino_series_response.go index 31341e3..3c00f80 100644 --- a/model_arduino_series_response.go +++ b/model_arduino_series_response.go @@ -20,6 +20,8 @@ var _ MappedNullable = &ArduinoSeriesResponse{} // ArduinoSeriesResponse ArduinoSeriesResponse media type (default view) type ArduinoSeriesResponse struct { + // Aggregation statistic function. For numeric values, AVG statistic is used by default. PCT_X compute the Xth approximate percentile (e.g. PCT_95 is the 95th approximate percentile). For boolean, BOOL_OR statistic is used as default. + Aggregation *string `json:"aggregation,omitempty"` // Total number of values in the array 'values' CountValues int64 `json:"count_values"` // From date @@ -32,7 +34,7 @@ type ArduinoSeriesResponse struct { Query string `json:"query"` // Response version RespVersion int64 `json:"resp_version"` - // Max of values + // Maximum number of values returned after data aggregation, if any SeriesLimit *int64 `json:"series_limit,omitempty"` // Status of the response Status string `json:"status"` @@ -74,6 +76,38 @@ func NewArduinoSeriesResponseWithDefaults() *ArduinoSeriesResponse { return &this } +// GetAggregation returns the Aggregation field value if set, zero value otherwise. +func (o *ArduinoSeriesResponse) GetAggregation() string { + if o == nil || IsNil(o.Aggregation) { + var ret string + return ret + } + return *o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoSeriesResponse) GetAggregationOk() (*string, bool) { + if o == nil || IsNil(o.Aggregation) { + return nil, false + } + return o.Aggregation, true +} + +// HasAggregation returns a boolean if a field has been set. +func (o *ArduinoSeriesResponse) HasAggregation() bool { + if o != nil && !IsNil(o.Aggregation) { + return true + } + + return false +} + +// SetAggregation gets a reference to the given string and assigns it to the Aggregation field. +func (o *ArduinoSeriesResponse) SetAggregation(v string) { + o.Aggregation = &v +} + // GetCountValues returns the CountValues field value func (o *ArduinoSeriesResponse) GetCountValues() int64 { if o == nil { @@ -364,6 +398,9 @@ func (o ArduinoSeriesResponse) MarshalJSON() ([]byte, error) { func (o ArduinoSeriesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Aggregation) { + toSerialize["aggregation"] = o.Aggregation + } toSerialize["count_values"] = o.CountValues toSerialize["from_date"] = o.FromDate toSerialize["interval"] = o.Interval diff --git a/model_arduino_templateproperty.go b/model_arduino_templateproperty.go new file mode 100644 index 0000000..636760d --- /dev/null +++ b/model_arduino_templateproperty.go @@ -0,0 +1,276 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ArduinoTemplateproperty type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoTemplateproperty{} + +// ArduinoTemplateproperty ArduinoTemplateproperty media type (default view) +type ArduinoTemplateproperty struct { + // The friendly name of the property + Name string `json:"name"` + // The permission of the property + Permission string `json:"permission"` + // The type of the property + Type string `json:"type"` + // The update frequency in seconds, or the amount of the property has to change in order to trigger an update + UpdateParameter *float64 `json:"update_parameter,omitempty"` + // The update strategy for the property value + UpdateStrategy string `json:"update_strategy"` + // The sketch variable name of the property + VariableName *string `json:"variable_name,omitempty"` +} + +// NewArduinoTemplateproperty instantiates a new ArduinoTemplateproperty object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoTemplateproperty(name string, permission string, type_ string, updateStrategy string) *ArduinoTemplateproperty { + this := ArduinoTemplateproperty{} + this.Name = name + this.Permission = permission + this.Type = type_ + this.UpdateStrategy = updateStrategy + return &this +} + +// NewArduinoTemplatepropertyWithDefaults instantiates a new ArduinoTemplateproperty object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoTemplatepropertyWithDefaults() *ArduinoTemplateproperty { + this := ArduinoTemplateproperty{} + return &this +} + +// GetName returns the Name field value +func (o *ArduinoTemplateproperty) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplateproperty) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ArduinoTemplateproperty) SetName(v string) { + o.Name = v +} + +// GetPermission returns the Permission field value +func (o *ArduinoTemplateproperty) GetPermission() string { + if o == nil { + var ret string + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplateproperty) GetPermissionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *ArduinoTemplateproperty) SetPermission(v string) { + o.Permission = v +} + +// GetType returns the Type field value +func (o *ArduinoTemplateproperty) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplateproperty) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ArduinoTemplateproperty) SetType(v string) { + o.Type = v +} + +// GetUpdateParameter returns the UpdateParameter field value if set, zero value otherwise. +func (o *ArduinoTemplateproperty) GetUpdateParameter() float64 { + if o == nil || IsNil(o.UpdateParameter) { + var ret float64 + return ret + } + return *o.UpdateParameter +} + +// GetUpdateParameterOk returns a tuple with the UpdateParameter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoTemplateproperty) GetUpdateParameterOk() (*float64, bool) { + if o == nil || IsNil(o.UpdateParameter) { + return nil, false + } + return o.UpdateParameter, true +} + +// HasUpdateParameter returns a boolean if a field has been set. +func (o *ArduinoTemplateproperty) HasUpdateParameter() bool { + if o != nil && !IsNil(o.UpdateParameter) { + return true + } + + return false +} + +// SetUpdateParameter gets a reference to the given float64 and assigns it to the UpdateParameter field. +func (o *ArduinoTemplateproperty) SetUpdateParameter(v float64) { + o.UpdateParameter = &v +} + +// GetUpdateStrategy returns the UpdateStrategy field value +func (o *ArduinoTemplateproperty) GetUpdateStrategy() string { + if o == nil { + var ret string + return ret + } + + return o.UpdateStrategy +} + +// GetUpdateStrategyOk returns a tuple with the UpdateStrategy field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplateproperty) GetUpdateStrategyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UpdateStrategy, true +} + +// SetUpdateStrategy sets field value +func (o *ArduinoTemplateproperty) SetUpdateStrategy(v string) { + o.UpdateStrategy = v +} + +// GetVariableName returns the VariableName field value if set, zero value otherwise. +func (o *ArduinoTemplateproperty) GetVariableName() string { + if o == nil || IsNil(o.VariableName) { + var ret string + return ret + } + return *o.VariableName +} + +// GetVariableNameOk returns a tuple with the VariableName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoTemplateproperty) GetVariableNameOk() (*string, bool) { + if o == nil || IsNil(o.VariableName) { + return nil, false + } + return o.VariableName, true +} + +// HasVariableName returns a boolean if a field has been set. +func (o *ArduinoTemplateproperty) HasVariableName() bool { + if o != nil && !IsNil(o.VariableName) { + return true + } + + return false +} + +// SetVariableName gets a reference to the given string and assigns it to the VariableName field. +func (o *ArduinoTemplateproperty) SetVariableName(v string) { + o.VariableName = &v +} + +func (o ArduinoTemplateproperty) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoTemplateproperty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["permission"] = o.Permission + toSerialize["type"] = o.Type + if !IsNil(o.UpdateParameter) { + toSerialize["update_parameter"] = o.UpdateParameter + } + toSerialize["update_strategy"] = o.UpdateStrategy + if !IsNil(o.VariableName) { + toSerialize["variable_name"] = o.VariableName + } + return toSerialize, nil +} + +type NullableArduinoTemplateproperty struct { + value *ArduinoTemplateproperty + isSet bool +} + +func (v NullableArduinoTemplateproperty) Get() *ArduinoTemplateproperty { + return v.value +} + +func (v *NullableArduinoTemplateproperty) Set(val *ArduinoTemplateproperty) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoTemplateproperty) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoTemplateproperty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoTemplateproperty(val *ArduinoTemplateproperty) *NullableArduinoTemplateproperty { + return &NullableArduinoTemplateproperty{value: val, isSet: true} +} + +func (v NullableArduinoTemplateproperty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoTemplateproperty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_arduino_templatevariable.go b/model_arduino_templatevariable.go new file mode 100644 index 0000000..6074e01 --- /dev/null +++ b/model_arduino_templatevariable.go @@ -0,0 +1,266 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ArduinoTemplatevariable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoTemplatevariable{} + +// ArduinoTemplatevariable ArduinoTemplatevariable media type (default view) +type ArduinoTemplatevariable struct { + // The name of the variable + Name string `json:"name"` + // The permission of the linked variable + Permission string `json:"permission"` + // The name of the related thing + ThingId string `json:"thing_id"` + ThingTimezone *ArduinoTimezone `json:"thing_timezone,omitempty"` + // The type of the variable + Type string `json:"type"` + // The name of the variable in the code + VariableId string `json:"variable_id"` +} + +// NewArduinoTemplatevariable instantiates a new ArduinoTemplatevariable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoTemplatevariable(name string, permission string, thingId string, type_ string, variableId string) *ArduinoTemplatevariable { + this := ArduinoTemplatevariable{} + this.Name = name + this.Permission = permission + this.ThingId = thingId + this.Type = type_ + this.VariableId = variableId + return &this +} + +// NewArduinoTemplatevariableWithDefaults instantiates a new ArduinoTemplatevariable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoTemplatevariableWithDefaults() *ArduinoTemplatevariable { + this := ArduinoTemplatevariable{} + return &this +} + +// GetName returns the Name field value +func (o *ArduinoTemplatevariable) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplatevariable) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ArduinoTemplatevariable) SetName(v string) { + o.Name = v +} + +// GetPermission returns the Permission field value +func (o *ArduinoTemplatevariable) GetPermission() string { + if o == nil { + var ret string + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplatevariable) GetPermissionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *ArduinoTemplatevariable) SetPermission(v string) { + o.Permission = v +} + +// GetThingId returns the ThingId field value +func (o *ArduinoTemplatevariable) GetThingId() string { + if o == nil { + var ret string + return ret + } + + return o.ThingId +} + +// GetThingIdOk returns a tuple with the ThingId field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplatevariable) GetThingIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ThingId, true +} + +// SetThingId sets field value +func (o *ArduinoTemplatevariable) SetThingId(v string) { + o.ThingId = v +} + +// GetThingTimezone returns the ThingTimezone field value if set, zero value otherwise. +func (o *ArduinoTemplatevariable) GetThingTimezone() ArduinoTimezone { + if o == nil || IsNil(o.ThingTimezone) { + var ret ArduinoTimezone + return ret + } + return *o.ThingTimezone +} + +// GetThingTimezoneOk returns a tuple with the ThingTimezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoTemplatevariable) GetThingTimezoneOk() (*ArduinoTimezone, bool) { + if o == nil || IsNil(o.ThingTimezone) { + return nil, false + } + return o.ThingTimezone, true +} + +// HasThingTimezone returns a boolean if a field has been set. +func (o *ArduinoTemplatevariable) HasThingTimezone() bool { + if o != nil && !IsNil(o.ThingTimezone) { + return true + } + + return false +} + +// SetThingTimezone gets a reference to the given ArduinoTimezone and assigns it to the ThingTimezone field. +func (o *ArduinoTemplatevariable) SetThingTimezone(v ArduinoTimezone) { + o.ThingTimezone = &v +} + +// GetType returns the Type field value +func (o *ArduinoTemplatevariable) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplatevariable) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ArduinoTemplatevariable) SetType(v string) { + o.Type = v +} + +// GetVariableId returns the VariableId field value +func (o *ArduinoTemplatevariable) GetVariableId() string { + if o == nil { + var ret string + return ret + } + + return o.VariableId +} + +// GetVariableIdOk returns a tuple with the VariableId field value +// and a boolean to check if the value has been set. +func (o *ArduinoTemplatevariable) GetVariableIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VariableId, true +} + +// SetVariableId sets field value +func (o *ArduinoTemplatevariable) SetVariableId(v string) { + o.VariableId = v +} + +func (o ArduinoTemplatevariable) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoTemplatevariable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["permission"] = o.Permission + toSerialize["thing_id"] = o.ThingId + if !IsNil(o.ThingTimezone) { + toSerialize["thing_timezone"] = o.ThingTimezone + } + toSerialize["type"] = o.Type + toSerialize["variable_id"] = o.VariableId + return toSerialize, nil +} + +type NullableArduinoTemplatevariable struct { + value *ArduinoTemplatevariable + isSet bool +} + +func (v NullableArduinoTemplatevariable) Get() *ArduinoTemplatevariable { + return v.value +} + +func (v *NullableArduinoTemplatevariable) Set(val *ArduinoTemplatevariable) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoTemplatevariable) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoTemplatevariable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoTemplatevariable(val *ArduinoTemplatevariable) *NullableArduinoTemplatevariable { + return &NullableArduinoTemplatevariable{value: val, isSet: true} +} + +func (v NullableArduinoTemplatevariable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoTemplatevariable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_arduino_thingtemplate.go b/model_arduino_thingtemplate.go new file mode 100644 index 0000000..e8af774 --- /dev/null +++ b/model_arduino_thingtemplate.go @@ -0,0 +1,294 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ArduinoThingtemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoThingtemplate{} + +// ArduinoThingtemplate ArduinoThingtemplate media type (default view) +type ArduinoThingtemplate struct { + // The friendly name of the thing + Name string `json:"name"` + // Id of the organization the thing belongs to + OrganizationId *string `json:"organization_id,omitempty"` + // ArduinoTemplatepropertyCollection is the media type for an array of ArduinoTemplateproperty (default view) + Properties []ArduinoTemplateproperty `json:"properties,omitempty"` + // Tags of the thing + Tags []Tag `json:"tags,omitempty"` + // Time zone of the thing + Timezone string `json:"timezone"` + // Webhook uri + WebhookUri *string `json:"webhook_uri,omitempty"` +} + +// NewArduinoThingtemplate instantiates a new ArduinoThingtemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoThingtemplate(name string, timezone string) *ArduinoThingtemplate { + this := ArduinoThingtemplate{} + this.Name = name + this.Timezone = timezone + return &this +} + +// NewArduinoThingtemplateWithDefaults instantiates a new ArduinoThingtemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoThingtemplateWithDefaults() *ArduinoThingtemplate { + this := ArduinoThingtemplate{} + return &this +} + +// GetName returns the Name field value +func (o *ArduinoThingtemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ArduinoThingtemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ArduinoThingtemplate) SetName(v string) { + o.Name = v +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *ArduinoThingtemplate) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoThingtemplate) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *ArduinoThingtemplate) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *ArduinoThingtemplate) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *ArduinoThingtemplate) GetProperties() []ArduinoTemplateproperty { + if o == nil || IsNil(o.Properties) { + var ret []ArduinoTemplateproperty + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoThingtemplate) GetPropertiesOk() ([]ArduinoTemplateproperty, bool) { + if o == nil || IsNil(o.Properties) { + return nil, false + } + return o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *ArduinoThingtemplate) HasProperties() bool { + if o != nil && !IsNil(o.Properties) { + return true + } + + return false +} + +// SetProperties gets a reference to the given []ArduinoTemplateproperty and assigns it to the Properties field. +func (o *ArduinoThingtemplate) SetProperties(v []ArduinoTemplateproperty) { + o.Properties = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ArduinoThingtemplate) GetTags() []Tag { + if o == nil || IsNil(o.Tags) { + var ret []Tag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoThingtemplate) GetTagsOk() ([]Tag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ArduinoThingtemplate) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *ArduinoThingtemplate) SetTags(v []Tag) { + o.Tags = v +} + +// GetTimezone returns the Timezone field value +func (o *ArduinoThingtemplate) GetTimezone() string { + if o == nil { + var ret string + return ret + } + + return o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value +// and a boolean to check if the value has been set. +func (o *ArduinoThingtemplate) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timezone, true +} + +// SetTimezone sets field value +func (o *ArduinoThingtemplate) SetTimezone(v string) { + o.Timezone = v +} + +// GetWebhookUri returns the WebhookUri field value if set, zero value otherwise. +func (o *ArduinoThingtemplate) GetWebhookUri() string { + if o == nil || IsNil(o.WebhookUri) { + var ret string + return ret + } + return *o.WebhookUri +} + +// GetWebhookUriOk returns a tuple with the WebhookUri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoThingtemplate) GetWebhookUriOk() (*string, bool) { + if o == nil || IsNil(o.WebhookUri) { + return nil, false + } + return o.WebhookUri, true +} + +// HasWebhookUri returns a boolean if a field has been set. +func (o *ArduinoThingtemplate) HasWebhookUri() bool { + if o != nil && !IsNil(o.WebhookUri) { + return true + } + + return false +} + +// SetWebhookUri gets a reference to the given string and assigns it to the WebhookUri field. +func (o *ArduinoThingtemplate) SetWebhookUri(v string) { + o.WebhookUri = &v +} + +func (o ArduinoThingtemplate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoThingtemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.OrganizationId) { + toSerialize["organization_id"] = o.OrganizationId + } + if !IsNil(o.Properties) { + toSerialize["properties"] = o.Properties + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["timezone"] = o.Timezone + if !IsNil(o.WebhookUri) { + toSerialize["webhook_uri"] = o.WebhookUri + } + return toSerialize, nil +} + +type NullableArduinoThingtemplate struct { + value *ArduinoThingtemplate + isSet bool +} + +func (v NullableArduinoThingtemplate) Get() *ArduinoThingtemplate { + return v.value +} + +func (v *NullableArduinoThingtemplate) Set(val *ArduinoThingtemplate) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoThingtemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoThingtemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoThingtemplate(val *ArduinoThingtemplate) *NullableArduinoThingtemplate { + return &NullableArduinoThingtemplate{value: val, isSet: true} +} + +func (v NullableArduinoThingtemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoThingtemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_arduino_timezone.go b/model_arduino_timezone.go index c0c915f..2ef67fa 100644 --- a/model_arduino_timezone.go +++ b/model_arduino_timezone.go @@ -25,17 +25,18 @@ type ArduinoTimezone struct { // Current UTC DST offset in seconds. Offset int64 `json:"offset"` // Date until the offset is valid. - Until *time.Time `json:"until,omitempty"` + Until time.Time `json:"until"` } // NewArduinoTimezone instantiates a new ArduinoTimezone object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewArduinoTimezone(name string, offset int64) *ArduinoTimezone { +func NewArduinoTimezone(name string, offset int64, until time.Time) *ArduinoTimezone { this := ArduinoTimezone{} this.Name = name this.Offset = offset + this.Until = until return &this } @@ -95,36 +96,28 @@ func (o *ArduinoTimezone) SetOffset(v int64) { o.Offset = v } -// GetUntil returns the Until field value if set, zero value otherwise. +// GetUntil returns the Until field value func (o *ArduinoTimezone) GetUntil() time.Time { - if o == nil || IsNil(o.Until) { + if o == nil { var ret time.Time return ret } - return *o.Until + + return o.Until } -// GetUntilOk returns a tuple with the Until field value if set, nil otherwise +// GetUntilOk returns a tuple with the Until field value // and a boolean to check if the value has been set. func (o *ArduinoTimezone) GetUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.Until) { + if o == nil { return nil, false } - return o.Until, true -} - -// HasUntil returns a boolean if a field has been set. -func (o *ArduinoTimezone) HasUntil() bool { - if o != nil && !IsNil(o.Until) { - return true - } - - return false + return &o.Until, true } -// SetUntil gets a reference to the given time.Time and assigns it to the Until field. +// SetUntil sets field value func (o *ArduinoTimezone) SetUntil(v time.Time) { - o.Until = &v + o.Until = v } func (o ArduinoTimezone) MarshalJSON() ([]byte, error) { @@ -139,9 +132,7 @@ func (o ArduinoTimezone) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["offset"] = o.Offset - if !IsNil(o.Until) { - toSerialize["until"] = o.Until - } + toSerialize["until"] = o.Until return toSerialize, nil } diff --git a/model_arduino_widgetv2.go b/model_arduino_widgetv2.go index 8861b59..6ffed28 100644 --- a/model_arduino_widgetv2.go +++ b/model_arduino_widgetv2.go @@ -17,7 +17,7 @@ import ( // checks if the ArduinoWidgetv2 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ArduinoWidgetv2{} -// ArduinoWidgetv2 Widget describes a dashboard widget (default view) +// ArduinoWidgetv2 ArduinoWidgetv2 media type (default view) type ArduinoWidgetv2 struct { // True if the linked variables permissions are incompatible with the widget HasPermissionIncompatibility *bool `json:"has_permission_incompatibility,omitempty"` diff --git a/model_arduino_widgetv2template.go b/model_arduino_widgetv2template.go new file mode 100644 index 0000000..0e99d76 --- /dev/null +++ b/model_arduino_widgetv2template.go @@ -0,0 +1,480 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ArduinoWidgetv2template type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ArduinoWidgetv2template{} + +// ArduinoWidgetv2template ArduinoWidgetv2template media type (default view) +type ArduinoWidgetv2template struct { + // Widget current height for desktop + Height int64 `json:"height"` + // Widget current height for mobile + HeightMobile *int64 `json:"height_mobile,omitempty"` + // The name of the widget + Name *string `json:"name,omitempty"` + // Widget options + Options map[string]interface{} `json:"options"` + // The type of the widget + Type string `json:"type"` + // ArduinoTemplatevariableCollection is the media type for an array of ArduinoTemplatevariable (default view) + Variables []ArduinoTemplatevariable `json:"variables,omitempty"` + // Widget current width for desktop + Width int64 `json:"width"` + // Widget current width for mobile + WidthMobile *int64 `json:"width_mobile,omitempty"` + // Widget x position for desktop + X int64 `json:"x"` + // Widget x position for mobile + XMobile *int64 `json:"x_mobile,omitempty"` + // Widget y position for desktop + Y int64 `json:"y"` + // Widget y position for mobile + YMobile *int64 `json:"y_mobile,omitempty"` +} + +// NewArduinoWidgetv2template instantiates a new ArduinoWidgetv2template object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArduinoWidgetv2template(height int64, options map[string]interface{}, type_ string, width int64, x int64, y int64) *ArduinoWidgetv2template { + this := ArduinoWidgetv2template{} + this.Height = height + this.Options = options + this.Type = type_ + this.Width = width + this.X = x + this.Y = y + return &this +} + +// NewArduinoWidgetv2templateWithDefaults instantiates a new ArduinoWidgetv2template object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArduinoWidgetv2templateWithDefaults() *ArduinoWidgetv2template { + this := ArduinoWidgetv2template{} + return &this +} + +// GetHeight returns the Height field value +func (o *ArduinoWidgetv2template) GetHeight() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Height +} + +// GetHeightOk returns a tuple with the Height field value +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetHeightOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Height, true +} + +// SetHeight sets field value +func (o *ArduinoWidgetv2template) SetHeight(v int64) { + o.Height = v +} + +// GetHeightMobile returns the HeightMobile field value if set, zero value otherwise. +func (o *ArduinoWidgetv2template) GetHeightMobile() int64 { + if o == nil || IsNil(o.HeightMobile) { + var ret int64 + return ret + } + return *o.HeightMobile +} + +// GetHeightMobileOk returns a tuple with the HeightMobile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetHeightMobileOk() (*int64, bool) { + if o == nil || IsNil(o.HeightMobile) { + return nil, false + } + return o.HeightMobile, true +} + +// HasHeightMobile returns a boolean if a field has been set. +func (o *ArduinoWidgetv2template) HasHeightMobile() bool { + if o != nil && !IsNil(o.HeightMobile) { + return true + } + + return false +} + +// SetHeightMobile gets a reference to the given int64 and assigns it to the HeightMobile field. +func (o *ArduinoWidgetv2template) SetHeightMobile(v int64) { + o.HeightMobile = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ArduinoWidgetv2template) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ArduinoWidgetv2template) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ArduinoWidgetv2template) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value +func (o *ArduinoWidgetv2template) GetOptions() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetOptionsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Options, true +} + +// SetOptions sets field value +func (o *ArduinoWidgetv2template) SetOptions(v map[string]interface{}) { + o.Options = v +} + +// GetType returns the Type field value +func (o *ArduinoWidgetv2template) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ArduinoWidgetv2template) SetType(v string) { + o.Type = v +} + +// GetVariables returns the Variables field value if set, zero value otherwise. +func (o *ArduinoWidgetv2template) GetVariables() []ArduinoTemplatevariable { + if o == nil || IsNil(o.Variables) { + var ret []ArduinoTemplatevariable + return ret + } + return o.Variables +} + +// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetVariablesOk() ([]ArduinoTemplatevariable, bool) { + if o == nil || IsNil(o.Variables) { + return nil, false + } + return o.Variables, true +} + +// HasVariables returns a boolean if a field has been set. +func (o *ArduinoWidgetv2template) HasVariables() bool { + if o != nil && !IsNil(o.Variables) { + return true + } + + return false +} + +// SetVariables gets a reference to the given []ArduinoTemplatevariable and assigns it to the Variables field. +func (o *ArduinoWidgetv2template) SetVariables(v []ArduinoTemplatevariable) { + o.Variables = v +} + +// GetWidth returns the Width field value +func (o *ArduinoWidgetv2template) GetWidth() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Width +} + +// GetWidthOk returns a tuple with the Width field value +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetWidthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Width, true +} + +// SetWidth sets field value +func (o *ArduinoWidgetv2template) SetWidth(v int64) { + o.Width = v +} + +// GetWidthMobile returns the WidthMobile field value if set, zero value otherwise. +func (o *ArduinoWidgetv2template) GetWidthMobile() int64 { + if o == nil || IsNil(o.WidthMobile) { + var ret int64 + return ret + } + return *o.WidthMobile +} + +// GetWidthMobileOk returns a tuple with the WidthMobile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetWidthMobileOk() (*int64, bool) { + if o == nil || IsNil(o.WidthMobile) { + return nil, false + } + return o.WidthMobile, true +} + +// HasWidthMobile returns a boolean if a field has been set. +func (o *ArduinoWidgetv2template) HasWidthMobile() bool { + if o != nil && !IsNil(o.WidthMobile) { + return true + } + + return false +} + +// SetWidthMobile gets a reference to the given int64 and assigns it to the WidthMobile field. +func (o *ArduinoWidgetv2template) SetWidthMobile(v int64) { + o.WidthMobile = &v +} + +// GetX returns the X field value +func (o *ArduinoWidgetv2template) GetX() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.X +} + +// GetXOk returns a tuple with the X field value +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetXOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.X, true +} + +// SetX sets field value +func (o *ArduinoWidgetv2template) SetX(v int64) { + o.X = v +} + +// GetXMobile returns the XMobile field value if set, zero value otherwise. +func (o *ArduinoWidgetv2template) GetXMobile() int64 { + if o == nil || IsNil(o.XMobile) { + var ret int64 + return ret + } + return *o.XMobile +} + +// GetXMobileOk returns a tuple with the XMobile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetXMobileOk() (*int64, bool) { + if o == nil || IsNil(o.XMobile) { + return nil, false + } + return o.XMobile, true +} + +// HasXMobile returns a boolean if a field has been set. +func (o *ArduinoWidgetv2template) HasXMobile() bool { + if o != nil && !IsNil(o.XMobile) { + return true + } + + return false +} + +// SetXMobile gets a reference to the given int64 and assigns it to the XMobile field. +func (o *ArduinoWidgetv2template) SetXMobile(v int64) { + o.XMobile = &v +} + +// GetY returns the Y field value +func (o *ArduinoWidgetv2template) GetY() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Y +} + +// GetYOk returns a tuple with the Y field value +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetYOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Y, true +} + +// SetY sets field value +func (o *ArduinoWidgetv2template) SetY(v int64) { + o.Y = v +} + +// GetYMobile returns the YMobile field value if set, zero value otherwise. +func (o *ArduinoWidgetv2template) GetYMobile() int64 { + if o == nil || IsNil(o.YMobile) { + var ret int64 + return ret + } + return *o.YMobile +} + +// GetYMobileOk returns a tuple with the YMobile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArduinoWidgetv2template) GetYMobileOk() (*int64, bool) { + if o == nil || IsNil(o.YMobile) { + return nil, false + } + return o.YMobile, true +} + +// HasYMobile returns a boolean if a field has been set. +func (o *ArduinoWidgetv2template) HasYMobile() bool { + if o != nil && !IsNil(o.YMobile) { + return true + } + + return false +} + +// SetYMobile gets a reference to the given int64 and assigns it to the YMobile field. +func (o *ArduinoWidgetv2template) SetYMobile(v int64) { + o.YMobile = &v +} + +func (o ArduinoWidgetv2template) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ArduinoWidgetv2template) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["height"] = o.Height + if !IsNil(o.HeightMobile) { + toSerialize["height_mobile"] = o.HeightMobile + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["options"] = o.Options + toSerialize["type"] = o.Type + if !IsNil(o.Variables) { + toSerialize["variables"] = o.Variables + } + toSerialize["width"] = o.Width + if !IsNil(o.WidthMobile) { + toSerialize["width_mobile"] = o.WidthMobile + } + toSerialize["x"] = o.X + if !IsNil(o.XMobile) { + toSerialize["x_mobile"] = o.XMobile + } + toSerialize["y"] = o.Y + if !IsNil(o.YMobile) { + toSerialize["y_mobile"] = o.YMobile + } + return toSerialize, nil +} + +type NullableArduinoWidgetv2template struct { + value *ArduinoWidgetv2template + isSet bool +} + +func (v NullableArduinoWidgetv2template) Get() *ArduinoWidgetv2template { + return v.value +} + +func (v *NullableArduinoWidgetv2template) Set(val *ArduinoWidgetv2template) { + v.value = val + v.isSet = true +} + +func (v NullableArduinoWidgetv2template) IsSet() bool { + return v.isSet +} + +func (v *NullableArduinoWidgetv2template) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArduinoWidgetv2template(val *ArduinoWidgetv2template) *NullableArduinoWidgetv2template { + return &NullableArduinoWidgetv2template{value: val, isSet: true} +} + +func (v NullableArduinoWidgetv2template) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArduinoWidgetv2template) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_query_raw_request_media_v1.go b/model_batch_query_raw_request_media_v1.go index c2f28d4..f408f9f 100644 --- a/model_batch_query_raw_request_media_v1.go +++ b/model_batch_query_raw_request_media_v1.go @@ -22,7 +22,7 @@ var _ MappedNullable = &BatchQueryRawRequestMediaV1{} type BatchQueryRawRequestMediaV1 struct { // From timestamp From *time.Time `json:"from,omitempty"` - // Query + // Data selection query (e.g. property.2a99729d-2556-4220-a139-023348a1e6b5) Q string `json:"q"` // Max of values SeriesLimit *int64 `json:"series_limit,omitempty"` diff --git a/model_batch_query_request_media_v1.go b/model_batch_query_request_media_v1.go index 0a7db09..89f66d1 100644 --- a/model_batch_query_request_media_v1.go +++ b/model_batch_query_request_media_v1.go @@ -20,13 +20,15 @@ var _ MappedNullable = &BatchQueryRequestMediaV1{} // BatchQueryRequestMediaV1 struct for BatchQueryRequestMediaV1 type BatchQueryRequestMediaV1 struct { + // Aggregation statistic function. For numeric values, AVG statistic is used by default. PCT_X compute the Xth approximate percentile (e.g. PCT_95 is the 95th approximate percentile). For boolean, BOOL_OR statistic is used as default. + Aggregation *string `json:"aggregation,omitempty"` // From timestamp From time.Time `json:"from"` - // Resolution in seconds + // Resolution in seconds (max allowed: 86400) Interval *int64 `json:"interval,omitempty"` - // Query + // Data selection query (e.g. property.2a99729d-2556-4220-a139-023348a1e6b5) Q string `json:"q"` - // Max of values + // Maximum number of values returned after data aggregation, if any (default: 300, limit: 1000) SeriesLimit *int64 `json:"series_limit,omitempty"` // To timestamp To time.Time `json:"to"` @@ -52,6 +54,38 @@ func NewBatchQueryRequestMediaV1WithDefaults() *BatchQueryRequestMediaV1 { return &this } +// GetAggregation returns the Aggregation field value if set, zero value otherwise. +func (o *BatchQueryRequestMediaV1) GetAggregation() string { + if o == nil || IsNil(o.Aggregation) { + var ret string + return ret + } + return *o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BatchQueryRequestMediaV1) GetAggregationOk() (*string, bool) { + if o == nil || IsNil(o.Aggregation) { + return nil, false + } + return o.Aggregation, true +} + +// HasAggregation returns a boolean if a field has been set. +func (o *BatchQueryRequestMediaV1) HasAggregation() bool { + if o != nil && !IsNil(o.Aggregation) { + return true + } + + return false +} + +// SetAggregation gets a reference to the given string and assigns it to the Aggregation field. +func (o *BatchQueryRequestMediaV1) SetAggregation(v string) { + o.Aggregation = &v +} + // GetFrom returns the From field value func (o *BatchQueryRequestMediaV1) GetFrom() time.Time { if o == nil { @@ -198,6 +232,9 @@ func (o BatchQueryRequestMediaV1) MarshalJSON() ([]byte, error) { func (o BatchQueryRequestMediaV1) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Aggregation) { + toSerialize["aggregation"] = o.Aggregation + } toSerialize["from"] = o.From if !IsNil(o.Interval) { toSerialize["interval"] = o.Interval diff --git a/model_clone.go b/model_clone.go new file mode 100644 index 0000000..efc4674 --- /dev/null +++ b/model_clone.go @@ -0,0 +1,127 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the Clone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Clone{} + +// Clone struct for Clone +type Clone struct { + // The overrides to apply to the cloned dashboard. An override is a tuple of ids: the id of the thing to override and the id of the new thing to link + Overrides []Override `json:"overrides,omitempty"` +} + +// NewClone instantiates a new Clone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClone() *Clone { + this := Clone{} + return &this +} + +// NewCloneWithDefaults instantiates a new Clone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneWithDefaults() *Clone { + this := Clone{} + return &this +} + +// GetOverrides returns the Overrides field value if set, zero value otherwise. +func (o *Clone) GetOverrides() []Override { + if o == nil || IsNil(o.Overrides) { + var ret []Override + return ret + } + return o.Overrides +} + +// GetOverridesOk returns a tuple with the Overrides field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Clone) GetOverridesOk() ([]Override, bool) { + if o == nil || IsNil(o.Overrides) { + return nil, false + } + return o.Overrides, true +} + +// HasOverrides returns a boolean if a field has been set. +func (o *Clone) HasOverrides() bool { + if o != nil && !IsNil(o.Overrides) { + return true + } + + return false +} + +// SetOverrides gets a reference to the given []Override and assigns it to the Overrides field. +func (o *Clone) SetOverrides(v []Override) { + o.Overrides = v +} + +func (o Clone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Clone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Overrides) { + toSerialize["overrides"] = o.Overrides + } + return toSerialize, nil +} + +type NullableClone struct { + value *Clone + isSet bool +} + +func (v NullableClone) Get() *Clone { + return v.value +} + +func (v *NullableClone) Set(val *Clone) { + v.value = val + v.isSet = true +} + +func (v NullableClone) IsSet() bool { + return v.isSet +} + +func (v *NullableClone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClone(val *Clone) *NullableClone { + return &NullableClone{value: val, isSet: true} +} + +func (v NullableClone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_override.go b/model_override.go new file mode 100644 index 0000000..e1d1e22 --- /dev/null +++ b/model_override.go @@ -0,0 +1,146 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the Override type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Override{} + +// Override struct for Override +type Override struct { + // The id of the new thing to link + NewThingId string `json:"new_thing_id"` + // The id of the thing to override + OldThingId string `json:"old_thing_id"` +} + +// NewOverride instantiates a new Override object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverride(newThingId string, oldThingId string) *Override { + this := Override{} + this.NewThingId = newThingId + this.OldThingId = oldThingId + return &this +} + +// NewOverrideWithDefaults instantiates a new Override object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverrideWithDefaults() *Override { + this := Override{} + return &this +} + +// GetNewThingId returns the NewThingId field value +func (o *Override) GetNewThingId() string { + if o == nil { + var ret string + return ret + } + + return o.NewThingId +} + +// GetNewThingIdOk returns a tuple with the NewThingId field value +// and a boolean to check if the value has been set. +func (o *Override) GetNewThingIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NewThingId, true +} + +// SetNewThingId sets field value +func (o *Override) SetNewThingId(v string) { + o.NewThingId = v +} + +// GetOldThingId returns the OldThingId field value +func (o *Override) GetOldThingId() string { + if o == nil { + var ret string + return ret + } + + return o.OldThingId +} + +// GetOldThingIdOk returns a tuple with the OldThingId field value +// and a boolean to check if the value has been set. +func (o *Override) GetOldThingIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OldThingId, true +} + +// SetOldThingId sets field value +func (o *Override) SetOldThingId(v string) { + o.OldThingId = v +} + +func (o Override) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Override) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["new_thing_id"] = o.NewThingId + toSerialize["old_thing_id"] = o.OldThingId + return toSerialize, nil +} + +type NullableOverride struct { + value *Override + isSet bool +} + +func (v NullableOverride) Get() *Override { + return v.value +} + +func (v *NullableOverride) Set(val *Override) { + v.value = val + v.isSet = true +} + +func (v NullableOverride) IsSet() bool { + return v.isSet +} + +func (v *NullableOverride) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverride(val *Override) *NullableOverride { + return &NullableOverride{value: val, isSet: true} +} + +func (v NullableOverride) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverride) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_property.go b/model_property.go index 24bc75f..e029ee2 100644 --- a/model_property.go +++ b/model_property.go @@ -30,7 +30,7 @@ type Property struct { // If true, data will persist into a timeseries database Persist *bool `json:"persist,omitempty"` // The integer id of the property - Tag *float64 `json:"tag,omitempty"` + Tag *int64 `json:"tag,omitempty"` // The type of the property Type string `json:"type"` // The update frequency in seconds, or the amount of the property has to change in order to trigger an update @@ -211,9 +211,9 @@ func (o *Property) SetPersist(v bool) { } // GetTag returns the Tag field value if set, zero value otherwise. -func (o *Property) GetTag() float64 { +func (o *Property) GetTag() int64 { if o == nil || IsNil(o.Tag) { - var ret float64 + var ret int64 return ret } return *o.Tag @@ -221,7 +221,7 @@ func (o *Property) GetTag() float64 { // GetTagOk returns a tuple with the Tag field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Property) GetTagOk() (*float64, bool) { +func (o *Property) GetTagOk() (*int64, bool) { if o == nil || IsNil(o.Tag) { return nil, false } @@ -237,8 +237,8 @@ func (o *Property) HasTag() bool { return false } -// SetTag gets a reference to the given float64 and assigns it to the Tag field. -func (o *Property) SetTag(v float64) { +// SetTag gets a reference to the given int64 and assigns it to the Tag field. +func (o *Property) SetTag(v int64) { o.Tag = &v } diff --git a/model_thing_clone.go b/model_thing_clone.go new file mode 100644 index 0000000..b4ee637 --- /dev/null +++ b/model_thing_clone.go @@ -0,0 +1,155 @@ +/* +Arduino IoT Cloud API + + 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) + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iot + +import ( + "encoding/json" +) + +// checks if the ThingClone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ThingClone{} + +// ThingClone Payload to clone a new thing from an existing one +type ThingClone struct { + // Include tags in clone procedure + IncludeTags *bool `json:"include_tags,omitempty"` + // The friendly name of the thing + Name string `json:"name"` +} + +// NewThingClone instantiates a new ThingClone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewThingClone(name string) *ThingClone { + this := ThingClone{} + this.Name = name + return &this +} + +// NewThingCloneWithDefaults instantiates a new ThingClone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewThingCloneWithDefaults() *ThingClone { + this := ThingClone{} + return &this +} + +// GetIncludeTags returns the IncludeTags field value if set, zero value otherwise. +func (o *ThingClone) GetIncludeTags() bool { + if o == nil || IsNil(o.IncludeTags) { + var ret bool + return ret + } + return *o.IncludeTags +} + +// GetIncludeTagsOk returns a tuple with the IncludeTags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThingClone) GetIncludeTagsOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeTags) { + return nil, false + } + return o.IncludeTags, true +} + +// HasIncludeTags returns a boolean if a field has been set. +func (o *ThingClone) HasIncludeTags() bool { + if o != nil && !IsNil(o.IncludeTags) { + return true + } + + return false +} + +// SetIncludeTags gets a reference to the given bool and assigns it to the IncludeTags field. +func (o *ThingClone) SetIncludeTags(v bool) { + o.IncludeTags = &v +} + +// GetName returns the Name field value +func (o *ThingClone) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ThingClone) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ThingClone) SetName(v string) { + o.Name = v +} + +func (o ThingClone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ThingClone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IncludeTags) { + toSerialize["include_tags"] = o.IncludeTags + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +type NullableThingClone struct { + value *ThingClone + isSet bool +} + +func (v NullableThingClone) Get() *ThingClone { + return v.value +} + +func (v *NullableThingClone) Set(val *ThingClone) { + v.value = val + v.isSet = true +} + +func (v NullableThingClone) IsSet() bool { + return v.isSet +} + +func (v *NullableThingClone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableThingClone(val *ThingClone) *NullableThingClone { + return &NullableThingClone{value: val, isSet: true} +} + +func (v NullableThingClone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableThingClone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_thing_create.go b/model_thing_create.go index ba77c66..55fe003 100644 --- a/model_thing_create.go +++ b/model_thing_create.go @@ -27,6 +27,8 @@ type ThingCreate struct { Name *string `json:"name,omitempty"` // The properties of the thing Properties []Property `json:"properties,omitempty"` + // Optional set of tags + Tags []Tag `json:"tags,omitempty"` // A time zone name Check /v2/timezones for a list of valid names. Timezone *string `json:"timezone,omitempty"` // Webhook uri @@ -184,6 +186,38 @@ func (o *ThingCreate) SetProperties(v []Property) { o.Properties = v } +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ThingCreate) GetTags() []Tag { + if o == nil || IsNil(o.Tags) { + var ret []Tag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThingCreate) GetTagsOk() ([]Tag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ThingCreate) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *ThingCreate) SetTags(v []Tag) { + o.Tags = v +} + // GetTimezone returns the Timezone field value if set, zero value otherwise. func (o *ThingCreate) GetTimezone() string { if o == nil || IsNil(o.Timezone) { @@ -302,6 +336,9 @@ func (o ThingCreate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Properties) { toSerialize["properties"] = o.Properties } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } if !IsNil(o.Timezone) { toSerialize["timezone"] = o.Timezone }