diff --git a/openapi.filtered.yaml b/openapi.filtered.yaml index 02df95d5..b6276026 100644 --- a/openapi.filtered.yaml +++ b/openapi.filtered.yaml @@ -153,13 +153,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 @@ -175,8 +174,6 @@ paths: $ref: "#/components/responses/EnvironmentVariablesResponse" default: $ref: "#/components/responses/ErrorResponse" - security: - - pin: [] tags: - device /v1/products/{productUID}/ext-devices/{deviceUID}/event: @@ -461,13 +458,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 @@ -1518,6 +1508,8 @@ paths: - $ref: "#/components/parameters/filenameQueryParam" - $ref: "#/components/parameters/md5QueryParam" - $ref: "#/components/parameters/unpublishedQueryParam" + - $ref: "#/components/parameters/firmwareSortByParam" + - $ref: "#/components/parameters/firmwareSortOrderParam" responses: "200": description: Success @@ -2380,6 +2372,8 @@ paths: - $ref: "#/components/parameters/systemFilesOnlyParam" - $ref: "#/components/parameters/mostRecentOnlyParam" - $ref: "#/components/parameters/filesQueryParam" + - $ref: "#/components/parameters/routingStatusParam" + - $ref: "#/components/parameters/responseStatusParam" responses: "200": description: Successful operation @@ -2558,6 +2552,16 @@ 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" @@ -2936,6 +2940,30 @@ components: required: false schema: type: string + firmwareSortByParam: + description: Field to sort by + in: query + name: sortBy + required: false + schema: + type: string + default: created + enum: + - created + - name + - version + - length + firmwareSortOrderParam: + description: Sort order (asc for ascending, desc for descending) + in: query + name: sortOrder + required: false + schema: + type: string + default: desc + enum: + - asc + - desc firmwareTypeParam: in: path name: firmwareType @@ -3142,6 +3170,15 @@ components: schema: type: string example: rid:2606f411-dea6-44a0-9743-1130f57d77d8 + responseStatusParam: + example: 500 + in: query + name: responseStatus + required: false + schema: + type: array + items: + type: string routeLogsSortByParam: in: query name: sortBy @@ -3180,6 +3217,18 @@ components: items: type: string style: form + routingStatusParam: + example: failure + in: query + name: routingStatus + required: false + schema: + type: array + items: + enum: + - success + - failure + type: string selectFieldsParam: description: Comma-separated list of fields to select from JSON payload (e.g., @@ -3313,6 +3362,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 @@ -3344,6 +3400,7 @@ components: type: string enum: - event + - device source_uid: description: The UID of the source of the alert type: string @@ -3575,8 +3632,9 @@ components: - required: - name - description - - notefile_filter - alert_routes + - source_type + - threshold CreateUpdateRepository: type: object properties: @@ -4757,10 +4815,13 @@ 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 @@ -5284,6 +5345,34 @@ components: type: string format: uri additionalProperties: false + SatelliteDataUsage: + type: object + properties: + bytes_remaining: + description: Bytes remaining in the plan + type: integer + format: int64 + example: 18600 + bytes_total: + description: Total bytes included in the plan + type: integer + format: int64 + example: 18650 + bytes_used: + description: Bytes used to date + type: integer + format: int64 + example: 49 + bytes_used_billable: + description: Billable bytes used to date + type: integer + format: int64 + example: 50 + required: + - bytes_total + - bytes_used + - bytes_used_billable + - bytes_remaining SatellitePlan: type: object properties: @@ -5292,13 +5381,16 @@ components: type: integer format: int64 example: 1609459200 - billable_bytes: - $ref: "#/components/schemas/DataUsage" - last_updated: - description: Time this plan information was last updated + last_session_at: + description: When this Starnote last had a session type: integer format: int64 - example: 1656010061 + example: 1808675309 + minimum_billable_bytes: + description: Minimum billable bytes + type: integer + format: int64 + example: 50 ntn_provider: description: Non-Terrestrial Network provider name type: string @@ -5307,6 +5399,8 @@ components: description: Provider-specific identifier for the satellite subscription type: string example: skylo:5746354465786 + satellite_data_usage: + $ref: "#/components/schemas/SatelliteDataUsage" nullable: true required: - ntn_provider @@ -5608,6 +5702,18 @@ components: UsageData: type: object properties: + billable_bytes_received: + description: Billable bytes received (only for packet-based protocols) + type: integer + format: int64 + billable_bytes_sent: + description: Billable bytes sent (only for packet-based protocols) + type: integer + format: int64 + billable_bytes_total: + description: Total billable bytes (only for packet-based protocols) + type: integer + format: int64 bytes_received: type: integer format: int64 @@ -5616,6 +5722,14 @@ components: type: integer format: int64 example: 524288 + packets_received: + description: Packets received (only for packet-based protocols) + type: integer + format: int64 + packets_sent: + description: Packets sent (only for packet-based protocols) + type: integer + format: int64 period: type: string format: date-time @@ -6227,6 +6341,9 @@ components: 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 @@ -6239,12 +6356,12 @@ components: 'cellular') type: string example: "12345678901234567890" - imsi: + psid: description: - The IMSI of the satellite device (only present when type is - 'satellite') + The PSID (Packet Service ID) of the satellite (or other + packet-based device) type: string - example: "123456789012345" + example: skylo:5746354465786 type: description: The type of connectivity type: string @@ -6287,12 +6404,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.yaml b/openapi.yaml index 86615515..325cd500 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 @@ -1503,6 +1493,8 @@ paths: - $ref: '#/components/parameters/filenameQueryParam' - $ref: '#/components/parameters/md5QueryParam' - $ref: '#/components/parameters/unpublishedQueryParam' + - $ref: '#/components/parameters/firmwareSortByParam' + - $ref: '#/components/parameters/firmwareSortOrderParam' responses: '200': description: Success @@ -2369,6 +2361,8 @@ paths: - $ref: '#/components/parameters/systemFilesOnlyParam' - $ref: '#/components/parameters/mostRecentOnlyParam' - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/routingStatusParam' + - $ref: '#/components/parameters/responseStatusParam' responses: '200': description: Successful operation @@ -2538,6 +2532,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' @@ -2888,6 +2889,30 @@ components: required: false schema: type: string + firmwareSortByParam: + description: Field to sort by + in: query + name: sortBy + required: false + schema: + type: string + default: created + enum: + - created + - name + - version + - length + firmwareSortOrderParam: + description: 'Sort order (asc for ascending, desc for descending)' + in: query + name: sortOrder + required: false + schema: + type: string + default: desc + enum: + - asc + - desc firmwareTypeParam: in: path name: firmwareType @@ -3094,6 +3119,15 @@ components: schema: type: string example: 'rid:2606f411-dea6-44a0-9743-1130f57d77d8' + responseStatusParam: + example: 500 + in: query + name: responseStatus + required: false + schema: + type: array + items: + type: string routeLogsSortByParam: in: query name: sortBy @@ -3132,6 +3166,18 @@ components: items: type: string style: form + routingStatusParam: + example: failure + in: query + name: routingStatus + required: false + schema: + type: array + items: + enum: + - success + - failure + type: string selectFieldsParam: description: 'Comma-separated list of fields to select from JSON payload (e.g., "field1,field2.subfield,field3"), this will reflect the columns in the CSV output.' in: query @@ -3262,6 +3308,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 +3346,7 @@ components: type: string enum: - event + - device source_uid: description: The UID of the source of the alert type: string @@ -3522,8 +3576,9 @@ components: - required: - name - description - - notefile_filter - alert_routes + - source_type + - threshold CreateUpdateRepository: type: object properties: @@ -4656,10 +4711,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 @@ -5177,6 +5233,34 @@ components: type: string format: uri additionalProperties: false + SatelliteDataUsage: + type: object + properties: + bytes_remaining: + description: Bytes remaining in the plan + type: integer + format: int64 + example: 18600 + bytes_total: + description: Total bytes included in the plan + type: integer + format: int64 + example: 18650 + bytes_used: + description: Bytes used to date + type: integer + format: int64 + example: 49 + bytes_used_billable: + description: Billable bytes used to date + type: integer + format: int64 + example: 50 + required: + - bytes_total + - bytes_used + - bytes_used_billable + - bytes_remaining SatellitePlan: type: object properties: @@ -5185,13 +5269,16 @@ components: type: integer format: int64 example: 1609459200 - billable_bytes: - $ref: '#/components/schemas/DataUsage' - last_updated: - description: Time this plan information was last updated + last_session_at: + description: When this Starnote last had a session type: integer format: int64 - example: 1656010061 + example: 1808675309 + minimum_billable_bytes: + description: Minimum billable bytes + type: integer + format: int64 + example: 50 ntn_provider: description: Non-Terrestrial Network provider name type: string @@ -5200,6 +5287,8 @@ components: description: Provider-specific identifier for the satellite subscription type: string example: 'skylo:5746354465786' + satellite_data_usage: + $ref: '#/components/schemas/SatelliteDataUsage' nullable: true required: - ntn_provider @@ -5501,6 +5590,18 @@ components: UsageData: type: object properties: + billable_bytes_received: + description: Billable bytes received (only for packet-based protocols) + type: integer + format: int64 + billable_bytes_sent: + description: Billable bytes sent (only for packet-based protocols) + type: integer + format: int64 + billable_bytes_total: + description: Total billable bytes (only for packet-based protocols) + type: integer + format: int64 bytes_received: type: integer format: int64 @@ -5509,6 +5610,14 @@ components: type: integer format: int64 example: 524288 + packets_received: + description: Packets received (only for packet-based protocols) + type: integer + format: int64 + packets_sent: + description: Packets sent (only for packet-based protocols) + type: integer + format: int64 period: type: string format: date-time @@ -6097,6 +6206,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 @@ -6105,10 +6217,10 @@ components: description: The ICCID of the cellular SIM card (only present when type is 'cellular') type: string example: '12345678901234567890' - imsi: - description: The IMSI of the satellite device (only present when type is 'satellite') + psid: + description: The PSID (Packet Service ID) of the satellite (or other packet-based device) type: string - example: '123456789012345' + example: 'skylo:5746354465786' type: description: The type of connectivity type: string @@ -6151,12 +6263,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/src/.openapi-generator/FILES b/src/.openapi-generator/FILES index 4f3a4d9a..50b4fa8a 100644 --- a/src/.openapi-generator/FILES +++ b/src/.openapi-generator/FILES @@ -118,6 +118,7 @@ docs/RouteApi.md docs/RouteLog.md docs/RouteTransformSettings.md docs/S3ArchiveRoute.md +docs/SatelliteDataUsage.md docs/SatellitePlan.md docs/SchemaProperty.md docs/SignalDevice200Response.md @@ -266,6 +267,7 @@ src/model/Role.js src/model/RouteLog.js src/model/RouteTransformSettings.js src/model/S3ArchiveRoute.js +src/model/SatelliteDataUsage.js src/model/SatellitePlan.js src/model/SchemaProperty.js src/model/SignalDevice200Response.js diff --git a/src/README.md b/src/README.md index 9521e8d5..b5d242fe 100644 --- a/src/README.md +++ b/src/README.md @@ -338,6 +338,7 @@ All URIs are relative to *https://api.notefile.net* - [NotehubJs.RouteLog](docs/RouteLog.md) - [NotehubJs.RouteTransformSettings](docs/RouteTransformSettings.md) - [NotehubJs.S3ArchiveRoute](docs/S3ArchiveRoute.md) +- [NotehubJs.SatelliteDataUsage](docs/SatelliteDataUsage.md) - [NotehubJs.SatellitePlan](docs/SatellitePlan.md) - [NotehubJs.SchemaProperty](docs/SchemaProperty.md) - [NotehubJs.SignalDevice200Response](docs/SignalDevice200Response.md) @@ -367,9 +368,3 @@ All URIs are relative to *https://api.notefile.net* ### personalAccessToken - **Type**: Bearer authentication - -### pin - -- **Type**: API key -- **API key parameter name**: X-Auth-Token -- **Location**: HTTP header diff --git a/src/docs/AlertDataInner.md b/src/docs/AlertDataInner.md index 28f1518c..ae589481 100644 --- a/src/docs/AlertDataInner.md +++ b/src/docs/AlertDataInner.md @@ -20,3 +20,5 @@ ## Enum: SourceTypeEnum - `event` (value: `"event"`) + +- `device` (value: `"device"`) diff --git a/src/docs/CreateMonitor.md b/src/docs/CreateMonitor.md index ecf75576..000e6b54 100644 --- a/src/docs/CreateMonitor.md +++ b/src/docs/CreateMonitor.md @@ -14,13 +14,13 @@ | **fleetFilter** | **[String]** | | [optional] | | **lastRoutedAt** | **String** | The last time the monitor was evaluated and routed. | [optional] | | **name** | **String** | | -| **notefileFilter** | **[String]** | | +| **notefileFilter** | **[String]** | | [optional] | | **perDevice** | **Boolean** | Only relevant when using an aggregate_function. If true, the monitor will be evaluated per device, | rather than across the set of selected devices. If true then if a single device matches the specified criteria, | and alert will be created, otherwise the aggregate function will be applied across all devices. | [optional] | | **routingCooldownPeriod** | **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** | **Boolean** | If true, alerts will be created, but no notifications will be sent. | [optional] | | **sourceSelector** | **String** | A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. | [optional] | -| **sourceType** | **String** | The type of source to monitor. Currently only \"event\" is supported. | [optional] | -| **threshold** | **Number** | The type of condition to apply to the value selected by the source_selector | [optional] | +| **sourceType** | **String** | The type of source to monitor. Supported values are \"event\" and \"heartbeat\". | +| **threshold** | **Number** | The type of condition to apply to the value selected by the source_selector | | **uid** | **String** | | [optional] | ## Enum: AggregateFunctionEnum @@ -52,3 +52,5 @@ ## Enum: SourceTypeEnum - `event` (value: `"event"`) + +- `heartbeat` (value: `"heartbeat"`) diff --git a/src/docs/DeviceApi.md b/src/docs/DeviceApi.md index fc0e4fe8..233298c7 100644 --- a/src/docs/DeviceApi.md +++ b/src/docs/DeviceApi.md @@ -139,7 +139,7 @@ null (empty response body) ## deleteDevice -> deleteDevice(projectOrProductUID, deviceUID, purge) +> deleteDevice(projectOrProductUID, deviceUID) Delete Device @@ -155,8 +155,7 @@ personalAccessToken.accessToken = "YOUR ACCESS TOKEN" let apiInstance = new NotehubJs.DeviceApi(); let projectOrProductUID = app:2606f411-dea6-44a0-9743-1130f57d77d8; // String | let deviceUID = dev:000000000000000; // String | -let purge = false; // Boolean | -apiInstance.deleteDevice(projectOrProductUID, deviceUID, purge).then(() => { +apiInstance.deleteDevice(projectOrProductUID, deviceUID).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); @@ -166,11 +165,10 @@ apiInstance.deleteDevice(projectOrProductUID, deviceUID, purge).then(() => { ### Parameters -| Name | Type | Description | Notes | -| ----------------------- | ----------- | ----------- | ------------------ | -| **projectOrProductUID** | **String** | | -| **deviceUID** | **String** | | -| **purge** | **Boolean** | | [default to false] | +| Name | Type | Description | Notes | +| ----------------------- | ---------- | ----------- | ----- | +| **projectOrProductUID** | **String** | | +| **deviceUID** | **String** | | ### Return type @@ -711,7 +709,7 @@ apiInstance.getDeviceEnvironmentVariables(projectOrProductUID, deviceUID).then(( ## getDeviceEnvironmentVariablesByPin -> GetDeviceEnvironmentVariablesByPin200Response getDeviceEnvironmentVariablesByPin(productUID, deviceUID) +> GetDeviceEnvironmentVariablesByPin200Response getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken) Get environment variables of a device with device pin authorization @@ -719,15 +717,12 @@ Get environment variables of a device with device pin authorization ```javascript import * as NotehubJs from '@blues-inc/notehub-js'; -let defaultClient = NotehubJs.ApiClient.instance; -// Configure API key authorization: pin -let pin = defaultClient.authentications['pin']; -pin.apiKey = 'YOUR API KEY'; let apiInstance = new NotehubJs.DeviceApi(); let productUID = com.blues.bridge:sensors; // String | let deviceUID = dev:000000000000000; // String | -apiInstance.getDeviceEnvironmentVariablesByPin(productUID, deviceUID).then((data) => { +let xAuthToken = "xAuthToken_example"; // String | For accessing endpoints by Device pin. +apiInstance.getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken).then((data) => { console.log('API called successfully. Returned data: ' + JSON.stringify(data)); }, (error) => { console.error(error); @@ -737,10 +732,11 @@ apiInstance.getDeviceEnvironmentVariablesByPin(productUID, deviceUID).then((data ### Parameters -| Name | Type | Description | Notes | -| -------------- | ---------- | ----------- | ----- | -| **productUID** | **String** | | -| **deviceUID** | **String** | | +| Name | Type | Description | Notes | +| -------------- | ---------- | -------------------------------------- | ----- | +| **productUID** | **String** | | +| **deviceUID** | **String** | | +| **xAuthToken** | **String** | For accessing endpoints by Device pin. | ### Return type @@ -748,7 +744,7 @@ apiInstance.getDeviceEnvironmentVariablesByPin(productUID, deviceUID).then((data ### Authorization -[pin](../README.md#pin) +No authorization required ### HTTP request headers @@ -1395,7 +1391,7 @@ apiInstance.setDeviceEnvironmentVariables(projectOrProductUID, deviceUID, enviro ## setDeviceEnvironmentVariablesByPin -> EnvironmentVariables setDeviceEnvironmentVariablesByPin(productUID, deviceUID, environmentVariables) +> EnvironmentVariables setDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken, environmentVariables) Set environment variables of a device with device pin authorization @@ -1403,16 +1399,13 @@ Set environment variables of a device with device pin authorization ```javascript import * as NotehubJs from '@blues-inc/notehub-js'; -let defaultClient = NotehubJs.ApiClient.instance; -// Configure API key authorization: pin -let pin = defaultClient.authentications['pin']; -pin.apiKey = 'YOUR API KEY'; let apiInstance = new NotehubJs.DeviceApi(); let productUID = com.blues.bridge:sensors; // String | let deviceUID = dev:000000000000000; // String | +let xAuthToken = "xAuthToken_example"; // String | For accessing endpoints by Device pin. let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device -apiInstance.setDeviceEnvironmentVariablesByPin(productUID, deviceUID, environmentVariables).then((data) => { +apiInstance.setDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken, environmentVariables).then((data) => { console.log('API called successfully. Returned data: ' + JSON.stringify(data)); }, (error) => { console.error(error); @@ -1426,6 +1419,7 @@ apiInstance.setDeviceEnvironmentVariablesByPin(productUID, deviceUID, environmen | ------------------------ | --------------------------------------------------- | ----------------------------------------------- | ----- | | **productUID** | **String** | | | **deviceUID** | **String** | | +| **xAuthToken** | **String** | For accessing endpoints by Device pin. | | **environmentVariables** | [**EnvironmentVariables**](EnvironmentVariables.md) | Environment variables to be added to the device | ### Return type @@ -1434,7 +1428,7 @@ apiInstance.setDeviceEnvironmentVariablesByPin(productUID, deviceUID, environmen ### Authorization -[pin](../README.md#pin) +No authorization required ### HTTP request headers diff --git a/src/docs/GetDataUsage200ResponseDataInner.md b/src/docs/GetDataUsage200ResponseDataInner.md index cdc20a6d..053811cf 100644 --- a/src/docs/GetDataUsage200ResponseDataInner.md +++ b/src/docs/GetDataUsage200ResponseDataInner.md @@ -2,14 +2,15 @@ ## Properties -| Name | Type | Description | Notes | -| ---------- | ------------------------------- | ------------------------------------------------------------------------------------------- | ---------- | -| **data** | [**[UsageData]**](UsageData.md) | | -| **device** | **String** | The device UID this usage data belongs to (only present when aggregate is 'device') | [optional] | -| **fleet** | **String** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | -| **iccid** | **String** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | -| **imsi** | **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** | **String** | The device UID this usage data belongs to (only present when aggregate is 'device') | [optional] | +| **deviceCount** | **Number** | the number of devices represented by this data point | [optional] | +| **fleet** | **String** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | +| **iccid** | **String** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | +| **psid** | **String** | The PSID (Packet Service ID) of the satellite (or other packet-based device) | [optional] | +| **type** | **String** | The type of connectivity | ## Enum: TypeEnum diff --git a/src/docs/Monitor.md b/src/docs/Monitor.md index d1e846d8..9bd82ea6 100644 --- a/src/docs/Monitor.md +++ b/src/docs/Monitor.md @@ -19,7 +19,7 @@ | **routingCooldownPeriod** | **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** | **Boolean** | If true, alerts will be created, but no notifications will be sent. | [optional] | | **sourceSelector** | **String** | A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. | [optional] | -| **sourceType** | **String** | The type of source to monitor. Currently only \"event\" is supported. | [optional] | +| **sourceType** | **String** | The type of source to monitor. Supported values are \"event\" and \"heartbeat\". | [optional] | | **threshold** | **Number** | The type of condition to apply to the value selected by the source_selector | [optional] | | **uid** | **String** | | [optional] | @@ -52,3 +52,5 @@ ## Enum: SourceTypeEnum - `event` (value: `"event"`) + +- `heartbeat` (value: `"heartbeat"`) diff --git a/src/docs/ProjectApi.md b/src/docs/ProjectApi.md index e3cdde22..6c13e728 100644 --- a/src/docs/ProjectApi.md +++ b/src/docs/ProjectApi.md @@ -956,7 +956,9 @@ let opts = { 'target': "target_example", // String | 'filename': notecard-7.2.2.16518$20240410043100.bin, // String | 'md5': "md5_example", // String | - 'unpublished': true // Boolean | + 'unpublished': true, // Boolean | + 'sortBy': "'created'", // String | Field to sort by + 'sortOrder': "'desc'" // String | Sort order (asc for ascending, desc for descending) }; apiInstance.getFirmwareInfo(projectOrProductUID, opts).then((data) => { console.log('API called successfully. Returned data: ' + JSON.stringify(data)); @@ -968,16 +970,18 @@ apiInstance.getFirmwareInfo(projectOrProductUID, opts).then((data) => { ### Parameters -| Name | Type | Description | Notes | -| ----------------------- | ----------- | ----------- | ---------- | -| **projectOrProductUID** | **String** | | -| **product** | **String** | | [optional] | -| **firmwareType** | **String** | | [optional] | -| **version** | **String** | | [optional] | -| **target** | **String** | | [optional] | -| **filename** | **String** | | [optional] | -| **md5** | **String** | | [optional] | -| **unpublished** | **Boolean** | | [optional] | +| Name | Type | Description | Notes | +| ----------------------- | ----------- | --------------------------------------------------- | ----------------------------------------- | +| **projectOrProductUID** | **String** | | +| **product** | **String** | | [optional] | +| **firmwareType** | **String** | | [optional] | +| **version** | **String** | | [optional] | +| **target** | **String** | | [optional] | +| **filename** | **String** | | [optional] | +| **md5** | **String** | | [optional] | +| **unpublished** | **Boolean** | | [optional] | +| **sortBy** | **String** | Field to sort by | [optional] [default to 'created'] | +| **sortOrder** | **String** | Sort order (asc for ascending, desc for descending) | [optional] [default to 'desc'] | ### Return type diff --git a/src/docs/RouteApi.md b/src/docs/RouteApi.md index cae8a16b..3f412f3a 100644 --- a/src/docs/RouteApi.md +++ b/src/docs/RouteApi.md @@ -177,7 +177,9 @@ let opts = { 'endDate': 1657894210, // Number | End date for filtering results, specified as a Unix timestamp 'systemFilesOnly': true, // Boolean | 'mostRecentOnly': true, // Boolean | - 'files': _health.qo, data.qo // String | + 'files': _health.qo, data.qo, // String | + 'routingStatus': failure, // [String] | + 'responseStatus': 500 // [String] | }; apiInstance.getRouteLogsByRoute(projectOrProductUID, routeUID, opts).then((data) => { console.log('API called successfully. Returned data: ' + JSON.stringify(data)); @@ -203,6 +205,8 @@ apiInstance.getRouteLogsByRoute(projectOrProductUID, routeUID, opts).then((data) | **systemFilesOnly** | **Boolean** | | [optional] | | **mostRecentOnly** | **Boolean** | | [optional] | | **files** | **String** | | [optional] | +| **routingStatus** | [**[String]**](String.md) | | [optional] | +| **responseStatus** | [**[String]**](String.md) | | [optional] | ### Return type diff --git a/src/docs/SatelliteDataUsage.md b/src/docs/SatelliteDataUsage.md new file mode 100644 index 00000000..dbcaa846 --- /dev/null +++ b/src/docs/SatelliteDataUsage.md @@ -0,0 +1,10 @@ +# NotehubJs.SatelliteDataUsage + +## Properties + +| Name | Type | Description | Notes | +| --------------------- | ---------- | -------------------------------- | ----- | +| **bytesRemaining** | **Number** | Bytes remaining in the plan | +| **bytesTotal** | **Number** | Total bytes included in the plan | +| **bytesUsed** | **Number** | Bytes used to date | +| **bytesUsedBillable** | **Number** | Billable bytes used to date | diff --git a/src/docs/SatellitePlan.md b/src/docs/SatellitePlan.md index 734b5de6..54901827 100644 --- a/src/docs/SatellitePlan.md +++ b/src/docs/SatellitePlan.md @@ -2,10 +2,11 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | ----------------------------- | ----------------------------------------------------------- | ---------- | -| **activated** | **Number** | Activation date of the satellite plan as Unix timestamp | -| **billableBytes** | [**DataUsage**](DataUsage.md) | | [optional] | -| **lastUpdated** | **Number** | Time this plan information was last updated | [optional] | -| **ntnProvider** | **String** | Non-Terrestrial Network provider name | -| **psid** | **String** | Provider-specific identifier for the satellite subscription | +| Name | Type | Description | Notes | +| ------------------------ | ----------------------------------------------- | ----------------------------------------------------------- | ---------- | +| **activated** | **Number** | Activation date of the satellite plan as Unix timestamp | +| **lastSessionAt** | **Number** | When this Starnote last had a session | [optional] | +| **minimumBillableBytes** | **Number** | Minimum billable bytes | [optional] | +| **ntnProvider** | **String** | Non-Terrestrial Network provider name | +| **psid** | **String** | Provider-specific identifier for the satellite subscription | +| **satelliteDataUsage** | [**SatelliteDataUsage**](SatelliteDataUsage.md) | | [optional] | diff --git a/src/docs/UsageApi.md b/src/docs/UsageApi.md index 2fce17c0..b3240741 100644 --- a/src/docs/UsageApi.md +++ b/src/docs/UsageApi.md @@ -153,7 +153,8 @@ let opts = { 'startDate': 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp 'endDate': 1657894210, // Number | End date for filtering results, specified as a Unix timestamp 'routeUID': ["null"], // [String] | A Route UID. - 'aggregate': "'route'" // String | Aggregation level for results + 'aggregate': "'route'", // String | Aggregation level for results + 'skipRecentData': false // Boolean | 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. }; apiInstance.getRouteLogsUsage(projectOrProductUID, period, opts).then((data) => { console.log('API called successfully. Returned data: ' + JSON.stringify(data)); @@ -165,14 +166,15 @@ apiInstance.getRouteLogsUsage(projectOrProductUID, period, opts).then((data) => ### Parameters -| Name | Type | Description | Notes | -| ----------------------- | ------------------------- | --------------------------------------------------------------- | --------------------------------------- | -| **projectOrProductUID** | **String** | | -| **period** | **String** | Period type for aggregation | -| **startDate** | **Number** | Start date for filtering results, specified as a Unix timestamp | [optional] | -| **endDate** | **Number** | End date for filtering results, specified as a Unix timestamp | [optional] | -| **routeUID** | [**[String]**](String.md) | A Route UID. | [optional] | -| **aggregate** | **String** | Aggregation level for results | [optional] [default to 'route'] | +| Name | Type | Description | Notes | +| ----------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | +| **projectOrProductUID** | **String** | | +| **period** | **String** | Period type for aggregation | +| **startDate** | **Number** | Start date for filtering results, specified as a Unix timestamp | [optional] | +| **endDate** | **Number** | End date for filtering results, specified as a Unix timestamp | [optional] | +| **routeUID** | [**[String]**](String.md) | A Route UID. | [optional] | +| **aggregate** | **String** | Aggregation level for results | [optional] [default to 'route'] | +| **skipRecentData** | **Boolean** | 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] | ### Return type diff --git a/src/docs/UsageData.md b/src/docs/UsageData.md index 80a8db46..4daf4f37 100644 --- a/src/docs/UsageData.md +++ b/src/docs/UsageData.md @@ -2,9 +2,14 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | ---------- | ----------- | ---------- | -| **bytesReceived** | **Number** | | [optional] | -| **bytesSent** | **Number** | | [optional] | -| **period** | **Date** | | -| **totalBytes** | **Number** | | +| Name | Type | Description | Notes | +| ------------------------- | ---------- | --------------------------------------------------------- | ---------- | +| **billableBytesReceived** | **Number** | Billable bytes received (only for packet-based protocols) | [optional] | +| **billableBytesSent** | **Number** | Billable bytes sent (only for packet-based protocols) | [optional] | +| **billableBytesTotal** | **Number** | Total billable bytes (only for packet-based protocols) | [optional] | +| **bytesReceived** | **Number** | | [optional] | +| **bytesSent** | **Number** | | [optional] | +| **packetsReceived** | **Number** | Packets received (only for packet-based protocols) | [optional] | +| **packetsSent** | **Number** | Packets sent (only for packet-based protocols) | [optional] | +| **period** | **Date** | | +| **totalBytes** | **Number** | | diff --git a/src/src/ApiClient.js b/src/src/ApiClient.js index 776ac919..9a057d1b 100644 --- a/src/src/ApiClient.js +++ b/src/src/ApiClient.js @@ -46,7 +46,6 @@ class ApiClient { */ this.authentications = { personalAccessToken: { type: "bearer" }, - pin: { type: "apiKey", in: "header", name: "X-Auth-Token" }, }; /** diff --git a/src/src/api/DeviceApi.js b/src/src/api/DeviceApi.js index 15e4068f..c908e785 100644 --- a/src/src/api/DeviceApi.js +++ b/src/src/api/DeviceApi.js @@ -236,10 +236,9 @@ export default class DeviceApi { * Delete Device * @param {String} projectOrProductUID * @param {String} deviceUID - * @param {Boolean} purge * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - deleteDeviceWithHttpInfo(projectOrProductUID, deviceUID, purge) { + deleteDeviceWithHttpInfo(projectOrProductUID, deviceUID) { let postBody = null; // verify the required parameter 'projectOrProductUID' is set if (projectOrProductUID === undefined || projectOrProductUID === null) { @@ -253,20 +252,12 @@ export default class DeviceApi { "Missing the required parameter 'deviceUID' when calling deleteDevice" ); } - // verify the required parameter 'purge' is set - if (purge === undefined || purge === null) { - throw new Error( - "Missing the required parameter 'purge' when calling deleteDevice" - ); - } let pathParams = { projectOrProductUID: projectOrProductUID, deviceUID: deviceUID, }; - let queryParams = { - purge: purge, - }; + let queryParams = {}; let headerParams = {}; let formParams = {}; @@ -294,17 +285,14 @@ export default class DeviceApi { * Delete Device * @param {String} projectOrProductUID * @param {String} deviceUID - * @param {Boolean} purge * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - deleteDevice(projectOrProductUID, deviceUID, purge) { - return this.deleteDeviceWithHttpInfo( - projectOrProductUID, - deviceUID, - purge - ).then(function (response_and_data) { - return response_and_data.data; - }); + deleteDevice(projectOrProductUID, deviceUID) { + return this.deleteDeviceWithHttpInfo(projectOrProductUID, deviceUID).then( + function (response_and_data) { + return response_and_data.data; + } + ); } /** @@ -1105,9 +1093,14 @@ export default class DeviceApi { * Get environment variables of a device with device pin authorization * @param {String} productUID * @param {String} deviceUID + * @param {String} xAuthToken For accessing endpoints by Device pin. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetDeviceEnvironmentVariablesByPin200Response} and HTTP response */ - getDeviceEnvironmentVariablesByPinWithHttpInfo(productUID, deviceUID) { + getDeviceEnvironmentVariablesByPinWithHttpInfo( + productUID, + deviceUID, + xAuthToken + ) { let postBody = null; // verify the required parameter 'productUID' is set if (productUID === undefined || productUID === null) { @@ -1121,16 +1114,24 @@ export default class DeviceApi { "Missing the required parameter 'deviceUID' when calling getDeviceEnvironmentVariablesByPin" ); } + // verify the required parameter 'xAuthToken' is set + if (xAuthToken === undefined || xAuthToken === null) { + throw new Error( + "Missing the required parameter 'xAuthToken' when calling getDeviceEnvironmentVariablesByPin" + ); + } let pathParams = { productUID: productUID, deviceUID: deviceUID, }; let queryParams = {}; - let headerParams = {}; + let headerParams = { + "X-Auth-Token": xAuthToken, + }; let formParams = {}; - let authNames = ["pin"]; + let authNames = []; let contentTypes = []; let accepts = ["application/json"]; let returnType = GetDeviceEnvironmentVariablesByPin200Response; @@ -1154,12 +1155,14 @@ export default class DeviceApi { * Get environment variables of a device with device pin authorization * @param {String} productUID * @param {String} deviceUID + * @param {String} xAuthToken For accessing endpoints by Device pin. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetDeviceEnvironmentVariablesByPin200Response} */ - getDeviceEnvironmentVariablesByPin(productUID, deviceUID) { + getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken) { return this.getDeviceEnvironmentVariablesByPinWithHttpInfo( productUID, - deviceUID + deviceUID, + xAuthToken ).then(function (response_and_data) { return response_and_data.data; }); @@ -2127,12 +2130,14 @@ export default class DeviceApi { * Set environment variables of a device with device pin authorization * @param {String} productUID * @param {String} deviceUID + * @param {String} xAuthToken For accessing endpoints by Device pin. * @param {module:model/EnvironmentVariables} environmentVariables Environment variables to be added to the device * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EnvironmentVariables} and HTTP response */ setDeviceEnvironmentVariablesByPinWithHttpInfo( productUID, deviceUID, + xAuthToken, environmentVariables ) { let postBody = environmentVariables; @@ -2148,6 +2153,12 @@ export default class DeviceApi { "Missing the required parameter 'deviceUID' when calling setDeviceEnvironmentVariablesByPin" ); } + // verify the required parameter 'xAuthToken' is set + if (xAuthToken === undefined || xAuthToken === null) { + throw new Error( + "Missing the required parameter 'xAuthToken' when calling setDeviceEnvironmentVariablesByPin" + ); + } // verify the required parameter 'environmentVariables' is set if (environmentVariables === undefined || environmentVariables === null) { throw new Error( @@ -2160,10 +2171,12 @@ export default class DeviceApi { deviceUID: deviceUID, }; let queryParams = {}; - let headerParams = {}; + let headerParams = { + "X-Auth-Token": xAuthToken, + }; let formParams = {}; - let authNames = ["pin"]; + let authNames = []; let contentTypes = ["application/json"]; let accepts = ["application/json"]; let returnType = EnvironmentVariables; @@ -2187,17 +2200,20 @@ export default class DeviceApi { * Set environment variables of a device with device pin authorization * @param {String} productUID * @param {String} deviceUID + * @param {String} xAuthToken For accessing endpoints by Device pin. * @param {module:model/EnvironmentVariables} environmentVariables Environment variables to be added to the device * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EnvironmentVariables} */ setDeviceEnvironmentVariablesByPin( productUID, deviceUID, + xAuthToken, environmentVariables ) { return this.setDeviceEnvironmentVariablesByPinWithHttpInfo( productUID, deviceUID, + xAuthToken, environmentVariables ).then(function (response_and_data) { return response_and_data.data; diff --git a/src/src/api/ProjectApi.js b/src/src/api/ProjectApi.js index 3e5bcc0c..086678d8 100644 --- a/src/src/api/ProjectApi.js +++ b/src/src/api/ProjectApi.js @@ -1362,6 +1362,8 @@ export default class ProjectApi { * @param {String} opts.filename * @param {String} opts.md5 * @param {Boolean} opts.unpublished + * @param {module:model/String} opts.sortBy Field to sort by (default to 'created') + * @param {module:model/String} opts.sortOrder Sort order (asc for ascending, desc for descending) (default to 'desc') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ getFirmwareInfoWithHttpInfo(projectOrProductUID, opts) { @@ -1385,6 +1387,8 @@ export default class ProjectApi { filename: opts["filename"], md5: opts["md5"], unpublished: opts["unpublished"], + sortBy: opts["sortBy"], + sortOrder: opts["sortOrder"], }; let headerParams = {}; let formParams = {}; @@ -1420,6 +1424,8 @@ export default class ProjectApi { * @param {String} opts.filename * @param {String} opts.md5 * @param {Boolean} opts.unpublished + * @param {module:model/String} opts.sortBy Field to sort by (default to 'created') + * @param {module:model/String} opts.sortOrder Sort order (asc for ascending, desc for descending) (default to 'desc') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} */ getFirmwareInfo(projectOrProductUID, opts) { diff --git a/src/src/api/RouteApi.js b/src/src/api/RouteApi.js index b24c5df4..50bc4866 100644 --- a/src/src/api/RouteApi.js +++ b/src/src/api/RouteApi.js @@ -237,6 +237,8 @@ export default class RouteApi { * @param {Boolean} opts.systemFilesOnly * @param {Boolean} opts.mostRecentOnly * @param {String} opts.files + * @param {Array.} opts.routingStatus + * @param {Array.} opts.responseStatus * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ getRouteLogsByRouteWithHttpInfo(projectOrProductUID, routeUID, opts) { @@ -273,6 +275,14 @@ export default class RouteApi { systemFilesOnly: opts["systemFilesOnly"], mostRecentOnly: opts["mostRecentOnly"], files: opts["files"], + routingStatus: this.apiClient.buildCollectionParam( + opts["routingStatus"], + "multi" + ), + responseStatus: this.apiClient.buildCollectionParam( + opts["responseStatus"], + "multi" + ), }; let headerParams = {}; let formParams = {}; @@ -312,6 +322,8 @@ export default class RouteApi { * @param {Boolean} opts.systemFilesOnly * @param {Boolean} opts.mostRecentOnly * @param {String} opts.files + * @param {Array.} opts.routingStatus + * @param {Array.} opts.responseStatus * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} */ getRouteLogsByRoute(projectOrProductUID, routeUID, opts) { diff --git a/src/src/api/UsageApi.js b/src/src/api/UsageApi.js index f1ff1c8e..aed003fe 100644 --- a/src/src/api/UsageApi.js +++ b/src/src/api/UsageApi.js @@ -227,6 +227,7 @@ export default class UsageApi { * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp * @param {Array.} opts.routeUID A Route UID. * @param {module:model/String} opts.aggregate Aggregation level for results (default to 'route') + * @param {Boolean} opts.skipRecentData 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 {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetRouteLogsUsage200Response} and HTTP response */ getRouteLogsUsageWithHttpInfo(projectOrProductUID, period, opts) { @@ -254,6 +255,7 @@ export default class UsageApi { routeUID: this.apiClient.buildCollectionParam(opts["routeUID"], "multi"), period: period, aggregate: opts["aggregate"], + skipRecentData: opts["skipRecentData"], }; let headerParams = {}; let formParams = {}; @@ -287,6 +289,7 @@ export default class UsageApi { * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp * @param {Array.} opts.routeUID A Route UID. * @param {module:model/String} opts.aggregate Aggregation level for results (default to 'route') + * @param {Boolean} opts.skipRecentData 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 {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetRouteLogsUsage200Response} */ getRouteLogsUsage(projectOrProductUID, period, opts) { diff --git a/src/src/index.js b/src/src/index.js index 5ffecb70..0d1ceab8 100644 --- a/src/src/index.js +++ b/src/src/index.js @@ -119,6 +119,7 @@ import Role from "./model/Role"; import RouteLog from "./model/RouteLog"; import RouteTransformSettings from "./model/RouteTransformSettings"; import S3ArchiveRoute from "./model/S3ArchiveRoute"; +import SatelliteDataUsage from "./model/SatelliteDataUsage"; import SatellitePlan from "./model/SatellitePlan"; import SchemaProperty from "./model/SchemaProperty"; import SignalDevice200Response from "./model/SignalDevice200Response"; @@ -834,6 +835,12 @@ export { */ S3ArchiveRoute, + /** + * The SatelliteDataUsage model constructor. + * @property {module:model/SatelliteDataUsage} + */ + SatelliteDataUsage, + /** * The SatellitePlan model constructor. * @property {module:model/SatellitePlan} diff --git a/src/src/model/AlertDataInner.js b/src/src/model/AlertDataInner.js index 034ab9dc..b2530e15 100644 --- a/src/src/model/AlertDataInner.js +++ b/src/src/model/AlertDataInner.js @@ -214,6 +214,12 @@ AlertDataInner["SourceTypeEnum"] = { * @const */ event: "event", + + /** + * value: "device" + * @const + */ + device: "device", }; export default AlertDataInner; diff --git a/src/src/model/CreateMonitor.js b/src/src/model/CreateMonitor.js index 22e6aa2a..98354861 100644 --- a/src/src/model/CreateMonitor.js +++ b/src/src/model/CreateMonitor.js @@ -28,16 +28,18 @@ class CreateMonitor { * @param alertRoutes {Array.} * @param description {String} * @param name {String} - * @param notefileFilter {Array.} + * @param sourceType {module:model/CreateMonitor.SourceTypeEnum} The type of source to monitor. Supported values are \"event\" and \"heartbeat\". + * @param threshold {Number} The type of condition to apply to the value selected by the source_selector */ - constructor(alertRoutes, description, name, notefileFilter) { + constructor(alertRoutes, description, name, sourceType, threshold) { Monitor.initialize(this); CreateMonitor.initialize( this, alertRoutes, description, name, - notefileFilter + sourceType, + threshold ); } @@ -46,11 +48,19 @@ class CreateMonitor { * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). * Only for internal use. */ - static initialize(obj, alertRoutes, description, name, notefileFilter) { + static initialize( + obj, + alertRoutes, + description, + name, + sourceType, + threshold + ) { obj["alert_routes"] = alertRoutes; obj["description"] = description; obj["name"] = name; - obj["notefile_filter"] = notefileFilter; + obj["source_type"] = sourceType; + obj["threshold"] = threshold; } /** @@ -337,7 +347,8 @@ CreateMonitor.RequiredProperties = [ "alert_routes", "description", "name", - "notefile_filter", + "source_type", + "threshold", ]; /** @@ -426,7 +437,7 @@ CreateMonitor.prototype["silenced"] = undefined; CreateMonitor.prototype["source_selector"] = undefined; /** - * The type of source to monitor. Currently only \"event\" is supported. + * The type of source to monitor. Supported values are \"event\" and \"heartbeat\". * @member {module:model/CreateMonitor.SourceTypeEnum} source_type */ CreateMonitor.prototype["source_type"] = undefined; @@ -514,7 +525,7 @@ Monitor.prototype["silenced"] = undefined; */ Monitor.prototype["source_selector"] = undefined; /** - * The type of source to monitor. Currently only \"event\" is supported. + * The type of source to monitor. Supported values are \"event\" and \"heartbeat\". * @member {module:model/Monitor.SourceTypeEnum} source_type */ Monitor.prototype["source_type"] = undefined; @@ -619,6 +630,12 @@ CreateMonitor["SourceTypeEnum"] = { * @const */ event: "event", + + /** + * value: "heartbeat" + * @const + */ + heartbeat: "heartbeat", }; export default CreateMonitor; diff --git a/src/src/model/GetDataUsage200ResponseDataInner.js b/src/src/model/GetDataUsage200ResponseDataInner.js index 7b0fd113..a6c6cc0f 100644 --- a/src/src/model/GetDataUsage200ResponseDataInner.js +++ b/src/src/model/GetDataUsage200ResponseDataInner.js @@ -57,14 +57,20 @@ class GetDataUsage200ResponseDataInner { if (data.hasOwnProperty("device")) { obj["device"] = ApiClient.convertToType(data["device"], "String"); } + if (data.hasOwnProperty("device_count")) { + obj["device_count"] = ApiClient.convertToType( + data["device_count"], + "Number" + ); + } if (data.hasOwnProperty("fleet")) { obj["fleet"] = ApiClient.convertToType(data["fleet"], "String"); } if (data.hasOwnProperty("iccid")) { obj["iccid"] = ApiClient.convertToType(data["iccid"], "String"); } - if (data.hasOwnProperty("imsi")) { - obj["imsi"] = ApiClient.convertToType(data["imsi"], "String"); + if (data.hasOwnProperty("psid")) { + obj["psid"] = ApiClient.convertToType(data["psid"], "String"); } if (data.hasOwnProperty("type")) { obj["type"] = ApiClient.convertToType(data["type"], "String"); @@ -138,12 +144,12 @@ class GetDataUsage200ResponseDataInner { } // ensure the json data is a string if ( - data["imsi"] && - !(typeof data["imsi"] === "string" || data["imsi"] instanceof String) + data["psid"] && + !(typeof data["psid"] === "string" || data["psid"] instanceof String) ) { throw new Error( - "Expected the field `imsi` to be a primitive type in the JSON string but got " + - data["imsi"] + "Expected the field `psid` to be a primitive type in the JSON string but got " + + data["psid"] ); } // ensure the json data is a string @@ -174,6 +180,12 @@ GetDataUsage200ResponseDataInner.prototype["data"] = undefined; */ GetDataUsage200ResponseDataInner.prototype["device"] = undefined; +/** + * the number of devices represented by this data point + * @member {Number} device_count + */ +GetDataUsage200ResponseDataInner.prototype["device_count"] = undefined; + /** * The fleet UID this usage data belongs to (only present when aggregate is 'fleet') * @member {String} fleet @@ -187,10 +199,10 @@ GetDataUsage200ResponseDataInner.prototype["fleet"] = undefined; GetDataUsage200ResponseDataInner.prototype["iccid"] = undefined; /** - * The IMSI of the satellite device (only present when type is 'satellite') - * @member {String} imsi + * The PSID (Packet Service ID) of the satellite (or other packet-based device) + * @member {String} psid */ -GetDataUsage200ResponseDataInner.prototype["imsi"] = undefined; +GetDataUsage200ResponseDataInner.prototype["psid"] = undefined; /** * The type of connectivity diff --git a/src/src/model/Monitor.js b/src/src/model/Monitor.js index 32667f5c..2c7a8323 100644 --- a/src/src/model/Monitor.js +++ b/src/src/model/Monitor.js @@ -389,7 +389,7 @@ Monitor.prototype["silenced"] = undefined; Monitor.prototype["source_selector"] = undefined; /** - * The type of source to monitor. Currently only \"event\" is supported. + * The type of source to monitor. Supported values are \"event\" and \"heartbeat\". * @member {module:model/Monitor.SourceTypeEnum} source_type */ Monitor.prototype["source_type"] = undefined; @@ -496,6 +496,12 @@ Monitor["SourceTypeEnum"] = { * @const */ event: "event", + + /** + * value: "heartbeat" + * @const + */ + heartbeat: "heartbeat", }; export default Monitor; diff --git a/src/src/model/SatelliteDataUsage.js b/src/src/model/SatelliteDataUsage.js new file mode 100644 index 00000000..091ec0de --- /dev/null +++ b/src/src/model/SatelliteDataUsage.js @@ -0,0 +1,152 @@ +/** + * Notehub API + * The OpenAPI definition for the Notehub.io API. + * + * The version of the OpenAPI document: 1.2.0 + * Contact: engineering@blues.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from "../ApiClient"; + +/** + * The SatelliteDataUsage model module. + * @module model/SatelliteDataUsage + * @version 4.0.0 + */ +class SatelliteDataUsage { + /** + * Constructs a new SatelliteDataUsage. + * @alias module:model/SatelliteDataUsage + * @param bytesRemaining {Number} Bytes remaining in the plan + * @param bytesTotal {Number} Total bytes included in the plan + * @param bytesUsed {Number} Bytes used to date + * @param bytesUsedBillable {Number} Billable bytes used to date + */ + constructor(bytesRemaining, bytesTotal, bytesUsed, bytesUsedBillable) { + SatelliteDataUsage.initialize( + this, + bytesRemaining, + bytesTotal, + bytesUsed, + bytesUsedBillable + ); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize( + obj, + bytesRemaining, + bytesTotal, + bytesUsed, + bytesUsedBillable + ) { + obj["bytes_remaining"] = bytesRemaining; + obj["bytes_total"] = bytesTotal; + obj["bytes_used"] = bytesUsed; + obj["bytes_used_billable"] = bytesUsedBillable; + } + + /** + * Constructs a SatelliteDataUsage from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SatelliteDataUsage} obj Optional instance to populate. + * @return {module:model/SatelliteDataUsage} The populated SatelliteDataUsage instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new SatelliteDataUsage(); + + if (data.hasOwnProperty("bytes_remaining")) { + obj["bytes_remaining"] = ApiClient.convertToType( + data["bytes_remaining"], + "Number" + ); + } + if (data.hasOwnProperty("bytes_total")) { + obj["bytes_total"] = ApiClient.convertToType( + data["bytes_total"], + "Number" + ); + } + if (data.hasOwnProperty("bytes_used")) { + obj["bytes_used"] = ApiClient.convertToType( + data["bytes_used"], + "Number" + ); + } + if (data.hasOwnProperty("bytes_used_billable")) { + obj["bytes_used_billable"] = ApiClient.convertToType( + data["bytes_used_billable"], + "Number" + ); + } + } else if (data === null) { + return null; + } + return obj; + } + + /** + * Validates the JSON data with respect to SatelliteDataUsage. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to SatelliteDataUsage. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of SatelliteDataUsage.RequiredProperties) { + if (!data[property]) { + throw new Error( + "The required field `" + + property + + "` is not found in the JSON data: " + + JSON.stringify(data) + ); + } + } + + return true; + } +} + +SatelliteDataUsage.RequiredProperties = [ + "bytes_remaining", + "bytes_total", + "bytes_used", + "bytes_used_billable", +]; + +/** + * Bytes remaining in the plan + * @member {Number} bytes_remaining + */ +SatelliteDataUsage.prototype["bytes_remaining"] = undefined; + +/** + * Total bytes included in the plan + * @member {Number} bytes_total + */ +SatelliteDataUsage.prototype["bytes_total"] = undefined; + +/** + * Bytes used to date + * @member {Number} bytes_used + */ +SatelliteDataUsage.prototype["bytes_used"] = undefined; + +/** + * Billable bytes used to date + * @member {Number} bytes_used_billable + */ +SatelliteDataUsage.prototype["bytes_used_billable"] = undefined; + +export default SatelliteDataUsage; diff --git a/src/src/model/SatellitePlan.js b/src/src/model/SatellitePlan.js index 777d44e6..5f918b18 100644 --- a/src/src/model/SatellitePlan.js +++ b/src/src/model/SatellitePlan.js @@ -12,7 +12,7 @@ */ import ApiClient from "../ApiClient"; -import DataUsage from "./DataUsage"; +import SatelliteDataUsage from "./SatelliteDataUsage"; /** * The SatellitePlan model module. @@ -56,14 +56,15 @@ class SatellitePlan { if (data.hasOwnProperty("activated")) { obj["activated"] = ApiClient.convertToType(data["activated"], "Number"); } - if (data.hasOwnProperty("billable_bytes")) { - obj["billable_bytes"] = DataUsage.constructFromObject( - data["billable_bytes"] + if (data.hasOwnProperty("last_session_at")) { + obj["last_session_at"] = ApiClient.convertToType( + data["last_session_at"], + "Number" ); } - if (data.hasOwnProperty("last_updated")) { - obj["last_updated"] = ApiClient.convertToType( - data["last_updated"], + if (data.hasOwnProperty("minimum_billable_bytes")) { + obj["minimum_billable_bytes"] = ApiClient.convertToType( + data["minimum_billable_bytes"], "Number" ); } @@ -76,6 +77,11 @@ class SatellitePlan { if (data.hasOwnProperty("psid")) { obj["psid"] = ApiClient.convertToType(data["psid"], "String"); } + if (data.hasOwnProperty("satellite_data_usage")) { + obj["satellite_data_usage"] = SatelliteDataUsage.constructFromObject( + data["satellite_data_usage"] + ); + } } else if (data === null) { return null; } @@ -99,11 +105,6 @@ class SatellitePlan { ); } } - // validate the optional field `billable_bytes` - if (data["billable_bytes"]) { - // data not null - DataUsage.validateJSON(data["billable_bytes"]); - } // ensure the json data is a string if ( data["ntn_provider"] && @@ -127,6 +128,11 @@ class SatellitePlan { data["psid"] ); } + // validate the optional field `satellite_data_usage` + if (data["satellite_data_usage"]) { + // data not null + SatelliteDataUsage.validateJSON(data["satellite_data_usage"]); + } return true; } @@ -141,15 +147,16 @@ SatellitePlan.RequiredProperties = ["activated", "ntn_provider", "psid"]; SatellitePlan.prototype["activated"] = undefined; /** - * @member {module:model/DataUsage} billable_bytes + * When this Starnote last had a session + * @member {Number} last_session_at */ -SatellitePlan.prototype["billable_bytes"] = undefined; +SatellitePlan.prototype["last_session_at"] = undefined; /** - * Time this plan information was last updated - * @member {Number} last_updated + * Minimum billable bytes + * @member {Number} minimum_billable_bytes */ -SatellitePlan.prototype["last_updated"] = undefined; +SatellitePlan.prototype["minimum_billable_bytes"] = undefined; /** * Non-Terrestrial Network provider name @@ -163,4 +170,9 @@ SatellitePlan.prototype["ntn_provider"] = undefined; */ SatellitePlan.prototype["psid"] = undefined; +/** + * @member {module:model/SatelliteDataUsage} satellite_data_usage + */ +SatellitePlan.prototype["satellite_data_usage"] = undefined; + export default SatellitePlan; diff --git a/src/src/model/UsageData.js b/src/src/model/UsageData.js index b0610e0d..c1bd8349 100644 --- a/src/src/model/UsageData.js +++ b/src/src/model/UsageData.js @@ -50,6 +50,24 @@ class UsageData { if (data) { obj = obj || new UsageData(); + if (data.hasOwnProperty("billable_bytes_received")) { + obj["billable_bytes_received"] = ApiClient.convertToType( + data["billable_bytes_received"], + "Number" + ); + } + if (data.hasOwnProperty("billable_bytes_sent")) { + obj["billable_bytes_sent"] = ApiClient.convertToType( + data["billable_bytes_sent"], + "Number" + ); + } + if (data.hasOwnProperty("billable_bytes_total")) { + obj["billable_bytes_total"] = ApiClient.convertToType( + data["billable_bytes_total"], + "Number" + ); + } if (data.hasOwnProperty("bytes_received")) { obj["bytes_received"] = ApiClient.convertToType( data["bytes_received"], @@ -62,6 +80,18 @@ class UsageData { "Number" ); } + if (data.hasOwnProperty("packets_received")) { + obj["packets_received"] = ApiClient.convertToType( + data["packets_received"], + "Number" + ); + } + if (data.hasOwnProperty("packets_sent")) { + obj["packets_sent"] = ApiClient.convertToType( + data["packets_sent"], + "Number" + ); + } if (data.hasOwnProperty("period")) { obj["period"] = ApiClient.convertToType(data["period"], "Date"); } @@ -101,6 +131,24 @@ class UsageData { UsageData.RequiredProperties = ["period", "total_bytes"]; +/** + * Billable bytes received (only for packet-based protocols) + * @member {Number} billable_bytes_received + */ +UsageData.prototype["billable_bytes_received"] = undefined; + +/** + * Billable bytes sent (only for packet-based protocols) + * @member {Number} billable_bytes_sent + */ +UsageData.prototype["billable_bytes_sent"] = undefined; + +/** + * Total billable bytes (only for packet-based protocols) + * @member {Number} billable_bytes_total + */ +UsageData.prototype["billable_bytes_total"] = undefined; + /** * @member {Number} bytes_received */ @@ -111,6 +159,18 @@ UsageData.prototype["bytes_received"] = undefined; */ UsageData.prototype["bytes_sent"] = undefined; +/** + * Packets received (only for packet-based protocols) + * @member {Number} packets_received + */ +UsageData.prototype["packets_received"] = undefined; + +/** + * Packets sent (only for packet-based protocols) + * @member {Number} packets_sent + */ +UsageData.prototype["packets_sent"] = undefined; + /** * @member {Date} period */ diff --git a/src/test/model/SatelliteDataUsage.spec.js b/src/test/model/SatelliteDataUsage.spec.js new file mode 100644 index 00000000..8ce06630 --- /dev/null +++ b/src/test/model/SatelliteDataUsage.spec.js @@ -0,0 +1,77 @@ +/** + * Notehub API + * The OpenAPI definition for the Notehub.io API. + * + * The version of the OpenAPI document: 1.2.0 + * Contact: engineering@blues.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function (root, factory) { + if (typeof define === "function" && define.amd) { + // AMD. + define(["expect.js", process.cwd() + "/src/index"], factory); + } else if (typeof module === "object" && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require("expect.js"), require(process.cwd() + "/src/index")); + } else { + // Browser globals (root is window) + factory(root.expect, root.NotehubJs); + } +})(this, function (expect, NotehubJs) { + "use strict"; + + var instance; + + beforeEach(function () { + instance = new NotehubJs.SatelliteDataUsage(); + }); + + var getProperty = function (object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === "function") return object[getter](); + else return object[property]; + }; + + var setProperty = function (object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === "function") object[setter](value); + else object[property] = value; + }; + + describe("SatelliteDataUsage", function () { + it("should create an instance of SatelliteDataUsage", function () { + // uncomment below and update the code to test SatelliteDataUsage + //var instance = new NotehubJs.SatelliteDataUsage(); + //expect(instance).to.be.a(NotehubJs.SatelliteDataUsage); + }); + + it('should have the property bytesRemaining (base name: "bytes_remaining")', function () { + // uncomment below and update the code to test the property bytesRemaining + //var instance = new NotehubJs.SatelliteDataUsage(); + //expect(instance).to.be(); + }); + + it('should have the property bytesTotal (base name: "bytes_total")', function () { + // uncomment below and update the code to test the property bytesTotal + //var instance = new NotehubJs.SatelliteDataUsage(); + //expect(instance).to.be(); + }); + + it('should have the property bytesUsed (base name: "bytes_used")', function () { + // uncomment below and update the code to test the property bytesUsed + //var instance = new NotehubJs.SatelliteDataUsage(); + //expect(instance).to.be(); + }); + + it('should have the property bytesUsedBillable (base name: "bytes_used_billable")', function () { + // uncomment below and update the code to test the property bytesUsedBillable + //var instance = new NotehubJs.SatelliteDataUsage(); + //expect(instance).to.be(); + }); + }); +});