diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d91e4e0..ab60527 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -289,15 +289,4 @@ model_user_dfu_state_machine_status.go model_user_firmware_info.go model_webhook_settings.go response.go -test/api_alert_test.go -test/api_authorization_test.go -test/api_billing_account_test.go -test/api_device_test.go -test/api_event_test.go -test/api_external_devices_test.go -test/api_monitor_test.go -test/api_project_test.go -test/api_route_test.go -test/api_usage_test.go -test/api_webhook_test.go utils.go diff --git a/api_device.go b/api_device.go index 77e7abe..78a35c2 100644 --- a/api_device.go +++ b/api_device.go @@ -273,12 +273,6 @@ type ApiDeleteDeviceRequest struct { ApiService *DeviceAPIService projectOrProductUID string deviceUID string - purge *bool -} - -func (r ApiDeleteDeviceRequest) Purge(purge bool) ApiDeleteDeviceRequest { - r.purge = &purge - return r } func (r ApiDeleteDeviceRequest) Execute() (*http.Response, error) { @@ -324,11 +318,7 @@ func (a *DeviceAPIService) DeleteDeviceExecute(r ApiDeleteDeviceRequest) (*http. localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.purge == nil { - return nil, reportError("purge is required and must be specified") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "purge", r.purge, "form", "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1632,6 +1622,13 @@ type ApiGetDeviceEnvironmentVariablesByPinRequest struct { ApiService *DeviceAPIService productUID string deviceUID string + xAuthToken *string +} + +// For accessing endpoints by Device pin. +func (r ApiGetDeviceEnvironmentVariablesByPinRequest) XAuthToken(xAuthToken string) ApiGetDeviceEnvironmentVariablesByPinRequest { + r.xAuthToken = &xAuthToken + return r } func (r ApiGetDeviceEnvironmentVariablesByPinRequest) Execute() (*GetDeviceEnvironmentVariablesByPin200Response, *http.Response, error) { @@ -1680,6 +1677,9 @@ func (a *DeviceAPIService) GetDeviceEnvironmentVariablesByPinExecute(r ApiGetDev localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.xAuthToken == nil { + return localVarReturnValue, nil, reportError("xAuthToken is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1698,20 +1698,7 @@ func (a *DeviceAPIService) GetDeviceEnvironmentVariablesByPinExecute(r ApiGetDev if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["pin"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["X-Auth-Token"] = key - } - } - } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Auth-Token", r.xAuthToken, "simple", "") req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -3697,9 +3684,16 @@ type ApiSetDeviceEnvironmentVariablesByPinRequest struct { ApiService *DeviceAPIService productUID string deviceUID string + xAuthToken *string environmentVariables *EnvironmentVariables } +// For accessing endpoints by Device pin. +func (r ApiSetDeviceEnvironmentVariablesByPinRequest) XAuthToken(xAuthToken string) ApiSetDeviceEnvironmentVariablesByPinRequest { + r.xAuthToken = &xAuthToken + return r +} + // Environment variables to be added to the device func (r ApiSetDeviceEnvironmentVariablesByPinRequest) EnvironmentVariables(environmentVariables EnvironmentVariables) ApiSetDeviceEnvironmentVariablesByPinRequest { r.environmentVariables = &environmentVariables @@ -3752,6 +3746,9 @@ func (a *DeviceAPIService) SetDeviceEnvironmentVariablesByPinExecute(r ApiSetDev localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.xAuthToken == nil { + return localVarReturnValue, nil, reportError("xAuthToken is required and must be specified") + } if r.environmentVariables == nil { return localVarReturnValue, nil, reportError("environmentVariables is required and must be specified") } @@ -3773,22 +3770,9 @@ func (a *DeviceAPIService) SetDeviceEnvironmentVariablesByPinExecute(r ApiSetDev if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Auth-Token", r.xAuthToken, "simple", "") // body params localVarPostBody = r.environmentVariables - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["pin"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["X-Auth-Token"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err diff --git a/api_usage.go b/api_usage.go index 5cb14f4..9891678 100644 --- a/api_usage.go +++ b/api_usage.go @@ -465,6 +465,7 @@ type ApiGetRouteLogsUsageRequest struct { endDate *int32 routeUID *[]string aggregate *string + skipRecentData *bool } // Period type for aggregation @@ -497,6 +498,12 @@ func (r ApiGetRouteLogsUsageRequest) Aggregate(aggregate string) ApiGetRouteLogs return r } +// When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. +func (r ApiGetRouteLogsUsageRequest) SkipRecentData(skipRecentData bool) ApiGetRouteLogsUsageRequest { + r.skipRecentData = &skipRecentData + return r +} + func (r ApiGetRouteLogsUsageRequest) Execute() (*GetRouteLogsUsage200Response, *http.Response, error) { return r.ApiService.GetRouteLogsUsageExecute(r) } @@ -569,6 +576,13 @@ func (a *UsageAPIService) GetRouteLogsUsageExecute(r ApiGetRouteLogsUsageRequest parameterAddToHeaderOrQuery(localVarQueryParams, "aggregate", defaultValue, "form", "") r.aggregate = &defaultValue } + if r.skipRecentData != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipRecentData", r.skipRecentData, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "skipRecentData", defaultValue, "form", "") + r.skipRecentData = &defaultValue + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/configuration.go b/configuration.go index 4eb31a0..61af8e8 100644 --- a/configuration.go +++ b/configuration.go @@ -32,9 +32,6 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") diff --git a/docs/CreateMonitor.md b/docs/CreateMonitor.md index cc8283f..37518b2 100644 --- a/docs/CreateMonitor.md +++ b/docs/CreateMonitor.md @@ -19,7 +19,7 @@ | **RoutingCooldownPeriod** | Pointer to **string** | The time period to wait before routing another event after the monitor | has been triggered. It follows the format of a number followed by a time unit. | [optional] | | **Silenced** | Pointer to **bool** | If true, alerts will be created, but no notifications will be sent. | [optional] | | **SourceSelector** | Pointer to **string** | A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. | [optional] | -| **SourceType** | Pointer to **string** | The type of source to monitor. Currently only \"event\" is supported. | [optional] | +| **SourceType** | Pointer to **string** | The type of source to monitor. Supported values are \"event\" and \"heartbeat\". | [optional] | | **Threshold** | Pointer to **int32** | The type of condition to apply to the value selected by the source_selector | [optional] | | **Uid** | Pointer to **string** | | [optional] | diff --git a/docs/DeviceAPI.md b/docs/DeviceAPI.md index 65c2283..c8322ad 100644 --- a/docs/DeviceAPI.md +++ b/docs/DeviceAPI.md @@ -173,7 +173,7 @@ Other parameters are passed through a pointer to a apiAddQiNoteRequest struct vi ## DeleteDevice -> DeleteDevice(ctx, projectOrProductUID, deviceUID).Purge(purge).Execute() +> DeleteDevice(ctx, projectOrProductUID, deviceUID).Execute() ### Example @@ -190,11 +190,10 @@ import ( func main() { projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | deviceUID := "dev:000000000000000" // string | - purge := true // bool | (default to false) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), projectOrProductUID, deviceUID).Purge(purge).Execute() + r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), projectOrProductUID, deviceUID).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -217,8 +216,6 @@ Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -**purge** | **bool** | | [default to false] - ### Return type (empty response body) @@ -950,7 +947,7 @@ Other parameters are passed through a pointer to a apiGetDeviceEnvironmentVariab ## GetDeviceEnvironmentVariablesByPin -> GetDeviceEnvironmentVariablesByPin200Response GetDeviceEnvironmentVariablesByPin(ctx, productUID, deviceUID).Execute() +> GetDeviceEnvironmentVariablesByPin200Response GetDeviceEnvironmentVariablesByPin(ctx, productUID, deviceUID).XAuthToken(xAuthToken).Execute() ### Example @@ -967,10 +964,11 @@ import ( func main() { productUID := "com.blues.bridge:sensors" // string | deviceUID := "dev:000000000000000" // string | + xAuthToken := "xAuthToken_example" // string | For accessing endpoints by Device pin. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DeviceAPI.GetDeviceEnvironmentVariablesByPin(context.Background(), productUID, deviceUID).Execute() + resp, r, err := apiClient.DeviceAPI.GetDeviceEnvironmentVariablesByPin(context.Background(), productUID, deviceUID).XAuthToken(xAuthToken).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDeviceEnvironmentVariablesByPin``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -995,13 +993,15 @@ Other parameters are passed through a pointer to a apiGetDeviceEnvironmentVariab | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +**xAuthToken** | **string** | For accessing endpoints by Device pin. | + ### Return type [**GetDeviceEnvironmentVariablesByPin200Response**](GetDeviceEnvironmentVariablesByPin200Response.md) ### Authorization -[pin](../README.md#pin) +No authorization required ### HTTP request headers @@ -1863,7 +1863,7 @@ Other parameters are passed through a pointer to a apiSetDeviceEnvironmentVariab ## SetDeviceEnvironmentVariablesByPin -> EnvironmentVariables SetDeviceEnvironmentVariablesByPin(ctx, productUID, deviceUID).EnvironmentVariables(environmentVariables).Execute() +> EnvironmentVariables SetDeviceEnvironmentVariablesByPin(ctx, productUID, deviceUID).XAuthToken(xAuthToken).EnvironmentVariables(environmentVariables).Execute() ### Example @@ -1880,11 +1880,12 @@ import ( func main() { productUID := "com.blues.bridge:sensors" // string | deviceUID := "dev:000000000000000" // string | + xAuthToken := "xAuthToken_example" // string | For accessing endpoints by Device pin. environmentVariables := *openapiclient.NewEnvironmentVariables(map[string]string{"key": "Inner_example"}) // EnvironmentVariables | Environment variables to be added to the device configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DeviceAPI.SetDeviceEnvironmentVariablesByPin(context.Background(), productUID, deviceUID).EnvironmentVariables(environmentVariables).Execute() + resp, r, err := apiClient.DeviceAPI.SetDeviceEnvironmentVariablesByPin(context.Background(), productUID, deviceUID).XAuthToken(xAuthToken).EnvironmentVariables(environmentVariables).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.SetDeviceEnvironmentVariablesByPin``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1909,6 +1910,7 @@ Other parameters are passed through a pointer to a apiSetDeviceEnvironmentVariab | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +**xAuthToken** | **string** | For accessing endpoints by Device pin. | **environmentVariables** | [**EnvironmentVariables**](EnvironmentVariables.md) | Environment variables to be added to the device | ### Return type @@ -1917,7 +1919,7 @@ Other parameters are passed through a pointer to a apiSetDeviceEnvironmentVariab ### Authorization -[pin](../README.md#pin) +No authorization required ### HTTP request headers diff --git a/docs/GetDataUsage200ResponseDataInner.md b/docs/GetDataUsage200ResponseDataInner.md index a53622c..a81783e 100644 --- a/docs/GetDataUsage200ResponseDataInner.md +++ b/docs/GetDataUsage200ResponseDataInner.md @@ -2,14 +2,15 @@ ## Properties -| Name | Type | Description | Notes | -| ---------- | ------------------------------- | ------------------------------------------------------------------------------------------- | ---------- | -| **Data** | [**[]UsageData**](UsageData.md) | | -| **Device** | Pointer to **string** | The device UID this usage data belongs to (only present when aggregate is 'device') | [optional] | -| **Fleet** | Pointer to **string** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | -| **Iccid** | Pointer to **string** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | -| **Imsi** | Pointer to **string** | The IMSI of the satellite device (only present when type is 'satellite') | [optional] | -| **Type** | **string** | The type of connectivity | +| Name | Type | Description | Notes | +| --------------- | ------------------------------- | ------------------------------------------------------------------------------------------- | ---------- | +| **Data** | [**[]UsageData**](UsageData.md) | | +| **Device** | Pointer to **string** | The device UID this usage data belongs to (only present when aggregate is 'device') | [optional] | +| **DeviceCount** | Pointer to **int32** | the number of devices represented by this data point | [optional] | +| **Fleet** | Pointer to **string** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | +| **Iccid** | Pointer to **string** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | +| **Imsi** | Pointer to **string** | The IMSI of the satellite device (only present when type is 'satellite') | [optional] | +| **Type** | **string** | The type of connectivity | ## Methods @@ -74,6 +75,31 @@ SetDevice sets Device field to given value. HasDevice returns a boolean if a field has been set. +### GetDeviceCount + +`func (o *GetDataUsage200ResponseDataInner) GetDeviceCount() int32` + +GetDeviceCount returns the DeviceCount field if non-nil, zero value otherwise. + +### GetDeviceCountOk + +`func (o *GetDataUsage200ResponseDataInner) GetDeviceCountOk() (*int32, bool)` + +GetDeviceCountOk returns a tuple with the DeviceCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceCount + +`func (o *GetDataUsage200ResponseDataInner) SetDeviceCount(v int32)` + +SetDeviceCount sets DeviceCount field to given value. + +### HasDeviceCount + +`func (o *GetDataUsage200ResponseDataInner) HasDeviceCount() bool` + +HasDeviceCount returns a boolean if a field has been set. + ### GetFleet `func (o *GetDataUsage200ResponseDataInner) GetFleet() string` diff --git a/docs/Monitor.md b/docs/Monitor.md index d10f25a..53be2fd 100644 --- a/docs/Monitor.md +++ b/docs/Monitor.md @@ -19,7 +19,7 @@ | **RoutingCooldownPeriod** | Pointer to **string** | The time period to wait before routing another event after the monitor | has been triggered. It follows the format of a number followed by a time unit. | [optional] | | **Silenced** | Pointer to **bool** | If true, alerts will be created, but no notifications will be sent. | [optional] | | **SourceSelector** | Pointer to **string** | A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. | [optional] | -| **SourceType** | Pointer to **string** | The type of source to monitor. Currently only \"event\" is supported. | [optional] | +| **SourceType** | Pointer to **string** | The type of source to monitor. Supported values are \"event\" and \"heartbeat\". | [optional] | | **Threshold** | Pointer to **int32** | The type of condition to apply to the value selected by the source_selector | [optional] | | **Uid** | Pointer to **string** | | [optional] | diff --git a/docs/UsageAPI.md b/docs/UsageAPI.md index 9649ea1..f69942a 100644 --- a/docs/UsageAPI.md +++ b/docs/UsageAPI.md @@ -167,7 +167,7 @@ Other parameters are passed through a pointer to a apiGetEventsUsageRequest stru ## GetRouteLogsUsage -> GetRouteLogsUsage200Response GetRouteLogsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Aggregate(aggregate).Execute() +> GetRouteLogsUsage200Response GetRouteLogsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() ### Example @@ -188,10 +188,11 @@ func main() { endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) routeUID := []string{"Inner_example"} // []string | A Route UID. (optional) aggregate := "aggregate_example" // string | Aggregation level for results (optional) (default to "route") + skipRecentData := true // bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to false) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.GetRouteLogsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Aggregate(aggregate).Execute() + resp, r, err := apiClient.UsageAPI.GetRouteLogsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.GetRouteLogsUsage``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -220,6 +221,7 @@ Other parameters are passed through a pointer to a apiGetRouteLogsUsageRequest s **endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | **routeUID** | **[]string** | A Route UID. | **aggregate** | **string** | Aggregation level for results | [default to "route"] +**skipRecentData** | **bool** | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [default to false] ### Return type diff --git a/model_create_monitor.go b/model_create_monitor.go index c562273..62b8508 100644 --- a/model_create_monitor.go +++ b/model_create_monitor.go @@ -45,7 +45,7 @@ type CreateMonitor struct { Silenced *bool `json:"silenced,omitempty"` // A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. SourceSelector *string `json:"source_selector,omitempty"` - // The type of source to monitor. Currently only \"event\" is supported. + // The type of source to monitor. Supported values are \"event\" and \"heartbeat\". SourceType *string `json:"source_type,omitempty"` // The type of condition to apply to the value selected by the source_selector Threshold *int32 `json:"threshold,omitempty"` diff --git a/model_get_data_usage_200_response_data_inner.go b/model_get_data_usage_200_response_data_inner.go index 98c4b9a..ada8073 100644 --- a/model_get_data_usage_200_response_data_inner.go +++ b/model_get_data_usage_200_response_data_inner.go @@ -25,6 +25,8 @@ type GetDataUsage200ResponseDataInner struct { Data []UsageData `json:"data"` // The device UID this usage data belongs to (only present when aggregate is 'device') Device *string `json:"device,omitempty"` + // the number of devices represented by this data point + DeviceCount *int32 `json:"device_count,omitempty"` // The fleet UID this usage data belongs to (only present when aggregate is 'fleet') Fleet *string `json:"fleet,omitempty"` // The ICCID of the cellular SIM card (only present when type is 'cellular') @@ -112,6 +114,38 @@ func (o *GetDataUsage200ResponseDataInner) SetDevice(v string) { o.Device = &v } +// GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. +func (o *GetDataUsage200ResponseDataInner) GetDeviceCount() int32 { + if o == nil || IsNil(o.DeviceCount) { + var ret int32 + return ret + } + return *o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDataUsage200ResponseDataInner) GetDeviceCountOk() (*int32, bool) { + if o == nil || IsNil(o.DeviceCount) { + return nil, false + } + return o.DeviceCount, true +} + +// HasDeviceCount returns a boolean if a field has been set. +func (o *GetDataUsage200ResponseDataInner) HasDeviceCount() bool { + if o != nil && !IsNil(o.DeviceCount) { + return true + } + + return false +} + +// SetDeviceCount gets a reference to the given int32 and assigns it to the DeviceCount field. +func (o *GetDataUsage200ResponseDataInner) SetDeviceCount(v int32) { + o.DeviceCount = &v +} + // GetFleet returns the Fleet field value if set, zero value otherwise. func (o *GetDataUsage200ResponseDataInner) GetFleet() string { if o == nil || IsNil(o.Fleet) { @@ -246,6 +280,9 @@ func (o GetDataUsage200ResponseDataInner) ToMap() (map[string]interface{}, error if !IsNil(o.Device) { toSerialize["device"] = o.Device } + if !IsNil(o.DeviceCount) { + toSerialize["device_count"] = o.DeviceCount + } if !IsNil(o.Fleet) { toSerialize["fleet"] = o.Fleet } diff --git a/model_monitor.go b/model_monitor.go index 0c963db..1beeaad 100644 --- a/model_monitor.go +++ b/model_monitor.go @@ -45,7 +45,7 @@ type Monitor struct { Silenced *bool `json:"silenced,omitempty"` // A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. SourceSelector *string `json:"source_selector,omitempty"` - // The type of source to monitor. Currently only \"event\" is supported. + // The type of source to monitor. Supported values are \"event\" and \"heartbeat\". SourceType *string `json:"source_type,omitempty"` // The type of condition to apply to the value selected by the source_selector Threshold *int32 `json:"threshold,omitempty"` diff --git a/openapi.yaml b/openapi.yaml index 8661551..6406d6a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -152,13 +152,12 @@ paths: $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' - security: - - pin: [] tags: - device parameters: - $ref: '#/components/parameters/productUIDParam' - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/XAuthTokenHeader' put: operationId: SetDeviceEnvironmentVariablesByPin description: Set environment variables of a device with device pin authorization @@ -174,8 +173,6 @@ paths: $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' - security: - - pin: [] tags: - device '/v1/products/{productUID}/ext-devices/{deviceUID}/event': @@ -450,13 +447,6 @@ paths: delete: operationId: DeleteDevice description: Delete Device - parameters: - - name: purge - in: query - required: true - schema: - type: boolean - default: false responses: '204': description: Successful operation @@ -2538,6 +2528,13 @@ paths: enum: - route - project + - name: skipRecentData + in: query + description: 'When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.' + required: false + schema: + type: boolean + default: false responses: '200': $ref: '#/components/responses/UsageRouteLogsResponse' @@ -3262,6 +3259,13 @@ components: schema: type: string example: Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8 + XAuthTokenHeader: + description: For accessing endpoints by Device pin. + in: header + name: X-Auth-Token + required: true + schema: + type: string schemas: Alert: type: object @@ -3293,6 +3297,7 @@ components: type: string enum: - event + - device source_uid: description: The UID of the source of the alert type: string @@ -3522,8 +3527,9 @@ components: - required: - name - description - - notefile_filter - alert_routes + - source_type + - threshold CreateUpdateRepository: type: object properties: @@ -4656,10 +4662,11 @@ components: type: string example: body.temperature source_type: - description: The type of source to monitor. Currently only "event" is supported. + description: The type of source to monitor. Supported values are "event" and "heartbeat". type: string enum: - event + - heartbeat threshold: description: The type of condition to apply to the value selected by the source_selector type: integer @@ -6097,6 +6104,9 @@ components: description: The device UID this usage data belongs to (only present when aggregate is 'device') type: string example: 'dev:123456789012345' + device_count: + description: the number of devices represented by this data point + type: integer fleet: description: The fleet UID this usage data belongs to (only present when aggregate is 'fleet') type: string @@ -6151,12 +6161,6 @@ components: Use a personal access token from notehub.io/api-access scheme: bearer type: http - pin: - description: | - For accessing endpoints by Device pin. - in: header - name: X-Auth-Token - type: apiKey tags: - description: Authorization operations name: authorization diff --git a/openapi_filtered.yaml b/openapi_filtered.yaml index 7d7e68a..ac666ae 100644 --- a/openapi_filtered.yaml +++ b/openapi_filtered.yaml @@ -152,13 +152,12 @@ paths: $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' - security: - - pin: [] tags: - device parameters: - $ref: '#/components/parameters/productUIDParam' - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/XAuthTokenHeader' put: operationId: SetDeviceEnvironmentVariablesByPin description: Set environment variables of a device with device pin authorization @@ -174,8 +173,6 @@ paths: $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' - security: - - pin: [] tags: - device /v1/products/{productUID}/ext-devices/{deviceUID}/event: @@ -450,13 +447,6 @@ paths: delete: operationId: DeleteDevice description: Delete Device - parameters: - - name: purge - in: query - required: true - schema: - type: boolean - default: false responses: "204": description: Successful operation @@ -2506,6 +2496,13 @@ paths: enum: - route - project + - name: skipRecentData + in: query + description: When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. + required: false + schema: + type: boolean + default: false responses: "200": $ref: '#/components/responses/UsageRouteLogsResponse' @@ -3230,6 +3227,13 @@ components: schema: type: string example: Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8 + XAuthTokenHeader: + description: For accessing endpoints by Device pin. + in: header + name: X-Auth-Token + required: true + schema: + type: string schemas: Alert: type: object @@ -3261,6 +3265,7 @@ components: type: string enum: - event + - device source_uid: description: The UID of the source of the alert type: string @@ -3490,8 +3495,9 @@ components: - required: - name - description - - notefile_filter - alert_routes + - source_type + - threshold CreateUpdateRepository: type: object properties: @@ -4624,10 +4630,11 @@ components: type: string example: body.temperature source_type: - description: The type of source to monitor. Currently only "event" is supported. + description: The type of source to monitor. Supported values are "event" and "heartbeat". type: string enum: - event + - heartbeat threshold: description: The type of condition to apply to the value selected by the source_selector type: integer @@ -6065,6 +6072,9 @@ components: description: The device UID this usage data belongs to (only present when aggregate is 'device') type: string example: dev:123456789012345 + device_count: + description: the number of devices represented by this data point + type: integer fleet: description: The fleet UID this usage data belongs to (only present when aggregate is 'fleet') type: string @@ -6119,12 +6129,6 @@ components: Use a personal access token from notehub.io/api-access scheme: bearer type: http - pin: - description: | - For accessing endpoints by Device pin. - in: header - name: X-Auth-Token - type: apiKey tags: - description: Authorization operations name: authorization