From c028606f72d32c65ad4bf97736f65950857ba8c8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 17 Dec 2025 18:11:51 +0000 Subject: [PATCH 1/8] feat: Update OpenAPI file replicated from Notehub commit b7c6c90 --- openapi.yaml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 8661551..86dfb94 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': @@ -2538,6 +2535,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 +3266,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 @@ -6151,12 +6162,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 From d0a951085ff67ba659fbbcded995d5a11d5246d0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 17 Dec 2025 21:16:06 +0000 Subject: [PATCH 2/8] feat: Update OpenAPI file replicated from Notehub commit b78e372 --- openapi.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 86dfb94..362ba0f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3304,6 +3304,7 @@ components: type: string enum: - event + - device source_uid: description: The UID of the source of the alert type: string @@ -3533,8 +3534,9 @@ components: - required: - name - description - - notefile_filter - alert_routes + - source_type + - threshold CreateUpdateRepository: type: object properties: @@ -4667,10 +4669,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 From 636d29c11f55aa13586f9127a008d9c00a8b67e5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 17 Dec 2025 21:38:22 +0000 Subject: [PATCH 3/8] feat: Update OpenAPI file replicated from Notehub commit c3e07ac --- openapi.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 362ba0f..0d763a4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -447,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 From 874db0a1f0dbd31dac8edf99cdaba0151d0974da Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 18 Dec 2025 21:54:57 +0000 Subject: [PATCH 4/8] feat: Update OpenAPI file replicated from Notehub commit 96e474b --- openapi.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 0d763a4..6406d6a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6104,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 From 97c10f9d8e5ec65242ff52080aeb324b939b6f0a Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 8 Jan 2026 16:59:28 +0000 Subject: [PATCH 5/8] feat: Update OpenAPI file replicated from Notehub commit 804eabf --- openapi.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 6406d6a..36eb5c1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1493,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 @@ -2885,6 +2887,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 From 404cfcef3544b9b0f3042e69cdd0f84c581db11a Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 9 Jan 2026 09:25:25 +0000 Subject: [PATCH 6/8] feat: Update OpenAPI file replicated from Notehub commit 06bd4f1 --- openapi.yaml | 69 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 8 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 36eb5c1..9106327 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5210,6 +5210,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: @@ -5218,13 +5246,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 @@ -5233,6 +5264,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 @@ -5534,6 +5567,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 @@ -5542,6 +5587,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 @@ -6141,10 +6194,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 From 8b8d0c7f31d21788aeb264a33209076edd87a455 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 14 Jan 2026 19:02:42 +0000 Subject: [PATCH 7/8] feat: Update OpenAPI file replicated from Notehub commit 2bbd4d9 --- openapi.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 9106327..325cd50 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2361,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 @@ -3117,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 @@ -3155,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 From e708b01ee8bcc28cc1857d3d25540f0672cb02da Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Wed, 14 Jan 2026 16:11:09 -0500 Subject: [PATCH 8/8] 5.0.0 --- openapi_filtered.yaml | 167 +++++++++++++++--- src/.openapi-generator/FILES | 3 + src/README.md | 8 +- src/docs/CreateMonitor.md | 6 +- src/docs/DeviceApi.md | 62 +++---- src/docs/GetDataUsage200ResponseDataInner.md | 17 +- src/docs/Monitor.md | 2 +- src/docs/ProjectApi.md | 28 +-- src/docs/RouteApi.md | 8 +- src/docs/SatelliteDataUsage.md | 30 ++++ src/docs/SatellitePlan.md | 15 +- src/docs/UsageApi.md | 22 +-- src/docs/UsageData.md | 17 +- src/notehub_py/__init__.py | 1 + src/notehub_py/api/device_api.py | 63 +++++-- src/notehub_py/api/project_api.py | 49 +++++ src/notehub_py/api/route_api.py | 36 ++++ src/notehub_py/api/usage_api.py | 32 ++++ src/notehub_py/configuration.py | 78 +++----- src/notehub_py/models/__init__.py | 1 + src/notehub_py/models/alert_data_inner.py | 4 +- src/notehub_py/models/create_monitor.py | 19 +- .../get_data_usage200_response_data_inner.py | 15 +- src/notehub_py/models/monitor.py | 6 +- src/notehub_py/models/satellite_data_usage.py | 99 +++++++++++ src/notehub_py/models/satellite_plan.py | 35 ++-- src/notehub_py/models/usage_data.py | 30 +++- src/test/test_satellite_data_usage.py | 61 +++++++ 28 files changed, 677 insertions(+), 237 deletions(-) create mode 100644 src/docs/SatelliteDataUsage.md create mode 100644 src/notehub_py/models/satellite_data_usage.py create mode 100644 src/test/test_satellite_data_usage.py diff --git a/openapi_filtered.yaml b/openapi_filtered.yaml index 3efbc5c..348b3b9 100644 --- a/openapi_filtered.yaml +++ b/openapi_filtered.yaml @@ -155,13 +155,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 @@ -178,8 +177,6 @@ paths: $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' - security: - - pin: [] tags: - device /v1/products/{productUID}/ext-devices/{deviceUID}/event: @@ -465,13 +462,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 @@ -1525,6 +1515,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 @@ -2367,6 +2359,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 @@ -2541,6 +2535,15 @@ 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' @@ -2911,6 +2914,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 @@ -3117,6 +3144,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 @@ -3155,6 +3191,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 @@ -3287,6 +3335,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 @@ -3318,6 +3373,7 @@ components: type: string enum: - event + - device source_uid: description: The UID of the source of the alert type: string @@ -3548,8 +3604,9 @@ components: - required: - name - description - - notefile_filter - alert_routes + - source_type + - threshold CreateUpdateRepository: type: object properties: @@ -4720,10 +4777,12 @@ 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 @@ -5248,6 +5307,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: @@ -5256,13 +5343,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 @@ -5271,6 +5361,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 @@ -5572,6 +5664,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 @@ -5580,6 +5684,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 @@ -6189,6 +6301,10 @@ components: 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') @@ -6199,11 +6315,11 @@ components: 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 @@ -6247,13 +6363,6 @@ components: ' 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 54dea22..30399b4 100644 --- a/src/.openapi-generator/FILES +++ b/src/.openapi-generator/FILES @@ -119,6 +119,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 @@ -270,6 +271,7 @@ notehub_py/models/role.py notehub_py/models/route_log.py notehub_py/models/route_transform_settings.py notehub_py/models/s3_archive_route.py +notehub_py/models/satellite_data_usage.py notehub_py/models/satellite_plan.py notehub_py/models/schema_property.py notehub_py/models/signal_device200_response.py @@ -301,4 +303,5 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_satellite_data_usage.py tox.ini diff --git a/src/README.md b/src/README.md index 6115a36..d3ff90d 100644 --- a/src/README.md +++ b/src/README.md @@ -315,6 +315,7 @@ Class | Method | HTTP request | Description - [RouteLog](docs/RouteLog.md) - [RouteTransformSettings](docs/RouteTransformSettings.md) - [S3ArchiveRoute](docs/S3ArchiveRoute.md) + - [SatelliteDataUsage](docs/SatelliteDataUsage.md) - [SatellitePlan](docs/SatellitePlan.md) - [SchemaProperty](docs/SchemaProperty.md) - [SignalDevice200Response](docs/SignalDevice200Response.md) @@ -350,13 +351,6 @@ Authentication schemes defined for the API: - **Type**: Bearer authentication - -### pin - -- **Type**: API key -- **API key parameter name**: X-Auth-Token -- **Location**: HTTP header - ## Author diff --git a/src/docs/CreateMonitor.md b/src/docs/CreateMonitor.md index 77e7565..3d04a69 100644 --- a/src/docs/CreateMonitor.md +++ b/src/docs/CreateMonitor.md @@ -14,13 +14,13 @@ | **fleet_filter** | **List[str]** | | [optional] | | **last_routed_at** | **str** | The last time the monitor was evaluated and routed. | [optional] | | **name** | **str** | | -| **notefile_filter** | **List[str]** | | +| **notefile_filter** | **List[str]** | | [optional] | | **per_device** | **bool** | 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] | | **routing_cooldown_period** | **str** | 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** | **bool** | If true, alerts will be created, but no notifications will be sent. | [optional] | | **source_selector** | **str** | A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. | [optional] | -| **source_type** | **str** | The type of source to monitor. Currently only \"event\" is supported. | [optional] | -| **threshold** | **int** | The type of condition to apply to the value selected by the source_selector | [optional] | +| **source_type** | **str** | The type of source to monitor. Supported values are \"event\" and \"heartbeat\". | +| **threshold** | **int** | The type of condition to apply to the value selected by the source_selector | | **uid** | **str** | | [optional] | ## Example diff --git a/src/docs/DeviceApi.md b/src/docs/DeviceApi.md index b992156..fe3eaf3 100644 --- a/src/docs/DeviceApi.md +++ b/src/docs/DeviceApi.md @@ -195,7 +195,7 @@ void (empty response body) # **delete_device** -> delete_device(project_or_product_uid, device_uid, purge) +> delete_device(project_or_product_uid, device_uid) Delete Device @@ -230,21 +230,19 @@ with notehub_py.ApiClient(configuration) as api_client: api_instance = notehub_py.DeviceApi(api_client) project_or_product_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str | device_uid = 'dev:000000000000000' # str | - purge = False # bool | (default to False) try: - api_instance.delete_device(project_or_product_uid, device_uid, purge) + api_instance.delete_device(project_or_product_uid, device_uid) except Exception as e: print("Exception when calling DeviceApi->delete_device: %s\n" % e) ``` ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | -------- | ----------- | ------------------ | -| **project_or_product_uid** | **str** | | -| **device_uid** | **str** | | -| **purge** | **bool** | | [default to False] | +| Name | Type | Description | Notes | +| -------------------------- | ------- | ----------- | ----- | +| **project_or_product_uid** | **str** | | +| **device_uid** | **str** | | ### Return type @@ -1107,14 +1105,12 @@ with notehub_py.ApiClient(configuration) as api_client: # **get_device_environment_variables_by_pin** -> GetDeviceEnvironmentVariablesByPin200Response get_device_environment_variables_by_pin(product_uid, device_uid) +> GetDeviceEnvironmentVariablesByPin200Response get_device_environment_variables_by_pin(product_uid, device_uid, x_auth_token) Get environment variables of a device with device pin authorization ### Example -- Api Key Authentication (pin): - ```python import notehub_py from notehub_py.models.get_device_environment_variables_by_pin200_response import GetDeviceEnvironmentVariablesByPin200Response @@ -1127,16 +1123,6 @@ configuration = notehub_py.Configuration( host = "https://api.notefile.net" ) -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: pin -configuration.api_key['pin'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['pin'] = 'Bearer' # Enter a context with an instance of the API client with notehub_py.ApiClient(configuration) as api_client: @@ -1144,9 +1130,10 @@ with notehub_py.ApiClient(configuration) as api_client: api_instance = notehub_py.DeviceApi(api_client) product_uid = 'com.blues.bridge:sensors' # str | device_uid = 'dev:000000000000000' # str | + x_auth_token = 'x_auth_token_example' # str | For accessing endpoints by Device pin. try: - api_response = api_instance.get_device_environment_variables_by_pin(product_uid, device_uid) + api_response = api_instance.get_device_environment_variables_by_pin(product_uid, device_uid, x_auth_token) print("The response of DeviceApi->get_device_environment_variables_by_pin:\n") pprint(api_response) except Exception as e: @@ -1155,10 +1142,11 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| --------------- | ------- | ----------- | ----- | -| **product_uid** | **str** | | -| **device_uid** | **str** | | +| Name | Type | Description | Notes | +| ---------------- | ------- | -------------------------------------- | ----- | +| **product_uid** | **str** | | +| **device_uid** | **str** | | +| **x_auth_token** | **str** | For accessing endpoints by Device pin. | ### Return type @@ -1166,7 +1154,7 @@ with notehub_py.ApiClient(configuration) as api_client: ### Authorization -[pin](../README.md#pin) +No authorization required ### HTTP request headers @@ -2168,14 +2156,12 @@ with notehub_py.ApiClient(configuration) as api_client: # **set_device_environment_variables_by_pin** -> EnvironmentVariables set_device_environment_variables_by_pin(product_uid, device_uid, environment_variables) +> EnvironmentVariables set_device_environment_variables_by_pin(product_uid, device_uid, x_auth_token, environment_variables) Set environment variables of a device with device pin authorization ### Example -- Api Key Authentication (pin): - ```python import notehub_py from notehub_py.models.environment_variables import EnvironmentVariables @@ -2188,16 +2174,6 @@ configuration = notehub_py.Configuration( host = "https://api.notefile.net" ) -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: pin -configuration.api_key['pin'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['pin'] = 'Bearer' # Enter a context with an instance of the API client with notehub_py.ApiClient(configuration) as api_client: @@ -2205,10 +2181,11 @@ with notehub_py.ApiClient(configuration) as api_client: api_instance = notehub_py.DeviceApi(api_client) product_uid = 'com.blues.bridge:sensors' # str | device_uid = 'dev:000000000000000' # str | + x_auth_token = 'x_auth_token_example' # str | For accessing endpoints by Device pin. environment_variables = notehub_py.EnvironmentVariables() # EnvironmentVariables | Environment variables to be added to the device try: - api_response = api_instance.set_device_environment_variables_by_pin(product_uid, device_uid, environment_variables) + api_response = api_instance.set_device_environment_variables_by_pin(product_uid, device_uid, x_auth_token, environment_variables) print("The response of DeviceApi->set_device_environment_variables_by_pin:\n") pprint(api_response) except Exception as e: @@ -2221,6 +2198,7 @@ with notehub_py.ApiClient(configuration) as api_client: | ------------------------- | --------------------------------------------------- | ----------------------------------------------- | ----- | | **product_uid** | **str** | | | **device_uid** | **str** | | +| **x_auth_token** | **str** | For accessing endpoints by Device pin. | | **environment_variables** | [**EnvironmentVariables**](EnvironmentVariables.md) | Environment variables to be added to the device | ### Return type @@ -2229,7 +2207,7 @@ with notehub_py.ApiClient(configuration) as api_client: ### Authorization -[pin](../README.md#pin) +No authorization required ### HTTP request headers diff --git a/src/docs/GetDataUsage200ResponseDataInner.md b/src/docs/GetDataUsage200ResponseDataInner.md index d9ad75f..d9749e2 100644 --- a/src/docs/GetDataUsage200ResponseDataInner.md +++ b/src/docs/GetDataUsage200ResponseDataInner.md @@ -2,14 +2,15 @@ ## Properties -| Name | Type | Description | Notes | -| ---------- | ----------------------------------- | ------------------------------------------------------------------------------------------- | ---------- | -| **data** | [**List[UsageData]**](UsageData.md) | | -| **device** | **str** | The device UID this usage data belongs to (only present when aggregate is 'device') | [optional] | -| **fleet** | **str** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | -| **iccid** | **str** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | -| **imsi** | **str** | The IMSI of the satellite device (only present when type is 'satellite') | [optional] | -| **type** | **str** | The type of connectivity | +| Name | Type | Description | Notes | +| ---------------- | ----------------------------------- | ------------------------------------------------------------------------------------------- | ---------- | +| **data** | [**List[UsageData]**](UsageData.md) | | +| **device** | **str** | The device UID this usage data belongs to (only present when aggregate is 'device') | [optional] | +| **device_count** | **int** | the number of devices represented by this data point | [optional] | +| **fleet** | **str** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | +| **iccid** | **str** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | +| **psid** | **str** | The PSID (Packet Service ID) of the satellite (or other packet-based device) | [optional] | +| **type** | **str** | The type of connectivity | ## Example diff --git a/src/docs/Monitor.md b/src/docs/Monitor.md index b1eff16..913822d 100644 --- a/src/docs/Monitor.md +++ b/src/docs/Monitor.md @@ -19,7 +19,7 @@ | **routing_cooldown_period** | **str** | 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** | **bool** | If true, alerts will be created, but no notifications will be sent. | [optional] | | **source_selector** | **str** | A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value. | [optional] | -| **source_type** | **str** | The type of source to monitor. Currently only \"event\" is supported. | [optional] | +| **source_type** | **str** | The type of source to monitor. Supported values are \"event\" and \"heartbeat\". | [optional] | | **threshold** | **int** | The type of condition to apply to the value selected by the source_selector | [optional] | | **uid** | **str** | | [optional] | diff --git a/src/docs/ProjectApi.md b/src/docs/ProjectApi.md index 6e9f382..304073c 100644 --- a/src/docs/ProjectApi.md +++ b/src/docs/ProjectApi.md @@ -1457,7 +1457,7 @@ with notehub_py.ApiClient(configuration) as api_client: # **get_firmware_info** -> List[FirmwareInfo] get_firmware_info(project_or_product_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished) +> List[FirmwareInfo] get_firmware_info(project_or_product_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished, sort_by=sort_by, sort_order=sort_order) Get Available Firmware Information @@ -1499,9 +1499,11 @@ with notehub_py.ApiClient(configuration) as api_client: filename = 'notecard-7.2.2.16518$20240410043100.bin' # str | (optional) md5 = 'md5_example' # str | (optional) unpublished = True # bool | (optional) + sort_by = 'created' # str | Field to sort by (optional) (default to 'created') + sort_order = 'desc' # str | Sort order (asc for ascending, desc for descending) (optional) (default to 'desc') try: - api_response = api_instance.get_firmware_info(project_or_product_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished) + api_response = api_instance.get_firmware_info(project_or_product_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished, sort_by=sort_by, sort_order=sort_order) print("The response of ProjectApi->get_firmware_info:\n") pprint(api_response) except Exception as e: @@ -1510,16 +1512,18 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | -------- | ----------- | ---------- | -| **project_or_product_uid** | **str** | | -| **product** | **str** | | [optional] | -| **firmware_type** | **str** | | [optional] | -| **version** | **str** | | [optional] | -| **target** | **str** | | [optional] | -| **filename** | **str** | | [optional] | -| **md5** | **str** | | [optional] | -| **unpublished** | **bool** | | [optional] | +| Name | Type | Description | Notes | +| -------------------------- | -------- | --------------------------------------------------- | ----------------------------------------- | +| **project_or_product_uid** | **str** | | +| **product** | **str** | | [optional] | +| **firmware_type** | **str** | | [optional] | +| **version** | **str** | | [optional] | +| **target** | **str** | | [optional] | +| **filename** | **str** | | [optional] | +| **md5** | **str** | | [optional] | +| **unpublished** | **bool** | | [optional] | +| **sort_by** | **str** | Field to sort by | [optional] [default to 'created'] | +| **sort_order** | **str** | 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 e6a4345..7e7b3a7 100644 --- a/src/docs/RouteApi.md +++ b/src/docs/RouteApi.md @@ -238,7 +238,7 @@ with notehub_py.ApiClient(configuration) as api_client: # **get_route_logs_by_route** -> List[RouteLog] get_route_logs_by_route(project_or_product_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, most_recent_only=most_recent_only, files=files) +> List[RouteLog] get_route_logs_by_route(project_or_product_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, most_recent_only=most_recent_only, files=files, routing_status=routing_status, response_status=response_status) Get Route Logs by Route UID @@ -284,9 +284,11 @@ with notehub_py.ApiClient(configuration) as api_client: system_files_only = True # bool | (optional) most_recent_only = True # bool | (optional) files = '_health.qo, data.qo' # str | (optional) + routing_status = ['failure'] # List[str] | (optional) + response_status = ['500'] # List[str] | (optional) try: - api_response = api_instance.get_route_logs_by_route(project_or_product_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, most_recent_only=most_recent_only, files=files) + api_response = api_instance.get_route_logs_by_route(project_or_product_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, most_recent_only=most_recent_only, files=files, routing_status=routing_status, response_status=response_status) print("The response of RouteApi->get_route_logs_by_route:\n") pprint(api_response) except Exception as e: @@ -309,6 +311,8 @@ with notehub_py.ApiClient(configuration) as api_client: | **system_files_only** | **bool** | | [optional] | | **most_recent_only** | **bool** | | [optional] | | **files** | **str** | | [optional] | +| **routing_status** | [**List[str]**](str.md) | | [optional] | +| **response_status** | [**List[str]**](str.md) | | [optional] | ### Return type diff --git a/src/docs/SatelliteDataUsage.md b/src/docs/SatelliteDataUsage.md new file mode 100644 index 0000000..1a4617c --- /dev/null +++ b/src/docs/SatelliteDataUsage.md @@ -0,0 +1,30 @@ +# SatelliteDataUsage + +## Properties + +| Name | Type | Description | Notes | +| ----------------------- | ------- | -------------------------------- | ----- | +| **bytes_remaining** | **int** | Bytes remaining in the plan | +| **bytes_total** | **int** | Total bytes included in the plan | +| **bytes_used** | **int** | Bytes used to date | +| **bytes_used_billable** | **int** | Billable bytes used to date | + +## Example + +```python +from notehub_py.models.satellite_data_usage import SatelliteDataUsage + +# TODO update the JSON string below +json = "{}" +# create an instance of SatelliteDataUsage from a JSON string +satellite_data_usage_instance = SatelliteDataUsage.from_json(json) +# print the JSON string representation of the object +print(SatelliteDataUsage.to_json()) + +# convert the object into a dict +satellite_data_usage_dict = satellite_data_usage_instance.to_dict() +# create an instance of SatelliteDataUsage from a dict +satellite_data_usage_from_dict = SatelliteDataUsage.from_dict(satellite_data_usage_dict) +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/src/docs/SatellitePlan.md b/src/docs/SatellitePlan.md index 6968702..f259308 100644 --- a/src/docs/SatellitePlan.md +++ b/src/docs/SatellitePlan.md @@ -2,13 +2,14 @@ ## Properties -| Name | Type | Description | Notes | -| ------------------ | ----------------------------- | ----------------------------------------------------------- | ---------- | -| **activated** | **int** | Activation date of the satellite plan as Unix timestamp | -| **billable_bytes** | [**DataUsage**](DataUsage.md) | | [optional] | -| **last_updated** | **int** | Time this plan information was last updated | [optional] | -| **ntn_provider** | **str** | Non-Terrestrial Network provider name | -| **psid** | **str** | Provider-specific identifier for the satellite subscription | +| Name | Type | Description | Notes | +| -------------------------- | ----------------------------------------------- | ----------------------------------------------------------- | ---------- | +| **activated** | **int** | Activation date of the satellite plan as Unix timestamp | +| **last_session_at** | **int** | When this Starnote last had a session | [optional] | +| **minimum_billable_bytes** | **int** | Minimum billable bytes | [optional] | +| **ntn_provider** | **str** | Non-Terrestrial Network provider name | +| **psid** | **str** | Provider-specific identifier for the satellite subscription | +| **satellite_data_usage** | [**SatelliteDataUsage**](SatelliteDataUsage.md) | | [optional] | ## Example diff --git a/src/docs/UsageApi.md b/src/docs/UsageApi.md index 8c9d2f9..c83148b 100644 --- a/src/docs/UsageApi.md +++ b/src/docs/UsageApi.md @@ -189,7 +189,7 @@ with notehub_py.ApiClient(configuration) as api_client: # **get_route_logs_usage** -> GetRouteLogsUsage200Response get_route_logs_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, route_uid=route_uid, aggregate=aggregate) +> GetRouteLogsUsage200Response get_route_logs_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, route_uid=route_uid, aggregate=aggregate, skip_recent_data=skip_recent_data) Get route logs usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied @@ -229,9 +229,10 @@ with notehub_py.ApiClient(configuration) as api_client: end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional) route_uid = ['route_uid_example'] # List[str] | A Route UID. (optional) aggregate = 'route' # str | Aggregation level for results (optional) (default to 'route') + skip_recent_data = False # 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) try: - api_response = api_instance.get_route_logs_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, route_uid=route_uid, aggregate=aggregate) + api_response = api_instance.get_route_logs_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, route_uid=route_uid, aggregate=aggregate, skip_recent_data=skip_recent_data) print("The response of UsageApi->get_route_logs_usage:\n") pprint(api_response) except Exception as e: @@ -240,14 +241,15 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | ----------------------- | --------------------------------------------------------------- | --------------------------------------- | -| **project_or_product_uid** | **str** | | -| **period** | **str** | Period type for aggregation | -| **start_date** | **int** | Start date for filtering results, specified as a Unix timestamp | [optional] | -| **end_date** | **int** | End date for filtering results, specified as a Unix timestamp | [optional] | -| **route_uid** | [**List[str]**](str.md) | A Route UID. | [optional] | -| **aggregate** | **str** | Aggregation level for results | [optional] [default to 'route'] | +| Name | Type | Description | Notes | +| -------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | +| **project_or_product_uid** | **str** | | +| **period** | **str** | Period type for aggregation | +| **start_date** | **int** | Start date for filtering results, specified as a Unix timestamp | [optional] | +| **end_date** | **int** | End date for filtering results, specified as a Unix timestamp | [optional] | +| **route_uid** | [**List[str]**](str.md) | A Route UID. | [optional] | +| **aggregate** | **str** | Aggregation level for results | [optional] [default to 'route'] | +| **skip_recent_data** | **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] | ### Return type diff --git a/src/docs/UsageData.md b/src/docs/UsageData.md index 34d21e4..35e3b95 100644 --- a/src/docs/UsageData.md +++ b/src/docs/UsageData.md @@ -2,12 +2,17 @@ ## Properties -| Name | Type | Description | Notes | -| ------------------ | ------------ | ----------- | ---------- | -| **bytes_received** | **int** | | [optional] | -| **bytes_sent** | **int** | | [optional] | -| **period** | **datetime** | | -| **total_bytes** | **int** | | +| Name | Type | Description | Notes | +| --------------------------- | ------------ | --------------------------------------------------------- | ---------- | +| **billable_bytes_received** | **int** | Billable bytes received (only for packet-based protocols) | [optional] | +| **billable_bytes_sent** | **int** | Billable bytes sent (only for packet-based protocols) | [optional] | +| **billable_bytes_total** | **int** | Total billable bytes (only for packet-based protocols) | [optional] | +| **bytes_received** | **int** | | [optional] | +| **bytes_sent** | **int** | | [optional] | +| **packets_received** | **int** | Packets received (only for packet-based protocols) | [optional] | +| **packets_sent** | **int** | Packets sent (only for packet-based protocols) | [optional] | +| **period** | **datetime** | | +| **total_bytes** | **int** | | ## Example diff --git a/src/notehub_py/__init__.py b/src/notehub_py/__init__.py index f33c7a8..fe003c9 100644 --- a/src/notehub_py/__init__.py +++ b/src/notehub_py/__init__.py @@ -179,6 +179,7 @@ from notehub_py.models.route_log import RouteLog from notehub_py.models.route_transform_settings import RouteTransformSettings from notehub_py.models.s3_archive_route import S3ArchiveRoute +from notehub_py.models.satellite_data_usage import SatelliteDataUsage from notehub_py.models.satellite_plan import SatellitePlan from notehub_py.models.schema_property import SchemaProperty from notehub_py.models.signal_device200_response import SignalDevice200Response diff --git a/src/notehub_py/api/device_api.py b/src/notehub_py/api/device_api.py index b00f1ac..058cd98 100644 --- a/src/notehub_py/api/device_api.py +++ b/src/notehub_py/api/device_api.py @@ -695,7 +695,6 @@ def delete_device( self, project_or_product_uid: StrictStr, device_uid: StrictStr, - purge: StrictBool, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -716,8 +715,6 @@ def delete_device( :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str - :param purge: (required) - :type purge: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -743,7 +740,6 @@ def delete_device( _param = self._delete_device_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, - purge=purge, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -767,7 +763,6 @@ def delete_device_with_http_info( self, project_or_product_uid: StrictStr, device_uid: StrictStr, - purge: StrictBool, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -788,8 +783,6 @@ def delete_device_with_http_info( :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str - :param purge: (required) - :type purge: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -815,7 +808,6 @@ def delete_device_with_http_info( _param = self._delete_device_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, - purge=purge, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -839,7 +831,6 @@ def delete_device_without_preload_content( self, project_or_product_uid: StrictStr, device_uid: StrictStr, - purge: StrictBool, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -860,8 +851,6 @@ def delete_device_without_preload_content( :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str - :param purge: (required) - :type purge: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -887,7 +876,6 @@ def delete_device_without_preload_content( _param = self._delete_device_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, - purge=purge, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -906,7 +894,6 @@ def _delete_device_serialize( self, project_or_product_uid, device_uid, - purge, _request_auth, _content_type, _headers, @@ -930,10 +917,6 @@ def _delete_device_serialize( if device_uid is not None: _path_params["deviceUID"] = device_uid # process the query parameters - if purge is not None: - - _query_params.append(("purge", purge)) - # process the header parameters # process the form parameters # process the body parameter @@ -3918,6 +3901,9 @@ def get_device_environment_variables_by_pin( self, product_uid: StrictStr, device_uid: StrictStr, + x_auth_token: Annotated[ + StrictStr, Field(description="For accessing endpoints by Device pin.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3938,6 +3924,8 @@ def get_device_environment_variables_by_pin( :type product_uid: str :param device_uid: (required) :type device_uid: str + :param x_auth_token: For accessing endpoints by Device pin. (required) + :type x_auth_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3963,6 +3951,7 @@ def get_device_environment_variables_by_pin( _param = self._get_device_environment_variables_by_pin_serialize( product_uid=product_uid, device_uid=device_uid, + x_auth_token=x_auth_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3986,6 +3975,9 @@ def get_device_environment_variables_by_pin_with_http_info( self, product_uid: StrictStr, device_uid: StrictStr, + x_auth_token: Annotated[ + StrictStr, Field(description="For accessing endpoints by Device pin.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4006,6 +3998,8 @@ def get_device_environment_variables_by_pin_with_http_info( :type product_uid: str :param device_uid: (required) :type device_uid: str + :param x_auth_token: For accessing endpoints by Device pin. (required) + :type x_auth_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4031,6 +4025,7 @@ def get_device_environment_variables_by_pin_with_http_info( _param = self._get_device_environment_variables_by_pin_serialize( product_uid=product_uid, device_uid=device_uid, + x_auth_token=x_auth_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4054,6 +4049,9 @@ def get_device_environment_variables_by_pin_without_preload_content( self, product_uid: StrictStr, device_uid: StrictStr, + x_auth_token: Annotated[ + StrictStr, Field(description="For accessing endpoints by Device pin.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4074,6 +4072,8 @@ def get_device_environment_variables_by_pin_without_preload_content( :type product_uid: str :param device_uid: (required) :type device_uid: str + :param x_auth_token: For accessing endpoints by Device pin. (required) + :type x_auth_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4099,6 +4099,7 @@ def get_device_environment_variables_by_pin_without_preload_content( _param = self._get_device_environment_variables_by_pin_serialize( product_uid=product_uid, device_uid=device_uid, + x_auth_token=x_auth_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4117,6 +4118,7 @@ def _get_device_environment_variables_by_pin_serialize( self, product_uid, device_uid, + x_auth_token, _request_auth, _content_type, _headers, @@ -4141,6 +4143,8 @@ def _get_device_environment_variables_by_pin_serialize( _path_params["deviceUID"] = device_uid # process the query parameters # process the header parameters + if x_auth_token is not None: + _header_params["X-Auth-Token"] = x_auth_token # process the form parameters # process the body parameter @@ -4150,7 +4154,7 @@ def _get_device_environment_variables_by_pin_serialize( ) # authentication setting - _auth_settings: List[str] = ["pin"] + _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", @@ -8086,6 +8090,9 @@ def set_device_environment_variables_by_pin( self, product_uid: StrictStr, device_uid: StrictStr, + x_auth_token: Annotated[ + StrictStr, Field(description="For accessing endpoints by Device pin.") + ], environment_variables: Annotated[ EnvironmentVariables, Field(description="Environment variables to be added to the device"), @@ -8110,6 +8117,8 @@ def set_device_environment_variables_by_pin( :type product_uid: str :param device_uid: (required) :type device_uid: str + :param x_auth_token: For accessing endpoints by Device pin. (required) + :type x_auth_token: str :param environment_variables: Environment variables to be added to the device (required) :type environment_variables: EnvironmentVariables :param _request_timeout: timeout setting for this request. If one @@ -8137,6 +8146,7 @@ def set_device_environment_variables_by_pin( _param = self._set_device_environment_variables_by_pin_serialize( product_uid=product_uid, device_uid=device_uid, + x_auth_token=x_auth_token, environment_variables=environment_variables, _request_auth=_request_auth, _content_type=_content_type, @@ -8161,6 +8171,9 @@ def set_device_environment_variables_by_pin_with_http_info( self, product_uid: StrictStr, device_uid: StrictStr, + x_auth_token: Annotated[ + StrictStr, Field(description="For accessing endpoints by Device pin.") + ], environment_variables: Annotated[ EnvironmentVariables, Field(description="Environment variables to be added to the device"), @@ -8185,6 +8198,8 @@ def set_device_environment_variables_by_pin_with_http_info( :type product_uid: str :param device_uid: (required) :type device_uid: str + :param x_auth_token: For accessing endpoints by Device pin. (required) + :type x_auth_token: str :param environment_variables: Environment variables to be added to the device (required) :type environment_variables: EnvironmentVariables :param _request_timeout: timeout setting for this request. If one @@ -8212,6 +8227,7 @@ def set_device_environment_variables_by_pin_with_http_info( _param = self._set_device_environment_variables_by_pin_serialize( product_uid=product_uid, device_uid=device_uid, + x_auth_token=x_auth_token, environment_variables=environment_variables, _request_auth=_request_auth, _content_type=_content_type, @@ -8236,6 +8252,9 @@ def set_device_environment_variables_by_pin_without_preload_content( self, product_uid: StrictStr, device_uid: StrictStr, + x_auth_token: Annotated[ + StrictStr, Field(description="For accessing endpoints by Device pin.") + ], environment_variables: Annotated[ EnvironmentVariables, Field(description="Environment variables to be added to the device"), @@ -8260,6 +8279,8 @@ def set_device_environment_variables_by_pin_without_preload_content( :type product_uid: str :param device_uid: (required) :type device_uid: str + :param x_auth_token: For accessing endpoints by Device pin. (required) + :type x_auth_token: str :param environment_variables: Environment variables to be added to the device (required) :type environment_variables: EnvironmentVariables :param _request_timeout: timeout setting for this request. If one @@ -8287,6 +8308,7 @@ def set_device_environment_variables_by_pin_without_preload_content( _param = self._set_device_environment_variables_by_pin_serialize( product_uid=product_uid, device_uid=device_uid, + x_auth_token=x_auth_token, environment_variables=environment_variables, _request_auth=_request_auth, _content_type=_content_type, @@ -8306,6 +8328,7 @@ def _set_device_environment_variables_by_pin_serialize( self, product_uid, device_uid, + x_auth_token, environment_variables, _request_auth, _content_type, @@ -8331,6 +8354,8 @@ def _set_device_environment_variables_by_pin_serialize( _path_params["deviceUID"] = device_uid # process the query parameters # process the header parameters + if x_auth_token is not None: + _header_params["X-Auth-Token"] = x_auth_token # process the form parameters # process the body parameter if environment_variables is not None: @@ -8352,7 +8377,7 @@ def _set_device_environment_variables_by_pin_serialize( _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = ["pin"] + _auth_settings: List[str] = [] return self.api_client.param_serialize( method="PUT", diff --git a/src/notehub_py/api/project_api.py b/src/notehub_py/api/project_api.py index 467ac68..19144b3 100644 --- a/src/notehub_py/api/project_api.py +++ b/src/notehub_py/api/project_api.py @@ -5333,6 +5333,13 @@ def get_firmware_info( filename: Optional[StrictStr] = None, md5: Optional[StrictStr] = None, unpublished: Optional[StrictBool] = None, + sort_by: Annotated[ + Optional[StrictStr], Field(description="Field to sort by") + ] = None, + sort_order: Annotated[ + Optional[StrictStr], + Field(description="Sort order (asc for ascending, desc for descending)"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5365,6 +5372,10 @@ def get_firmware_info( :type md5: str :param unpublished: :type unpublished: bool + :param sort_by: Field to sort by + :type sort_by: str + :param sort_order: Sort order (asc for ascending, desc for descending) + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5396,6 +5407,8 @@ def get_firmware_info( filename=filename, md5=md5, unpublished=unpublished, + sort_by=sort_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5425,6 +5438,13 @@ def get_firmware_info_with_http_info( filename: Optional[StrictStr] = None, md5: Optional[StrictStr] = None, unpublished: Optional[StrictBool] = None, + sort_by: Annotated[ + Optional[StrictStr], Field(description="Field to sort by") + ] = None, + sort_order: Annotated[ + Optional[StrictStr], + Field(description="Sort order (asc for ascending, desc for descending)"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5457,6 +5477,10 @@ def get_firmware_info_with_http_info( :type md5: str :param unpublished: :type unpublished: bool + :param sort_by: Field to sort by + :type sort_by: str + :param sort_order: Sort order (asc for ascending, desc for descending) + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5488,6 +5512,8 @@ def get_firmware_info_with_http_info( filename=filename, md5=md5, unpublished=unpublished, + sort_by=sort_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5517,6 +5543,13 @@ def get_firmware_info_without_preload_content( filename: Optional[StrictStr] = None, md5: Optional[StrictStr] = None, unpublished: Optional[StrictBool] = None, + sort_by: Annotated[ + Optional[StrictStr], Field(description="Field to sort by") + ] = None, + sort_order: Annotated[ + Optional[StrictStr], + Field(description="Sort order (asc for ascending, desc for descending)"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5549,6 +5582,10 @@ def get_firmware_info_without_preload_content( :type md5: str :param unpublished: :type unpublished: bool + :param sort_by: Field to sort by + :type sort_by: str + :param sort_order: Sort order (asc for ascending, desc for descending) + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5580,6 +5617,8 @@ def get_firmware_info_without_preload_content( filename=filename, md5=md5, unpublished=unpublished, + sort_by=sort_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5604,6 +5643,8 @@ def _get_firmware_info_serialize( filename, md5, unpublished, + sort_by, + sort_order, _request_auth, _content_type, _headers, @@ -5653,6 +5694,14 @@ def _get_firmware_info_serialize( _query_params.append(("unpublished", unpublished)) + if sort_by is not None: + + _query_params.append(("sortBy", sort_by)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/src/notehub_py/api/route_api.py b/src/notehub_py/api/route_api.py index a0d48d4..cbb2a8b 100644 --- a/src/notehub_py/api/route_api.py +++ b/src/notehub_py/api/route_api.py @@ -846,6 +846,8 @@ def get_route_logs_by_route( system_files_only: Optional[StrictBool] = None, most_recent_only: Optional[StrictBool] = None, files: Optional[StrictStr] = None, + routing_status: Optional[List[StrictStr]] = None, + response_status: Optional[List[StrictStr]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -886,6 +888,10 @@ def get_route_logs_by_route( :type most_recent_only: bool :param files: :type files: str + :param routing_status: + :type routing_status: List[str] + :param response_status: + :type response_status: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -921,6 +927,8 @@ def get_route_logs_by_route( system_files_only=system_files_only, most_recent_only=most_recent_only, files=files, + routing_status=routing_status, + response_status=response_status, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -966,6 +974,8 @@ def get_route_logs_by_route_with_http_info( system_files_only: Optional[StrictBool] = None, most_recent_only: Optional[StrictBool] = None, files: Optional[StrictStr] = None, + routing_status: Optional[List[StrictStr]] = None, + response_status: Optional[List[StrictStr]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1006,6 +1016,10 @@ def get_route_logs_by_route_with_http_info( :type most_recent_only: bool :param files: :type files: str + :param routing_status: + :type routing_status: List[str] + :param response_status: + :type response_status: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1041,6 +1055,8 @@ def get_route_logs_by_route_with_http_info( system_files_only=system_files_only, most_recent_only=most_recent_only, files=files, + routing_status=routing_status, + response_status=response_status, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1086,6 +1102,8 @@ def get_route_logs_by_route_without_preload_content( system_files_only: Optional[StrictBool] = None, most_recent_only: Optional[StrictBool] = None, files: Optional[StrictStr] = None, + routing_status: Optional[List[StrictStr]] = None, + response_status: Optional[List[StrictStr]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1126,6 +1144,10 @@ def get_route_logs_by_route_without_preload_content( :type most_recent_only: bool :param files: :type files: str + :param routing_status: + :type routing_status: List[str] + :param response_status: + :type response_status: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1161,6 +1183,8 @@ def get_route_logs_by_route_without_preload_content( system_files_only=system_files_only, most_recent_only=most_recent_only, files=files, + routing_status=routing_status, + response_status=response_status, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1189,6 +1213,8 @@ def _get_route_logs_by_route_serialize( system_files_only, most_recent_only, files, + routing_status, + response_status, _request_auth, _content_type, _headers, @@ -1199,6 +1225,8 @@ def _get_route_logs_by_route_serialize( _collection_formats: Dict[str, str] = { "deviceUID": "multi", + "routingStatus": "multi", + "responseStatus": "multi", } _path_params: Dict[str, str] = {} @@ -1254,6 +1282,14 @@ def _get_route_logs_by_route_serialize( _query_params.append(("files", files)) + if routing_status is not None: + + _query_params.append(("routingStatus", routing_status)) + + if response_status is not None: + + _query_params.append(("responseStatus", response_status)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/src/notehub_py/api/usage_api.py b/src/notehub_py/api/usage_api.py index b3fcb17..19c02ae 100644 --- a/src/notehub_py/api/usage_api.py +++ b/src/notehub_py/api/usage_api.py @@ -933,6 +933,12 @@ def get_route_logs_usage( aggregate: Annotated[ Optional[StrictStr], Field(description="Aggregation level for results") ] = None, + skip_recent_data: Annotated[ + Optional[StrictBool], + Field( + 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." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -961,6 +967,8 @@ def get_route_logs_usage( :type route_uid: List[str] :param aggregate: Aggregation level for results :type aggregate: str + :param skip_recent_data: 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. + :type skip_recent_data: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -990,6 +998,7 @@ def get_route_logs_usage( end_date=end_date, route_uid=route_uid, aggregate=aggregate, + skip_recent_data=skip_recent_data, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1031,6 +1040,12 @@ def get_route_logs_usage_with_http_info( aggregate: Annotated[ Optional[StrictStr], Field(description="Aggregation level for results") ] = None, + skip_recent_data: Annotated[ + Optional[StrictBool], + Field( + 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." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1059,6 +1074,8 @@ def get_route_logs_usage_with_http_info( :type route_uid: List[str] :param aggregate: Aggregation level for results :type aggregate: str + :param skip_recent_data: 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. + :type skip_recent_data: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1088,6 +1105,7 @@ def get_route_logs_usage_with_http_info( end_date=end_date, route_uid=route_uid, aggregate=aggregate, + skip_recent_data=skip_recent_data, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1129,6 +1147,12 @@ def get_route_logs_usage_without_preload_content( aggregate: Annotated[ Optional[StrictStr], Field(description="Aggregation level for results") ] = None, + skip_recent_data: Annotated[ + Optional[StrictBool], + Field( + 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." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1157,6 +1181,8 @@ def get_route_logs_usage_without_preload_content( :type route_uid: List[str] :param aggregate: Aggregation level for results :type aggregate: str + :param skip_recent_data: 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. + :type skip_recent_data: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1186,6 +1212,7 @@ def get_route_logs_usage_without_preload_content( end_date=end_date, route_uid=route_uid, aggregate=aggregate, + skip_recent_data=skip_recent_data, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1208,6 +1235,7 @@ def _get_route_logs_usage_serialize( end_date, route_uid, aggregate, + skip_recent_data, _request_auth, _content_type, _headers, @@ -1251,6 +1279,10 @@ def _get_route_logs_usage_serialize( _query_params.append(("aggregate", aggregate)) + if skip_recent_data is not None: + + _query_params.append(("skipRecentData", skip_recent_data)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/src/notehub_py/configuration.py b/src/notehub_py/configuration.py index 0dbbcf3..8107174 100644 --- a/src/notehub_py/configuration.py +++ b/src/notehub_py/configuration.py @@ -40,50 +40,31 @@ class Configuration: """This class contains various settings of the API client. - :param host: Base url. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - - conf = notehub_py.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: """ _default = None @@ -402,15 +383,6 @@ def auth_settings(self): "key": "Authorization", "value": "Bearer " + self.access_token, } - if "pin" in self.api_key: - auth["pin"] = { - "type": "api_key", - "in": "header", - "key": "X-Auth-Token", - "value": self.get_api_key_with_prefix( - "pin", - ), - } return auth def to_debug_report(self): diff --git a/src/notehub_py/models/__init__.py b/src/notehub_py/models/__init__.py index 7a508c1..e27213d 100644 --- a/src/notehub_py/models/__init__.py +++ b/src/notehub_py/models/__init__.py @@ -152,6 +152,7 @@ from notehub_py.models.route_log import RouteLog from notehub_py.models.route_transform_settings import RouteTransformSettings from notehub_py.models.s3_archive_route import S3ArchiveRoute +from notehub_py.models.satellite_data_usage import SatelliteDataUsage from notehub_py.models.satellite_plan import SatellitePlan from notehub_py.models.schema_property import SchemaProperty from notehub_py.models.signal_device200_response import SignalDevice200Response diff --git a/src/notehub_py/models/alert_data_inner.py b/src/notehub_py/models/alert_data_inner.py index 37e5ebb..f0fe432 100644 --- a/src/notehub_py/models/alert_data_inner.py +++ b/src/notehub_py/models/alert_data_inner.py @@ -80,8 +80,8 @@ def source_type_validate_enum(cls, value): if value is None: return value - if value not in set(["event"]): - raise ValueError("must be one of enum values ('event')") + if value not in set(["event", "device"]): + raise ValueError("must be one of enum values ('event', 'device')") return value model_config = ConfigDict( diff --git a/src/notehub_py/models/create_monitor.py b/src/notehub_py/models/create_monitor.py index 25f6b48..c6c2221 100644 --- a/src/notehub_py/models/create_monitor.py +++ b/src/notehub_py/models/create_monitor.py @@ -64,7 +64,7 @@ class CreateMonitor(BaseModel): default=None, description="The last time the monitor was evaluated and routed." ) name: StrictStr - notefile_filter: List[StrictStr] + notefile_filter: Optional[List[StrictStr]] = None per_device: Optional[StrictBool] = Field( default=None, description="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.", @@ -81,13 +81,11 @@ class CreateMonitor(BaseModel): default=None, description="A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.", ) - source_type: Optional[StrictStr] = Field( - default=None, - description='The type of source to monitor. Currently only "event" is supported.', + source_type: StrictStr = Field( + description='The type of source to monitor. Supported values are "event" and "heartbeat".' ) - threshold: Optional[StrictInt] = Field( - default=None, - description="The type of condition to apply to the value selected by the source_selector", + threshold: StrictInt = Field( + description="The type of condition to apply to the value selected by the source_selector" ) uid: Optional[StrictStr] = None __properties: ClassVar[List[str]] = [ @@ -167,11 +165,8 @@ def routing_cooldown_period_validate_regular_expression(cls, value): @field_validator("source_type") def source_type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(["event"]): - raise ValueError("must be one of enum values ('event')") + if value not in set(["event", "heartbeat"]): + raise ValueError("must be one of enum values ('event', 'heartbeat')") return value model_config = ConfigDict( diff --git a/src/notehub_py/models/get_data_usage200_response_data_inner.py b/src/notehub_py/models/get_data_usage200_response_data_inner.py index 35c3f81..cc9d729 100644 --- a/src/notehub_py/models/get_data_usage200_response_data_inner.py +++ b/src/notehub_py/models/get_data_usage200_response_data_inner.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from notehub_py.models.usage_data import UsageData from typing import Optional, Set @@ -35,6 +35,9 @@ class GetDataUsage200ResponseDataInner(BaseModel): default=None, description="The device UID this usage data belongs to (only present when aggregate is 'device')", ) + device_count: Optional[StrictInt] = Field( + default=None, description="the number of devices represented by this data point" + ) fleet: Optional[StrictStr] = Field( default=None, description="The fleet UID this usage data belongs to (only present when aggregate is 'fleet')", @@ -43,17 +46,18 @@ class GetDataUsage200ResponseDataInner(BaseModel): default=None, description="The ICCID of the cellular SIM card (only present when type is 'cellular')", ) - imsi: Optional[StrictStr] = Field( + psid: Optional[StrictStr] = Field( default=None, - description="The IMSI of the satellite device (only present when type is 'satellite')", + description="The PSID (Packet Service ID) of the satellite (or other packet-based device)", ) type: StrictStr = Field(description="The type of connectivity") __properties: ClassVar[List[str]] = [ "data", "device", + "device_count", "fleet", "iccid", - "imsi", + "psid", "type", ] @@ -127,9 +131,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: else None ), "device": obj.get("device"), + "device_count": obj.get("device_count"), "fleet": obj.get("fleet"), "iccid": obj.get("iccid"), - "imsi": obj.get("imsi"), + "psid": obj.get("psid"), "type": obj.get("type"), } ) diff --git a/src/notehub_py/models/monitor.py b/src/notehub_py/models/monitor.py index dd667f5..f9d24ee 100644 --- a/src/notehub_py/models/monitor.py +++ b/src/notehub_py/models/monitor.py @@ -83,7 +83,7 @@ class Monitor(BaseModel): ) source_type: Optional[StrictStr] = Field( default=None, - 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".', ) threshold: Optional[StrictInt] = Field( default=None, @@ -170,8 +170,8 @@ def source_type_validate_enum(cls, value): if value is None: return value - if value not in set(["event"]): - raise ValueError("must be one of enum values ('event')") + if value not in set(["event", "heartbeat"]): + raise ValueError("must be one of enum values ('event', 'heartbeat')") return value model_config = ConfigDict( diff --git a/src/notehub_py/models/satellite_data_usage.py b/src/notehub_py/models/satellite_data_usage.py new file mode 100644 index 0000000..1aacebd --- /dev/null +++ b/src/notehub_py/models/satellite_data_usage.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +Notehub API + +The OpenAPI definition for the Notehub.io API. + +The version of the OpenAPI document: 1.2.0 +Contact: engineering@blues.io +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class SatelliteDataUsage(BaseModel): + """ + SatelliteDataUsage + """ # noqa: E501 + + bytes_remaining: StrictInt = Field(description="Bytes remaining in the plan") + bytes_total: StrictInt = Field(description="Total bytes included in the plan") + bytes_used: StrictInt = Field(description="Bytes used to date") + bytes_used_billable: StrictInt = Field(description="Billable bytes used to date") + __properties: ClassVar[List[str]] = [ + "bytes_remaining", + "bytes_total", + "bytes_used", + "bytes_used_billable", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SatelliteDataUsage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SatelliteDataUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "bytes_remaining": obj.get("bytes_remaining"), + "bytes_total": obj.get("bytes_total"), + "bytes_used": obj.get("bytes_used"), + "bytes_used_billable": obj.get("bytes_used_billable"), + } + ) + return _obj diff --git a/src/notehub_py/models/satellite_plan.py b/src/notehub_py/models/satellite_plan.py index 6171280..f43b763 100644 --- a/src/notehub_py/models/satellite_plan.py +++ b/src/notehub_py/models/satellite_plan.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from notehub_py.models.data_usage import DataUsage +from notehub_py.models.satellite_data_usage import SatelliteDataUsage from typing import Optional, Set from typing_extensions import Self @@ -33,20 +33,24 @@ class SatellitePlan(BaseModel): activated: StrictInt = Field( description="Activation date of the satellite plan as Unix timestamp" ) - billable_bytes: Optional[DataUsage] = None - last_updated: Optional[StrictInt] = Field( - default=None, description="Time this plan information was last updated" + last_session_at: Optional[StrictInt] = Field( + default=None, description="When this Starnote last had a session" + ) + minimum_billable_bytes: Optional[StrictInt] = Field( + default=None, description="Minimum billable bytes" ) ntn_provider: StrictStr = Field(description="Non-Terrestrial Network provider name") psid: StrictStr = Field( description="Provider-specific identifier for the satellite subscription" ) + satellite_data_usage: Optional[SatelliteDataUsage] = None __properties: ClassVar[List[str]] = [ "activated", - "billable_bytes", - "last_updated", + "last_session_at", + "minimum_billable_bytes", "ntn_provider", "psid", + "satellite_data_usage", ] model_config = ConfigDict( @@ -86,9 +90,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of billable_bytes - if self.billable_bytes: - _dict["billable_bytes"] = self.billable_bytes.to_dict() + # override the default output from pydantic by calling `to_dict()` of satellite_data_usage + if self.satellite_data_usage: + _dict["satellite_data_usage"] = self.satellite_data_usage.to_dict() return _dict @classmethod @@ -103,14 +107,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "activated": obj.get("activated"), - "billable_bytes": ( - DataUsage.from_dict(obj["billable_bytes"]) - if obj.get("billable_bytes") is not None - else None - ), - "last_updated": obj.get("last_updated"), + "last_session_at": obj.get("last_session_at"), + "minimum_billable_bytes": obj.get("minimum_billable_bytes"), "ntn_provider": obj.get("ntn_provider"), "psid": obj.get("psid"), + "satellite_data_usage": ( + SatelliteDataUsage.from_dict(obj["satellite_data_usage"]) + if obj.get("satellite_data_usage") is not None + else None + ), } ) return _obj diff --git a/src/notehub_py/models/usage_data.py b/src/notehub_py/models/usage_data.py index 59aee6b..be1733b 100644 --- a/src/notehub_py/models/usage_data.py +++ b/src/notehub_py/models/usage_data.py @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -30,13 +30,36 @@ class UsageData(BaseModel): UsageData """ # noqa: E501 + billable_bytes_received: Optional[StrictInt] = Field( + default=None, + description="Billable bytes received (only for packet-based protocols)", + ) + billable_bytes_sent: Optional[StrictInt] = Field( + default=None, + description="Billable bytes sent (only for packet-based protocols)", + ) + billable_bytes_total: Optional[StrictInt] = Field( + default=None, + description="Total billable bytes (only for packet-based protocols)", + ) bytes_received: Optional[StrictInt] = None bytes_sent: Optional[StrictInt] = None + packets_received: Optional[StrictInt] = Field( + default=None, description="Packets received (only for packet-based protocols)" + ) + packets_sent: Optional[StrictInt] = Field( + default=None, description="Packets sent (only for packet-based protocols)" + ) period: datetime total_bytes: StrictInt __properties: ClassVar[List[str]] = [ + "billable_bytes_received", + "billable_bytes_sent", + "billable_bytes_total", "bytes_received", "bytes_sent", + "packets_received", + "packets_sent", "period", "total_bytes", ] @@ -91,8 +114,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "billable_bytes_received": obj.get("billable_bytes_received"), + "billable_bytes_sent": obj.get("billable_bytes_sent"), + "billable_bytes_total": obj.get("billable_bytes_total"), "bytes_received": obj.get("bytes_received"), "bytes_sent": obj.get("bytes_sent"), + "packets_received": obj.get("packets_received"), + "packets_sent": obj.get("packets_sent"), "period": obj.get("period"), "total_bytes": obj.get("total_bytes"), } diff --git a/src/test/test_satellite_data_usage.py b/src/test/test_satellite_data_usage.py new file mode 100644 index 0000000..5b82f63 --- /dev/null +++ b/src/test/test_satellite_data_usage.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" +Notehub API + +The OpenAPI definition for the Notehub.io API. + +The version of the OpenAPI document: 1.2.0 +Contact: engineering@blues.io +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from notehub_py.models.satellite_data_usage import SatelliteDataUsage + + +class TestSatelliteDataUsage(unittest.TestCase): + """SatelliteDataUsage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SatelliteDataUsage: + """Test SatelliteDataUsage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `SatelliteDataUsage` + """ + model = SatelliteDataUsage() + if include_optional: + return SatelliteDataUsage( + bytes_remaining = 18600, + bytes_total = 18650, + bytes_used = 49, + bytes_used_billable = 50 + ) + else: + return SatelliteDataUsage( + bytes_remaining = 18600, + bytes_total = 18650, + bytes_used = 49, + bytes_used_billable = 50, + ) + """ + + def testSatelliteDataUsage(self): + """Test SatelliteDataUsage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main()