diff --git a/config.json b/config.json index fb1c50a..d33934e 100644 --- a/config.json +++ b/config.json @@ -2,5 +2,5 @@ "packageName": "notehub_py", "packageUrl": "https://github.com/blues/notehub-py", "projectName": "notehub-py", - "packageVersion": "6.2.0" + "packageVersion": "6.3.0" } diff --git a/openapi.yaml b/openapi.yaml index aed060c..30b9743 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -46,6 +46,8 @@ paths: description: Internal Server Error tags: - authorization + x-custom-attributes: + permission: create /oauth2/token: post: operationId: OAuth2ClientCredentials @@ -143,6 +145,8 @@ paths: - personalAccessToken: [] tags: - billing_account + x-custom-attributes: + permission: read '/v1/billing-accounts/{billingAccountUID}': get: operationId: GetBillingAccount @@ -191,6 +195,8 @@ paths: - personalAccessToken: [] tags: - billing_account + x-custom-attributes: + permission: read '/v1/billing-accounts/{billingAccountUID}/balance-history': get: operationId: GetBillingAccountBalanceHistory @@ -231,6 +237,8 @@ paths: - personalAccessToken: [] tags: - billing_account + x-custom-attributes: + permission: read '/v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin': get: operationId: GetDeviceEnvironmentVariablesByPin @@ -240,8 +248,12 @@ paths: $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read parameters: - $ref: '#/components/parameters/productUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -261,8 +273,82 @@ paths: $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + '/v1/products/{productUID}/devices/{deviceUID}/webhook-event': + post: + operationId: CreateLegacyWebhookEvent + description: 'Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload.' + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + requestBody: + description: 'A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload.' + required: true + content: + application/json: + example: + body: + key: value + file: data.qo + payload: SGVsbG8sIFdvcmxkIQ== + schema: + type: object + properties: + body: + description: Arbitrary JSON event body. + type: object + additionalProperties: true + file: + description: The notefile to which the event should be written. + type: string + payload: + description: Optional base64-encoded binary payload. + type: string + additionalProperties: true + responses: + '200': + description: Event created successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' + '/v1/products/{productUID}/devices/{deviceUID}/webhook-session': + put: + operationId: UpdateLegacyWebhookSession + description: Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + requestBody: + description: Optional session metadata. + required: false + content: + application/json: + schema: + type: object + additionalProperties: true + responses: + '200': + description: Webhook session updated successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' '/v1/products/{productUID}/ext-devices/{deviceUID}/event': post: operationId: CreateEventExtDevice @@ -286,6 +372,9 @@ paths: - personalAccessToken: [] tags: - external devices + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' '/v1/products/{productUID}/ext-devices/{deviceUID}/session/close': post: operationId: ExtDeviceSessionClose @@ -309,6 +398,9 @@ paths: - personalAccessToken: [] tags: - external devices + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' '/v1/products/{productUID}/ext-devices/{deviceUID}/session/open': post: operationId: ExtDeviceSessionOpen @@ -332,6 +424,9 @@ paths: - personalAccessToken: [] tags: - external devices + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' '/v1/products/{productUID}/project': get: operationId: GetProjectByProduct @@ -356,6 +451,114 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' + '/v1/products/{productUID}/webhooks/{webhookUID}/devices/{deviceUID}/event': + post: + operationId: CreateWebhookDeviceEventByProduct + description: 'Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook''s configured JSONata transform, if any, is applied before routing.' + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + requestBody: + description: The event body (arbitrary JSON) + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + responses: + '200': + description: Event created successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' + '/v1/products/{productUID}/webhooks/{webhookUID}/event': + post: + operationId: CreateWebhookEventByProduct + description: 'Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook''s configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device.' + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + requestBody: + description: The event body (arbitrary JSON) + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + responses: + '200': + description: Event created successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' + '/v1/products/{productUID}/webhooks/{webhookUID}/settings': + get: + operationId: GetWebhookSettingsByProduct + description: 'Retrieves the configuration settings for the specified webhook, addressed by productUID.' + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + responses: + '200': + description: Webhook settings retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSettings' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' + put: + operationId: UpdateWebhookSettingsByProduct + description: 'Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings.' + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + requestBody: + required: true + content: + application/json: + example: + disabled: false + transform: '{"device":body.end_device_ids.dev_eui,"sn":body.end_device_ids.device_id,"body":body.uplink_message.decoded_payload,"details":body}' + schema: + $ref: '#/components/schemas/WebhookSettings' + responses: + '200': + description: Webhook settings updated successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' /v1/projects: get: operationId: GetProjects @@ -378,6 +581,8 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read post: operationId: CreateProject description: Create a Project @@ -412,6 +617,8 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create '/v1/projects/{projectOrProductUID}': delete: operationId: DeleteProject @@ -427,6 +634,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' get: operationId: GetProject description: Get a Project by ProjectUID @@ -445,6 +655,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/alerts': get: operationId: GetAlerts @@ -463,6 +676,9 @@ paths: - personalAccessToken: [] tags: - alert + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/aws-role-config': get: operationId: GetAWSRoleConfig @@ -485,6 +701,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/clone': post: operationId: CloneProject @@ -527,6 +746,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/devices': get: operationId: GetDevices @@ -553,6 +775,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}': delete: operationId: DeleteDevice @@ -566,6 +791,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:devices' get: operationId: GetDevice description: Get Device @@ -582,6 +810,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -606,6 +837,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status': get: operationId: GetDeviceDfuStatus @@ -627,6 +861,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable': post: operationId: DisableDevice @@ -643,6 +880,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable': post: operationId: EnableDevice @@ -659,6 +899,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy': get: operationId: GetDeviceEnvironmentHierarchy @@ -681,6 +924,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables': get: operationId: GetDeviceEnvironmentVariables @@ -694,6 +940,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -716,6 +965,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key}': delete: operationId: DeleteDeviceEnvironmentVariable @@ -738,6 +990,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/files': delete: operationId: DeleteNotefiles @@ -766,6 +1021,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:notefiles' get: operationId: ListNotefiles description: Lists .qi and .db files for the device @@ -799,6 +1057,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:notefiles' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets': delete: operationId: DeleteDeviceFromFleets @@ -828,6 +1089,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:devices' get: operationId: GetDeviceFleets description: Get Device Fleets @@ -840,6 +1104,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -871,6 +1138,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log': get: operationId: GetDeviceHealthLog @@ -923,6 +1193,133 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys': + get: + operationId: GetDeviceJourneys + description: | + Get the list of journeys for a device, derived from `_track.qo` events. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; `has_more` is true when the cap is hit. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + has_more: + type: boolean + journeys: + type: array + items: + properties: + end_date: + description: Latest event time within the journey. + type: string + format: date-time + journey_id: + description: | + Identifier of the journey, taken from the `journey` field on `_track.qo` events. This value is itself a Unix timestamp marking the start of the journey. + type: integer + format: int64 + start_date: + description: Earliest event time within the journey. + type: string + format: date-time + total_events: + description: The number of _track.qo events in the journey. + type: integer + format: int64 + required: + - journey_id + - total_events + - start_date + - end_date + type: object + required: + - journeys + - has_more + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID}': + get: + operationId: GetDeviceJourney + description: | + Get a single journey for a device along with its `_track.qo` events. The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` to detect additional pages. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - name: journeyID + in: path + description: | + Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). + required: true + schema: + type: integer + format: int64 + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + end_date: + description: Latest event time within the journey. + type: string + format: date-time + journey: + description: Paginated `_track.qo` events for the journey. + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/Event' + has_more: + type: boolean + required: + - events + - has_more + journey_id: + description: Identifier of the journey. + type: integer + format: int64 + start_date: + description: Earliest event time within the journey. + type: string + format: date-time + required: + - journey_id + - start_date + - end_date + - journey + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest': get: operationId: GetDeviceLatestEvents @@ -939,6 +1336,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}': post: operationId: CreateNotefile @@ -956,6 +1356,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notefiles' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}': get: operationId: GetNotefile @@ -1005,6 +1408,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:notefiles' post: operationId: AddQiNote description: 'Adds a Note to a Notefile, creating the Notefile if it doesn''t yet exist.' @@ -1028,6 +1434,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}': delete: operationId: DeleteNote @@ -1046,6 +1455,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:notes' get: operationId: GetDbNote description: Get a note from a .db or .qi notefile @@ -1089,6 +1501,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:notes' post: operationId: AddDbNote description: Add a Note to a .db notefile. if noteID is '-' then payload is ignored and empty notefile is created @@ -1113,6 +1528,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:notes' put: operationId: UpdateDbNote description: Update a note in a .db or .qi notefile @@ -1137,6 +1555,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:notes' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans': get: operationId: GetDevicePlans @@ -1150,6 +1571,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -1196,6 +1620,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key': get: operationId: GetDevicePublicKey @@ -1224,6 +1651,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions': get: operationId: GetDeviceSessions @@ -1245,6 +1675,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal': post: operationId: SignalDevice @@ -1276,6 +1709,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/devices/public-keys': get: operationId: GetDevicePublicKeys @@ -1312,6 +1748,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action}': post: operationId: PerformDfuAction @@ -1345,6 +1784,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history': get: operationId: GetDevicesDfuHistory @@ -1378,6 +1820,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status': get: operationId: GetDevicesDfuStatus @@ -1411,6 +1856,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/environment_hierarchy': get: operationId: GetProjectEnvironmentHierarchy @@ -1432,6 +1880,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/environment_variables': get: operationId: GetProjectEnvironmentVariables @@ -1445,6 +1896,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' put: @@ -1464,6 +1918,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/environment_variables/{key}': delete: operationId: DeleteProjectEnvironmentVariable @@ -1485,6 +1942,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/events': get: operationId: GetEvents @@ -1532,6 +1992,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/events-cursor': get: operationId: GetEventsByCursor @@ -1554,6 +2017,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs': get: operationId: GetRouteLogsByEvent @@ -1576,6 +2042,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/firmware': get: operationId: GetFirmwareInfo @@ -1606,6 +2075,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}': delete: operationId: DeleteFirmware @@ -1634,6 +2106,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' get: operationId: DownloadFirmware description: Download firmware binary @@ -1659,6 +2134,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' post: operationId: UpdateFirmware description: | @@ -1697,6 +2175,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' put: operationId: UploadFirmware description: Upload firmware binary @@ -1741,6 +2222,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/fleets': get: operationId: GetFleets @@ -1754,6 +2238,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:fleets' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' post: @@ -1789,6 +2276,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:fleets' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}': delete: operationId: DeleteFleet @@ -1802,6 +2292,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:fleets' get: operationId: GetFleet description: Get Fleet @@ -1816,6 +2309,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:fleets' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/fleetUIDParam' @@ -1866,6 +2362,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:fleets' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices': get: operationId: GetFleetDevices @@ -1892,6 +2391,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy': get: operationId: GetFleetEnvironmentHierarchy @@ -1914,6 +2416,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:fleets' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables': get: operationId: GetFleetEnvironmentVariables @@ -1927,6 +2432,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:fleets' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/fleetUIDParam' @@ -1949,6 +2457,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:fleets' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables/{key}': delete: operationId: DeleteFleetEnvironmentVariable @@ -1971,6 +2482,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:fleets' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events': get: operationId: GetFleetEvents @@ -2018,6 +2532,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor': get: operationId: GetFleetEventsByCursor @@ -2042,6 +2559,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/global-transformation': post: operationId: SetGlobalEventTransformation @@ -2052,9 +2572,9 @@ paths: description: JSONata expression which will be applied to each event before it is persisted and routed required: true content: - application/json: + text/plain: schema: - $ref: '#/components/schemas/JSONata' + type: string responses: '200': description: Successful operation @@ -2064,6 +2584,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/global-transformation/disable': post: operationId: DisableGlobalEventTransformation @@ -2079,6 +2602,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/global-transformation/enable': post: operationId: EnableGlobalEventTransformation @@ -2094,6 +2620,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/jobs': get: operationId: GetJobs @@ -2109,6 +2638,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' post: operationId: CreateJob description: Create a new batch job with an optional name @@ -2121,13 +2653,12 @@ paths: schema: type: string requestBody: - description: The job definition as raw JSON + description: The batch job definition required: true content: application/json: schema: - description: Job definition (structure varies by job type) - type: object + $ref: '#/components/schemas/JobDefinition' responses: '201': $ref: '#/components/responses/CreateJobResponse' @@ -2139,6 +2670,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/jobs/{jobUID}': delete: operationId: DeleteJob @@ -2157,6 +2691,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' get: operationId: GetJob description: Get a specific batch job definition @@ -2174,6 +2711,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/jobs/{jobUID}/run': post: operationId: RunJob @@ -2199,6 +2739,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs': get: operationId: GetJobRuns @@ -2230,13 +2773,43 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}': + delete: + operationId: DeleteJobRun + description: Delete the results of a job run + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + description: Job run deleted successfully + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs get: operationId: GetJobRun description: Get the result of a job execution parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/reportUIDParam' + - name: view + in: query + description: 'Controls the level of detail returned: ''summary'' returns metadata only, ''detail'' returns the full result payload' + required: false + schema: + type: string + default: summary + enum: + - summary + - detail responses: '200': $ref: '#/components/responses/GetJobRunResponse' @@ -2248,6 +2821,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel': post: operationId: CancelJobRun @@ -2266,6 +2842,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/members': get: operationId: GetProjectMembers @@ -2290,6 +2869,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:accounts' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' '/v1/projects/{projectOrProductUID}/monitors': @@ -2307,6 +2889,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' post: operationId: CreateMonitor description: Create a new Monitor @@ -2332,6 +2917,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/monitors/{monitorUID}': delete: operationId: DeleteMonitor @@ -2352,6 +2940,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:devices' get: operationId: GetMonitor description: Get Monitor @@ -2371,6 +2962,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:devices' put: operationId: UpdateMonitor description: Update Monitor @@ -2397,6 +2991,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:devices' '/v1/projects/{projectOrProductUID}/products': get: operationId: GetProducts @@ -2419,6 +3016,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:products' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' post: @@ -2461,6 +3061,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/products/{productUID}': delete: operationId: DeleteProduct @@ -2474,6 +3077,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/productUIDParam' @@ -2530,6 +3136,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:routes' post: operationId: CreateRoute description: Create Route within a Project @@ -2589,6 +3198,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:routes' '/v1/projects/{projectOrProductUID}/routes/{routeUID}': delete: operationId: DeleteRoute @@ -2605,6 +3217,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:routes' get: operationId: GetRoute description: Get single route within a project @@ -2642,6 +3257,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:routes' put: operationId: UpdateRoute description: Update route by UID @@ -2702,6 +3320,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:routes' '/v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs': get: operationId: GetRouteLogsByRoute @@ -2736,6 +3357,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:routes' '/v1/projects/{projectOrProductUID}/schemas': get: operationId: GetNotefileSchemas @@ -2751,8 +3375,113 @@ paths: type: array items: $ref: '#/components/schemas/NotefileSchema' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' + '/v1/projects/{projectOrProductUID}/secrets': + get: + operationId: GetProjectSecrets + description: 'Get all secrets for a project (metadata only, values are never returned)' + responses: + '200': + $ref: '#/components/responses/GetProjectSecretsResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:settings' + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + post: + operationId: CreateProjectSecret + description: Create a new project secret + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProjectSecretRequest' + responses: + '201': + description: Secret created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectSecret' + '400': + $ref: '#/components/responses/ErrorResponse' + '409': + $ref: '#/components/responses/ErrorResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: create + resource: 'blues:resources:app:APPSERIAL:settings' + '/v1/projects/{projectOrProductUID}/secrets/{secretName}': + delete: + operationId: DeleteProjectSecret + description: Delete a project secret by name + responses: + '204': + description: Secret deleted successfully + '404': + $ref: '#/components/responses/ErrorResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: delete + resource: 'blues:resources:app:APPSERIAL:settings' + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - name: secretName + in: path + description: The name of the secret. + required: true + schema: + type: string + put: + operationId: UpdateProjectSecret + description: Update the value of an existing project secret + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProjectSecretRequest' + responses: + '200': + description: Secret updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectSecret' + '404': + $ref: '#/components/responses/ErrorResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/usage/data': get: operationId: GetDataUsage @@ -2794,6 +3523,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/usage/events': get: operationId: GetEventsUsage @@ -2863,6 +3595,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/usage/route-logs': get: operationId: GetRouteLogsUsage @@ -2909,6 +3644,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/usage/sessions': get: operationId: GetSessionsUsage @@ -2957,6 +3695,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: 'blues:resources:app:APPSERIAL:events' '/v1/projects/{projectOrProductUID}/webhooks': get: operationId: GetWebhooks @@ -2981,6 +3722,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' '/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}': delete: operationId: DeleteWebhook @@ -2997,6 +3741,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' get: operationId: GetWebhook description: Retrieves the configuration settings for the specified webhook @@ -3016,6 +3763,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' post: operationId: CreateWebhook description: Creates a webhook for the specified product with the given name. The name | must be unique within the project. @@ -3042,6 +3792,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' put: operationId: UpdateWebhook description: Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings. @@ -3066,6 +3819,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: 'blues:resources:app:APPSERIAL:settings' components: parameters: billingAccountUIDParam: @@ -3893,6 +4649,58 @@ components: type: string format: uri additionalProperties: false + BatchJobRequests: + description: Operations to apply to a device + type: object + properties: + comment: + type: string + connectivity_assurance_disable: + description: Disable connectivity assurance for the device + type: boolean + connectivity_assurance_enable: + description: Enable connectivity assurance for the device + type: boolean + disable: + description: Disable the device + type: boolean + enable: + description: Enable the device + type: boolean + fleets_to_default: + description: Fleet UIDs to assign to the device if it has no fleets + type: array + items: + type: string + fleets_to_join: + description: Fleet UIDs to add the device to + type: array + items: + type: string + fleets_to_leave: + description: Fleet UIDs to remove the device from + type: array + items: + type: string + provision_product: + description: Product UID to provision the device with if not already provisioned + type: string + sn_to_default: + description: Set the device serial number only if not already set + type: string + sn_to_set: + description: Set the device serial number ("-" to clear) + type: string + vars_to_default: + description: Environment variables to set only if not already set + type: object + additionalProperties: + type: string + vars_to_set: + description: Environment variables to set (use "-" as value to clear) + type: object + additionalProperties: + type: string BillingAccount: type: object properties: @@ -3913,6 +4721,7 @@ components: - billing_admin - billing_manager - project_creator + - billing_member BlynkRoute: type: object properties: @@ -3998,6 +4807,18 @@ components: - alert_routes - source_type - threshold + CreateProjectSecretRequest: + type: object + properties: + name: + description: The secret name (alphanumeric and underscores only). + type: string + value: + description: 'The secret value (encrypted at rest, never returned after creation).' + type: string + required: + - name + - value CreateUpdateRepository: type: object properties: @@ -4990,6 +5811,15 @@ components: items: type: string properties: {} + GetProjectSecretsResponse: + type: object + properties: + secrets: + type: array + items: + $ref: '#/components/schemas/ProjectSecret' + required: + - secrets GoogleRoute: type: object properties: @@ -5050,13 +5880,23 @@ components: created_by: description: User who created the job type: string - definition: - description: Full job definition (only in detail view) - type: object - additionalProperties: true job_uid: description: Unique identifier for the job type: string + last_run_completed: + description: Unix timestamp when the most recent run completed (0 if still in progress) + type: integer + format: int64 + example: 1775252922 + last_run_status: + description: 'Status of the most recent job run. Terminal values are: "submitted", "completed successfully", "dry run completed successfully", "completed with errors", "cancelled". While a job is running, intermediate per-device progress updates may appear (e.g. "dev:000000000000000 completed", "dev:000000000000000 updated: ...").' + type: string + example: dry run completed successfully + last_run_submitted: + description: Unix timestamp when the most recent run was submitted + type: integer + format: int64 + example: 1775252900 name: description: Human-readable job name type: string @@ -5065,50 +5905,167 @@ components: - name - created - created_by + JobDefinition: + description: Batch job definition + type: object + properties: + comment: + description: Human-readable description of the job + type: string + default_requests: + $ref: '#/components/schemas/BatchJobRequests' + device_requests: + description: 'Device-specific request overrides, keyed by device UID' + type: object + additionalProperties: + $ref: '#/components/schemas/BatchJobRequests' + report_options: + description: Controls what data is included in the job report + type: object + properties: + app_fleets: + description: Include project fleets in the report + type: boolean + app_info: + description: Include project info in the report + type: boolean + app_vars: + description: Include project environment variables in the report + type: boolean + comment: + type: string + device_activity: + description: Include device activity data in the report + type: boolean + device_health: + description: Include device health data in the report + type: boolean + device_info: + description: Include device info in the report + type: boolean + device_vars: + description: Include device environment variables in the report + type: boolean + select: + description: Device selection criteria + type: object + properties: + all_devices: + description: Select all devices in the project + type: boolean + comment: + type: string + devices: + description: Specific device UIDs to include + type: array + items: + type: string + devices_by_sn: + description: 'Serial number patterns to match (supports glob wildcards *, ?, [...])' + type: array + items: + type: string + devices_in_fleets: + description: Fleet UIDs whose devices should be included + type: array + items: + type: string + example: + comment: Set environment variables on all devices in a fleet + default_requests: + vars_to_set: + firmware_channel: production + log_level: '1' + select: + devices_in_fleets: + - 'fleet:00000000-0000-0000-0000-000000000000' + JobDetail: + description: Batch job with full definition + type: '' + properties: {} + allOf: + - $ref: '#/components/schemas/Job' + - properties: + definition: + $ref: '#/components/schemas/JobDefinition' + type: object JobRun: type: object properties: cancel: description: Whether cancellation was requested type: boolean + example: false completed: description: Unix timestamp when completed type: integer format: int64 + example: 1775252922 dry_run: description: Whether this was a dry run type: boolean + example: false job_name: description: Name of the job type: string + example: My Fleet Update job_uid: description: Unique identifier for the job type: string + example: 6862064d-9c7a-4d5d-88e6-2dfa8b4ef6c5 report_uid: description: Unique identifier for this run type: string + example: 6862064d-9c7a-4d5d-88e6-2dfa8b4ef6c5-1776780688472 results: description: Full results (only in detail view) type: object + example: + devices: + 'dev:000000000000001': + status: completed + vars_set: + firmware_channel: production + log_level: '1' + 'dev:000000000000002': + status: completed + vars_set: + firmware_channel: production + log_level: '1' + job: + dry_run: false + job_name: My Fleet Update + job_uid: 6862064d-9c7a-4d5d-88e6-2dfa8b4ef6c5 + status: completed successfully + when_completed: 1775252922 + when_started: 1775252900 + when_submitted: 1775252900 + when_updated: 1775252922 + who_submitted: user@example.com additionalProperties: true started: description: Unix timestamp when started type: integer format: int64 + example: 1775252900 status: description: 'Current status (submitted, running, completed, cancelled, failed)' type: string + example: completed successfully submitted: description: Unix timestamp when submitted type: integer format: int64 + example: 1775252900 submitted_by: description: User who submitted the run type: string + example: user@example.com updated: description: Unix timestamp of last update type: integer format: int64 + example: 1775252922 required: - report_uid - job_uid @@ -5225,6 +6182,16 @@ components: type: integer uid: type: string + usage_scope: + description: 'For usage monitors: the scope of aggregation. Supported values are "device" and "fleet".' + type: string + usage_type: + description: 'For usage monitors: the type of data usage to monitor. Supported values are "cellular" and "satellite".' + type: string + usage_window: + description: 'For usage monitors: the rolling time window in days to sum usage over (e.g. 30 for 30 days).' + type: integer + format: int32 MqttRoute: type: object properties: @@ -5566,6 +6533,31 @@ components: - name - email - role + ProjectSecret: + description: Metadata for a project secret. The value is never returned. + type: object + properties: + created: + description: When the secret was first created. + type: string + format: date-time + created_by: + description: The actor who created the secret. + type: string + modified: + description: When the secret was last updated. + type: string + format: date-time + modified_by: + description: The actor who last updated the secret. + type: string + name: + description: The secret name (alphanumeric and underscores only). + type: string + required: + - name + - created + - created_by ProxyRoute: type: object properties: @@ -5641,6 +6633,67 @@ components: uid: description: The unique identifier for the data repository type: string + RepositoryListResponse: + type: object + properties: + repositories: + type: array + items: + $ref: '#/components/schemas/Repository' + required: + - repositories + RepositoryTokenRequest: + type: object + properties: + intent: + description: | + Access intent for the vended credentials. Only `read` is + supported today; `write` and `admin` are reserved for future use. + type: string + default: read + enum: + - read + ttl_seconds: + description: | + Requested credential lifetime in seconds. Clamped server-side to + [60, 3600]. Defaults to 900 (15 minutes) if omitted. + type: integer + default: 900 + maximum: 3600 + minimum: 60 + RepositoryTokenResponse: + type: object + properties: + database: + description: Storage service database name scoped to this repository + type: string + expires_at: + description: | + Absolute expiration time of the ephemeral user. The storage + service will reject connections and queries after this instant. + type: string + format: date-time + host: + description: Storage service hostname the caller should connect to + type: string + password: + description: | + Ephemeral password. Returned once; not stored by Notehub. Hold + this in memory only and discard after `expires_at`. + type: string + port: + description: Storage service port + type: integer + username: + description: Ephemeral storage service username (prefixed with `u_`) + type: string + required: + - host + - port + - username + - password + - database + - expires_at Role: type: string properties: {} @@ -6074,6 +7127,14 @@ components: version: description: The firmware version string. type: string + UpdateProjectSecretRequest: + type: object + properties: + value: + description: 'The new secret value (encrypted at rest, never returned).' + type: string + required: + - value UploadMetadata: type: object properties: @@ -6636,7 +7697,7 @@ components: schema: type: '' properties: {} - $ref: '#/components/schemas/Job' + $ref: '#/components/schemas/JobDetail' GetJobRunResponse: description: Job run details content: @@ -6671,6 +7732,14 @@ components: $ref: '#/components/schemas/Job' required: - jobs + GetProjectSecretsResponse: + description: The response body from a get project secrets request. + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/GetProjectSecretsResponse' LatestResponse: description: The response body for a Latest Events request. content: diff --git a/openapi_filtered.yaml b/openapi_filtered.yaml index 792c693..076cc0b 100644 --- a/openapi_filtered.yaml +++ b/openapi_filtered.yaml @@ -47,6 +47,8 @@ paths: description: Internal Server Error tags: - authorization + x-custom-attributes: + permission: create /oauth2/token: post: operationId: OAuth2ClientCredentials @@ -146,6 +148,8 @@ paths: - personalAccessToken: [] tags: - billing_account + x-custom-attributes: + permission: read /v1/billing-accounts/{billingAccountUID}: get: operationId: GetBillingAccount @@ -194,6 +198,8 @@ paths: - personalAccessToken: [] tags: - billing_account + x-custom-attributes: + permission: read /v1/billing-accounts/{billingAccountUID}/balance-history: get: operationId: GetBillingAccountBalanceHistory @@ -234,6 +240,8 @@ paths: - personalAccessToken: [] tags: - billing_account + x-custom-attributes: + permission: read /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin: get: operationId: GetDeviceEnvironmentVariablesByPin @@ -243,8 +251,12 @@ paths: $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read parameters: - $ref: '#/components/parameters/productUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -265,8 +277,88 @@ paths: $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + /v1/products/{productUID}/devices/{deviceUID}/webhook-event: + post: + operationId: CreateLegacyWebhookEvent + description: Legacy endpoint for sending an event from a webhook, associated + with the given device (provisioning it if necessary). The request body is + a Note-shaped object containing the notefile name, body, and optional payload. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + requestBody: + description: A Note-shaped event with notefile name, JSON body, and optional + base64-encoded payload. + required: true + content: + application/json: + example: + body: + key: value + file: data.qo + payload: SGVsbG8sIFdvcmxkIQ== + schema: + type: object + properties: + body: + description: Arbitrary JSON event body. + type: object + additionalProperties: true + file: + description: The notefile to which the event should be written. + type: string + payload: + description: Optional base64-encoded binary payload. + type: string + additionalProperties: true + responses: + '200': + description: Event created successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes + /v1/products/{productUID}/devices/{deviceUID}/webhook-session: + put: + operationId: UpdateLegacyWebhookSession + description: Legacy endpoint for opening or updating a webhook session for the + given device (provisioning the device if necessary). Used by external services + that need to maintain a callable session against a device behind a webhook. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + requestBody: + description: Optional session metadata. + required: false + content: + application/json: + schema: + type: object + additionalProperties: true + properties: {} + responses: + '200': + description: Webhook session updated successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes /v1/products/{productUID}/ext-devices/{deviceUID}/event: post: operationId: CreateEventExtDevice @@ -291,6 +383,9 @@ paths: - personalAccessToken: [] tags: - external devices + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes /v1/products/{productUID}/ext-devices/{deviceUID}/session/close: post: operationId: ExtDeviceSessionClose @@ -315,6 +410,9 @@ paths: - personalAccessToken: [] tags: - external devices + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes /v1/products/{productUID}/ext-devices/{deviceUID}/session/open: post: operationId: ExtDeviceSessionOpen @@ -340,6 +438,9 @@ paths: - personalAccessToken: [] tags: - external devices + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes /v1/products/{productUID}/project: get: operationId: GetProjectByProduct @@ -364,6 +465,125 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings + /v1/products/{productUID}/webhooks/{webhookUID}/devices/{deviceUID}/event: + post: + operationId: CreateWebhookDeviceEventByProduct + description: Sends an event to be processed by the specified webhook, addressed + by productUID, associated with the given device (provisioning it if necessary). + The entire request body becomes the event body. The webhook's configured JSONata + transform, if any, is applied before routing. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + requestBody: + description: The event body (arbitrary JSON) + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + properties: {} + responses: + '200': + description: Event created successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes + /v1/products/{productUID}/webhooks/{webhookUID}/event: + post: + operationId: CreateWebhookEventByProduct + description: Sends an event to be processed by the specified webhook, addressed + by productUID. The entire request body becomes the event body. The webhook's + configured JSONata transform, if any, is applied before routing. The event + is not associated with a specific device. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + requestBody: + description: The event body (arbitrary JSON) + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + properties: {} + responses: + '200': + description: Event created successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes + /v1/products/{productUID}/webhooks/{webhookUID}/settings: + get: + operationId: GetWebhookSettingsByProduct + description: Retrieves the configuration settings for the specified webhook, + addressed by productUID. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + responses: + '200': + description: Webhook settings retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSettings' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings + put: + operationId: UpdateWebhookSettingsByProduct + description: Updates the configuration settings for the specified webhook, addressed + by productUID. Update body will completely replace the existing settings. + parameters: + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' + requestBody: + required: true + content: + application/json: + example: + disabled: false + transform: '{"device":body.end_device_ids.dev_eui,"sn":body.end_device_ids.device_id,"body":body.uplink_message.decoded_payload,"details":body}' + schema: + $ref: '#/components/schemas/WebhookSettings' + properties: {} + responses: + '200': + description: Webhook settings updated successfully + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects: get: operationId: GetProjects @@ -386,6 +606,8 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read post: operationId: CreateProject description: Create a Project @@ -423,6 +645,8 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create /v1/projects/{projectOrProductUID}: delete: operationId: DeleteProject @@ -438,6 +662,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings get: operationId: GetProject description: Get a Project by ProjectUID @@ -456,6 +683,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/alerts: get: operationId: GetAlerts @@ -474,6 +704,9 @@ paths: - personalAccessToken: [] tags: - alert + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/aws-role-config: get: operationId: GetAWSRoleConfig @@ -499,6 +732,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/clone: post: operationId: CloneProject @@ -545,6 +781,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/devices: get: operationId: GetDevices @@ -571,6 +810,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}: delete: operationId: DeleteDevice @@ -584,6 +826,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:devices get: operationId: GetDevice description: Get Device @@ -600,6 +845,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -624,6 +872,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status: get: operationId: GetDeviceDfuStatus @@ -645,6 +896,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable: post: operationId: DisableDevice @@ -661,6 +915,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable: post: operationId: EnableDevice @@ -677,6 +934,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy: get: operationId: GetDeviceEnvironmentHierarchy @@ -699,6 +959,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables: get: operationId: GetDeviceEnvironmentVariables @@ -712,6 +975,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -735,6 +1001,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key}: delete: operationId: DeleteDeviceEnvironmentVariable @@ -757,6 +1026,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files: delete: operationId: DeleteNotefiles @@ -785,6 +1057,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:notefiles get: operationId: ListNotefiles description: Lists .qi and .db files for the device @@ -818,6 +1093,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:notefiles /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets: delete: operationId: DeleteDeviceFromFleets @@ -852,6 +1130,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:devices get: operationId: GetDeviceFleets description: Get Device Fleets @@ -864,6 +1145,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -899,6 +1183,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log: get: operationId: GetDeviceHealthLog @@ -951,6 +1238,144 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices + /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys: + get: + operationId: GetDeviceJourneys + description: 'Get the list of journeys for a device, derived from `_track.qo` + events. Returns journey metadata only (no event payloads). Capped at 100 most + recent journeys; `has_more` is true when the cap is hit. + + ' + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + has_more: + type: boolean + journeys: + type: array + items: + properties: + end_date: + description: Latest event time within the journey. + type: string + format: date-time + journey_id: + description: 'Identifier of the journey, taken from the + `journey` field on `_track.qo` events. This value is itself + a Unix timestamp marking the start of the journey. + + ' + type: integer + format: int64 + start_date: + description: Earliest event time within the journey. + type: string + format: date-time + total_events: + description: The number of _track.qo events in the journey. + type: integer + format: int64 + required: + - journey_id + - total_events + - start_date + - end_date + type: object + required: + - journeys + - has_more + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices + /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID}: + get: + operationId: GetDeviceJourney + description: 'Get a single journey for a device along with its `_track.qo` events. + The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` + to detect additional pages. + + ' + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - name: journeyID + in: path + description: 'Identifier of the journey, taken from the `journey` field on + `_track.qo` events (a Unix timestamp marking the start of the journey). + + ' + required: true + schema: + type: integer + format: int64 + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + end_date: + description: Latest event time within the journey. + type: string + format: date-time + journey: + description: Paginated `_track.qo` events for the journey. + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/Event' + has_more: + type: boolean + required: + - events + - has_more + journey_id: + description: Identifier of the journey. + type: integer + format: int64 + start_date: + description: Earliest event time within the journey. + type: string + format: date-time + required: + - journey_id + - start_date + - end_date + - journey + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest: get: operationId: GetDeviceLatestEvents @@ -967,6 +1392,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}: post: operationId: CreateNotefile @@ -984,6 +1412,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notefiles /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}: get: operationId: GetNotefile @@ -1035,6 +1466,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:notefiles post: operationId: AddQiNote description: Adds a Note to a Notefile, creating the Notefile if it doesn't @@ -1060,6 +1494,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}: delete: operationId: DeleteNote @@ -1078,6 +1515,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:notes get: operationId: GetDbNote description: Get a note from a .db or .qi notefile @@ -1121,6 +1561,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:notes post: operationId: AddDbNote description: Add a Note to a .db notefile. if noteID is '-' then payload is @@ -1147,6 +1590,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:notes put: operationId: UpdateDbNote description: Update a note in a .db or .qi notefile @@ -1172,6 +1618,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:notes /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans: get: operationId: GetDevicePlans @@ -1186,6 +1635,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' @@ -1232,6 +1684,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key: get: operationId: GetDevicePublicKey @@ -1260,6 +1715,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions: get: operationId: GetDeviceSessions @@ -1281,6 +1739,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal: post: operationId: SignalDevice @@ -1313,6 +1774,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/public-keys: get: operationId: GetDevicePublicKeys @@ -1349,6 +1813,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action}: post: operationId: PerformDfuAction @@ -1383,6 +1850,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history: get: operationId: GetDevicesDfuHistory @@ -1417,6 +1887,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status: get: operationId: GetDevicesDfuStatus @@ -1451,6 +1924,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/environment_hierarchy: get: operationId: GetProjectEnvironmentHierarchy @@ -1472,6 +1948,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/environment_variables: get: operationId: GetProjectEnvironmentVariables @@ -1485,6 +1964,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' put: @@ -1505,6 +1987,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/environment_variables/{key}: delete: operationId: DeleteProjectEnvironmentVariable @@ -1526,6 +2011,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/events: get: operationId: GetEvents @@ -1557,6 +2045,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/events-cursor: get: operationId: GetEventsByCursor @@ -1579,6 +2070,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs: get: operationId: GetRouteLogsByEvent @@ -1601,6 +2095,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/firmware: get: operationId: GetFirmwareInfo @@ -1631,6 +2128,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}: delete: operationId: DeleteFirmware @@ -1662,6 +2162,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings get: operationId: DownloadFirmware description: Download firmware binary @@ -1687,6 +2190,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings post: operationId: UpdateFirmware description: 'Update the metadata of an existing host firmware entry. The filename @@ -1730,6 +2236,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings put: operationId: UploadFirmware description: Upload firmware binary @@ -1777,6 +2286,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/fleets: get: operationId: GetFleets @@ -1790,6 +2302,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:fleets parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' post: @@ -1825,6 +2340,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:fleets /v1/projects/{projectOrProductUID}/fleets/{fleetUID}: delete: operationId: DeleteFleet @@ -1838,6 +2356,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:fleets get: operationId: GetFleet description: Get Fleet @@ -1852,6 +2373,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:fleets parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/fleetUIDParam' @@ -1903,6 +2427,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:fleets /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices: get: operationId: GetFleetDevices @@ -1929,6 +2456,9 @@ paths: - personalAccessToken: [] tags: - device + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy: get: operationId: GetFleetEnvironmentHierarchy @@ -1951,6 +2481,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:fleets /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables: get: operationId: GetFleetEnvironmentVariables @@ -1964,6 +2497,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:fleets parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/fleetUIDParam' @@ -1987,6 +2523,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:fleets /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables/{key}: delete: operationId: DeleteFleetEnvironmentVariable @@ -2009,6 +2548,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:fleets /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events: get: operationId: GetFleetEvents @@ -2040,6 +2582,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor: get: operationId: GetFleetEventsByCursor @@ -2064,6 +2609,9 @@ paths: - personalAccessToken: [] tags: - event + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/global-transformation: post: operationId: SetGlobalEventTransformation @@ -2075,9 +2623,9 @@ paths: it is persisted and routed required: true content: - application/json: + text/plain: schema: - $ref: '#/components/schemas/JSONata' + type: string properties: {} responses: '200': @@ -2088,6 +2636,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/global-transformation/disable: post: operationId: DisableGlobalEventTransformation @@ -2103,6 +2654,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/global-transformation/enable: post: operationId: EnableGlobalEventTransformation @@ -2118,6 +2672,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/jobs: get: operationId: GetJobs @@ -2133,6 +2690,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings post: operationId: CreateJob description: Create a new batch job with an optional name @@ -2145,13 +2705,12 @@ paths: schema: type: string requestBody: - description: The job definition as raw JSON + description: The batch job definition required: true content: application/json: schema: - description: Job definition (structure varies by job type) - type: object + $ref: '#/components/schemas/JobDefinition' properties: {} responses: '201': @@ -2164,6 +2723,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/jobs/{jobUID}: delete: operationId: DeleteJob @@ -2182,6 +2744,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings get: operationId: GetJob description: Get a specific batch job definition @@ -2199,6 +2764,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run: post: operationId: RunJob @@ -2224,6 +2792,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs: get: operationId: GetJobRuns @@ -2255,13 +2826,44 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}: + delete: + operationId: DeleteJobRun + description: Delete the results of a job run + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + description: Job run deleted successfully + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs get: operationId: GetJobRun description: Get the result of a job execution parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/reportUIDParam' + - name: view + in: query + description: 'Controls the level of detail returned: ''summary'' returns metadata + only, ''detail'' returns the full result payload' + required: false + schema: + type: string + default: summary + enum: + - summary + - detail responses: '200': $ref: '#/components/responses/GetJobRunResponse' @@ -2273,6 +2875,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel: post: operationId: CancelJobRun @@ -2291,6 +2896,9 @@ paths: - personalAccessToken: [] tags: - jobs + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/members: get: operationId: GetProjectMembers @@ -2315,6 +2923,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:accounts parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' /v1/projects/{projectOrProductUID}/monitors: @@ -2332,6 +2943,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices post: operationId: CreateMonitor description: Create a new Monitor @@ -2358,6 +2972,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/monitors/{monitorUID}: delete: operationId: DeleteMonitor @@ -2378,6 +2995,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:devices get: operationId: GetMonitor description: Get Monitor @@ -2397,6 +3017,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:devices put: operationId: UpdateMonitor description: Update Monitor @@ -2424,6 +3047,9 @@ paths: - personalAccessToken: [] tags: - monitor + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/products: get: operationId: GetProducts @@ -2446,6 +3072,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:products parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' post: @@ -2490,6 +3119,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/products/{productUID}: delete: operationId: DeleteProduct @@ -2503,6 +3135,9 @@ paths: - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/productUIDParam' @@ -2559,6 +3194,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:routes post: operationId: CreateRoute description: Create Route within a Project @@ -2619,6 +3257,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:routes /v1/projects/{projectOrProductUID}/routes/{routeUID}: delete: operationId: DeleteRoute @@ -2635,6 +3276,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:routes get: operationId: GetRoute description: Get single route within a project @@ -2672,6 +3316,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:routes put: operationId: UpdateRoute description: Update route by UID @@ -2712,6 +3359,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:routes /v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs: get: operationId: GetRouteLogsByRoute @@ -2746,6 +3396,9 @@ paths: - personalAccessToken: [] tags: - route + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:routes /v1/projects/{projectOrProductUID}/schemas: get: operationId: GetNotefileSchemas @@ -2761,8 +3414,116 @@ paths: type: array items: $ref: '#/components/schemas/NotefileSchema' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings + /v1/projects/{projectOrProductUID}/secrets: + get: + operationId: GetProjectSecrets + description: Get all secrets for a project (metadata only, values are never + returned) + responses: + '200': + $ref: '#/components/responses/GetProjectSecretsResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:settings + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + post: + operationId: CreateProjectSecret + description: Create a new project secret + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProjectSecretRequest' + properties: {} + responses: + '201': + description: Secret created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectSecret' + '400': + $ref: '#/components/responses/ErrorResponse' + '409': + $ref: '#/components/responses/ErrorResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] tags: - project + x-custom-attributes: + permission: create + resource: blues:resources:app:APPSERIAL:settings + /v1/projects/{projectOrProductUID}/secrets/{secretName}: + delete: + operationId: DeleteProjectSecret + description: Delete a project secret by name + responses: + '204': + description: Secret deleted successfully + '404': + $ref: '#/components/responses/ErrorResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: delete + resource: blues:resources:app:APPSERIAL:settings + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - name: secretName + in: path + description: The name of the secret. + required: true + schema: + type: string + put: + operationId: UpdateProjectSecret + description: Update the value of an existing project secret + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProjectSecretRequest' + properties: {} + responses: + '200': + description: Secret updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectSecret' + '404': + $ref: '#/components/responses/ErrorResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/usage/data: get: operationId: GetDataUsage @@ -2805,6 +3566,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/usage/events: get: operationId: GetEventsUsage @@ -2877,6 +3641,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/usage/route-logs: get: operationId: GetRouteLogsUsage @@ -2926,6 +3693,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/usage/sessions: get: operationId: GetSessionsUsage @@ -2977,6 +3747,9 @@ paths: - personalAccessToken: [] tags: - usage + x-custom-attributes: + permission: read + resource: blues:resources:app:APPSERIAL:events /v1/projects/{projectOrProductUID}/webhooks: get: operationId: GetWebhooks @@ -3001,6 +3774,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings /v1/projects/{projectOrProductUID}/webhooks/{webhookUID}: delete: operationId: DeleteWebhook @@ -3017,6 +3793,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings get: operationId: GetWebhook description: Retrieves the configuration settings for the specified webhook @@ -3036,6 +3815,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings post: operationId: CreateWebhook description: Creates a webhook for the specified product with the given name. @@ -3064,6 +3846,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings put: operationId: UpdateWebhook description: Updates the configuration settings for the specified webhook. | @@ -3091,6 +3876,9 @@ paths: - personalAccessToken: [] tags: - webhook + x-custom-attributes: + permission: update + resource: blues:resources:app:APPSERIAL:settings components: parameters: billingAccountUIDParam: @@ -3934,6 +4722,58 @@ components: type: string format: uri additionalProperties: false + BatchJobRequests: + description: Operations to apply to a device + type: object + properties: + comment: + type: string + connectivity_assurance_disable: + description: Disable connectivity assurance for the device + type: boolean + connectivity_assurance_enable: + description: Enable connectivity assurance for the device + type: boolean + disable: + description: Disable the device + type: boolean + enable: + description: Enable the device + type: boolean + fleets_to_default: + description: Fleet UIDs to assign to the device if it has no fleets + type: array + items: + type: string + fleets_to_join: + description: Fleet UIDs to add the device to + type: array + items: + type: string + fleets_to_leave: + description: Fleet UIDs to remove the device from + type: array + items: + type: string + provision_product: + description: Product UID to provision the device with if not already provisioned + type: string + sn_to_default: + description: Set the device serial number only if not already set + type: string + sn_to_set: + description: Set the device serial number ("-" to clear) + type: string + vars_to_default: + description: Environment variables to set only if not already set + type: object + additionalProperties: + type: string + vars_to_set: + description: Environment variables to set (use "-" as value to clear) + type: object + additionalProperties: + type: string BillingAccount: type: object properties: @@ -3954,6 +4794,7 @@ components: - billing_admin - billing_manager - project_creator + - billing_member BlynkRoute: type: object properties: @@ -4040,6 +4881,18 @@ components: - alert_routes - source_type - threshold + CreateProjectSecretRequest: + type: object + properties: + name: + description: The secret name (alphanumeric and underscores only). + type: string + value: + description: The secret value (encrypted at rest, never returned after creation). + type: string + required: + - name + - value CreateUpdateRepository: type: object properties: @@ -5058,6 +5911,15 @@ components: items: type: string properties: {} + GetProjectSecretsResponse: + type: object + properties: + secrets: + type: array + items: + $ref: '#/components/schemas/ProjectSecret' + required: + - secrets GoogleRoute: type: object properties: @@ -5118,13 +5980,28 @@ components: created_by: description: User who created the job type: string - definition: - description: Full job definition (only in detail view) - type: object - additionalProperties: true job_uid: description: Unique identifier for the job type: string + last_run_completed: + description: Unix timestamp when the most recent run completed (0 if still + in progress) + type: integer + format: int64 + example: 1775252922 + last_run_status: + description: 'Status of the most recent job run. Terminal values are: "submitted", + "completed successfully", "dry run completed successfully", "completed + with errors", "cancelled". While a job is running, intermediate per-device + progress updates may appear (e.g. "dev:000000000000000 completed", "dev:000000000000000 + updated: ...").' + type: string + example: dry run completed successfully + last_run_submitted: + description: Unix timestamp when the most recent run was submitted + type: integer + format: int64 + example: 1775252900 name: description: Human-readable job name type: string @@ -5133,50 +6010,168 @@ components: - name - created - created_by + JobDefinition: + description: Batch job definition + type: object + properties: + comment: + description: Human-readable description of the job + type: string + default_requests: + $ref: '#/components/schemas/BatchJobRequests' + device_requests: + description: Device-specific request overrides, keyed by device UID + type: object + additionalProperties: + $ref: '#/components/schemas/BatchJobRequests' + report_options: + description: Controls what data is included in the job report + type: object + properties: + app_fleets: + description: Include project fleets in the report + type: boolean + app_info: + description: Include project info in the report + type: boolean + app_vars: + description: Include project environment variables in the report + type: boolean + comment: + type: string + device_activity: + description: Include device activity data in the report + type: boolean + device_health: + description: Include device health data in the report + type: boolean + device_info: + description: Include device info in the report + type: boolean + device_vars: + description: Include device environment variables in the report + type: boolean + select: + description: Device selection criteria + type: object + properties: + all_devices: + description: Select all devices in the project + type: boolean + comment: + type: string + devices: + description: Specific device UIDs to include + type: array + items: + type: string + devices_by_sn: + description: Serial number patterns to match (supports glob wildcards + *, ?, [...]) + type: array + items: + type: string + devices_in_fleets: + description: Fleet UIDs whose devices should be included + type: array + items: + type: string + example: + comment: Set environment variables on all devices in a fleet + default_requests: + vars_to_set: + firmware_channel: production + log_level: '1' + select: + devices_in_fleets: + - fleet:00000000-0000-0000-0000-000000000000 + JobDetail: + description: Batch job with full definition + type: '' + properties: {} + allOf: + - $ref: '#/components/schemas/Job' + - properties: + definition: + $ref: '#/components/schemas/JobDefinition' + type: object JobRun: type: object properties: cancel: description: Whether cancellation was requested type: boolean + example: false completed: description: Unix timestamp when completed type: integer format: int64 + example: 1775252922 dry_run: description: Whether this was a dry run type: boolean + example: false job_name: description: Name of the job type: string + example: My Fleet Update job_uid: description: Unique identifier for the job type: string + example: 6862064d-9c7a-4d5d-88e6-2dfa8b4ef6c5 report_uid: description: Unique identifier for this run type: string + example: 6862064d-9c7a-4d5d-88e6-2dfa8b4ef6c5-1776780688472 results: description: Full results (only in detail view) type: object + example: + devices: + dev:000000000000001: + status: completed + vars_set: + firmware_channel: production + log_level: '1' + dev:000000000000002: + status: completed + vars_set: + firmware_channel: production + log_level: '1' + job: + dry_run: false + job_name: My Fleet Update + job_uid: 6862064d-9c7a-4d5d-88e6-2dfa8b4ef6c5 + status: completed successfully + when_completed: 1775252922 + when_started: 1775252900 + when_submitted: 1775252900 + when_updated: 1775252922 + who_submitted: user@example.com additionalProperties: true started: description: Unix timestamp when started type: integer format: int64 + example: 1775252900 status: description: Current status (submitted, running, completed, cancelled, failed) type: string + example: completed successfully submitted: description: Unix timestamp when submitted type: integer format: int64 + example: 1775252900 submitted_by: description: User who submitted the run type: string + example: user@example.com updated: description: Unix timestamp of last update type: integer format: int64 + example: 1775252922 required: - report_uid - job_uid @@ -5307,6 +6302,19 @@ components: type: integer uid: type: string + usage_scope: + description: 'For usage monitors: the scope of aggregation. Supported values + are "device" and "fleet".' + type: string + usage_type: + description: 'For usage monitors: the type of data usage to monitor. Supported + values are "cellular" and "satellite".' + type: string + usage_window: + description: 'For usage monitors: the rolling time window in days to sum + usage over (e.g. 30 for 30 days).' + type: integer + format: int32 MqttRoute: type: object properties: @@ -5651,6 +6659,31 @@ components: - name - email - role + ProjectSecret: + description: Metadata for a project secret. The value is never returned. + type: object + properties: + created: + description: When the secret was first created. + type: string + format: date-time + created_by: + description: The actor who created the secret. + type: string + modified: + description: When the secret was last updated. + type: string + format: date-time + modified_by: + description: The actor who last updated the secret. + type: string + name: + description: The secret name (alphanumeric and underscores only). + type: string + required: + - name + - created + - created_by ProxyRoute: type: object properties: @@ -5726,6 +6759,77 @@ components: uid: description: The unique identifier for the data repository type: string + RepositoryListResponse: + type: object + properties: + repositories: + type: array + items: + $ref: '#/components/schemas/Repository' + required: + - repositories + RepositoryTokenRequest: + type: object + properties: + intent: + description: 'Access intent for the vended credentials. Only `read` is + + supported today; `write` and `admin` are reserved for future use. + + ' + type: string + default: read + enum: + - read + ttl_seconds: + description: 'Requested credential lifetime in seconds. Clamped server-side + to + + [60, 3600]. Defaults to 900 (15 minutes) if omitted. + + ' + type: integer + default: 900 + maximum: 3600 + minimum: 60 + RepositoryTokenResponse: + type: object + properties: + database: + description: Storage service database name scoped to this repository + type: string + expires_at: + description: 'Absolute expiration time of the ephemeral user. The storage + + service will reject connections and queries after this instant. + + ' + type: string + format: date-time + host: + description: Storage service hostname the caller should connect to + type: string + password: + description: 'Ephemeral password. Returned once; not stored by Notehub. + Hold + + this in memory only and discard after `expires_at`. + + ' + type: string + port: + description: Storage service port + type: integer + username: + description: Ephemeral storage service username (prefixed with `u_`) + type: string + required: + - host + - port + - username + - password + - database + - expires_at Role: type: string properties: {} @@ -6164,6 +7268,14 @@ components: version: description: The firmware version string. type: string + UpdateProjectSecretRequest: + type: object + properties: + value: + description: The new secret value (encrypted at rest, never returned). + type: string + required: + - value UploadMetadata: type: object properties: @@ -6755,7 +7867,7 @@ components: schema: type: '' properties: {} - $ref: '#/components/schemas/Job' + $ref: '#/components/schemas/JobDetail' GetJobRunResponse: description: Job run details content: @@ -6790,6 +7902,14 @@ components: $ref: '#/components/schemas/Job' required: - jobs + GetProjectSecretsResponse: + description: The response body from a get project secrets request. + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/GetProjectSecretsResponse' LatestResponse: description: The response body for a Latest Events request. content: diff --git a/src/.openapi-generator/FILES b/src/.openapi-generator/FILES index 805aae5..b8c3f47 100644 --- a/src/.openapi-generator/FILES +++ b/src/.openapi-generator/FILES @@ -12,6 +12,7 @@ docs/AlertNotificationsInner.md docs/AuthorizationApi.md docs/AwsRoute.md docs/AzureRoute.md +docs/BatchJobRequests.md docs/BillingAccount.md docs/BillingAccountApi.md docs/BillingAccountRole.md @@ -23,9 +24,11 @@ docs/CloneProjectRequest.md docs/Contact.md docs/CreateFleetRequest.md docs/CreateJob201Response.md +docs/CreateLegacyWebhookEventRequest.md docs/CreateMonitor.md docs/CreateProductRequest.md docs/CreateProjectRequest.md +docs/CreateProjectSecretRequest.md docs/CreateUpdateRepository.md docs/CurrentFirmware.md docs/DFUEnv.md @@ -76,6 +79,10 @@ docs/GetDeviceEnvironmentVariablesByPin200Response.md docs/GetDeviceFleets200Response.md docs/GetDeviceHealthLog200Response.md docs/GetDeviceHealthLog200ResponseHealthLogInner.md +docs/GetDeviceJourney200Response.md +docs/GetDeviceJourney200ResponseJourney.md +docs/GetDeviceJourneys200Response.md +docs/GetDeviceJourneys200ResponseJourneysInner.md docs/GetDeviceLatestEvents200Response.md docs/GetDevicePlans200Response.md docs/GetDevicePublicKey200Response.md @@ -90,6 +97,7 @@ docs/GetJobs200Response.md docs/GetNotefile200Response.md docs/GetProducts200Response.md docs/GetProjectMembers200Response.md +docs/GetProjectSecretsResponse.md docs/GetProjects200Response.md docs/GetRouteLogsUsage200Response.md docs/GetSessionsUsage200Response.md @@ -97,6 +105,10 @@ docs/GetWebhooks200Response.md docs/GoogleRoute.md docs/HttpRoute.md docs/Job.md +docs/JobDefinition.md +docs/JobDefinitionReportOptions.md +docs/JobDefinitionSelect.md +docs/JobDetail.md docs/JobRun.md docs/JobsApi.md docs/Location.md @@ -122,11 +134,15 @@ docs/Product.md docs/Project.md docs/ProjectApi.md docs/ProjectMember.md +docs/ProjectSecret.md docs/ProvisionDeviceRequest.md docs/ProxyRoute.md docs/QubitroRoute.md docs/RadRoute.md docs/Repository.md +docs/RepositoryListResponse.md +docs/RepositoryTokenRequest.md +docs/RepositoryTokenResponse.md docs/Role.md docs/RouteApi.md docs/RouteLog.md @@ -148,6 +164,7 @@ docs/TowerLocation.md docs/TwilioRoute.md docs/UpdateFleetRequest.md docs/UpdateHostFirmwareRequest.md +docs/UpdateProjectSecretRequest.md docs/UploadMetadata.md docs/UsageApi.md docs/UsageData.md @@ -187,6 +204,7 @@ notehub_py/models/alert_notifications_inner.py notehub_py/models/aws_role_config.py notehub_py/models/aws_route.py notehub_py/models/azure_route.py +notehub_py/models/batch_job_requests.py notehub_py/models/billing_account.py notehub_py/models/billing_account_role.py notehub_py/models/blynk_route.py @@ -197,9 +215,11 @@ notehub_py/models/clone_project_request.py notehub_py/models/contact.py notehub_py/models/create_fleet_request.py notehub_py/models/create_job201_response.py +notehub_py/models/create_legacy_webhook_event_request.py notehub_py/models/create_monitor.py notehub_py/models/create_product_request.py notehub_py/models/create_project_request.py +notehub_py/models/create_project_secret_request.py notehub_py/models/create_update_repository.py notehub_py/models/current_firmware.py notehub_py/models/data_field.py @@ -247,6 +267,10 @@ notehub_py/models/get_device_environment_variables_by_pin200_response.py notehub_py/models/get_device_fleets200_response.py notehub_py/models/get_device_health_log200_response.py notehub_py/models/get_device_health_log200_response_health_log_inner.py +notehub_py/models/get_device_journey200_response.py +notehub_py/models/get_device_journey200_response_journey.py +notehub_py/models/get_device_journeys200_response.py +notehub_py/models/get_device_journeys200_response_journeys_inner.py notehub_py/models/get_device_latest_events200_response.py notehub_py/models/get_device_plans200_response.py notehub_py/models/get_device_public_key200_response.py @@ -261,6 +285,7 @@ notehub_py/models/get_jobs200_response.py notehub_py/models/get_notefile200_response.py notehub_py/models/get_products200_response.py notehub_py/models/get_project_members200_response.py +notehub_py/models/get_project_secrets_response.py notehub_py/models/get_projects200_response.py notehub_py/models/get_route_logs_usage200_response.py notehub_py/models/get_sessions_usage200_response.py @@ -268,6 +293,10 @@ notehub_py/models/get_webhooks200_response.py notehub_py/models/google_route.py notehub_py/models/http_route.py notehub_py/models/job.py +notehub_py/models/job_definition.py +notehub_py/models/job_definition_report_options.py +notehub_py/models/job_definition_select.py +notehub_py/models/job_detail.py notehub_py/models/job_run.py notehub_py/models/location.py notehub_py/models/login200_response.py @@ -290,11 +319,15 @@ notehub_py/models/personal_access_token_secret.py notehub_py/models/product.py notehub_py/models/project.py notehub_py/models/project_member.py +notehub_py/models/project_secret.py notehub_py/models/provision_device_request.py notehub_py/models/proxy_route.py notehub_py/models/qubitro_route.py notehub_py/models/rad_route.py notehub_py/models/repository.py +notehub_py/models/repository_list_response.py +notehub_py/models/repository_token_request.py +notehub_py/models/repository_token_response.py notehub_py/models/role.py notehub_py/models/route_log.py notehub_py/models/route_transform_settings.py @@ -315,6 +348,7 @@ notehub_py/models/tower_location.py notehub_py/models/twilio_route.py notehub_py/models/update_fleet_request.py notehub_py/models/update_host_firmware_request.py +notehub_py/models/update_project_secret_request.py notehub_py/models/upload_metadata.py notehub_py/models/usage_data.py notehub_py/models/usage_events_data.py @@ -333,5 +367,21 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_update_host_firmware_request.py +test/test_batch_job_requests.py +test/test_create_legacy_webhook_event_request.py +test/test_create_project_secret_request.py +test/test_get_device_journey200_response.py +test/test_get_device_journey200_response_journey.py +test/test_get_device_journeys200_response.py +test/test_get_device_journeys200_response_journeys_inner.py +test/test_get_project_secrets_response.py +test/test_job_definition.py +test/test_job_definition_report_options.py +test/test_job_definition_select.py +test/test_job_detail.py +test/test_project_secret.py +test/test_repository_list_response.py +test/test_repository_token_request.py +test/test_repository_token_response.py +test/test_update_project_secret_request.py tox.ini diff --git a/src/README.md b/src/README.md index ef83476..22a6052 100644 --- a/src/README.md +++ b/src/README.md @@ -5,7 +5,7 @@ The OpenAPI definition for the Notehub.io API. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.2.0 -- Package version: 6.2.0 +- Package version: 6.3.0 - Generator version: 7.5.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://dev.blues.io/support/](https://dev.blues.io/support/) @@ -114,6 +114,8 @@ Class | Method | HTTP request | Description *DeviceApi* | [**get_device_environment_variables**](docs/DeviceApi.md#get_device_environment_variables) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | *DeviceApi* | [**get_device_environment_variables_by_pin**](docs/DeviceApi.md#get_device_environment_variables_by_pin) | **GET** /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | *DeviceApi* | [**get_device_health_log**](docs/DeviceApi.md#get_device_health_log) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log | +*DeviceApi* | [**get_device_journey**](docs/DeviceApi.md#get_device_journey) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID} | +*DeviceApi* | [**get_device_journeys**](docs/DeviceApi.md#get_device_journeys) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys | *DeviceApi* | [**get_device_latest_events**](docs/DeviceApi.md#get_device_latest_events) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest | *DeviceApi* | [**get_device_plans**](docs/DeviceApi.md#get_device_plans) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans | *DeviceApi* | [**get_device_public_key**](docs/DeviceApi.md#get_device_public_key) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key | @@ -139,6 +141,7 @@ Class | Method | HTTP request | Description *JobsApi* | [**cancel_job_run**](docs/JobsApi.md#cancel_job_run) | **POST** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel | *JobsApi* | [**create_job**](docs/JobsApi.md#create_job) | **POST** /v1/projects/{projectOrProductUID}/jobs | *JobsApi* | [**delete_job**](docs/JobsApi.md#delete_job) | **DELETE** /v1/projects/{projectOrProductUID}/jobs/{jobUID} | +*JobsApi* | [**delete_job_run**](docs/JobsApi.md#delete_job_run) | **DELETE** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID} | *JobsApi* | [**get_job**](docs/JobsApi.md#get_job) | **GET** /v1/projects/{projectOrProductUID}/jobs/{jobUID} | *JobsApi* | [**get_job_run**](docs/JobsApi.md#get_job_run) | **GET** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID} | *JobsApi* | [**get_job_runs**](docs/JobsApi.md#get_job_runs) | **GET** /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs | @@ -154,6 +157,7 @@ Class | Method | HTTP request | Description *ProjectApi* | [**create_fleet**](docs/ProjectApi.md#create_fleet) | **POST** /v1/projects/{projectOrProductUID}/fleets | *ProjectApi* | [**create_product**](docs/ProjectApi.md#create_product) | **POST** /v1/projects/{projectOrProductUID}/products | *ProjectApi* | [**create_project**](docs/ProjectApi.md#create_project) | **POST** /v1/projects | +*ProjectApi* | [**create_project_secret**](docs/ProjectApi.md#create_project_secret) | **POST** /v1/projects/{projectOrProductUID}/secrets | *ProjectApi* | [**delete_device_from_fleets**](docs/ProjectApi.md#delete_device_from_fleets) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | *ProjectApi* | [**delete_firmware**](docs/ProjectApi.md#delete_firmware) | **DELETE** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | *ProjectApi* | [**delete_fleet**](docs/ProjectApi.md#delete_fleet) | **DELETE** /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | @@ -161,6 +165,7 @@ Class | Method | HTTP request | Description *ProjectApi* | [**delete_product**](docs/ProjectApi.md#delete_product) | **DELETE** /v1/projects/{projectOrProductUID}/products/{productUID} | *ProjectApi* | [**delete_project**](docs/ProjectApi.md#delete_project) | **DELETE** /v1/projects/{projectOrProductUID} | *ProjectApi* | [**delete_project_environment_variable**](docs/ProjectApi.md#delete_project_environment_variable) | **DELETE** /v1/projects/{projectOrProductUID}/environment_variables/{key} | +*ProjectApi* | [**delete_project_secret**](docs/ProjectApi.md#delete_project_secret) | **DELETE** /v1/projects/{projectOrProductUID}/secrets/{secretName} | *ProjectApi* | [**disable_global_event_transformation**](docs/ProjectApi.md#disable_global_event_transformation) | **POST** /v1/projects/{projectOrProductUID}/global-transformation/disable | *ProjectApi* | [**download_firmware**](docs/ProjectApi.md#download_firmware) | **GET** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | *ProjectApi* | [**enable_global_event_transformation**](docs/ProjectApi.md#enable_global_event_transformation) | **POST** /v1/projects/{projectOrProductUID}/global-transformation/enable | @@ -182,6 +187,7 @@ Class | Method | HTTP request | Description *ProjectApi* | [**get_project_environment_hierarchy**](docs/ProjectApi.md#get_project_environment_hierarchy) | **GET** /v1/projects/{projectOrProductUID}/environment_hierarchy | Get environment variable hierarchy for a device *ProjectApi* | [**get_project_environment_variables**](docs/ProjectApi.md#get_project_environment_variables) | **GET** /v1/projects/{projectOrProductUID}/environment_variables | *ProjectApi* | [**get_project_members**](docs/ProjectApi.md#get_project_members) | **GET** /v1/projects/{projectOrProductUID}/members | +*ProjectApi* | [**get_project_secrets**](docs/ProjectApi.md#get_project_secrets) | **GET** /v1/projects/{projectOrProductUID}/secrets | *ProjectApi* | [**get_projects**](docs/ProjectApi.md#get_projects) | **GET** /v1/projects | *ProjectApi* | [**perform_dfu_action**](docs/ProjectApi.md#perform_dfu_action) | **POST** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action} | *ProjectApi* | [**set_fleet_environment_variables**](docs/ProjectApi.md#set_fleet_environment_variables) | **PUT** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | @@ -189,6 +195,7 @@ Class | Method | HTTP request | Description *ProjectApi* | [**set_project_environment_variables**](docs/ProjectApi.md#set_project_environment_variables) | **PUT** /v1/projects/{projectOrProductUID}/environment_variables | *ProjectApi* | [**update_firmware**](docs/ProjectApi.md#update_firmware) | **POST** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | *ProjectApi* | [**update_fleet**](docs/ProjectApi.md#update_fleet) | **PUT** /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | +*ProjectApi* | [**update_project_secret**](docs/ProjectApi.md#update_project_secret) | **PUT** /v1/projects/{projectOrProductUID}/secrets/{secretName} | *ProjectApi* | [**upload_firmware**](docs/ProjectApi.md#upload_firmware) | **PUT** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | *RouteApi* | [**create_route**](docs/RouteApi.md#create_route) | **POST** /v1/projects/{projectOrProductUID}/routes | *RouteApi* | [**delete_route**](docs/RouteApi.md#delete_route) | **DELETE** /v1/projects/{projectOrProductUID}/routes/{routeUID} | @@ -200,11 +207,17 @@ Class | Method | HTTP request | Description *UsageApi* | [**get_events_usage**](docs/UsageApi.md#get_events_usage) | **GET** /v1/projects/{projectOrProductUID}/usage/events | *UsageApi* | [**get_route_logs_usage**](docs/UsageApi.md#get_route_logs_usage) | **GET** /v1/projects/{projectOrProductUID}/usage/route-logs | *UsageApi* | [**get_sessions_usage**](docs/UsageApi.md#get_sessions_usage) | **GET** /v1/projects/{projectOrProductUID}/usage/sessions | +*WebhookApi* | [**create_legacy_webhook_event**](docs/WebhookApi.md#create_legacy_webhook_event) | **POST** /v1/products/{productUID}/devices/{deviceUID}/webhook-event | *WebhookApi* | [**create_webhook**](docs/WebhookApi.md#create_webhook) | **POST** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +*WebhookApi* | [**create_webhook_device_event_by_product**](docs/WebhookApi.md#create_webhook_device_event_by_product) | **POST** /v1/products/{productUID}/webhooks/{webhookUID}/devices/{deviceUID}/event | +*WebhookApi* | [**create_webhook_event_by_product**](docs/WebhookApi.md#create_webhook_event_by_product) | **POST** /v1/products/{productUID}/webhooks/{webhookUID}/event | *WebhookApi* | [**delete_webhook**](docs/WebhookApi.md#delete_webhook) | **DELETE** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | *WebhookApi* | [**get_webhook**](docs/WebhookApi.md#get_webhook) | **GET** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +*WebhookApi* | [**get_webhook_settings_by_product**](docs/WebhookApi.md#get_webhook_settings_by_product) | **GET** /v1/products/{productUID}/webhooks/{webhookUID}/settings | *WebhookApi* | [**get_webhooks**](docs/WebhookApi.md#get_webhooks) | **GET** /v1/projects/{projectOrProductUID}/webhooks | +*WebhookApi* | [**update_legacy_webhook_session**](docs/WebhookApi.md#update_legacy_webhook_session) | **PUT** /v1/products/{productUID}/devices/{deviceUID}/webhook-session | *WebhookApi* | [**update_webhook**](docs/WebhookApi.md#update_webhook) | **PUT** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +*WebhookApi* | [**update_webhook_settings_by_product**](docs/WebhookApi.md#update_webhook_settings_by_product) | **PUT** /v1/products/{productUID}/webhooks/{webhookUID}/settings | ## Documentation For Models @@ -216,6 +229,7 @@ Class | Method | HTTP request | Description - [AlertNotificationsInner](docs/AlertNotificationsInner.md) - [AwsRoute](docs/AwsRoute.md) - [AzureRoute](docs/AzureRoute.md) + - [BatchJobRequests](docs/BatchJobRequests.md) - [BillingAccount](docs/BillingAccount.md) - [BillingAccountRole](docs/BillingAccountRole.md) - [BlynkRoute](docs/BlynkRoute.md) @@ -226,9 +240,11 @@ Class | Method | HTTP request | Description - [Contact](docs/Contact.md) - [CreateFleetRequest](docs/CreateFleetRequest.md) - [CreateJob201Response](docs/CreateJob201Response.md) + - [CreateLegacyWebhookEventRequest](docs/CreateLegacyWebhookEventRequest.md) - [CreateMonitor](docs/CreateMonitor.md) - [CreateProductRequest](docs/CreateProductRequest.md) - [CreateProjectRequest](docs/CreateProjectRequest.md) + - [CreateProjectSecretRequest](docs/CreateProjectSecretRequest.md) - [CreateUpdateRepository](docs/CreateUpdateRepository.md) - [CurrentFirmware](docs/CurrentFirmware.md) - [DFUEnv](docs/DFUEnv.md) @@ -276,6 +292,10 @@ Class | Method | HTTP request | Description - [GetDeviceFleets200Response](docs/GetDeviceFleets200Response.md) - [GetDeviceHealthLog200Response](docs/GetDeviceHealthLog200Response.md) - [GetDeviceHealthLog200ResponseHealthLogInner](docs/GetDeviceHealthLog200ResponseHealthLogInner.md) + - [GetDeviceJourney200Response](docs/GetDeviceJourney200Response.md) + - [GetDeviceJourney200ResponseJourney](docs/GetDeviceJourney200ResponseJourney.md) + - [GetDeviceJourneys200Response](docs/GetDeviceJourneys200Response.md) + - [GetDeviceJourneys200ResponseJourneysInner](docs/GetDeviceJourneys200ResponseJourneysInner.md) - [GetDeviceLatestEvents200Response](docs/GetDeviceLatestEvents200Response.md) - [GetDevicePlans200Response](docs/GetDevicePlans200Response.md) - [GetDevicePublicKey200Response](docs/GetDevicePublicKey200Response.md) @@ -290,6 +310,7 @@ Class | Method | HTTP request | Description - [GetNotefile200Response](docs/GetNotefile200Response.md) - [GetProducts200Response](docs/GetProducts200Response.md) - [GetProjectMembers200Response](docs/GetProjectMembers200Response.md) + - [GetProjectSecretsResponse](docs/GetProjectSecretsResponse.md) - [GetProjects200Response](docs/GetProjects200Response.md) - [GetRouteLogsUsage200Response](docs/GetRouteLogsUsage200Response.md) - [GetSessionsUsage200Response](docs/GetSessionsUsage200Response.md) @@ -297,6 +318,10 @@ Class | Method | HTTP request | Description - [GoogleRoute](docs/GoogleRoute.md) - [HttpRoute](docs/HttpRoute.md) - [Job](docs/Job.md) + - [JobDefinition](docs/JobDefinition.md) + - [JobDefinitionReportOptions](docs/JobDefinitionReportOptions.md) + - [JobDefinitionSelect](docs/JobDefinitionSelect.md) + - [JobDetail](docs/JobDetail.md) - [JobRun](docs/JobRun.md) - [Location](docs/Location.md) - [Login200Response](docs/Login200Response.md) @@ -319,11 +344,15 @@ Class | Method | HTTP request | Description - [Product](docs/Product.md) - [Project](docs/Project.md) - [ProjectMember](docs/ProjectMember.md) + - [ProjectSecret](docs/ProjectSecret.md) - [ProvisionDeviceRequest](docs/ProvisionDeviceRequest.md) - [ProxyRoute](docs/ProxyRoute.md) - [QubitroRoute](docs/QubitroRoute.md) - [RadRoute](docs/RadRoute.md) - [Repository](docs/Repository.md) + - [RepositoryListResponse](docs/RepositoryListResponse.md) + - [RepositoryTokenRequest](docs/RepositoryTokenRequest.md) + - [RepositoryTokenResponse](docs/RepositoryTokenResponse.md) - [Role](docs/Role.md) - [RouteLog](docs/RouteLog.md) - [RouteTransformSettings](docs/RouteTransformSettings.md) @@ -344,6 +373,7 @@ Class | Method | HTTP request | Description - [TwilioRoute](docs/TwilioRoute.md) - [UpdateFleetRequest](docs/UpdateFleetRequest.md) - [UpdateHostFirmwareRequest](docs/UpdateHostFirmwareRequest.md) + - [UpdateProjectSecretRequest](docs/UpdateProjectSecretRequest.md) - [UploadMetadata](docs/UploadMetadata.md) - [UsageData](docs/UsageData.md) - [UsageEventsData](docs/UsageEventsData.md) diff --git a/src/docs/BatchJobRequests.md b/src/docs/BatchJobRequests.md new file mode 100644 index 0000000..5685a06 --- /dev/null +++ b/src/docs/BatchJobRequests.md @@ -0,0 +1,41 @@ +# BatchJobRequests + +Operations to apply to a device + +## Properties + +| Name | Type | Description | Notes | +| ---------------------------------- | ------------------ | -------------------------------------------------------------------- | ---------- | +| **comment** | **str** | | [optional] | +| **connectivity_assurance_disable** | **bool** | Disable connectivity assurance for the device | [optional] | +| **connectivity_assurance_enable** | **bool** | Enable connectivity assurance for the device | [optional] | +| **disable** | **bool** | Disable the device | [optional] | +| **enable** | **bool** | Enable the device | [optional] | +| **fleets_to_default** | **List[str]** | Fleet UIDs to assign to the device if it has no fleets | [optional] | +| **fleets_to_join** | **List[str]** | Fleet UIDs to add the device to | [optional] | +| **fleets_to_leave** | **List[str]** | Fleet UIDs to remove the device from | [optional] | +| **provision_product** | **str** | Product UID to provision the device with if not already provisioned | [optional] | +| **sn_to_default** | **str** | Set the device serial number only if not already set | [optional] | +| **sn_to_set** | **str** | Set the device serial number (\"-\" to clear) | [optional] | +| **vars_to_default** | **Dict[str, str]** | Environment variables to set only if not already set | [optional] | +| **vars_to_set** | **Dict[str, str]** | Environment variables to set (use \"-\" as value to clear) | [optional] | + +## Example + +```python +from notehub_py.models.batch_job_requests import BatchJobRequests + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchJobRequests from a JSON string +batch_job_requests_instance = BatchJobRequests.from_json(json) +# print the JSON string representation of the object +print(BatchJobRequests.to_json()) + +# convert the object into a dict +batch_job_requests_dict = batch_job_requests_instance.to_dict() +# create an instance of BatchJobRequests from a dict +batch_job_requests_from_dict = BatchJobRequests.from_dict(batch_job_requests_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/CreateLegacyWebhookEventRequest.md b/src/docs/CreateLegacyWebhookEventRequest.md new file mode 100644 index 0000000..e685905 --- /dev/null +++ b/src/docs/CreateLegacyWebhookEventRequest.md @@ -0,0 +1,37 @@ +# CreateLegacyWebhookEventRequest + +## Properties + +| Name | Type | Description | Notes | +| ----------- | --------------------- | -------------------------------------------------- | ---------- | +| **body** | **Dict[str, object]** | Arbitrary JSON event body. | [optional] | +| **file** | **str** | The notefile to which the event should be written. | [optional] | +| **payload** | **str** | Optional base64-encoded binary payload. | [optional] | + +## Example + +```python +from notehub_py.models.create_legacy_webhook_event_request import ( + CreateLegacyWebhookEventRequest, +) + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLegacyWebhookEventRequest from a JSON string +create_legacy_webhook_event_request_instance = ( + CreateLegacyWebhookEventRequest.from_json(json) +) +# print the JSON string representation of the object +print(CreateLegacyWebhookEventRequest.to_json()) + +# convert the object into a dict +create_legacy_webhook_event_request_dict = ( + create_legacy_webhook_event_request_instance.to_dict() +) +# create an instance of CreateLegacyWebhookEventRequest from a dict +create_legacy_webhook_event_request_from_dict = ( + CreateLegacyWebhookEventRequest.from_dict(create_legacy_webhook_event_request_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/CreateMonitor.md b/src/docs/CreateMonitor.md index 3d04a69..ee0be6c 100644 --- a/src/docs/CreateMonitor.md +++ b/src/docs/CreateMonitor.md @@ -22,6 +22,9 @@ | **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] | +| **usage_scope** | **str** | For usage monitors: the scope of aggregation. Supported values are \"device\" and \"fleet\". | [optional] | +| **usage_type** | **str** | For usage monitors: the type of data usage to monitor. Supported values are \"cellular\" and \"satellite\". | [optional] | +| **usage_window** | **int** | For usage monitors: the rolling time window in days to sum usage over (e.g. 30 for 30 days). | [optional] | ## Example diff --git a/src/docs/CreateProjectSecretRequest.md b/src/docs/CreateProjectSecretRequest.md new file mode 100644 index 0000000..0bdf744 --- /dev/null +++ b/src/docs/CreateProjectSecretRequest.md @@ -0,0 +1,30 @@ +# CreateProjectSecretRequest + +## Properties + +| Name | Type | Description | Notes | +| --------- | ------- | -------------------------------------------------------------------- | ----- | +| **name** | **str** | The secret name (alphanumeric and underscores only). | +| **value** | **str** | The secret value (encrypted at rest, never returned after creation). | + +## Example + +```python +from notehub_py.models.create_project_secret_request import CreateProjectSecretRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProjectSecretRequest from a JSON string +create_project_secret_request_instance = CreateProjectSecretRequest.from_json(json) +# print the JSON string representation of the object +print(CreateProjectSecretRequest.to_json()) + +# convert the object into a dict +create_project_secret_request_dict = create_project_secret_request_instance.to_dict() +# create an instance of CreateProjectSecretRequest from a dict +create_project_secret_request_from_dict = CreateProjectSecretRequest.from_dict( + create_project_secret_request_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/DeviceApi.md b/src/docs/DeviceApi.md index 791abab..cfc352a 100644 --- a/src/docs/DeviceApi.md +++ b/src/docs/DeviceApi.md @@ -19,6 +19,8 @@ All URIs are relative to *https://api.notefile.net* | [**get_device_environment_variables**](DeviceApi.md#get_device_environment_variables) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | | [**get_device_environment_variables_by_pin**](DeviceApi.md#get_device_environment_variables_by_pin) | **GET** /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | | [**get_device_health_log**](DeviceApi.md#get_device_health_log) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log | +| [**get_device_journey**](DeviceApi.md#get_device_journey) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID} | +| [**get_device_journeys**](DeviceApi.md#get_device_journeys) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys | | [**get_device_latest_events**](DeviceApi.md#get_device_latest_events) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest | | [**get_device_plans**](DeviceApi.md#get_device_plans) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans | | [**get_device_public_key**](DeviceApi.md#get_device_public_key) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key | @@ -759,6 +761,7 @@ from notehub_py.models.get_device_environment_variables_by_pin200_response impor from notehub_py.rest import ApiException from pprint import pprint +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") # Enter a context with an instance of the API client with notehub_py.ApiClient(configuration) as api_client: @@ -797,7 +800,7 @@ with notehub_py.ApiClient(configuration) as api_client: ### Authorization -No authorization required +[personalAccessToken](../README.md#personalAccessToken) ### HTTP request headers @@ -871,6 +874,128 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json +## get_device_journey + +> GetDeviceJourney200Response get_device_journey(project_or_product_uid, device_uid, journey_id, page_size=page_size, page_num=page_num) + +Get a single journey for a device along with its `_track.qo` events. The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` to detect additional pages. + +### Example + +```python +import notehub_py +from notehub_py.models.get_device_journey200_response import GetDeviceJourney200Response +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.DeviceApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + device_uid = "dev:000000000000000" # str | + journey_id = 56 # int | Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). + page_size = 50 # int | (optional) (default to 50) + page_num = 1 # int | (optional) (default to 1) + + try: + api_response = api_instance.get_device_journey( + project_or_product_uid, + device_uid, + journey_id, + page_size=page_size, + page_num=page_num, + ) + print("The response of DeviceApi->get_device_journey:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DeviceApi->get_device_journey: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | +| **project_or_product_uid** | **str** | | +| **device_uid** | **str** | | +| **journey_id** | **int** | Identifier of the journey, taken from the `journey` field on `\_track.qo` events (a Unix timestamp marking the start of the journey). | +| **page_size** | **int** | | [optional] [default to 50] | +| **page_num** | **int** | | [optional] [default to 1] | + +### Return type + +[**GetDeviceJourney200Response**](GetDeviceJourney200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +## get_device_journeys + +> GetDeviceJourneys200Response get_device_journeys(project_or_product_uid, device_uid, start_date=start_date, end_date=end_date) + +Get the list of journeys for a device, derived from `_track.qo` events. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; `has_more` is true when the cap is hit. + +### Example + +```python +import notehub_py +from notehub_py.models.get_device_journeys200_response import ( + GetDeviceJourneys200Response, +) +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.DeviceApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + device_uid = "dev:000000000000000" # str | + start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional) + end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional) + + try: + api_response = api_instance.get_device_journeys( + project_or_product_uid, device_uid, start_date=start_date, end_date=end_date + ) + print("The response of DeviceApi->get_device_journeys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DeviceApi->get_device_journeys: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | --------------------------------------------------------------- | ---------- | +| **project_or_product_uid** | **str** | | +| **device_uid** | **str** | | +| **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] | + +### Return type + +[**GetDeviceJourneys200Response**](GetDeviceJourneys200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## get_device_latest_events > GetDeviceLatestEvents200Response get_device_latest_events(project_or_product_uid, device_uid) @@ -1598,6 +1723,7 @@ from notehub_py.models.environment_variables import EnvironmentVariables from notehub_py.rest import ApiException from pprint import pprint +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") # Enter a context with an instance of the API client with notehub_py.ApiClient(configuration) as api_client: @@ -1640,7 +1766,7 @@ with notehub_py.ApiClient(configuration) as api_client: ### Authorization -No authorization required +[personalAccessToken](../README.md#personalAccessToken) ### HTTP request headers diff --git a/src/docs/GetDeviceJourney200Response.md b/src/docs/GetDeviceJourney200Response.md new file mode 100644 index 0000000..b30b700 --- /dev/null +++ b/src/docs/GetDeviceJourney200Response.md @@ -0,0 +1,32 @@ +# GetDeviceJourney200Response + +## Properties + +| Name | Type | Description | Notes | +| -------------- | ------------------------------------------------------------------------------- | --------------------------------------- | ----- | +| **end_date** | **datetime** | Latest event time within the journey. | +| **journey** | [**GetDeviceJourney200ResponseJourney**](GetDeviceJourney200ResponseJourney.md) | | +| **journey_id** | **int** | Identifier of the journey. | +| **start_date** | **datetime** | Earliest event time within the journey. | + +## Example + +```python +from notehub_py.models.get_device_journey200_response import GetDeviceJourney200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDeviceJourney200Response from a JSON string +get_device_journey200_response_instance = GetDeviceJourney200Response.from_json(json) +# print the JSON string representation of the object +print(GetDeviceJourney200Response.to_json()) + +# convert the object into a dict +get_device_journey200_response_dict = get_device_journey200_response_instance.to_dict() +# create an instance of GetDeviceJourney200Response from a dict +get_device_journey200_response_from_dict = GetDeviceJourney200Response.from_dict( + get_device_journey200_response_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/GetDeviceJourney200ResponseJourney.md b/src/docs/GetDeviceJourney200ResponseJourney.md new file mode 100644 index 0000000..2738a79 --- /dev/null +++ b/src/docs/GetDeviceJourney200ResponseJourney.md @@ -0,0 +1,40 @@ +# GetDeviceJourney200ResponseJourney + +Paginated `_track.qo` events for the journey. + +## Properties + +| Name | Type | Description | Notes | +| ------------ | --------------------------- | ----------- | ----- | +| **events** | [**List[Event]**](Event.md) | | +| **has_more** | **bool** | | + +## Example + +```python +from notehub_py.models.get_device_journey200_response_journey import ( + GetDeviceJourney200ResponseJourney, +) + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDeviceJourney200ResponseJourney from a JSON string +get_device_journey200_response_journey_instance = ( + GetDeviceJourney200ResponseJourney.from_json(json) +) +# print the JSON string representation of the object +print(GetDeviceJourney200ResponseJourney.to_json()) + +# convert the object into a dict +get_device_journey200_response_journey_dict = ( + get_device_journey200_response_journey_instance.to_dict() +) +# create an instance of GetDeviceJourney200ResponseJourney from a dict +get_device_journey200_response_journey_from_dict = ( + GetDeviceJourney200ResponseJourney.from_dict( + get_device_journey200_response_journey_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/GetDeviceJourneys200Response.md b/src/docs/GetDeviceJourneys200Response.md new file mode 100644 index 0000000..9a75eaa --- /dev/null +++ b/src/docs/GetDeviceJourneys200Response.md @@ -0,0 +1,34 @@ +# GetDeviceJourneys200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | --------------------------------------------------------------------------------------------------- | ----------- | ----- | +| **has_more** | **bool** | | +| **journeys** | [**List[GetDeviceJourneys200ResponseJourneysInner]**](GetDeviceJourneys200ResponseJourneysInner.md) | | + +## Example + +```python +from notehub_py.models.get_device_journeys200_response import ( + GetDeviceJourneys200Response, +) + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDeviceJourneys200Response from a JSON string +get_device_journeys200_response_instance = GetDeviceJourneys200Response.from_json(json) +# print the JSON string representation of the object +print(GetDeviceJourneys200Response.to_json()) + +# convert the object into a dict +get_device_journeys200_response_dict = ( + get_device_journeys200_response_instance.to_dict() +) +# create an instance of GetDeviceJourneys200Response from a dict +get_device_journeys200_response_from_dict = GetDeviceJourneys200Response.from_dict( + get_device_journeys200_response_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/GetDeviceJourneys200ResponseJourneysInner.md b/src/docs/GetDeviceJourneys200ResponseJourneysInner.md new file mode 100644 index 0000000..8ecb558 --- /dev/null +++ b/src/docs/GetDeviceJourneys200ResponseJourneysInner.md @@ -0,0 +1,40 @@ +# GetDeviceJourneys200ResponseJourneysInner + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| **end_date** | **datetime** | Latest event time within the journey. | +| **journey_id** | **int** | Identifier of the journey, taken from the `journey` field on `\_track.qo` events. This value is itself a Unix timestamp marking the start of the journey. | +| **start_date** | **datetime** | Earliest event time within the journey. | +| **total_events** | **int** | The number of \_track.qo events in the journey. | + +## Example + +```python +from notehub_py.models.get_device_journeys200_response_journeys_inner import ( + GetDeviceJourneys200ResponseJourneysInner, +) + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDeviceJourneys200ResponseJourneysInner from a JSON string +get_device_journeys200_response_journeys_inner_instance = ( + GetDeviceJourneys200ResponseJourneysInner.from_json(json) +) +# print the JSON string representation of the object +print(GetDeviceJourneys200ResponseJourneysInner.to_json()) + +# convert the object into a dict +get_device_journeys200_response_journeys_inner_dict = ( + get_device_journeys200_response_journeys_inner_instance.to_dict() +) +# create an instance of GetDeviceJourneys200ResponseJourneysInner from a dict +get_device_journeys200_response_journeys_inner_from_dict = ( + GetDeviceJourneys200ResponseJourneysInner.from_dict( + get_device_journeys200_response_journeys_inner_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/GetProjectSecretsResponse.md b/src/docs/GetProjectSecretsResponse.md new file mode 100644 index 0000000..e2d1165 --- /dev/null +++ b/src/docs/GetProjectSecretsResponse.md @@ -0,0 +1,29 @@ +# GetProjectSecretsResponse + +## Properties + +| Name | Type | Description | Notes | +| ----------- | ------------------------------------------- | ----------- | ----- | +| **secrets** | [**List[ProjectSecret]**](ProjectSecret.md) | | + +## Example + +```python +from notehub_py.models.get_project_secrets_response import GetProjectSecretsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GetProjectSecretsResponse from a JSON string +get_project_secrets_response_instance = GetProjectSecretsResponse.from_json(json) +# print the JSON string representation of the object +print(GetProjectSecretsResponse.to_json()) + +# convert the object into a dict +get_project_secrets_response_dict = get_project_secrets_response_instance.to_dict() +# create an instance of GetProjectSecretsResponse from a dict +get_project_secrets_response_from_dict = GetProjectSecretsResponse.from_dict( + get_project_secrets_response_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/Job.md b/src/docs/Job.md index a78f4d2..fe7705e 100644 --- a/src/docs/Job.md +++ b/src/docs/Job.md @@ -2,13 +2,15 @@ ## Properties -| Name | Type | Description | Notes | -| -------------- | --------------------- | ----------------------------------------- | ---------- | -| **created** | **int** | Unix timestamp when job was created | -| **created_by** | **str** | User who created the job | -| **definition** | **Dict[str, object]** | Full job definition (only in detail view) | [optional] | -| **job_uid** | **str** | Unique identifier for the job | -| **name** | **str** | Human-readable job name | +| Name | Type | Description | Notes | +| ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | +| **created** | **int** | Unix timestamp when job was created | +| **created_by** | **str** | User who created the job | +| **job_uid** | **str** | Unique identifier for the job | +| **last_run_completed** | **int** | Unix timestamp when the most recent run completed (0 if still in progress) | [optional] | +| **last_run_status** | **str** | Status of the most recent job run. Terminal values are: \"submitted\", \"completed successfully\", \"dry run completed successfully\", \"completed with errors\", \"cancelled\". While a job is running, intermediate per-device progress updates may appear (e.g. \"dev:000000000000000 completed\", \"dev:000000000000000 updated: ...\"). | [optional] | +| **last_run_submitted** | **int** | Unix timestamp when the most recent run was submitted | [optional] | +| **name** | **str** | Human-readable job name | ## Example diff --git a/src/docs/JobDefinition.md b/src/docs/JobDefinition.md new file mode 100644 index 0000000..7b4b678 --- /dev/null +++ b/src/docs/JobDefinition.md @@ -0,0 +1,33 @@ +# JobDefinition + +Batch job definition + +## Properties + +| Name | Type | Description | Notes | +| -------------------- | --------------------------------------------------------------- | ------------------------------------------------------ | ---------- | +| **comment** | **str** | Human-readable description of the job | [optional] | +| **default_requests** | [**BatchJobRequests**](BatchJobRequests.md) | | [optional] | +| **device_requests** | [**Dict[str, BatchJobRequests]**](BatchJobRequests.md) | Device-specific request overrides, keyed by device UID | [optional] | +| **report_options** | [**JobDefinitionReportOptions**](JobDefinitionReportOptions.md) | | [optional] | +| **select** | [**JobDefinitionSelect**](JobDefinitionSelect.md) | | [optional] | + +## Example + +```python +from notehub_py.models.job_definition import JobDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of JobDefinition from a JSON string +job_definition_instance = JobDefinition.from_json(json) +# print the JSON string representation of the object +print(JobDefinition.to_json()) + +# convert the object into a dict +job_definition_dict = job_definition_instance.to_dict() +# create an instance of JobDefinition from a dict +job_definition_from_dict = JobDefinition.from_dict(job_definition_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/JobDefinitionReportOptions.md b/src/docs/JobDefinitionReportOptions.md new file mode 100644 index 0000000..f8bda21 --- /dev/null +++ b/src/docs/JobDefinitionReportOptions.md @@ -0,0 +1,38 @@ +# JobDefinitionReportOptions + +Controls what data is included in the job report + +## Properties + +| Name | Type | Description | Notes | +| ------------------- | -------- | --------------------------------------------------- | ---------- | +| **app_fleets** | **bool** | Include project fleets in the report | [optional] | +| **app_info** | **bool** | Include project info in the report | [optional] | +| **app_vars** | **bool** | Include project environment variables in the report | [optional] | +| **comment** | **str** | | [optional] | +| **device_activity** | **bool** | Include device activity data in the report | [optional] | +| **device_health** | **bool** | Include device health data in the report | [optional] | +| **device_info** | **bool** | Include device info in the report | [optional] | +| **device_vars** | **bool** | Include device environment variables in the report | [optional] | + +## Example + +```python +from notehub_py.models.job_definition_report_options import JobDefinitionReportOptions + +# TODO update the JSON string below +json = "{}" +# create an instance of JobDefinitionReportOptions from a JSON string +job_definition_report_options_instance = JobDefinitionReportOptions.from_json(json) +# print the JSON string representation of the object +print(JobDefinitionReportOptions.to_json()) + +# convert the object into a dict +job_definition_report_options_dict = job_definition_report_options_instance.to_dict() +# create an instance of JobDefinitionReportOptions from a dict +job_definition_report_options_from_dict = JobDefinitionReportOptions.from_dict( + job_definition_report_options_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/JobDefinitionSelect.md b/src/docs/JobDefinitionSelect.md new file mode 100644 index 0000000..b8f5bc0 --- /dev/null +++ b/src/docs/JobDefinitionSelect.md @@ -0,0 +1,35 @@ +# JobDefinitionSelect + +Device selection criteria + +## Properties + +| Name | Type | Description | Notes | +| --------------------- | ------------- | ---------------------------------------------------------------------- | ---------- | +| **all_devices** | **bool** | Select all devices in the project | [optional] | +| **comment** | **str** | | [optional] | +| **devices** | **List[str]** | Specific device UIDs to include | [optional] | +| **devices_by_sn** | **List[str]** | Serial number patterns to match (supports glob wildcards \*, ?, [...]) | [optional] | +| **devices_in_fleets** | **List[str]** | Fleet UIDs whose devices should be included | [optional] | + +## Example + +```python +from notehub_py.models.job_definition_select import JobDefinitionSelect + +# TODO update the JSON string below +json = "{}" +# create an instance of JobDefinitionSelect from a JSON string +job_definition_select_instance = JobDefinitionSelect.from_json(json) +# print the JSON string representation of the object +print(JobDefinitionSelect.to_json()) + +# convert the object into a dict +job_definition_select_dict = job_definition_select_instance.to_dict() +# create an instance of JobDefinitionSelect from a dict +job_definition_select_from_dict = JobDefinitionSelect.from_dict( + job_definition_select_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/JobDetail.md b/src/docs/JobDetail.md new file mode 100644 index 0000000..887de19 --- /dev/null +++ b/src/docs/JobDetail.md @@ -0,0 +1,36 @@ +# JobDetail + +Batch job with full definition + +## Properties + +| Name | Type | Description | Notes | +| ---------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | +| **created** | **int** | Unix timestamp when job was created | +| **created_by** | **str** | User who created the job | +| **job_uid** | **str** | Unique identifier for the job | +| **last_run_completed** | **int** | Unix timestamp when the most recent run completed (0 if still in progress) | [optional] | +| **last_run_status** | **str** | Status of the most recent job run. Terminal values are: \"submitted\", \"completed successfully\", \"dry run completed successfully\", \"completed with errors\", \"cancelled\". While a job is running, intermediate per-device progress updates may appear (e.g. \"dev:000000000000000 completed\", \"dev:000000000000000 updated: ...\"). | [optional] | +| **last_run_submitted** | **int** | Unix timestamp when the most recent run was submitted | [optional] | +| **name** | **str** | Human-readable job name | +| **definition** | [**JobDefinition**](JobDefinition.md) | | [optional] | + +## Example + +```python +from notehub_py.models.job_detail import JobDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of JobDetail from a JSON string +job_detail_instance = JobDetail.from_json(json) +# print the JSON string representation of the object +print(JobDetail.to_json()) + +# convert the object into a dict +job_detail_dict = job_detail_instance.to_dict() +# create an instance of JobDetail from a dict +job_detail_from_dict = JobDetail.from_dict(job_detail_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/JobsApi.md b/src/docs/JobsApi.md index 1572c7f..77e9a08 100644 --- a/src/docs/JobsApi.md +++ b/src/docs/JobsApi.md @@ -7,6 +7,7 @@ All URIs are relative to *https://api.notefile.net* | [**cancel_job_run**](JobsApi.md#cancel_job_run) | **POST** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel | | [**create_job**](JobsApi.md#create_job) | **POST** /v1/projects/{projectOrProductUID}/jobs | | [**delete_job**](JobsApi.md#delete_job) | **DELETE** /v1/projects/{projectOrProductUID}/jobs/{jobUID} | +| [**delete_job_run**](JobsApi.md#delete_job_run) | **DELETE** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID} | | [**get_job**](JobsApi.md#get_job) | **GET** /v1/projects/{projectOrProductUID}/jobs/{jobUID} | | [**get_job_run**](JobsApi.md#get_job_run) | **GET** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID} | | [**get_job_runs**](JobsApi.md#get_job_runs) | **GET** /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs | @@ -66,7 +67,7 @@ with notehub_py.ApiClient(configuration) as api_client: ## create_job -> CreateJob201Response create_job(project_or_product_uid, name, body) +> CreateJob201Response create_job(project_or_product_uid, name, job_definition) Create a new batch job with an optional name @@ -75,6 +76,7 @@ Create a new batch job with an optional name ```python import notehub_py from notehub_py.models.create_job201_response import CreateJob201Response +from notehub_py.models.job_definition import JobDefinition from notehub_py.rest import ApiException from pprint import pprint @@ -86,10 +88,14 @@ with notehub_py.ApiClient(configuration) as api_client: api_instance = notehub_py.JobsApi(api_client) project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | name = "name_example" # str | Name for the job - body = None # object | The job definition as raw JSON + job_definition = ( + notehub_py.JobDefinition() + ) # JobDefinition | The batch job definition try: - api_response = api_instance.create_job(project_or_product_uid, name, body) + api_response = api_instance.create_job( + project_or_product_uid, name, job_definition + ) print("The response of JobsApi->create_job:\n") pprint(api_response) except Exception as e: @@ -98,11 +104,11 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | ---------- | ------------------------------ | ----- | -| **project_or_product_uid** | **str** | | -| **name** | **str** | Name for the job | -| **body** | **object** | The job definition as raw JSON | +| Name | Type | Description | Notes | +| -------------------------- | ------------------------------------- | ------------------------ | ----- | +| **project_or_product_uid** | **str** | | +| **name** | **str** | Name for the job | +| **job_definition** | [**JobDefinition**](JobDefinition.md) | The batch job definition | ### Return type @@ -168,9 +174,57 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json +## delete_job_run + +> delete_job_run(project_or_product_uid, report_uid) + +Delete the results of a job run + +### Example + +```python +import notehub_py +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.JobsApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + report_uid = "my-reconciliation-job-1707654321000" # str | Unique identifier for a job run report + + try: + api_instance.delete_job_run(project_or_product_uid, report_uid) + except Exception as e: + print("Exception when calling JobsApi->delete_job_run: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | -------------------------------------- | ----- | +| **project_or_product_uid** | **str** | | +| **report_uid** | **str** | Unique identifier for a job run report | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## get_job -> Job get_job(project_or_product_uid, job_uid) +> JobDetail get_job(project_or_product_uid, job_uid) Get a specific batch job definition @@ -178,7 +232,7 @@ Get a specific batch job definition ```python import notehub_py -from notehub_py.models.job import Job +from notehub_py.models.job_detail import JobDetail from notehub_py.rest import ApiException from pprint import pprint @@ -208,7 +262,7 @@ with notehub_py.ApiClient(configuration) as api_client: ### Return type -[**Job**](Job.md) +[**JobDetail**](JobDetail.md) ### Authorization @@ -221,7 +275,7 @@ with notehub_py.ApiClient(configuration) as api_client: ## get_job_run -> JobRun get_job_run(project_or_product_uid, report_uid) +> JobRun get_job_run(project_or_product_uid, report_uid, view=view) Get the result of a job execution @@ -241,9 +295,12 @@ with notehub_py.ApiClient(configuration) as api_client: api_instance = notehub_py.JobsApi(api_client) project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | report_uid = "my-reconciliation-job-1707654321000" # str | Unique identifier for a job run report + view = "summary" # str | Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload (optional) (default to 'summary') try: - api_response = api_instance.get_job_run(project_or_product_uid, report_uid) + api_response = api_instance.get_job_run( + project_or_product_uid, report_uid, view=view + ) print("The response of JobsApi->get_job_run:\n") pprint(api_response) except Exception as e: @@ -252,10 +309,11 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | ------- | -------------------------------------- | ----- | -| **project_or_product_uid** | **str** | | -| **report_uid** | **str** | Unique identifier for a job run report | +| Name | Type | Description | Notes | +| -------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | +| **project_or_product_uid** | **str** | | +| **report_uid** | **str** | Unique identifier for a job run report | +| **view** | **str** | Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload | [optional] [default to 'summary'] | ### Return type diff --git a/src/docs/Monitor.md b/src/docs/Monitor.md index 913822d..6e4b92e 100644 --- a/src/docs/Monitor.md +++ b/src/docs/Monitor.md @@ -22,6 +22,9 @@ | **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] | +| **usage_scope** | **str** | For usage monitors: the scope of aggregation. Supported values are \"device\" and \"fleet\". | [optional] | +| **usage_type** | **str** | For usage monitors: the type of data usage to monitor. Supported values are \"cellular\" and \"satellite\". | [optional] | +| **usage_window** | **int** | For usage monitors: the rolling time window in days to sum usage over (e.g. 30 for 30 days). | [optional] | ## Example diff --git a/src/docs/ProjectApi.md b/src/docs/ProjectApi.md index 721bc82..050081d 100644 --- a/src/docs/ProjectApi.md +++ b/src/docs/ProjectApi.md @@ -9,6 +9,7 @@ All URIs are relative to *https://api.notefile.net* | [**create_fleet**](ProjectApi.md#create_fleet) | **POST** /v1/projects/{projectOrProductUID}/fleets | | [**create_product**](ProjectApi.md#create_product) | **POST** /v1/projects/{projectOrProductUID}/products | | [**create_project**](ProjectApi.md#create_project) | **POST** /v1/projects | +| [**create_project_secret**](ProjectApi.md#create_project_secret) | **POST** /v1/projects/{projectOrProductUID}/secrets | | [**delete_device_from_fleets**](ProjectApi.md#delete_device_from_fleets) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | | [**delete_firmware**](ProjectApi.md#delete_firmware) | **DELETE** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | | [**delete_fleet**](ProjectApi.md#delete_fleet) | **DELETE** /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | @@ -16,6 +17,7 @@ All URIs are relative to *https://api.notefile.net* | [**delete_product**](ProjectApi.md#delete_product) | **DELETE** /v1/projects/{projectOrProductUID}/products/{productUID} | | [**delete_project**](ProjectApi.md#delete_project) | **DELETE** /v1/projects/{projectOrProductUID} | | [**delete_project_environment_variable**](ProjectApi.md#delete_project_environment_variable) | **DELETE** /v1/projects/{projectOrProductUID}/environment_variables/{key} | +| [**delete_project_secret**](ProjectApi.md#delete_project_secret) | **DELETE** /v1/projects/{projectOrProductUID}/secrets/{secretName} | | [**disable_global_event_transformation**](ProjectApi.md#disable_global_event_transformation) | **POST** /v1/projects/{projectOrProductUID}/global-transformation/disable | | [**download_firmware**](ProjectApi.md#download_firmware) | **GET** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | | [**enable_global_event_transformation**](ProjectApi.md#enable_global_event_transformation) | **POST** /v1/projects/{projectOrProductUID}/global-transformation/enable | @@ -37,6 +39,7 @@ All URIs are relative to *https://api.notefile.net* | [**get_project_environment_hierarchy**](ProjectApi.md#get_project_environment_hierarchy) | **GET** /v1/projects/{projectOrProductUID}/environment_hierarchy | Get environment variable hierarchy for a device | | [**get_project_environment_variables**](ProjectApi.md#get_project_environment_variables) | **GET** /v1/projects/{projectOrProductUID}/environment_variables | | [**get_project_members**](ProjectApi.md#get_project_members) | **GET** /v1/projects/{projectOrProductUID}/members | +| [**get_project_secrets**](ProjectApi.md#get_project_secrets) | **GET** /v1/projects/{projectOrProductUID}/secrets | | [**get_projects**](ProjectApi.md#get_projects) | **GET** /v1/projects | | [**perform_dfu_action**](ProjectApi.md#perform_dfu_action) | **POST** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action} | | [**set_fleet_environment_variables**](ProjectApi.md#set_fleet_environment_variables) | **PUT** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | @@ -44,6 +47,7 @@ All URIs are relative to *https://api.notefile.net* | [**set_project_environment_variables**](ProjectApi.md#set_project_environment_variables) | **PUT** /v1/projects/{projectOrProductUID}/environment_variables | | [**update_firmware**](ProjectApi.md#update_firmware) | **POST** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | | [**update_fleet**](ProjectApi.md#update_fleet) | **PUT** /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | +| [**update_project_secret**](ProjectApi.md#update_project_secret) | **PUT** /v1/projects/{projectOrProductUID}/secrets/{secretName} | | [**upload_firmware**](ProjectApi.md#upload_firmware) | **PUT** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | ## add_device_to_fleets @@ -324,6 +328,62 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json +## create_project_secret + +> ProjectSecret create_project_secret(project_or_product_uid, create_project_secret_request) + +Create a new project secret + +### Example + +```python +import notehub_py +from notehub_py.models.create_project_secret_request import CreateProjectSecretRequest +from notehub_py.models.project_secret import ProjectSecret +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.ProjectApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + create_project_secret_request = ( + notehub_py.CreateProjectSecretRequest() + ) # CreateProjectSecretRequest | + + try: + api_response = api_instance.create_project_secret( + project_or_product_uid, create_project_secret_request + ) + print("The response of ProjectApi->create_project_secret:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->create_project_secret: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------------------------------- | --------------------------------------------------------------- | ----------- | ----- | +| **project_or_product_uid** | **str** | | +| **create_project_secret_request** | [**CreateProjectSecretRequest**](CreateProjectSecretRequest.md) | | + +### Return type + +[**ProjectSecret**](ProjectSecret.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## delete_device_from_fleets > GetDeviceFleets200Response delete_device_from_fleets(project_or_product_uid, device_uid, delete_device_from_fleets_request) @@ -690,6 +750,54 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json +## delete_project_secret + +> delete_project_secret(project_or_product_uid, secret_name) + +Delete a project secret by name + +### Example + +```python +import notehub_py +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.ProjectApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + secret_name = "secret_name_example" # str | The name of the secret. + + try: + api_instance.delete_project_secret(project_or_product_uid, secret_name) + except Exception as e: + print("Exception when calling ProjectApi->delete_project_secret: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | ----------------------- | ----- | +| **project_or_product_uid** | **str** | | +| **secret_name** | **str** | The name of the secret. | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## disable_global_event_transformation > disable_global_event_transformation(project_or_product_uid) @@ -1560,6 +1668,7 @@ from notehub_py.models.notefile_schema import NotefileSchema from notehub_py.rest import ApiException from pprint import pprint +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") # Enter a context with an instance of the API client with notehub_py.ApiClient(configuration) as api_client: @@ -1588,7 +1697,7 @@ with notehub_py.ApiClient(configuration) as api_client: ### Authorization -No authorization required +[personalAccessToken](../README.md#personalAccessToken) ### HTTP request headers @@ -1902,6 +2011,55 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json +## get_project_secrets + +> GetProjectSecretsResponse get_project_secrets(project_or_product_uid) + +Get all secrets for a project (metadata only, values are never returned) + +### Example + +```python +import notehub_py +from notehub_py.models.get_project_secrets_response import GetProjectSecretsResponse +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.ProjectApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + + try: + api_response = api_instance.get_project_secrets(project_or_product_uid) + print("The response of ProjectApi->get_project_secrets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->get_project_secrets: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | ----------- | ----- | +| **project_or_product_uid** | **str** | | + +### Return type + +[**GetProjectSecretsResponse**](GetProjectSecretsResponse.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## get_projects > GetProjects200Response get_projects() @@ -2121,7 +2279,7 @@ with notehub_py.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = notehub_py.ProjectApi(api_client) project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | - body = None # object | JSONata expression which will be applied to each event before it is persisted and routed + body = "body_example" # str | JSONata expression which will be applied to each event before it is persisted and routed try: api_instance.set_global_event_transformation(project_or_product_uid, body) @@ -2134,10 +2292,10 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | ---------- | ---------------------------------------------------------------------------------------- | ----- | -| **project_or_product_uid** | **str** | | -| **body** | **object** | JSONata expression which will be applied to each event before it is persisted and routed | +| Name | Type | Description | Notes | +| -------------------------- | ------- | ---------------------------------------------------------------------------------------- | ----- | +| **project_or_product_uid** | **str** | | +| **body** | **str** | JSONata expression which will be applied to each event before it is persisted and routed | ### Return type @@ -2149,7 +2307,7 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: text/plain - **Accept**: application/json ## set_project_environment_variables @@ -2331,6 +2489,64 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json +## update_project_secret + +> ProjectSecret update_project_secret(project_or_product_uid, secret_name, update_project_secret_request) + +Update the value of an existing project secret + +### Example + +```python +import notehub_py +from notehub_py.models.project_secret import ProjectSecret +from notehub_py.models.update_project_secret_request import UpdateProjectSecretRequest +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.ProjectApi(api_client) + project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | + secret_name = "secret_name_example" # str | The name of the secret. + update_project_secret_request = ( + notehub_py.UpdateProjectSecretRequest() + ) # UpdateProjectSecretRequest | + + try: + api_response = api_instance.update_project_secret( + project_or_product_uid, secret_name, update_project_secret_request + ) + print("The response of ProjectApi->update_project_secret:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->update_project_secret: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------------------------------- | --------------------------------------------------------------- | ----------------------- | ----- | +| **project_or_product_uid** | **str** | | +| **secret_name** | **str** | The name of the secret. | +| **update_project_secret_request** | [**UpdateProjectSecretRequest**](UpdateProjectSecretRequest.md) | | + +### Return type + +[**ProjectSecret**](ProjectSecret.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## upload_firmware > FirmwareInfo upload_firmware(project_or_product_uid, firmware_type, filename, body, version=version, notes=notes) diff --git a/src/docs/ProjectSecret.md b/src/docs/ProjectSecret.md new file mode 100644 index 0000000..b0edb71 --- /dev/null +++ b/src/docs/ProjectSecret.md @@ -0,0 +1,33 @@ +# ProjectSecret + +Metadata for a project secret. The value is never returned. + +## Properties + +| Name | Type | Description | Notes | +| --------------- | ------------ | ---------------------------------------------------- | ---------- | +| **created** | **datetime** | When the secret was first created. | +| **created_by** | **str** | The actor who created the secret. | +| **modified** | **datetime** | When the secret was last updated. | [optional] | +| **modified_by** | **str** | The actor who last updated the secret. | [optional] | +| **name** | **str** | The secret name (alphanumeric and underscores only). | + +## Example + +```python +from notehub_py.models.project_secret import ProjectSecret + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectSecret from a JSON string +project_secret_instance = ProjectSecret.from_json(json) +# print the JSON string representation of the object +print(ProjectSecret.to_json()) + +# convert the object into a dict +project_secret_dict = project_secret_instance.to_dict() +# create an instance of ProjectSecret from a dict +project_secret_from_dict = ProjectSecret.from_dict(project_secret_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/RepositoryListResponse.md b/src/docs/RepositoryListResponse.md new file mode 100644 index 0000000..34ad5a4 --- /dev/null +++ b/src/docs/RepositoryListResponse.md @@ -0,0 +1,29 @@ +# RepositoryListResponse + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | ------------------------------------- | ----------- | ----- | +| **repositories** | [**List[Repository]**](Repository.md) | | + +## Example + +```python +from notehub_py.models.repository_list_response import RepositoryListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RepositoryListResponse from a JSON string +repository_list_response_instance = RepositoryListResponse.from_json(json) +# print the JSON string representation of the object +print(RepositoryListResponse.to_json()) + +# convert the object into a dict +repository_list_response_dict = repository_list_response_instance.to_dict() +# create an instance of RepositoryListResponse from a dict +repository_list_response_from_dict = RepositoryListResponse.from_dict( + repository_list_response_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/RepositoryTokenRequest.md b/src/docs/RepositoryTokenRequest.md new file mode 100644 index 0000000..718d613 --- /dev/null +++ b/src/docs/RepositoryTokenRequest.md @@ -0,0 +1,30 @@ +# RepositoryTokenRequest + +## Properties + +| Name | Type | Description | Notes | +| --------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | +| **intent** | **str** | Access intent for the vended credentials. Only `read` is supported today; `write` and `admin` are reserved for future use. | [optional] [default to 'read'] | +| **ttl_seconds** | **int** | Requested credential lifetime in seconds. Clamped server-side to [60, 3600]. Defaults to 900 (15 minutes) if omitted. | [optional] [default to 900] | + +## Example + +```python +from notehub_py.models.repository_token_request import RepositoryTokenRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of RepositoryTokenRequest from a JSON string +repository_token_request_instance = RepositoryTokenRequest.from_json(json) +# print the JSON string representation of the object +print(RepositoryTokenRequest.to_json()) + +# convert the object into a dict +repository_token_request_dict = repository_token_request_instance.to_dict() +# create an instance of RepositoryTokenRequest from a dict +repository_token_request_from_dict = RepositoryTokenRequest.from_dict( + repository_token_request_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/RepositoryTokenResponse.md b/src/docs/RepositoryTokenResponse.md new file mode 100644 index 0000000..a25877c --- /dev/null +++ b/src/docs/RepositoryTokenResponse.md @@ -0,0 +1,34 @@ +# RepositoryTokenResponse + +## Properties + +| Name | Type | Description | Notes | +| -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | ----- | +| **database** | **str** | Storage service database name scoped to this repository | +| **expires_at** | **datetime** | Absolute expiration time of the ephemeral user. The storage service will reject connections and queries after this instant. | +| **host** | **str** | Storage service hostname the caller should connect to | +| **password** | **str** | Ephemeral password. Returned once; not stored by Notehub. Hold this in memory only and discard after `expires_at`. | +| **port** | **int** | Storage service port | +| **username** | **str** | Ephemeral storage service username (prefixed with `u\_`) | + +## Example + +```python +from notehub_py.models.repository_token_response import RepositoryTokenResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RepositoryTokenResponse from a JSON string +repository_token_response_instance = RepositoryTokenResponse.from_json(json) +# print the JSON string representation of the object +print(RepositoryTokenResponse.to_json()) + +# convert the object into a dict +repository_token_response_dict = repository_token_response_instance.to_dict() +# create an instance of RepositoryTokenResponse from a dict +repository_token_response_from_dict = RepositoryTokenResponse.from_dict( + repository_token_response_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/UpdateProjectSecretRequest.md b/src/docs/UpdateProjectSecretRequest.md new file mode 100644 index 0000000..b19c30d --- /dev/null +++ b/src/docs/UpdateProjectSecretRequest.md @@ -0,0 +1,29 @@ +# UpdateProjectSecretRequest + +## Properties + +| Name | Type | Description | Notes | +| --------- | ------- | --------------------------------------------------------- | ----- | +| **value** | **str** | The new secret value (encrypted at rest, never returned). | + +## Example + +```python +from notehub_py.models.update_project_secret_request import UpdateProjectSecretRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateProjectSecretRequest from a JSON string +update_project_secret_request_instance = UpdateProjectSecretRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateProjectSecretRequest.to_json()) + +# convert the object into a dict +update_project_secret_request_dict = update_project_secret_request_instance.to_dict() +# create an instance of UpdateProjectSecretRequest from a dict +update_project_secret_request_from_dict = UpdateProjectSecretRequest.from_dict( + update_project_secret_request_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/WebhookApi.md b/src/docs/WebhookApi.md index cb9dc11..7c87fc0 100644 --- a/src/docs/WebhookApi.md +++ b/src/docs/WebhookApi.md @@ -2,13 +2,80 @@ All URIs are relative to *https://api.notefile.net* -| Method | HTTP request | Description | -| -------------------------------------------------- | ------------------------------------------------------------------- | ----------- | -| [**create_webhook**](WebhookApi.md#create_webhook) | **POST** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | -| [**delete_webhook**](WebhookApi.md#delete_webhook) | **DELETE** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | -| [**get_webhook**](WebhookApi.md#get_webhook) | **GET** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | -| [**get_webhooks**](WebhookApi.md#get_webhooks) | **GET** /v1/projects/{projectOrProductUID}/webhooks | -| [**update_webhook**](WebhookApi.md#update_webhook) | **PUT** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +| Method | HTTP request | Description | +| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ----------- | +| [**create_legacy_webhook_event**](WebhookApi.md#create_legacy_webhook_event) | **POST** /v1/products/{productUID}/devices/{deviceUID}/webhook-event | +| [**create_webhook**](WebhookApi.md#create_webhook) | **POST** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +| [**create_webhook_device_event_by_product**](WebhookApi.md#create_webhook_device_event_by_product) | **POST** /v1/products/{productUID}/webhooks/{webhookUID}/devices/{deviceUID}/event | +| [**create_webhook_event_by_product**](WebhookApi.md#create_webhook_event_by_product) | **POST** /v1/products/{productUID}/webhooks/{webhookUID}/event | +| [**delete_webhook**](WebhookApi.md#delete_webhook) | **DELETE** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +| [**get_webhook**](WebhookApi.md#get_webhook) | **GET** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +| [**get_webhook_settings_by_product**](WebhookApi.md#get_webhook_settings_by_product) | **GET** /v1/products/{productUID}/webhooks/{webhookUID}/settings | +| [**get_webhooks**](WebhookApi.md#get_webhooks) | **GET** /v1/projects/{projectOrProductUID}/webhooks | +| [**update_legacy_webhook_session**](WebhookApi.md#update_legacy_webhook_session) | **PUT** /v1/products/{productUID}/devices/{deviceUID}/webhook-session | +| [**update_webhook**](WebhookApi.md#update_webhook) | **PUT** /v1/projects/{projectOrProductUID}/webhooks/{webhookUID} | +| [**update_webhook_settings_by_product**](WebhookApi.md#update_webhook_settings_by_product) | **PUT** /v1/products/{productUID}/webhooks/{webhookUID}/settings | + +## create_legacy_webhook_event + +> create_legacy_webhook_event(product_uid, device_uid, create_legacy_webhook_event_request) + +Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload. + +### Example + +```python +import notehub_py +from notehub_py.models.create_legacy_webhook_event_request import ( + CreateLegacyWebhookEventRequest, +) +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.WebhookApi(api_client) + product_uid = "com.blues.bridge:sensors" # str | + device_uid = "dev:000000000000000" # str | + create_legacy_webhook_event_request = { + "body": {"key": "value"}, + "file": "data.qo", + "payload": "SGVsbG8sIFdvcmxkIQ==", + } # CreateLegacyWebhookEventRequest | A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload. + + try: + api_instance.create_legacy_webhook_event( + product_uid, device_uid, create_legacy_webhook_event_request + ) + except Exception as e: + print( + "Exception when calling WebhookApi->create_legacy_webhook_event: %s\n" % e + ) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----- | +| **product_uid** | **str** | | +| **device_uid** | **str** | | +| **create_legacy_webhook_event_request** | [**CreateLegacyWebhookEventRequest**](CreateLegacyWebhookEventRequest.md) | A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload. | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ## create_webhook @@ -69,6 +136,118 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json +## create_webhook_device_event_by_product + +> create_webhook_device_event_by_product(product_uid, webhook_uid, device_uid, request_body) + +Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. + +### Example + +```python +import notehub_py +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.WebhookApi(api_client) + product_uid = "com.blues.bridge:sensors" # str | + webhook_uid = "Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8" # str | Webhook UID + device_uid = "dev:000000000000000" # str | + request_body = None # Dict[str, object] | The event body (arbitrary JSON) + + try: + api_instance.create_webhook_device_event_by_product( + product_uid, webhook_uid, device_uid, request_body + ) + except Exception as e: + print( + "Exception when calling WebhookApi->create_webhook_device_event_by_product: %s\n" + % e + ) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------- | ---------------------------------- | ------------------------------- | ----- | +| **product_uid** | **str** | | +| **webhook_uid** | **str** | Webhook UID | +| **device_uid** | **str** | | +| **request_body** | [**Dict[str, object]**](object.md) | The event body (arbitrary JSON) | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +## create_webhook_event_by_product + +> create_webhook_event_by_product(product_uid, webhook_uid, request_body) + +Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device. + +### Example + +```python +import notehub_py +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.WebhookApi(api_client) + product_uid = "com.blues.bridge:sensors" # str | + webhook_uid = "Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8" # str | Webhook UID + request_body = None # Dict[str, object] | The event body (arbitrary JSON) + + try: + api_instance.create_webhook_event_by_product( + product_uid, webhook_uid, request_body + ) + except Exception as e: + print( + "Exception when calling WebhookApi->create_webhook_event_by_product: %s\n" + % e + ) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------- | ---------------------------------- | ------------------------------- | ----- | +| **product_uid** | **str** | | +| **webhook_uid** | **str** | Webhook UID | +| **request_body** | [**Dict[str, object]**](object.md) | The event body (arbitrary JSON) | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## delete_webhook > delete_webhook(project_or_product_uid, webhook_uid) @@ -168,6 +347,62 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json +## get_webhook_settings_by_product + +> WebhookSettings get_webhook_settings_by_product(product_uid, webhook_uid) + +Retrieves the configuration settings for the specified webhook, addressed by productUID. + +### Example + +```python +import notehub_py +from notehub_py.models.webhook_settings import WebhookSettings +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.WebhookApi(api_client) + product_uid = "com.blues.bridge:sensors" # str | + webhook_uid = "Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8" # str | Webhook UID + + try: + api_response = api_instance.get_webhook_settings_by_product( + product_uid, webhook_uid + ) + print("The response of WebhookApi->get_webhook_settings_by_product:\n") + pprint(api_response) + except Exception as e: + print( + "Exception when calling WebhookApi->get_webhook_settings_by_product: %s\n" + % e + ) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------------- | ------- | ----------- | ----- | +| **product_uid** | **str** | | +| **webhook_uid** | **str** | Webhook UID | + +### Return type + +[**WebhookSettings**](WebhookSettings.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## get_webhooks > GetWebhooks200Response get_webhooks(project_or_product_uid) @@ -217,6 +452,60 @@ with notehub_py.ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json +## update_legacy_webhook_session + +> update_legacy_webhook_session(product_uid, device_uid, request_body=request_body) + +Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook. + +### Example + +```python +import notehub_py +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.WebhookApi(api_client) + product_uid = "com.blues.bridge:sensors" # str | + device_uid = "dev:000000000000000" # str | + request_body = None # Dict[str, object] | Optional session metadata. (optional) + + try: + api_instance.update_legacy_webhook_session( + product_uid, device_uid, request_body=request_body + ) + except Exception as e: + print( + "Exception when calling WebhookApi->update_legacy_webhook_session: %s\n" % e + ) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------- | ---------------------------------- | -------------------------- | ---------- | +| **product_uid** | **str** | | +| **device_uid** | **str** | | +| **request_body** | [**Dict[str, object]**](object.md) | Optional session metadata. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## update_webhook > update_webhook(project_or_product_uid, webhook_uid, webhook_settings) @@ -272,3 +561,62 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json + +## update_webhook_settings_by_product + +> update_webhook_settings_by_product(product_uid, webhook_uid, webhook_settings) + +Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings. + +### Example + +```python +import notehub_py +from notehub_py.models.webhook_settings import WebhookSettings +from notehub_py.rest import ApiException +from pprint import pprint + +configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN") + +# Enter a context with an instance of the API client +with notehub_py.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = notehub_py.WebhookApi(api_client) + product_uid = "com.blues.bridge:sensors" # str | + webhook_uid = "Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8" # str | Webhook UID + webhook_settings = { + "disabled": false, + "transform": '{"device":body.end_device_ids.dev_eui,"sn":body.end_device_ids.device_id,"body":body.uplink_message.decoded_payload,"details":body}', + } # WebhookSettings | + + try: + api_instance.update_webhook_settings_by_product( + product_uid, webhook_uid, webhook_settings + ) + except Exception as e: + print( + "Exception when calling WebhookApi->update_webhook_settings_by_product: %s\n" + % e + ) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------- | ----------------------------------------- | ----------- | ----- | +| **product_uid** | **str** | | +| **webhook_uid** | **str** | Webhook UID | +| **webhook_settings** | [**WebhookSettings**](WebhookSettings.md) | | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/src/notehub_py/__init__.py b/src/notehub_py/__init__.py index 160a6cf..bac2c26 100644 --- a/src/notehub_py/__init__.py +++ b/src/notehub_py/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "6.2.0" +__version__ = "6.3.0" # import apis into sdk package from notehub_py.api.alert_api import AlertApi @@ -50,6 +50,7 @@ from notehub_py.models.alert_notifications_inner import AlertNotificationsInner from notehub_py.models.aws_route import AwsRoute from notehub_py.models.azure_route import AzureRoute +from notehub_py.models.batch_job_requests import BatchJobRequests from notehub_py.models.billing_account import BillingAccount from notehub_py.models.billing_account_role import BillingAccountRole from notehub_py.models.blynk_route import BlynkRoute @@ -60,9 +61,13 @@ from notehub_py.models.contact import Contact from notehub_py.models.create_fleet_request import CreateFleetRequest from notehub_py.models.create_job201_response import CreateJob201Response +from notehub_py.models.create_legacy_webhook_event_request import ( + CreateLegacyWebhookEventRequest, +) from notehub_py.models.create_monitor import CreateMonitor from notehub_py.models.create_product_request import CreateProductRequest from notehub_py.models.create_project_request import CreateProjectRequest +from notehub_py.models.create_project_secret_request import CreateProjectSecretRequest from notehub_py.models.create_update_repository import CreateUpdateRepository from notehub_py.models.current_firmware import CurrentFirmware from notehub_py.models.dfu_env import DFUEnv @@ -130,6 +135,16 @@ from notehub_py.models.get_device_health_log200_response_health_log_inner import ( GetDeviceHealthLog200ResponseHealthLogInner, ) +from notehub_py.models.get_device_journey200_response import GetDeviceJourney200Response +from notehub_py.models.get_device_journey200_response_journey import ( + GetDeviceJourney200ResponseJourney, +) +from notehub_py.models.get_device_journeys200_response import ( + GetDeviceJourneys200Response, +) +from notehub_py.models.get_device_journeys200_response_journeys_inner import ( + GetDeviceJourneys200ResponseJourneysInner, +) from notehub_py.models.get_device_latest_events200_response import ( GetDeviceLatestEvents200Response, ) @@ -158,6 +173,7 @@ from notehub_py.models.get_project_members200_response import ( GetProjectMembers200Response, ) +from notehub_py.models.get_project_secrets_response import GetProjectSecretsResponse from notehub_py.models.get_projects200_response import GetProjects200Response from notehub_py.models.get_route_logs_usage200_response import ( GetRouteLogsUsage200Response, @@ -167,6 +183,10 @@ from notehub_py.models.google_route import GoogleRoute from notehub_py.models.http_route import HttpRoute from notehub_py.models.job import Job +from notehub_py.models.job_definition import JobDefinition +from notehub_py.models.job_definition_report_options import JobDefinitionReportOptions +from notehub_py.models.job_definition_select import JobDefinitionSelect +from notehub_py.models.job_detail import JobDetail from notehub_py.models.job_run import JobRun from notehub_py.models.location import Location from notehub_py.models.login200_response import Login200Response @@ -191,11 +211,15 @@ from notehub_py.models.product import Product from notehub_py.models.project import Project from notehub_py.models.project_member import ProjectMember +from notehub_py.models.project_secret import ProjectSecret from notehub_py.models.provision_device_request import ProvisionDeviceRequest from notehub_py.models.proxy_route import ProxyRoute from notehub_py.models.qubitro_route import QubitroRoute from notehub_py.models.rad_route import RadRoute from notehub_py.models.repository import Repository +from notehub_py.models.repository_list_response import RepositoryListResponse +from notehub_py.models.repository_token_request import RepositoryTokenRequest +from notehub_py.models.repository_token_response import RepositoryTokenResponse from notehub_py.models.role import Role from notehub_py.models.route_log import RouteLog from notehub_py.models.route_transform_settings import RouteTransformSettings @@ -216,6 +240,7 @@ from notehub_py.models.twilio_route import TwilioRoute from notehub_py.models.update_fleet_request import UpdateFleetRequest from notehub_py.models.update_host_firmware_request import UpdateHostFirmwareRequest +from notehub_py.models.update_project_secret_request import UpdateProjectSecretRequest from notehub_py.models.upload_metadata import UploadMetadata from notehub_py.models.usage_data import UsageData from notehub_py.models.usage_events_data import UsageEventsData diff --git a/src/notehub_py/api/device_api.py b/src/notehub_py/api/device_api.py index c04a911..f60bc36 100644 --- a/src/notehub_py/api/device_api.py +++ b/src/notehub_py/api/device_api.py @@ -32,6 +32,10 @@ from notehub_py.models.get_device_health_log200_response import ( GetDeviceHealthLog200Response, ) +from notehub_py.models.get_device_journey200_response import GetDeviceJourney200Response +from notehub_py.models.get_device_journeys200_response import ( + GetDeviceJourneys200Response, +) from notehub_py.models.get_device_latest_events200_response import ( GetDeviceLatestEvents200Response, ) @@ -3915,7 +3919,7 @@ def _get_device_environment_variables_by_pin_serialize( ) # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = ["personalAccessToken"] return self.api_client.param_serialize( method="GET", @@ -4279,10 +4283,18 @@ def _get_device_health_log_serialize( ) @validate_call - def get_device_latest_events( + def get_device_journey( self, project_or_product_uid: StrictStr, device_uid: StrictStr, + journey_id: Annotated[ + StrictInt, + Field( + description="Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). " + ), + ], + page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, + page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4294,15 +4306,21 @@ def get_device_latest_events( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetDeviceLatestEvents200Response: - """get_device_latest_events + ) -> GetDeviceJourney200Response: + """get_device_journey - Get Device Latest Events + Get a single journey for a device along with its `_track.qo` events. The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` to detect additional pages. :param project_or_product_uid: (required) :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str + :param journey_id: Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). (required) + :type journey_id: int + :param page_size: + :type page_size: int + :param page_num: + :type page_num: int :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 @@ -4325,9 +4343,12 @@ def get_device_latest_events( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_latest_events_serialize( + _param = self._get_device_journey_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, + journey_id=journey_id, + page_size=page_size, + page_num=page_num, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4335,7 +4356,7 @@ def get_device_latest_events( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeviceLatestEvents200Response", + "200": "GetDeviceJourney200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -4347,10 +4368,18 @@ def get_device_latest_events( ).data @validate_call - def get_device_latest_events_with_http_info( + def get_device_journey_with_http_info( self, project_or_product_uid: StrictStr, device_uid: StrictStr, + journey_id: Annotated[ + StrictInt, + Field( + description="Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). " + ), + ], + page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, + page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4362,15 +4391,21 @@ def get_device_latest_events_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetDeviceLatestEvents200Response]: - """get_device_latest_events + ) -> ApiResponse[GetDeviceJourney200Response]: + """get_device_journey - Get Device Latest Events + Get a single journey for a device along with its `_track.qo` events. The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` to detect additional pages. :param project_or_product_uid: (required) :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str + :param journey_id: Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). (required) + :type journey_id: int + :param page_size: + :type page_size: int + :param page_num: + :type page_num: int :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 @@ -4393,9 +4428,12 @@ def get_device_latest_events_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_latest_events_serialize( + _param = self._get_device_journey_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, + journey_id=journey_id, + page_size=page_size, + page_num=page_num, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4403,7 +4441,7 @@ def get_device_latest_events_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeviceLatestEvents200Response", + "200": "GetDeviceJourney200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -4415,10 +4453,18 @@ def get_device_latest_events_with_http_info( ) @validate_call - def get_device_latest_events_without_preload_content( + def get_device_journey_without_preload_content( self, project_or_product_uid: StrictStr, device_uid: StrictStr, + journey_id: Annotated[ + StrictInt, + Field( + description="Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). " + ), + ], + page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, + page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4431,14 +4477,20 @@ def get_device_latest_events_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_device_latest_events + """get_device_journey - Get Device Latest Events + Get a single journey for a device along with its `_track.qo` events. The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` to detect additional pages. :param project_or_product_uid: (required) :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str + :param journey_id: Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). (required) + :type journey_id: int + :param page_size: + :type page_size: int + :param page_num: + :type page_num: int :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 @@ -4461,9 +4513,12 @@ def get_device_latest_events_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_latest_events_serialize( + _param = self._get_device_journey_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, + journey_id=journey_id, + page_size=page_size, + page_num=page_num, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4471,17 +4526,20 @@ def get_device_latest_events_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDeviceLatestEvents200Response", + "200": "GetDeviceJourney200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_device_latest_events_serialize( + def _get_device_journey_serialize( self, project_or_product_uid, device_uid, + journey_id, + page_size, + page_num, _request_auth, _content_type, _headers, @@ -4504,7 +4562,17 @@ def _get_device_latest_events_serialize( _path_params["projectOrProductUID"] = project_or_product_uid if device_uid is not None: _path_params["deviceUID"] = device_uid + if journey_id is not None: + _path_params["journeyID"] = journey_id # process the query parameters + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if page_num is not None: + + _query_params.append(("pageNum", page_num)) + # process the header parameters # process the form parameters # process the body parameter @@ -4519,7 +4587,7 @@ def _get_device_latest_events_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest", + resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4533,10 +4601,22 @@ def _get_device_latest_events_serialize( ) @validate_call - def get_device_plans( + def get_device_journeys( self, project_or_product_uid: StrictStr, device_uid: StrictStr, + start_date: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="Start date for filtering results, specified as a Unix timestamp" + ), + ] = None, + end_date: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="End date for filtering results, specified as a Unix timestamp" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4548,15 +4628,19 @@ def get_device_plans( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetDevicePlans200Response: - """get_device_plans + ) -> GetDeviceJourneys200Response: + """get_device_journeys - Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. + Get the list of journeys for a device, derived from `_track.qo` events. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; `has_more` is true when the cap is hit. :param project_or_product_uid: (required) :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str + :param start_date: Start date for filtering results, specified as a Unix timestamp + :type start_date: int + :param end_date: End date for filtering results, specified as a Unix timestamp + :type end_date: int :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 @@ -4579,9 +4663,11 @@ def get_device_plans( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_plans_serialize( + _param = self._get_device_journeys_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, + start_date=start_date, + end_date=end_date, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4589,7 +4675,7 @@ def get_device_plans( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePlans200Response", + "200": "GetDeviceJourneys200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -4601,10 +4687,22 @@ def get_device_plans( ).data @validate_call - def get_device_plans_with_http_info( + def get_device_journeys_with_http_info( self, project_or_product_uid: StrictStr, device_uid: StrictStr, + start_date: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="Start date for filtering results, specified as a Unix timestamp" + ), + ] = None, + end_date: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="End date for filtering results, specified as a Unix timestamp" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4616,15 +4714,19 @@ def get_device_plans_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetDevicePlans200Response]: - """get_device_plans + ) -> ApiResponse[GetDeviceJourneys200Response]: + """get_device_journeys - Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. + Get the list of journeys for a device, derived from `_track.qo` events. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; `has_more` is true when the cap is hit. :param project_or_product_uid: (required) :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str + :param start_date: Start date for filtering results, specified as a Unix timestamp + :type start_date: int + :param end_date: End date for filtering results, specified as a Unix timestamp + :type end_date: int :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 @@ -4647,9 +4749,11 @@ def get_device_plans_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_plans_serialize( + _param = self._get_device_journeys_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, + start_date=start_date, + end_date=end_date, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4657,7 +4761,7 @@ def get_device_plans_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePlans200Response", + "200": "GetDeviceJourneys200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -4669,10 +4773,22 @@ def get_device_plans_with_http_info( ) @validate_call - def get_device_plans_without_preload_content( + def get_device_journeys_without_preload_content( self, project_or_product_uid: StrictStr, device_uid: StrictStr, + start_date: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="Start date for filtering results, specified as a Unix timestamp" + ), + ] = None, + end_date: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="End date for filtering results, specified as a Unix timestamp" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4685,14 +4801,18 @@ def get_device_plans_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_device_plans + """get_device_journeys - Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. + Get the list of journeys for a device, derived from `_track.qo` events. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; `has_more` is true when the cap is hit. :param project_or_product_uid: (required) :type project_or_product_uid: str :param device_uid: (required) :type device_uid: str + :param start_date: Start date for filtering results, specified as a Unix timestamp + :type start_date: int + :param end_date: End date for filtering results, specified as a Unix timestamp + :type end_date: int :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 @@ -4715,9 +4835,11 @@ def get_device_plans_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_plans_serialize( + _param = self._get_device_journeys_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, + start_date=start_date, + end_date=end_date, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4725,17 +4847,19 @@ def get_device_plans_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePlans200Response", + "200": "GetDeviceJourneys200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_device_plans_serialize( + def _get_device_journeys_serialize( self, project_or_product_uid, device_uid, + start_date, + end_date, _request_auth, _content_type, _headers, @@ -4759,6 +4883,14 @@ def _get_device_plans_serialize( if device_uid is not None: _path_params["deviceUID"] = device_uid # process the query parameters + if start_date is not None: + + _query_params.append(("startDate", start_date)) + + if end_date is not None: + + _query_params.append(("endDate", end_date)) + # process the header parameters # process the form parameters # process the body parameter @@ -4773,7 +4905,7 @@ def _get_device_plans_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans", + resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4787,7 +4919,7 @@ def _get_device_plans_serialize( ) @validate_call - def get_device_public_key( + def get_device_latest_events( self, project_or_product_uid: StrictStr, device_uid: StrictStr, @@ -4802,10 +4934,10 @@ def get_device_public_key( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetDevicePublicKey200Response: - """get_device_public_key + ) -> GetDeviceLatestEvents200Response: + """get_device_latest_events - Get Device Public Key + Get Device Latest Events :param project_or_product_uid: (required) :type project_or_product_uid: str @@ -4833,7 +4965,7 @@ def get_device_public_key( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_public_key_serialize( + _param = self._get_device_latest_events_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, _request_auth=_request_auth, @@ -4843,7 +4975,7 @@ def get_device_public_key( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePublicKey200Response", + "200": "GetDeviceLatestEvents200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -4855,7 +4987,7 @@ def get_device_public_key( ).data @validate_call - def get_device_public_key_with_http_info( + def get_device_latest_events_with_http_info( self, project_or_product_uid: StrictStr, device_uid: StrictStr, @@ -4870,10 +5002,10 @@ def get_device_public_key_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetDevicePublicKey200Response]: - """get_device_public_key + ) -> ApiResponse[GetDeviceLatestEvents200Response]: + """get_device_latest_events - Get Device Public Key + Get Device Latest Events :param project_or_product_uid: (required) :type project_or_product_uid: str @@ -4901,7 +5033,7 @@ def get_device_public_key_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_public_key_serialize( + _param = self._get_device_latest_events_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, _request_auth=_request_auth, @@ -4911,7 +5043,7 @@ def get_device_public_key_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePublicKey200Response", + "200": "GetDeviceLatestEvents200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -4923,7 +5055,7 @@ def get_device_public_key_with_http_info( ) @validate_call - def get_device_public_key_without_preload_content( + def get_device_latest_events_without_preload_content( self, project_or_product_uid: StrictStr, device_uid: StrictStr, @@ -4939,9 +5071,9 @@ def get_device_public_key_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_device_public_key + """get_device_latest_events - Get Device Public Key + Get Device Latest Events :param project_or_product_uid: (required) :type project_or_product_uid: str @@ -4969,7 +5101,7 @@ def get_device_public_key_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_public_key_serialize( + _param = self._get_device_latest_events_serialize( project_or_product_uid=project_or_product_uid, device_uid=device_uid, _request_auth=_request_auth, @@ -4979,14 +5111,14 @@ def get_device_public_key_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePublicKey200Response", + "200": "GetDeviceLatestEvents200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_device_public_key_serialize( + def _get_device_latest_events_serialize( self, project_or_product_uid, device_uid, @@ -5027,7 +5159,7 @@ def _get_device_public_key_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key", + resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5041,11 +5173,10 @@ def _get_device_public_key_serialize( ) @validate_call - def get_device_public_keys( + def get_device_plans( self, project_or_product_uid: StrictStr, - page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, - page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + device_uid: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5057,17 +5188,15 @@ def get_device_public_keys( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetDevicePublicKeys200Response: - """get_device_public_keys + ) -> GetDevicePlans200Response: + """get_device_plans - Get Device Public Keys of a Project + Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. :param project_or_product_uid: (required) :type project_or_product_uid: str - :param page_size: - :type page_size: int - :param page_num: - :type page_num: int + :param device_uid: (required) + :type device_uid: 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 @@ -5090,10 +5219,9 @@ def get_device_public_keys( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_public_keys_serialize( + _param = self._get_device_plans_serialize( project_or_product_uid=project_or_product_uid, - page_size=page_size, - page_num=page_num, + device_uid=device_uid, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5101,7 +5229,7 @@ def get_device_public_keys( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePublicKeys200Response", + "200": "GetDevicePlans200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -5113,11 +5241,10 @@ def get_device_public_keys( ).data @validate_call - def get_device_public_keys_with_http_info( + def get_device_plans_with_http_info( self, project_or_product_uid: StrictStr, - page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, - page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + device_uid: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5129,17 +5256,15 @@ def get_device_public_keys_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetDevicePublicKeys200Response]: - """get_device_public_keys + ) -> ApiResponse[GetDevicePlans200Response]: + """get_device_plans - Get Device Public Keys of a Project + Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. :param project_or_product_uid: (required) :type project_or_product_uid: str - :param page_size: - :type page_size: int - :param page_num: - :type page_num: int + :param device_uid: (required) + :type device_uid: 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 @@ -5162,10 +5287,9 @@ def get_device_public_keys_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_public_keys_serialize( + _param = self._get_device_plans_serialize( project_or_product_uid=project_or_product_uid, - page_size=page_size, - page_num=page_num, + device_uid=device_uid, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5173,7 +5297,7 @@ def get_device_public_keys_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePublicKeys200Response", + "200": "GetDevicePlans200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -5185,11 +5309,10 @@ def get_device_public_keys_with_http_info( ) @validate_call - def get_device_public_keys_without_preload_content( + def get_device_plans_without_preload_content( self, project_or_product_uid: StrictStr, - page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, - page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + device_uid: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5202,16 +5325,14 @@ def get_device_public_keys_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_device_public_keys + """get_device_plans - Get Device Public Keys of a Project + Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. :param project_or_product_uid: (required) :type project_or_product_uid: str - :param page_size: - :type page_size: int - :param page_num: - :type page_num: int + :param device_uid: (required) + :type device_uid: 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 @@ -5234,10 +5355,9 @@ def get_device_public_keys_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_public_keys_serialize( + _param = self._get_device_plans_serialize( project_or_product_uid=project_or_product_uid, - page_size=page_size, - page_num=page_num, + device_uid=device_uid, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5245,14 +5365,534 @@ def get_device_public_keys_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetDevicePublicKeys200Response", + "200": "GetDevicePlans200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_device_public_keys_serialize( + def _get_device_plans_serialize( + self, + project_or_product_uid, + device_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if device_uid is not None: + _path_params["deviceUID"] = device_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_device_public_key( + self, + project_or_product_uid: StrictStr, + device_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetDevicePublicKey200Response: + """get_device_public_key + + Get Device Public Key + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param device_uid: (required) + :type device_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_public_key_serialize( + project_or_product_uid=project_or_product_uid, + device_uid=device_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetDevicePublicKey200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_device_public_key_with_http_info( + self, + project_or_product_uid: StrictStr, + device_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetDevicePublicKey200Response]: + """get_device_public_key + + Get Device Public Key + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param device_uid: (required) + :type device_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_public_key_serialize( + project_or_product_uid=project_or_product_uid, + device_uid=device_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetDevicePublicKey200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_device_public_key_without_preload_content( + self, + project_or_product_uid: StrictStr, + device_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_device_public_key + + Get Device Public Key + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param device_uid: (required) + :type device_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_public_key_serialize( + project_or_product_uid=project_or_product_uid, + device_uid=device_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetDevicePublicKey200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_device_public_key_serialize( + self, + project_or_product_uid, + device_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if device_uid is not None: + _path_params["deviceUID"] = device_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_device_public_keys( + self, + project_or_product_uid: StrictStr, + page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, + page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetDevicePublicKeys200Response: + """get_device_public_keys + + Get Device Public Keys of a Project + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param page_size: + :type page_size: int + :param page_num: + :type page_num: int + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_public_keys_serialize( + project_or_product_uid=project_or_product_uid, + page_size=page_size, + page_num=page_num, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetDevicePublicKeys200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_device_public_keys_with_http_info( + self, + project_or_product_uid: StrictStr, + page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, + page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetDevicePublicKeys200Response]: + """get_device_public_keys + + Get Device Public Keys of a Project + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param page_size: + :type page_size: int + :param page_num: + :type page_num: int + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_public_keys_serialize( + project_or_product_uid=project_or_product_uid, + page_size=page_size, + page_num=page_num, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetDevicePublicKeys200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_device_public_keys_without_preload_content( + self, + project_or_product_uid: StrictStr, + page_size: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = None, + page_num: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_device_public_keys + + Get Device Public Keys of a Project + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param page_size: + :type page_size: int + :param page_num: + :type page_num: int + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_public_keys_serialize( + project_or_product_uid=project_or_product_uid, + page_size=page_size, + page_num=page_num, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetDevicePublicKeys200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_device_public_keys_serialize( self, project_or_product_uid, page_size, @@ -8170,7 +8810,7 @@ def _set_device_environment_variables_by_pin_serialize( _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = ["personalAccessToken"] return self.api_client.param_serialize( method="PUT", diff --git a/src/notehub_py/api/jobs_api.py b/src/notehub_py/api/jobs_api.py index 8cc1d68..ff8e60f 100644 --- a/src/notehub_py/api/jobs_api.py +++ b/src/notehub_py/api/jobs_api.py @@ -17,15 +17,16 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr -from typing import Any, Dict, Optional +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import Optional from typing_extensions import Annotated from notehub_py.models.cancel_job_run200_response import CancelJobRun200Response from notehub_py.models.create_job201_response import CreateJob201Response from notehub_py.models.delete_job200_response import DeleteJob200Response from notehub_py.models.get_job_runs200_response import GetJobRuns200Response from notehub_py.models.get_jobs200_response import GetJobs200Response -from notehub_py.models.job import Job +from notehub_py.models.job_definition import JobDefinition +from notehub_py.models.job_detail import JobDetail from notehub_py.models.job_run import JobRun from notehub_py.models.run_job200_response import RunJob200Response @@ -314,8 +315,8 @@ def create_job( self, project_or_product_uid: StrictStr, name: Annotated[StrictStr, Field(description="Name for the job")], - body: Annotated[ - Dict[str, Any], Field(description="The job definition as raw JSON") + job_definition: Annotated[ + JobDefinition, Field(description="The batch job definition") ], _request_timeout: Union[ None, @@ -337,8 +338,8 @@ def create_job( :type project_or_product_uid: str :param name: Name for the job (required) :type name: str - :param body: The job definition as raw JSON (required) - :type body: object + :param job_definition: The batch job definition (required) + :type job_definition: JobDefinition :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 @@ -364,7 +365,7 @@ def create_job( _param = self._create_job_serialize( project_or_product_uid=project_or_product_uid, name=name, - body=body, + job_definition=job_definition, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -389,8 +390,8 @@ def create_job_with_http_info( self, project_or_product_uid: StrictStr, name: Annotated[StrictStr, Field(description="Name for the job")], - body: Annotated[ - Dict[str, Any], Field(description="The job definition as raw JSON") + job_definition: Annotated[ + JobDefinition, Field(description="The batch job definition") ], _request_timeout: Union[ None, @@ -412,8 +413,8 @@ def create_job_with_http_info( :type project_or_product_uid: str :param name: Name for the job (required) :type name: str - :param body: The job definition as raw JSON (required) - :type body: object + :param job_definition: The batch job definition (required) + :type job_definition: JobDefinition :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 @@ -439,7 +440,7 @@ def create_job_with_http_info( _param = self._create_job_serialize( project_or_product_uid=project_or_product_uid, name=name, - body=body, + job_definition=job_definition, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -464,8 +465,8 @@ def create_job_without_preload_content( self, project_or_product_uid: StrictStr, name: Annotated[StrictStr, Field(description="Name for the job")], - body: Annotated[ - Dict[str, Any], Field(description="The job definition as raw JSON") + job_definition: Annotated[ + JobDefinition, Field(description="The batch job definition") ], _request_timeout: Union[ None, @@ -487,8 +488,8 @@ def create_job_without_preload_content( :type project_or_product_uid: str :param name: Name for the job (required) :type name: str - :param body: The job definition as raw JSON (required) - :type body: object + :param job_definition: The batch job definition (required) + :type job_definition: JobDefinition :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 @@ -514,7 +515,7 @@ def create_job_without_preload_content( _param = self._create_job_serialize( project_or_product_uid=project_or_product_uid, name=name, - body=body, + job_definition=job_definition, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -534,7 +535,7 @@ def _create_job_serialize( self, project_or_product_uid, name, - body, + job_definition, _request_auth, _content_type, _headers, @@ -563,8 +564,8 @@ def _create_job_serialize( # process the header parameters # process the form parameters # process the body parameter - if body is not None: - _body_params = body + if job_definition is not None: + _body_params = job_definition # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( @@ -862,6 +863,269 @@ def _delete_job_serialize( _request_auth=_request_auth, ) + @validate_call + def delete_job_run( + self, + project_or_product_uid: StrictStr, + report_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a job run report") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_job_run + + Delete the results of a job run + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param report_uid: Unique identifier for a job run report (required) + :type report_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_job_run_serialize( + project_or_product_uid=project_or_product_uid, + report_uid=report_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_job_run_with_http_info( + self, + project_or_product_uid: StrictStr, + report_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a job run report") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_job_run + + Delete the results of a job run + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param report_uid: Unique identifier for a job run report (required) + :type report_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_job_run_serialize( + project_or_product_uid=project_or_product_uid, + report_uid=report_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_job_run_without_preload_content( + self, + project_or_product_uid: StrictStr, + report_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a job run report") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_job_run + + Delete the results of a job run + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param report_uid: Unique identifier for a job run report (required) + :type report_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_job_run_serialize( + project_or_product_uid=project_or_product_uid, + report_uid=report_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_job_run_serialize( + self, + project_or_product_uid, + report_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if report_uid is not None: + _path_params["reportUID"] = report_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def get_job( self, @@ -880,7 +1144,7 @@ def get_job( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Job: + ) -> JobDetail: """get_job Get a specific batch job definition @@ -921,7 +1185,7 @@ def get_job( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Job", + "200": "JobDetail", "404": None, } response_data = self.api_client.call_api( @@ -951,7 +1215,7 @@ def get_job_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Job]: + ) -> ApiResponse[JobDetail]: """get_job Get a specific batch job definition @@ -992,7 +1256,7 @@ def get_job_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Job", + "200": "JobDetail", "404": None, } response_data = self.api_client.call_api( @@ -1063,7 +1327,7 @@ def get_job_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Job", + "200": "JobDetail", "404": None, } response_data = self.api_client.call_api( @@ -1132,6 +1396,12 @@ def get_job_run( report_uid: Annotated[ StrictStr, Field(description="Unique identifier for a job run report") ], + view: Annotated[ + Optional[StrictStr], + Field( + description="Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1152,6 +1422,8 @@ def get_job_run( :type project_or_product_uid: str :param report_uid: Unique identifier for a job run report (required) :type report_uid: str + :param view: Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload + :type view: 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 @@ -1177,6 +1449,7 @@ def get_job_run( _param = self._get_job_run_serialize( project_or_product_uid=project_or_product_uid, report_uid=report_uid, + view=view, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1203,6 +1476,12 @@ def get_job_run_with_http_info( report_uid: Annotated[ StrictStr, Field(description="Unique identifier for a job run report") ], + view: Annotated[ + Optional[StrictStr], + Field( + description="Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1223,6 +1502,8 @@ def get_job_run_with_http_info( :type project_or_product_uid: str :param report_uid: Unique identifier for a job run report (required) :type report_uid: str + :param view: Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload + :type view: 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 @@ -1248,6 +1529,7 @@ def get_job_run_with_http_info( _param = self._get_job_run_serialize( project_or_product_uid=project_or_product_uid, report_uid=report_uid, + view=view, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1274,6 +1556,12 @@ def get_job_run_without_preload_content( report_uid: Annotated[ StrictStr, Field(description="Unique identifier for a job run report") ], + view: Annotated[ + Optional[StrictStr], + Field( + description="Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1294,6 +1582,8 @@ def get_job_run_without_preload_content( :type project_or_product_uid: str :param report_uid: Unique identifier for a job run report (required) :type report_uid: str + :param view: Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload + :type view: 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 @@ -1319,6 +1609,7 @@ def get_job_run_without_preload_content( _param = self._get_job_run_serialize( project_or_product_uid=project_or_product_uid, report_uid=report_uid, + view=view, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1338,6 +1629,7 @@ def _get_job_run_serialize( self, project_or_product_uid, report_uid, + view, _request_auth, _content_type, _headers, @@ -1361,6 +1653,10 @@ def _get_job_run_serialize( if report_uid is not None: _path_params["reportUID"] = report_uid # process the query parameters + if view is not None: + + _query_params.append(("view", view)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/src/notehub_py/api/project_api.py b/src/notehub_py/api/project_api.py index f45d10a..3cf5205 100644 --- a/src/notehub_py/api/project_api.py +++ b/src/notehub_py/api/project_api.py @@ -18,7 +18,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator -from typing import Any, Dict, List, Optional, Union +from typing import List, Optional, Union from typing_extensions import Annotated from notehub_py.models.aws_role_config import AWSRoleConfig from notehub_py.models.add_device_to_fleets_request import AddDeviceToFleetsRequest @@ -26,6 +26,7 @@ from notehub_py.models.create_fleet_request import CreateFleetRequest from notehub_py.models.create_product_request import CreateProductRequest from notehub_py.models.create_project_request import CreateProjectRequest +from notehub_py.models.create_project_secret_request import CreateProjectSecretRequest from notehub_py.models.delete_device_from_fleets_request import ( DeleteDeviceFromFleetsRequest, ) @@ -43,12 +44,15 @@ from notehub_py.models.get_project_members200_response import ( GetProjectMembers200Response, ) +from notehub_py.models.get_project_secrets_response import GetProjectSecretsResponse from notehub_py.models.get_projects200_response import GetProjects200Response from notehub_py.models.notefile_schema import NotefileSchema from notehub_py.models.product import Product from notehub_py.models.project import Project +from notehub_py.models.project_secret import ProjectSecret from notehub_py.models.update_fleet_request import UpdateFleetRequest from notehub_py.models.update_host_firmware_request import UpdateHostFirmwareRequest +from notehub_py.models.update_project_secret_request import UpdateProjectSecretRequest from notehub_py.api_client import ApiClient, RequestSerialized from notehub_py.api_response import ApiResponse @@ -1426,6 +1430,276 @@ def _create_project_serialize( _request_auth=_request_auth, ) + @validate_call + def create_project_secret( + self, + project_or_product_uid: StrictStr, + create_project_secret_request: CreateProjectSecretRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectSecret: + """create_project_secret + + Create a new project secret + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param create_project_secret_request: (required) + :type create_project_secret_request: CreateProjectSecretRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + create_project_secret_request=create_project_secret_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ProjectSecret", + "400": "Error", + "409": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_project_secret_with_http_info( + self, + project_or_product_uid: StrictStr, + create_project_secret_request: CreateProjectSecretRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectSecret]: + """create_project_secret + + Create a new project secret + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param create_project_secret_request: (required) + :type create_project_secret_request: CreateProjectSecretRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + create_project_secret_request=create_project_secret_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ProjectSecret", + "400": "Error", + "409": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_project_secret_without_preload_content( + self, + project_or_product_uid: StrictStr, + create_project_secret_request: CreateProjectSecretRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create_project_secret + + Create a new project secret + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param create_project_secret_request: (required) + :type create_project_secret_request: CreateProjectSecretRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + create_project_secret_request=create_project_secret_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ProjectSecret", + "400": "Error", + "409": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_project_secret_serialize( + self, + project_or_product_uid, + create_project_secret_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_project_secret_request is not None: + _body_params = create_project_secret_request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectOrProductUID}/secrets", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def delete_device_from_fleets( self, @@ -3155,9 +3429,265 @@ def delete_project_environment_variable_with_http_info( def delete_project_environment_variable_without_preload_content( self, project_or_product_uid: StrictStr, - key: Annotated[ - StrictStr, Field(description="The environment variable key to delete.") - ], + key: Annotated[ + StrictStr, Field(description="The environment variable key to delete.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_project_environment_variable + + Delete an environment variable of a project by key + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param key: The environment variable key to delete. (required) + :type key: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_environment_variable_serialize( + project_or_product_uid=project_or_product_uid, + key=key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EnvironmentVariables", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_project_environment_variable_serialize( + self, + project_or_product_uid, + key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if key is not None: + _path_params["key"] = key + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectOrProductUID}/environment_variables/{key}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_project_secret( + self, + project_or_product_uid: StrictStr, + secret_name: Annotated[StrictStr, Field(description="The name of the secret.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_project_secret + + Delete a project secret by name + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param secret_name: The name of the secret. (required) + :type secret_name: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + secret_name=secret_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "404": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_project_secret_with_http_info( + self, + project_or_product_uid: StrictStr, + secret_name: Annotated[StrictStr, Field(description="The name of the secret.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_project_secret + + Delete a project secret by name + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param secret_name: The name of the secret. (required) + :type secret_name: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + secret_name=secret_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "404": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_project_secret_without_preload_content( + self, + project_or_product_uid: StrictStr, + secret_name: Annotated[StrictStr, Field(description="The name of the secret.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3170,14 +3700,14 @@ def delete_project_environment_variable_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_project_environment_variable + """delete_project_secret - Delete an environment variable of a project by key + Delete a project secret by name :param project_or_product_uid: (required) :type project_or_product_uid: str - :param key: The environment variable key to delete. (required) - :type key: str + :param secret_name: The name of the secret. (required) + :type secret_name: 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 @@ -3200,9 +3730,9 @@ def delete_project_environment_variable_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_project_environment_variable_serialize( + _param = self._delete_project_secret_serialize( project_or_product_uid=project_or_product_uid, - key=key, + secret_name=secret_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3210,17 +3740,18 @@ def delete_project_environment_variable_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EnvironmentVariables", + "204": None, + "404": "Error", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _delete_project_environment_variable_serialize( + def _delete_project_secret_serialize( self, project_or_product_uid, - key, + secret_name, _request_auth, _content_type, _headers, @@ -3241,8 +3772,8 @@ def _delete_project_environment_variable_serialize( # process the path parameters if project_or_product_uid is not None: _path_params["projectOrProductUID"] = project_or_product_uid - if key is not None: - _path_params["key"] = key + if secret_name is not None: + _path_params["secretName"] = secret_name # process the query parameters # process the header parameters # process the form parameters @@ -3258,7 +3789,7 @@ def _delete_project_environment_variable_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectOrProductUID}/environment_variables/{key}", + resource_path="/v1/projects/{projectOrProductUID}/secrets/{secretName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7731,7 +8262,7 @@ def _get_notefile_schemas_serialize( ) # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = ["personalAccessToken"] return self.api_client.param_serialize( method="GET", @@ -8888,14 +9419,253 @@ def get_project_environment_variables_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EnvironmentVariables", + "200": "EnvironmentVariables", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_project_environment_variables_serialize( + self, + project_or_product_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectOrProductUID}/environment_variables", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_project_members( + self, + project_or_product_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetProjectMembers200Response: + """get_project_members + + Get Project Members + + :param project_or_product_uid: (required) + :type project_or_product_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_members_serialize( + project_or_product_uid=project_or_product_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetProjectMembers200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_project_members_with_http_info( + self, + project_or_product_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetProjectMembers200Response]: + """get_project_members + + Get Project Members + + :param project_or_product_uid: (required) + :type project_or_product_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_members_serialize( + project_or_product_uid=project_or_product_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetProjectMembers200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_project_members_without_preload_content( + self, + project_or_product_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_project_members + + Get Project Members + + :param project_or_product_uid: (required) + :type project_or_product_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_members_serialize( + project_or_product_uid=project_or_product_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetProjectMembers200Response", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_project_environment_variables_serialize( + def _get_project_members_serialize( self, project_or_product_uid, _request_auth, @@ -8933,7 +9703,7 @@ def _get_project_environment_variables_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectOrProductUID}/environment_variables", + resource_path="/v1/projects/{projectOrProductUID}/members", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8947,7 +9717,7 @@ def _get_project_environment_variables_serialize( ) @validate_call - def get_project_members( + def get_project_secrets( self, project_or_product_uid: StrictStr, _request_timeout: Union[ @@ -8961,10 +9731,10 @@ def get_project_members( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetProjectMembers200Response: - """get_project_members + ) -> GetProjectSecretsResponse: + """get_project_secrets - Get Project Members + Get all secrets for a project (metadata only, values are never returned) :param project_or_product_uid: (required) :type project_or_product_uid: str @@ -8990,7 +9760,7 @@ def get_project_members( :return: Returns the result object. """ # noqa: E501 - _param = self._get_project_members_serialize( + _param = self._get_project_secrets_serialize( project_or_product_uid=project_or_product_uid, _request_auth=_request_auth, _content_type=_content_type, @@ -8999,7 +9769,7 @@ def get_project_members( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetProjectMembers200Response", + "200": "GetProjectSecretsResponse", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -9011,7 +9781,7 @@ def get_project_members( ).data @validate_call - def get_project_members_with_http_info( + def get_project_secrets_with_http_info( self, project_or_product_uid: StrictStr, _request_timeout: Union[ @@ -9025,10 +9795,10 @@ def get_project_members_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetProjectMembers200Response]: - """get_project_members + ) -> ApiResponse[GetProjectSecretsResponse]: + """get_project_secrets - Get Project Members + Get all secrets for a project (metadata only, values are never returned) :param project_or_product_uid: (required) :type project_or_product_uid: str @@ -9054,7 +9824,7 @@ def get_project_members_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_project_members_serialize( + _param = self._get_project_secrets_serialize( project_or_product_uid=project_or_product_uid, _request_auth=_request_auth, _content_type=_content_type, @@ -9063,7 +9833,7 @@ def get_project_members_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetProjectMembers200Response", + "200": "GetProjectSecretsResponse", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -9075,7 +9845,7 @@ def get_project_members_with_http_info( ) @validate_call - def get_project_members_without_preload_content( + def get_project_secrets_without_preload_content( self, project_or_product_uid: StrictStr, _request_timeout: Union[ @@ -9090,9 +9860,9 @@ def get_project_members_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_project_members + """get_project_secrets - Get Project Members + Get all secrets for a project (metadata only, values are never returned) :param project_or_product_uid: (required) :type project_or_product_uid: str @@ -9118,7 +9888,7 @@ def get_project_members_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_project_members_serialize( + _param = self._get_project_secrets_serialize( project_or_product_uid=project_or_product_uid, _request_auth=_request_auth, _content_type=_content_type, @@ -9127,14 +9897,14 @@ def get_project_members_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetProjectMembers200Response", + "200": "GetProjectSecretsResponse", } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_project_members_serialize( + def _get_project_secrets_serialize( self, project_or_product_uid, _request_auth, @@ -9172,7 +9942,7 @@ def _get_project_members_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectOrProductUID}/members", + resource_path="/v1/projects/{projectOrProductUID}/secrets", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10209,7 +10979,7 @@ def set_global_event_transformation( self, project_or_product_uid: StrictStr, body: Annotated[ - Dict[str, Any], + StrictStr, Field( description="JSONata expression which will be applied to each event before it is persisted and routed" ), @@ -10233,7 +11003,7 @@ def set_global_event_transformation( :param project_or_product_uid: (required) :type project_or_product_uid: str :param body: JSONata expression which will be applied to each event before it is persisted and routed (required) - :type body: object + :type body: 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 @@ -10282,7 +11052,7 @@ def set_global_event_transformation_with_http_info( self, project_or_product_uid: StrictStr, body: Annotated[ - Dict[str, Any], + StrictStr, Field( description="JSONata expression which will be applied to each event before it is persisted and routed" ), @@ -10306,7 +11076,7 @@ def set_global_event_transformation_with_http_info( :param project_or_product_uid: (required) :type project_or_product_uid: str :param body: JSONata expression which will be applied to each event before it is persisted and routed (required) - :type body: object + :type body: 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 @@ -10355,7 +11125,7 @@ def set_global_event_transformation_without_preload_content( self, project_or_product_uid: StrictStr, body: Annotated[ - Dict[str, Any], + StrictStr, Field( description="JSONata expression which will be applied to each event before it is persisted and routed" ), @@ -10379,7 +11149,7 @@ def set_global_event_transformation_without_preload_content( :param project_or_product_uid: (required) :type project_or_product_uid: str :param body: JSONata expression which will be applied to each event before it is persisted and routed (required) - :type body: object + :type body: 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 @@ -10460,7 +11230,7 @@ def _set_global_event_transformation_serialize( _header_params["Content-Type"] = _content_type else: _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + ["text/plain"] ) if _default_content_type is not None: _header_params["Content-Type"] = _default_content_type @@ -11341,6 +12111,288 @@ def _update_fleet_serialize( _request_auth=_request_auth, ) + @validate_call + def update_project_secret( + self, + project_or_product_uid: StrictStr, + secret_name: Annotated[StrictStr, Field(description="The name of the secret.")], + update_project_secret_request: UpdateProjectSecretRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectSecret: + """update_project_secret + + Update the value of an existing project secret + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param secret_name: The name of the secret. (required) + :type secret_name: str + :param update_project_secret_request: (required) + :type update_project_secret_request: UpdateProjectSecretRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + secret_name=secret_name, + update_project_secret_request=update_project_secret_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectSecret", + "404": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_project_secret_with_http_info( + self, + project_or_product_uid: StrictStr, + secret_name: Annotated[StrictStr, Field(description="The name of the secret.")], + update_project_secret_request: UpdateProjectSecretRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectSecret]: + """update_project_secret + + Update the value of an existing project secret + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param secret_name: The name of the secret. (required) + :type secret_name: str + :param update_project_secret_request: (required) + :type update_project_secret_request: UpdateProjectSecretRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + secret_name=secret_name, + update_project_secret_request=update_project_secret_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectSecret", + "404": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_project_secret_without_preload_content( + self, + project_or_product_uid: StrictStr, + secret_name: Annotated[StrictStr, Field(description="The name of the secret.")], + update_project_secret_request: UpdateProjectSecretRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_project_secret + + Update the value of an existing project secret + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param secret_name: The name of the secret. (required) + :type secret_name: str + :param update_project_secret_request: (required) + :type update_project_secret_request: UpdateProjectSecretRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_secret_serialize( + project_or_product_uid=project_or_product_uid, + secret_name=secret_name, + update_project_secret_request=update_project_secret_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectSecret", + "404": "Error", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _update_project_secret_serialize( + self, + project_or_product_uid, + secret_name, + update_project_secret_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if secret_name is not None: + _path_params["secretName"] = secret_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_project_secret_request is not None: + _body_params = update_project_secret_request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/projects/{projectOrProductUID}/secrets/{secretName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def upload_firmware( self, diff --git a/src/notehub_py/api/webhook_api.py b/src/notehub_py/api/webhook_api.py index aa8279b..b1bf0a2 100644 --- a/src/notehub_py/api/webhook_api.py +++ b/src/notehub_py/api/webhook_api.py @@ -18,7 +18,11 @@ from typing_extensions import Annotated from pydantic import Field, StrictStr +from typing import Any, Dict, Optional from typing_extensions import Annotated +from notehub_py.models.create_legacy_webhook_event_request import ( + CreateLegacyWebhookEventRequest, +) from notehub_py.models.get_webhooks200_response import GetWebhooks200Response from notehub_py.models.webhook_settings import WebhookSettings @@ -40,11 +44,16 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_call - def create_webhook( + def create_legacy_webhook_event( self, - project_or_product_uid: StrictStr, - webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], - webhook_settings: WebhookSettings, + product_uid: StrictStr, + device_uid: StrictStr, + create_legacy_webhook_event_request: Annotated[ + CreateLegacyWebhookEventRequest, + Field( + description="A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload." + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -57,16 +66,16 @@ def create_webhook( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """create_webhook + """create_legacy_webhook_event - Creates a webhook for the specified product with the given name. The name | must be unique within the project. + Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload. - :param project_or_product_uid: (required) - :type project_or_product_uid: str - :param webhook_uid: Webhook UID (required) - :type webhook_uid: str - :param webhook_settings: (required) - :type webhook_settings: WebhookSettings + :param product_uid: (required) + :type product_uid: str + :param device_uid: (required) + :type device_uid: str + :param create_legacy_webhook_event_request: A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload. (required) + :type create_legacy_webhook_event_request: CreateLegacyWebhookEventRequest :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 @@ -89,10 +98,10 @@ def create_webhook( :return: Returns the result object. """ # noqa: E501 - _param = self._create_webhook_serialize( - project_or_product_uid=project_or_product_uid, - webhook_uid=webhook_uid, - webhook_settings=webhook_settings, + _param = self._create_legacy_webhook_event_serialize( + product_uid=product_uid, + device_uid=device_uid, + create_legacy_webhook_event_request=create_legacy_webhook_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -112,11 +121,16 @@ def create_webhook( ).data @validate_call - def create_webhook_with_http_info( + def create_legacy_webhook_event_with_http_info( self, - project_or_product_uid: StrictStr, - webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], - webhook_settings: WebhookSettings, + product_uid: StrictStr, + device_uid: StrictStr, + create_legacy_webhook_event_request: Annotated[ + CreateLegacyWebhookEventRequest, + Field( + description="A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload." + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -129,16 +143,16 @@ def create_webhook_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """create_webhook + """create_legacy_webhook_event - Creates a webhook for the specified product with the given name. The name | must be unique within the project. + Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload. - :param project_or_product_uid: (required) - :type project_or_product_uid: str - :param webhook_uid: Webhook UID (required) - :type webhook_uid: str - :param webhook_settings: (required) - :type webhook_settings: WebhookSettings + :param product_uid: (required) + :type product_uid: str + :param device_uid: (required) + :type device_uid: str + :param create_legacy_webhook_event_request: A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload. (required) + :type create_legacy_webhook_event_request: CreateLegacyWebhookEventRequest :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 @@ -161,10 +175,10 @@ def create_webhook_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_webhook_serialize( - project_or_product_uid=project_or_product_uid, - webhook_uid=webhook_uid, - webhook_settings=webhook_settings, + _param = self._create_legacy_webhook_event_serialize( + product_uid=product_uid, + device_uid=device_uid, + create_legacy_webhook_event_request=create_legacy_webhook_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -184,11 +198,16 @@ def create_webhook_with_http_info( ) @validate_call - def create_webhook_without_preload_content( + def create_legacy_webhook_event_without_preload_content( self, - project_or_product_uid: StrictStr, - webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], - webhook_settings: WebhookSettings, + product_uid: StrictStr, + device_uid: StrictStr, + create_legacy_webhook_event_request: Annotated[ + CreateLegacyWebhookEventRequest, + Field( + description="A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload." + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -201,16 +220,16 @@ def create_webhook_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_webhook + """create_legacy_webhook_event - Creates a webhook for the specified product with the given name. The name | must be unique within the project. + Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload. - :param project_or_product_uid: (required) - :type project_or_product_uid: str - :param webhook_uid: Webhook UID (required) - :type webhook_uid: str - :param webhook_settings: (required) - :type webhook_settings: WebhookSettings + :param product_uid: (required) + :type product_uid: str + :param device_uid: (required) + :type device_uid: str + :param create_legacy_webhook_event_request: A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload. (required) + :type create_legacy_webhook_event_request: CreateLegacyWebhookEventRequest :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 @@ -233,10 +252,10 @@ def create_webhook_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_webhook_serialize( - project_or_product_uid=project_or_product_uid, - webhook_uid=webhook_uid, - webhook_settings=webhook_settings, + _param = self._create_legacy_webhook_event_serialize( + product_uid=product_uid, + device_uid=device_uid, + create_legacy_webhook_event_request=create_legacy_webhook_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -251,11 +270,11 @@ def create_webhook_without_preload_content( ) return response_data.response - def _create_webhook_serialize( + def _create_legacy_webhook_event_serialize( self, - project_or_product_uid, - webhook_uid, - webhook_settings, + product_uid, + device_uid, + create_legacy_webhook_event_request, _request_auth, _content_type, _headers, @@ -274,16 +293,16 @@ def _create_webhook_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_or_product_uid is not None: - _path_params["projectOrProductUID"] = project_or_product_uid - if webhook_uid is not None: - _path_params["webhookUID"] = webhook_uid + if product_uid is not None: + _path_params["productUID"] = product_uid + if device_uid is not None: + _path_params["deviceUID"] = device_uid # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if webhook_settings is not None: - _body_params = webhook_settings + if create_legacy_webhook_event_request is not None: + _body_params = create_legacy_webhook_event_request # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( @@ -305,7 +324,7 @@ def _create_webhook_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", + resource_path="/v1/products/{productUID}/devices/{deviceUID}/webhook-event", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -319,10 +338,11 @@ def _create_webhook_serialize( ) @validate_call - def delete_webhook( + def create_webhook( self, project_or_product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -335,14 +355,16 @@ def delete_webhook( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """delete_webhook + """create_webhook - Deletes the specified webhook + Creates a webhook for the specified product with the given name. The name | must be unique within the project. :param project_or_product_uid: (required) :type project_or_product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings :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 @@ -365,9 +387,10 @@ def delete_webhook( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_webhook_serialize( + _param = self._create_webhook_serialize( project_or_product_uid=project_or_product_uid, webhook_uid=webhook_uid, + webhook_settings=webhook_settings, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -387,10 +410,11 @@ def delete_webhook( ).data @validate_call - def delete_webhook_with_http_info( + def create_webhook_with_http_info( self, project_or_product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -403,14 +427,16 @@ def delete_webhook_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """delete_webhook + """create_webhook - Deletes the specified webhook + Creates a webhook for the specified product with the given name. The name | must be unique within the project. :param project_or_product_uid: (required) :type project_or_product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings :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 @@ -433,9 +459,10 @@ def delete_webhook_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_webhook_serialize( + _param = self._create_webhook_serialize( project_or_product_uid=project_or_product_uid, webhook_uid=webhook_uid, + webhook_settings=webhook_settings, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -455,10 +482,11 @@ def delete_webhook_with_http_info( ) @validate_call - def delete_webhook_without_preload_content( + def create_webhook_without_preload_content( self, project_or_product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -471,14 +499,16 @@ def delete_webhook_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_webhook + """create_webhook - Deletes the specified webhook + Creates a webhook for the specified product with the given name. The name | must be unique within the project. :param project_or_product_uid: (required) :type project_or_product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings :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 @@ -501,9 +531,10 @@ def delete_webhook_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_webhook_serialize( + _param = self._create_webhook_serialize( project_or_product_uid=project_or_product_uid, webhook_uid=webhook_uid, + webhook_settings=webhook_settings, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -518,10 +549,11 @@ def delete_webhook_without_preload_content( ) return response_data.response - def _delete_webhook_serialize( + def _create_webhook_serialize( self, project_or_product_uid, webhook_uid, + webhook_settings, _request_auth, _content_type, _headers, @@ -548,17 +580,29 @@ def _delete_webhook_serialize( # process the header parameters # process the form parameters # process the body parameter + if webhook_settings is not None: + _body_params = webhook_settings # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = ["personalAccessToken"] return self.api_client.param_serialize( - method="DELETE", + method="POST", resource_path="/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", path_params=_path_params, query_params=_query_params, @@ -573,10 +617,14 @@ def _delete_webhook_serialize( ) @validate_call - def get_webhook( + def create_webhook_device_event_by_product( self, - project_or_product_uid: StrictStr, + product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + device_uid: StrictStr, + request_body: Annotated[ + Dict[str, Any], Field(description="The event body (arbitrary JSON)") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -588,15 +636,19 @@ def get_webhook( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WebhookSettings: - """get_webhook + ) -> None: + """create_webhook_device_event_by_product - Retrieves the configuration settings for the specified webhook + Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. - :param project_or_product_uid: (required) - :type project_or_product_uid: str + :param product_uid: (required) + :type product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str + :param device_uid: (required) + :type device_uid: str + :param request_body: The event body (arbitrary JSON) (required) + :type request_body: Dict[str, object] :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 @@ -619,9 +671,11 @@ def get_webhook( :return: Returns the result object. """ # noqa: E501 - _param = self._get_webhook_serialize( - project_or_product_uid=project_or_product_uid, + _param = self._create_webhook_device_event_by_product_serialize( + product_uid=product_uid, webhook_uid=webhook_uid, + device_uid=device_uid, + request_body=request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -629,7 +683,7 @@ def get_webhook( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookSettings", + "200": None, } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -641,10 +695,14 @@ def get_webhook( ).data @validate_call - def get_webhook_with_http_info( + def create_webhook_device_event_by_product_with_http_info( self, - project_or_product_uid: StrictStr, + product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + device_uid: StrictStr, + request_body: Annotated[ + Dict[str, Any], Field(description="The event body (arbitrary JSON)") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -656,15 +714,19 @@ def get_webhook_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WebhookSettings]: - """get_webhook + ) -> ApiResponse[None]: + """create_webhook_device_event_by_product - Retrieves the configuration settings for the specified webhook + Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. - :param project_or_product_uid: (required) - :type project_or_product_uid: str + :param product_uid: (required) + :type product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str + :param device_uid: (required) + :type device_uid: str + :param request_body: The event body (arbitrary JSON) (required) + :type request_body: Dict[str, object] :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 @@ -687,9 +749,11 @@ def get_webhook_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_webhook_serialize( - project_or_product_uid=project_or_product_uid, + _param = self._create_webhook_device_event_by_product_serialize( + product_uid=product_uid, webhook_uid=webhook_uid, + device_uid=device_uid, + request_body=request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -697,7 +761,7 @@ def get_webhook_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookSettings", + "200": None, } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -709,10 +773,14 @@ def get_webhook_with_http_info( ) @validate_call - def get_webhook_without_preload_content( + def create_webhook_device_event_by_product_without_preload_content( self, - project_or_product_uid: StrictStr, + product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + device_uid: StrictStr, + request_body: Annotated[ + Dict[str, Any], Field(description="The event body (arbitrary JSON)") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -725,14 +793,18 @@ def get_webhook_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_webhook + """create_webhook_device_event_by_product - Retrieves the configuration settings for the specified webhook + Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. - :param project_or_product_uid: (required) - :type project_or_product_uid: str + :param product_uid: (required) + :type product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str + :param device_uid: (required) + :type device_uid: str + :param request_body: The event body (arbitrary JSON) (required) + :type request_body: Dict[str, object] :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 @@ -755,9 +827,11 @@ def get_webhook_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_webhook_serialize( - project_or_product_uid=project_or_product_uid, + _param = self._create_webhook_device_event_by_product_serialize( + product_uid=product_uid, webhook_uid=webhook_uid, + device_uid=device_uid, + request_body=request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -765,17 +839,19 @@ def get_webhook_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookSettings", + "200": None, } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_webhook_serialize( + def _create_webhook_device_event_by_product_serialize( self, - project_or_product_uid, + product_uid, webhook_uid, + device_uid, + request_body, _request_auth, _content_type, _headers, @@ -794,26 +870,40 @@ def _get_webhook_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_or_product_uid is not None: - _path_params["projectOrProductUID"] = project_or_product_uid + if product_uid is not None: + _path_params["productUID"] = product_uid if webhook_uid is not None: _path_params["webhookUID"] = webhook_uid + if device_uid is not None: + _path_params["deviceUID"] = device_uid # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if request_body is not None: + _body_params = request_body # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = ["personalAccessToken"] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", + method="POST", + resource_path="/v1/products/{productUID}/webhooks/{webhookUID}/devices/{deviceUID}/event", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -827,9 +917,13 @@ def _get_webhook_serialize( ) @validate_call - def get_webhooks( + def create_webhook_event_by_product( self, - project_or_product_uid: StrictStr, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + request_body: Annotated[ + Dict[str, Any], Field(description="The event body (arbitrary JSON)") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -841,13 +935,17 @@ def get_webhooks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetWebhooks200Response: - """get_webhooks + ) -> None: + """create_webhook_event_by_product - Retrieves all webhooks for the specified project + Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device. - :param project_or_product_uid: (required) - :type project_or_product_uid: str + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param request_body: The event body (arbitrary JSON) (required) + :type request_body: Dict[str, object] :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 @@ -870,8 +968,10 @@ def get_webhooks( :return: Returns the result object. """ # noqa: E501 - _param = self._get_webhooks_serialize( - project_or_product_uid=project_or_product_uid, + _param = self._create_webhook_event_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + request_body=request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -879,7 +979,7 @@ def get_webhooks( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetWebhooks200Response", + "200": None, } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -891,9 +991,13 @@ def get_webhooks( ).data @validate_call - def get_webhooks_with_http_info( + def create_webhook_event_by_product_with_http_info( self, - project_or_product_uid: StrictStr, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + request_body: Annotated[ + Dict[str, Any], Field(description="The event body (arbitrary JSON)") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -905,13 +1009,17 @@ def get_webhooks_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetWebhooks200Response]: - """get_webhooks + ) -> ApiResponse[None]: + """create_webhook_event_by_product - Retrieves all webhooks for the specified project + Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device. - :param project_or_product_uid: (required) - :type project_or_product_uid: str + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param request_body: The event body (arbitrary JSON) (required) + :type request_body: Dict[str, object] :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 @@ -934,8 +1042,10 @@ def get_webhooks_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_webhooks_serialize( - project_or_product_uid=project_or_product_uid, + _param = self._create_webhook_event_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + request_body=request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -943,7 +1053,7 @@ def get_webhooks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetWebhooks200Response", + "200": None, } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -955,9 +1065,13 @@ def get_webhooks_with_http_info( ) @validate_call - def get_webhooks_without_preload_content( + def create_webhook_event_by_product_without_preload_content( self, - project_or_product_uid: StrictStr, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + request_body: Annotated[ + Dict[str, Any], Field(description="The event body (arbitrary JSON)") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -970,12 +1084,16 @@ def get_webhooks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_webhooks + """create_webhook_event_by_product - Retrieves all webhooks for the specified project + Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device. - :param project_or_product_uid: (required) - :type project_or_product_uid: str + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param request_body: The event body (arbitrary JSON) (required) + :type request_body: Dict[str, object] :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 @@ -998,8 +1116,10 @@ def get_webhooks_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_webhooks_serialize( - project_or_product_uid=project_or_product_uid, + _param = self._create_webhook_event_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + request_body=request_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1007,16 +1127,18 @@ def get_webhooks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetWebhooks200Response", + "200": None, } response_data = self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _get_webhooks_serialize( + def _create_webhook_event_by_product_serialize( self, - project_or_product_uid, + product_uid, + webhook_uid, + request_body, _request_auth, _content_type, _headers, @@ -1035,24 +1157,38 @@ def _get_webhooks_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_or_product_uid is not None: - _path_params["projectOrProductUID"] = project_or_product_uid + if product_uid is not None: + _path_params["productUID"] = product_uid + if webhook_uid is not None: + _path_params["webhookUID"] = webhook_uid # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if request_body is not None: + _body_params = request_body # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = ["personalAccessToken"] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectOrProductUID}/webhooks", + method="POST", + resource_path="/v1/products/{productUID}/webhooks/{webhookUID}/event", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1066,11 +1202,10 @@ def _get_webhooks_serialize( ) @validate_call - def update_webhook( + def delete_webhook( self, project_or_product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], - webhook_settings: WebhookSettings, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1083,16 +1218,14 @@ def update_webhook( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """update_webhook + """delete_webhook - Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings. + Deletes the specified webhook :param project_or_product_uid: (required) :type project_or_product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str - :param webhook_settings: (required) - :type webhook_settings: WebhookSettings :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 @@ -1115,10 +1248,9 @@ def update_webhook( :return: Returns the result object. """ # noqa: E501 - _param = self._update_webhook_serialize( + _param = self._delete_webhook_serialize( project_or_product_uid=project_or_product_uid, webhook_uid=webhook_uid, - webhook_settings=webhook_settings, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1138,11 +1270,10 @@ def update_webhook( ).data @validate_call - def update_webhook_with_http_info( + def delete_webhook_with_http_info( self, project_or_product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], - webhook_settings: WebhookSettings, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1155,16 +1286,14 @@ def update_webhook_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """update_webhook + """delete_webhook - Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings. + Deletes the specified webhook :param project_or_product_uid: (required) :type project_or_product_uid: str :param webhook_uid: Webhook UID (required) :type webhook_uid: str - :param webhook_settings: (required) - :type webhook_settings: WebhookSettings :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 @@ -1187,10 +1316,9 @@ def update_webhook_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_webhook_serialize( + _param = self._delete_webhook_serialize( project_or_product_uid=project_or_product_uid, webhook_uid=webhook_uid, - webhook_settings=webhook_settings, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1210,11 +1338,1305 @@ def update_webhook_with_http_info( ) @validate_call - def update_webhook_without_preload_content( + def delete_webhook_without_preload_content( self, project_or_product_uid: StrictStr, webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], - webhook_settings: WebhookSettings, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_webhook + + Deletes the specified webhook + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_webhook_serialize( + project_or_product_uid=project_or_product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_webhook_serialize( + self, + project_or_product_uid, + webhook_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if webhook_uid is not None: + _path_params["webhookUID"] = webhook_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_webhook( + self, + project_or_product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebhookSettings: + """get_webhook + + Retrieves the configuration settings for the specified webhook + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_serialize( + project_or_product_uid=project_or_product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WebhookSettings", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_webhook_with_http_info( + self, + project_or_product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebhookSettings]: + """get_webhook + + Retrieves the configuration settings for the specified webhook + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_serialize( + project_or_product_uid=project_or_product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WebhookSettings", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_webhook_without_preload_content( + self, + project_or_product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_webhook + + Retrieves the configuration settings for the specified webhook + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_serialize( + project_or_product_uid=project_or_product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WebhookSettings", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_webhook_serialize( + self, + project_or_product_uid, + webhook_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + if webhook_uid is not None: + _path_params["webhookUID"] = webhook_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_webhook_settings_by_product( + self, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebhookSettings: + """get_webhook_settings_by_product + + Retrieves the configuration settings for the specified webhook, addressed by productUID. + + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_settings_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WebhookSettings", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_webhook_settings_by_product_with_http_info( + self, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebhookSettings]: + """get_webhook_settings_by_product + + Retrieves the configuration settings for the specified webhook, addressed by productUID. + + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_settings_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WebhookSettings", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_webhook_settings_by_product_without_preload_content( + self, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_webhook_settings_by_product + + Retrieves the configuration settings for the specified webhook, addressed by productUID. + + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_settings_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WebhookSettings", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_webhook_settings_by_product_serialize( + self, + product_uid, + webhook_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if product_uid is not None: + _path_params["productUID"] = product_uid + if webhook_uid is not None: + _path_params["webhookUID"] = webhook_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/products/{productUID}/webhooks/{webhookUID}/settings", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_webhooks( + self, + project_or_product_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetWebhooks200Response: + """get_webhooks + + Retrieves all webhooks for the specified project + + :param project_or_product_uid: (required) + :type project_or_product_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhooks_serialize( + project_or_product_uid=project_or_product_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetWebhooks200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_webhooks_with_http_info( + self, + project_or_product_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetWebhooks200Response]: + """get_webhooks + + Retrieves all webhooks for the specified project + + :param project_or_product_uid: (required) + :type project_or_product_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhooks_serialize( + project_or_product_uid=project_or_product_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetWebhooks200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_webhooks_without_preload_content( + self, + project_or_product_uid: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_webhooks + + Retrieves all webhooks for the specified project + + :param project_or_product_uid: (required) + :type project_or_product_uid: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhooks_serialize( + project_or_product_uid=project_or_product_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetWebhooks200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_webhooks_serialize( + self, + project_or_product_uid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectOrProductUID}/webhooks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_legacy_webhook_session( + self, + product_uid: StrictStr, + device_uid: StrictStr, + request_body: Annotated[ + Optional[Dict[str, Any]], Field(description="Optional session metadata.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """update_legacy_webhook_session + + Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook. + + :param product_uid: (required) + :type product_uid: str + :param device_uid: (required) + :type device_uid: str + :param request_body: Optional session metadata. + :type request_body: Dict[str, object] + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_legacy_webhook_session_serialize( + product_uid=product_uid, + device_uid=device_uid, + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_legacy_webhook_session_with_http_info( + self, + product_uid: StrictStr, + device_uid: StrictStr, + request_body: Annotated[ + Optional[Dict[str, Any]], Field(description="Optional session metadata.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """update_legacy_webhook_session + + Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook. + + :param product_uid: (required) + :type product_uid: str + :param device_uid: (required) + :type device_uid: str + :param request_body: Optional session metadata. + :type request_body: Dict[str, object] + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_legacy_webhook_session_serialize( + product_uid=product_uid, + device_uid=device_uid, + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_legacy_webhook_session_without_preload_content( + self, + product_uid: StrictStr, + device_uid: StrictStr, + request_body: Annotated[ + Optional[Dict[str, Any]], Field(description="Optional session metadata.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_legacy_webhook_session + + Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook. + + :param product_uid: (required) + :type product_uid: str + :param device_uid: (required) + :type device_uid: str + :param request_body: Optional session metadata. + :type request_body: Dict[str, object] + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_legacy_webhook_session_serialize( + product_uid=product_uid, + device_uid=device_uid, + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _update_legacy_webhook_session_serialize( + self, + product_uid, + device_uid, + request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if product_uid is not None: + _path_params["productUID"] = product_uid + if device_uid is not None: + _path_params["deviceUID"] = device_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request_body is not None: + _body_params = request_body + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/products/{productUID}/devices/{deviceUID}/webhook-session", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_webhook( + self, + project_or_product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """update_webhook + + Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings. + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_serialize( + project_or_product_uid=project_or_product_uid, + webhook_uid=webhook_uid, + webhook_settings=webhook_settings, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_webhook_with_http_info( + self, + project_or_product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """update_webhook + + Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings. + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_serialize( + project_or_product_uid=project_or_product_uid, + webhook_uid=webhook_uid, + webhook_settings=webhook_settings, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_webhook_without_preload_content( + self, + project_or_product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1343,3 +2765,282 @@ def _update_webhook_serialize( _host=_host, _request_auth=_request_auth, ) + + @validate_call + def update_webhook_settings_by_product( + self, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """update_webhook_settings_by_product + + Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings. + + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_settings_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + webhook_settings=webhook_settings, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_webhook_settings_by_product_with_http_info( + self, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """update_webhook_settings_by_product + + Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings. + + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_settings_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + webhook_settings=webhook_settings, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_webhook_settings_by_product_without_preload_content( + self, + product_uid: StrictStr, + webhook_uid: Annotated[StrictStr, Field(description="Webhook UID")], + webhook_settings: WebhookSettings, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_webhook_settings_by_product + + Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings. + + :param product_uid: (required) + :type product_uid: str + :param webhook_uid: Webhook UID (required) + :type webhook_uid: str + :param webhook_settings: (required) + :type webhook_settings: WebhookSettings + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_settings_by_product_serialize( + product_uid=product_uid, + webhook_uid=webhook_uid, + webhook_settings=webhook_settings, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _update_webhook_settings_by_product_serialize( + self, + product_uid, + webhook_uid, + webhook_settings, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if product_uid is not None: + _path_params["productUID"] = product_uid + if webhook_uid is not None: + _path_params["webhookUID"] = webhook_uid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if webhook_settings is not None: + _body_params = webhook_settings + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["personalAccessToken"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/products/{productUID}/webhooks/{webhookUID}/settings", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/src/notehub_py/api_client.py b/src/notehub_py/api_client.py index fc2187a..3bdff5a 100644 --- a/src/notehub_py/api_client.py +++ b/src/notehub_py/api_client.py @@ -86,7 +86,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/6.2.0/python" + self.user_agent = "OpenAPI-Generator/6.3.0/python" self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/src/notehub_py/configuration.py b/src/notehub_py/configuration.py index 39f1328..49556ea 100644 --- a/src/notehub_py/configuration.py +++ b/src/notehub_py/configuration.py @@ -395,7 +395,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 1.2.0\n" - "SDK Package Version: 6.2.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 6.3.0".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/src/notehub_py/models/__init__.py b/src/notehub_py/models/__init__.py index d88a6ef..b5bed01 100644 --- a/src/notehub_py/models/__init__.py +++ b/src/notehub_py/models/__init__.py @@ -22,6 +22,7 @@ from notehub_py.models.alert_notifications_inner import AlertNotificationsInner from notehub_py.models.aws_route import AwsRoute from notehub_py.models.azure_route import AzureRoute +from notehub_py.models.batch_job_requests import BatchJobRequests from notehub_py.models.billing_account import BillingAccount from notehub_py.models.billing_account_role import BillingAccountRole from notehub_py.models.blynk_route import BlynkRoute @@ -32,9 +33,13 @@ from notehub_py.models.contact import Contact from notehub_py.models.create_fleet_request import CreateFleetRequest from notehub_py.models.create_job201_response import CreateJob201Response +from notehub_py.models.create_legacy_webhook_event_request import ( + CreateLegacyWebhookEventRequest, +) from notehub_py.models.create_monitor import CreateMonitor from notehub_py.models.create_product_request import CreateProductRequest from notehub_py.models.create_project_request import CreateProjectRequest +from notehub_py.models.create_project_secret_request import CreateProjectSecretRequest from notehub_py.models.create_update_repository import CreateUpdateRepository from notehub_py.models.current_firmware import CurrentFirmware from notehub_py.models.dfu_env import DFUEnv @@ -102,6 +107,16 @@ from notehub_py.models.get_device_health_log200_response_health_log_inner import ( GetDeviceHealthLog200ResponseHealthLogInner, ) +from notehub_py.models.get_device_journey200_response import GetDeviceJourney200Response +from notehub_py.models.get_device_journey200_response_journey import ( + GetDeviceJourney200ResponseJourney, +) +from notehub_py.models.get_device_journeys200_response import ( + GetDeviceJourneys200Response, +) +from notehub_py.models.get_device_journeys200_response_journeys_inner import ( + GetDeviceJourneys200ResponseJourneysInner, +) from notehub_py.models.get_device_latest_events200_response import ( GetDeviceLatestEvents200Response, ) @@ -130,6 +145,7 @@ from notehub_py.models.get_project_members200_response import ( GetProjectMembers200Response, ) +from notehub_py.models.get_project_secrets_response import GetProjectSecretsResponse from notehub_py.models.get_projects200_response import GetProjects200Response from notehub_py.models.get_route_logs_usage200_response import ( GetRouteLogsUsage200Response, @@ -139,6 +155,10 @@ from notehub_py.models.google_route import GoogleRoute from notehub_py.models.http_route import HttpRoute from notehub_py.models.job import Job +from notehub_py.models.job_definition import JobDefinition +from notehub_py.models.job_definition_report_options import JobDefinitionReportOptions +from notehub_py.models.job_definition_select import JobDefinitionSelect +from notehub_py.models.job_detail import JobDetail from notehub_py.models.job_run import JobRun from notehub_py.models.location import Location from notehub_py.models.login200_response import Login200Response @@ -163,11 +183,15 @@ from notehub_py.models.product import Product from notehub_py.models.project import Project from notehub_py.models.project_member import ProjectMember +from notehub_py.models.project_secret import ProjectSecret from notehub_py.models.provision_device_request import ProvisionDeviceRequest from notehub_py.models.proxy_route import ProxyRoute from notehub_py.models.qubitro_route import QubitroRoute from notehub_py.models.rad_route import RadRoute from notehub_py.models.repository import Repository +from notehub_py.models.repository_list_response import RepositoryListResponse +from notehub_py.models.repository_token_request import RepositoryTokenRequest +from notehub_py.models.repository_token_response import RepositoryTokenResponse from notehub_py.models.role import Role from notehub_py.models.route_log import RouteLog from notehub_py.models.route_transform_settings import RouteTransformSettings @@ -188,6 +212,7 @@ from notehub_py.models.twilio_route import TwilioRoute from notehub_py.models.update_fleet_request import UpdateFleetRequest from notehub_py.models.update_host_firmware_request import UpdateHostFirmwareRequest +from notehub_py.models.update_project_secret_request import UpdateProjectSecretRequest from notehub_py.models.upload_metadata import UploadMetadata from notehub_py.models.usage_data import UsageData from notehub_py.models.usage_events_data import UsageEventsData diff --git a/src/notehub_py/models/batch_job_requests.py b/src/notehub_py/models/batch_job_requests.py new file mode 100644 index 0000000..23f0b0d --- /dev/null +++ b/src/notehub_py/models/batch_job_requests.py @@ -0,0 +1,155 @@ +# 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class BatchJobRequests(BaseModel): + """ + Operations to apply to a device + """ # noqa: E501 + + comment: Optional[StrictStr] = None + connectivity_assurance_disable: Optional[StrictBool] = Field( + default=None, description="Disable connectivity assurance for the device" + ) + connectivity_assurance_enable: Optional[StrictBool] = Field( + default=None, description="Enable connectivity assurance for the device" + ) + disable: Optional[StrictBool] = Field( + default=None, description="Disable the device" + ) + enable: Optional[StrictBool] = Field(default=None, description="Enable the device") + fleets_to_default: Optional[List[StrictStr]] = Field( + default=None, + description="Fleet UIDs to assign to the device if it has no fleets", + ) + fleets_to_join: Optional[List[StrictStr]] = Field( + default=None, description="Fleet UIDs to add the device to" + ) + fleets_to_leave: Optional[List[StrictStr]] = Field( + default=None, description="Fleet UIDs to remove the device from" + ) + provision_product: Optional[StrictStr] = Field( + default=None, + description="Product UID to provision the device with if not already provisioned", + ) + sn_to_default: Optional[StrictStr] = Field( + default=None, description="Set the device serial number only if not already set" + ) + sn_to_set: Optional[StrictStr] = Field( + default=None, description='Set the device serial number ("-" to clear)' + ) + vars_to_default: Optional[Dict[str, StrictStr]] = Field( + default=None, description="Environment variables to set only if not already set" + ) + vars_to_set: Optional[Dict[str, StrictStr]] = Field( + default=None, + description='Environment variables to set (use "-" as value to clear)', + ) + __properties: ClassVar[List[str]] = [ + "comment", + "connectivity_assurance_disable", + "connectivity_assurance_enable", + "disable", + "enable", + "fleets_to_default", + "fleets_to_join", + "fleets_to_leave", + "provision_product", + "sn_to_default", + "sn_to_set", + "vars_to_default", + "vars_to_set", + ] + + 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 BatchJobRequests 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 BatchJobRequests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "comment": obj.get("comment"), + "connectivity_assurance_disable": obj.get( + "connectivity_assurance_disable" + ), + "connectivity_assurance_enable": obj.get( + "connectivity_assurance_enable" + ), + "disable": obj.get("disable"), + "enable": obj.get("enable"), + "fleets_to_default": obj.get("fleets_to_default"), + "fleets_to_join": obj.get("fleets_to_join"), + "fleets_to_leave": obj.get("fleets_to_leave"), + "provision_product": obj.get("provision_product"), + "sn_to_default": obj.get("sn_to_default"), + "sn_to_set": obj.get("sn_to_set"), + "vars_to_default": obj.get("vars_to_default"), + "vars_to_set": obj.get("vars_to_set"), + } + ) + return _obj diff --git a/src/notehub_py/models/billing_account_role.py b/src/notehub_py/models/billing_account_role.py index e86e782..b4756cf 100644 --- a/src/notehub_py/models/billing_account_role.py +++ b/src/notehub_py/models/billing_account_role.py @@ -30,6 +30,7 @@ class BillingAccountRole(str, Enum): BILLING_ADMIN = "billing_admin" BILLING_MANAGER = "billing_manager" PROJECT_CREATOR = "project_creator" + BILLING_MEMBER = "billing_member" @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/src/notehub_py/models/create_legacy_webhook_event_request.py b/src/notehub_py/models/create_legacy_webhook_event_request.py new file mode 100644 index 0000000..6a1c37f --- /dev/null +++ b/src/notehub_py/models/create_legacy_webhook_event_request.py @@ -0,0 +1,114 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class CreateLegacyWebhookEventRequest(BaseModel): + """ + CreateLegacyWebhookEventRequest + """ # noqa: E501 + + body: Optional[Dict[str, Any]] = Field( + default=None, description="Arbitrary JSON event body." + ) + file: Optional[StrictStr] = Field( + default=None, description="The notefile to which the event should be written." + ) + payload: Optional[StrictStr] = Field( + default=None, description="Optional base64-encoded binary payload." + ) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["body", "file", "payload"] + + 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 CreateLegacyWebhookEventRequest 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set( + [ + "additional_properties", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateLegacyWebhookEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "body": obj.get("body"), + "file": obj.get("file"), + "payload": obj.get("payload"), + } + ) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj diff --git a/src/notehub_py/models/create_monitor.py b/src/notehub_py/models/create_monitor.py index a7739f6..56bb4f7 100644 --- a/src/notehub_py/models/create_monitor.py +++ b/src/notehub_py/models/create_monitor.py @@ -88,6 +88,18 @@ class CreateMonitor(BaseModel): description="The type of condition to apply to the value selected by the source_selector" ) uid: Optional[StrictStr] = None + usage_scope: Optional[StrictStr] = Field( + default=None, + description='For usage monitors: the scope of aggregation. Supported values are "device" and "fleet".', + ) + usage_type: Optional[StrictStr] = Field( + default=None, + description='For usage monitors: the type of data usage to monitor. Supported values are "cellular" and "satellite".', + ) + usage_window: Optional[StrictInt] = Field( + default=None, + description="For usage monitors: the rolling time window in days to sum usage over (e.g. 30 for 30 days).", + ) __properties: ClassVar[List[str]] = [ "aggregate_function", "aggregate_window", @@ -107,6 +119,9 @@ class CreateMonitor(BaseModel): "source_type", "threshold", "uid", + "usage_scope", + "usage_type", + "usage_window", ] @field_validator("aggregate_function") @@ -252,6 +267,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "source_type": obj.get("source_type"), "threshold": obj.get("threshold"), "uid": obj.get("uid"), + "usage_scope": obj.get("usage_scope"), + "usage_type": obj.get("usage_type"), + "usage_window": obj.get("usage_window"), } ) return _obj diff --git a/src/notehub_py/models/create_project_secret_request.py b/src/notehub_py/models/create_project_secret_request.py new file mode 100644 index 0000000..54b3292 --- /dev/null +++ b/src/notehub_py/models/create_project_secret_request.py @@ -0,0 +1,89 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class CreateProjectSecretRequest(BaseModel): + """ + CreateProjectSecretRequest + """ # noqa: E501 + + name: StrictStr = Field( + description="The secret name (alphanumeric and underscores only)." + ) + value: StrictStr = Field( + description="The secret value (encrypted at rest, never returned after creation)." + ) + __properties: ClassVar[List[str]] = ["name", "value"] + + 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 CreateProjectSecretRequest 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 CreateProjectSecretRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name"), "value": obj.get("value")}) + return _obj diff --git a/src/notehub_py/models/get_device_journey200_response.py b/src/notehub_py/models/get_device_journey200_response.py new file mode 100644 index 0000000..4074fd1 --- /dev/null +++ b/src/notehub_py/models/get_device_journey200_response.py @@ -0,0 +1,110 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from notehub_py.models.get_device_journey200_response_journey import ( + GetDeviceJourney200ResponseJourney, +) +from typing import Optional, Set +from typing_extensions import Self + + +class GetDeviceJourney200Response(BaseModel): + """ + GetDeviceJourney200Response + """ # noqa: E501 + + end_date: datetime = Field(description="Latest event time within the journey.") + journey: GetDeviceJourney200ResponseJourney + journey_id: StrictInt = Field(description="Identifier of the journey.") + start_date: datetime = Field(description="Earliest event time within the journey.") + __properties: ClassVar[List[str]] = [ + "end_date", + "journey", + "journey_id", + "start_date", + ] + + 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 GetDeviceJourney200Response 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, + ) + # override the default output from pydantic by calling `to_dict()` of journey + if self.journey: + _dict["journey"] = self.journey.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDeviceJourney200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "end_date": obj.get("end_date"), + "journey": ( + GetDeviceJourney200ResponseJourney.from_dict(obj["journey"]) + if obj.get("journey") is not None + else None + ), + "journey_id": obj.get("journey_id"), + "start_date": obj.get("start_date"), + } + ) + return _obj diff --git a/src/notehub_py/models/get_device_journey200_response_journey.py b/src/notehub_py/models/get_device_journey200_response_journey.py new file mode 100644 index 0000000..51fc4c3 --- /dev/null +++ b/src/notehub_py/models/get_device_journey200_response_journey.py @@ -0,0 +1,102 @@ +# 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, StrictBool +from typing import Any, ClassVar, Dict, List +from notehub_py.models.event import Event +from typing import Optional, Set +from typing_extensions import Self + + +class GetDeviceJourney200ResponseJourney(BaseModel): + """ + Paginated `_track.qo` events for the journey. + """ # noqa: E501 + + events: List[Event] + has_more: StrictBool + __properties: ClassVar[List[str]] = ["events", "has_more"] + + 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 GetDeviceJourney200ResponseJourney 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in events (list) + _items = [] + if self.events: + for _item in self.events: + if _item: + _items.append(_item.to_dict()) + _dict["events"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDeviceJourney200ResponseJourney from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "events": ( + [Event.from_dict(_item) for _item in obj["events"]] + if obj.get("events") is not None + else None + ), + "has_more": obj.get("has_more"), + } + ) + return _obj diff --git a/src/notehub_py/models/get_device_journeys200_response.py b/src/notehub_py/models/get_device_journeys200_response.py new file mode 100644 index 0000000..0e2a557 --- /dev/null +++ b/src/notehub_py/models/get_device_journeys200_response.py @@ -0,0 +1,107 @@ +# 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, StrictBool +from typing import Any, ClassVar, Dict, List +from notehub_py.models.get_device_journeys200_response_journeys_inner import ( + GetDeviceJourneys200ResponseJourneysInner, +) +from typing import Optional, Set +from typing_extensions import Self + + +class GetDeviceJourneys200Response(BaseModel): + """ + GetDeviceJourneys200Response + """ # noqa: E501 + + has_more: StrictBool + journeys: List[GetDeviceJourneys200ResponseJourneysInner] + __properties: ClassVar[List[str]] = ["has_more", "journeys"] + + 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 GetDeviceJourneys200Response 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in journeys (list) + _items = [] + if self.journeys: + for _item in self.journeys: + if _item: + _items.append(_item.to_dict()) + _dict["journeys"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDeviceJourneys200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "has_more": obj.get("has_more"), + "journeys": ( + [ + GetDeviceJourneys200ResponseJourneysInner.from_dict(_item) + for _item in obj["journeys"] + ] + if obj.get("journeys") is not None + else None + ), + } + ) + return _obj diff --git a/src/notehub_py/models/get_device_journeys200_response_journeys_inner.py b/src/notehub_py/models/get_device_journeys200_response_journeys_inner.py new file mode 100644 index 0000000..a2c848a --- /dev/null +++ b/src/notehub_py/models/get_device_journeys200_response_journeys_inner.py @@ -0,0 +1,104 @@ +# 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 datetime import datetime +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 GetDeviceJourneys200ResponseJourneysInner(BaseModel): + """ + GetDeviceJourneys200ResponseJourneysInner + """ # noqa: E501 + + end_date: datetime = Field(description="Latest event time within the journey.") + journey_id: StrictInt = Field( + description="Identifier of the journey, taken from the `journey` field on `_track.qo` events. This value is itself a Unix timestamp marking the start of the journey. " + ) + start_date: datetime = Field(description="Earliest event time within the journey.") + total_events: StrictInt = Field( + description="The number of _track.qo events in the journey." + ) + __properties: ClassVar[List[str]] = [ + "end_date", + "journey_id", + "start_date", + "total_events", + ] + + 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 GetDeviceJourneys200ResponseJourneysInner 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 GetDeviceJourneys200ResponseJourneysInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "end_date": obj.get("end_date"), + "journey_id": obj.get("journey_id"), + "start_date": obj.get("start_date"), + "total_events": obj.get("total_events"), + } + ) + return _obj diff --git a/src/notehub_py/models/get_project_secrets_response.py b/src/notehub_py/models/get_project_secrets_response.py new file mode 100644 index 0000000..1299e77 --- /dev/null +++ b/src/notehub_py/models/get_project_secrets_response.py @@ -0,0 +1,100 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from notehub_py.models.project_secret import ProjectSecret +from typing import Optional, Set +from typing_extensions import Self + + +class GetProjectSecretsResponse(BaseModel): + """ + GetProjectSecretsResponse + """ # noqa: E501 + + secrets: List[ProjectSecret] + __properties: ClassVar[List[str]] = ["secrets"] + + 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 GetProjectSecretsResponse 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in secrets (list) + _items = [] + if self.secrets: + for _item in self.secrets: + if _item: + _items.append(_item.to_dict()) + _dict["secrets"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetProjectSecretsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "secrets": ( + [ProjectSecret.from_dict(_item) for _item in obj["secrets"]] + if obj.get("secrets") is not None + else None + ) + } + ) + return _obj diff --git a/src/notehub_py/models/job.py b/src/notehub_py/models/job.py index 41020c4..2060c56 100644 --- a/src/notehub_py/models/job.py +++ b/src/notehub_py/models/job.py @@ -31,16 +31,27 @@ class Job(BaseModel): created: StrictInt = Field(description="Unix timestamp when job was created") created_by: StrictStr = Field(description="User who created the job") - definition: Optional[Dict[str, Any]] = Field( - default=None, description="Full job definition (only in detail view)" - ) job_uid: StrictStr = Field(description="Unique identifier for the job") + last_run_completed: Optional[StrictInt] = Field( + default=None, + description="Unix timestamp when the most recent run completed (0 if still in progress)", + ) + last_run_status: Optional[StrictStr] = Field( + default=None, + description='Status of the most recent job run. Terminal values are: "submitted", "completed successfully", "dry run completed successfully", "completed with errors", "cancelled". While a job is running, intermediate per-device progress updates may appear (e.g. "dev:000000000000000 completed", "dev:000000000000000 updated: ...").', + ) + last_run_submitted: Optional[StrictInt] = Field( + default=None, + description="Unix timestamp when the most recent run was submitted", + ) name: StrictStr = Field(description="Human-readable job name") __properties: ClassVar[List[str]] = [ "created", "created_by", - "definition", "job_uid", + "last_run_completed", + "last_run_status", + "last_run_submitted", "name", ] @@ -96,8 +107,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "created": obj.get("created"), "created_by": obj.get("created_by"), - "definition": obj.get("definition"), "job_uid": obj.get("job_uid"), + "last_run_completed": obj.get("last_run_completed"), + "last_run_status": obj.get("last_run_status"), + "last_run_submitted": obj.get("last_run_submitted"), "name": obj.get("name"), } ) diff --git a/src/notehub_py/models/job_definition.py b/src/notehub_py/models/job_definition.py new file mode 100644 index 0000000..ed22028 --- /dev/null +++ b/src/notehub_py/models/job_definition.py @@ -0,0 +1,145 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from notehub_py.models.batch_job_requests import BatchJobRequests +from notehub_py.models.job_definition_report_options import JobDefinitionReportOptions +from notehub_py.models.job_definition_select import JobDefinitionSelect +from typing import Optional, Set +from typing_extensions import Self + + +class JobDefinition(BaseModel): + """ + Batch job definition + """ # noqa: E501 + + comment: Optional[StrictStr] = Field( + default=None, description="Human-readable description of the job" + ) + default_requests: Optional[BatchJobRequests] = None + device_requests: Optional[Dict[str, BatchJobRequests]] = Field( + default=None, + description="Device-specific request overrides, keyed by device UID", + ) + report_options: Optional[JobDefinitionReportOptions] = None + select: Optional[JobDefinitionSelect] = None + __properties: ClassVar[List[str]] = [ + "comment", + "default_requests", + "device_requests", + "report_options", + "select", + ] + + 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 JobDefinition 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, + ) + # override the default output from pydantic by calling `to_dict()` of default_requests + if self.default_requests: + _dict["default_requests"] = self.default_requests.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in device_requests (dict) + _field_dict = {} + if self.device_requests: + for _key in self.device_requests: + if self.device_requests[_key]: + _field_dict[_key] = self.device_requests[_key].to_dict() + _dict["device_requests"] = _field_dict + # override the default output from pydantic by calling `to_dict()` of report_options + if self.report_options: + _dict["report_options"] = self.report_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of select + if self.select: + _dict["select"] = self.select.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobDefinition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "comment": obj.get("comment"), + "default_requests": ( + BatchJobRequests.from_dict(obj["default_requests"]) + if obj.get("default_requests") is not None + else None + ), + "device_requests": ( + dict( + (_k, BatchJobRequests.from_dict(_v)) + for _k, _v in obj["device_requests"].items() + ) + if obj.get("device_requests") is not None + else None + ), + "report_options": ( + JobDefinitionReportOptions.from_dict(obj["report_options"]) + if obj.get("report_options") is not None + else None + ), + "select": ( + JobDefinitionSelect.from_dict(obj["select"]) + if obj.get("select") is not None + else None + ), + } + ) + return _obj diff --git a/src/notehub_py/models/job_definition_report_options.py b/src/notehub_py/models/job_definition_report_options.py new file mode 100644 index 0000000..622589d --- /dev/null +++ b/src/notehub_py/models/job_definition_report_options.py @@ -0,0 +1,125 @@ +# 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class JobDefinitionReportOptions(BaseModel): + """ + Controls what data is included in the job report + """ # noqa: E501 + + app_fleets: Optional[StrictBool] = Field( + default=None, description="Include project fleets in the report" + ) + app_info: Optional[StrictBool] = Field( + default=None, description="Include project info in the report" + ) + app_vars: Optional[StrictBool] = Field( + default=None, description="Include project environment variables in the report" + ) + comment: Optional[StrictStr] = None + device_activity: Optional[StrictBool] = Field( + default=None, description="Include device activity data in the report" + ) + device_health: Optional[StrictBool] = Field( + default=None, description="Include device health data in the report" + ) + device_info: Optional[StrictBool] = Field( + default=None, description="Include device info in the report" + ) + device_vars: Optional[StrictBool] = Field( + default=None, description="Include device environment variables in the report" + ) + __properties: ClassVar[List[str]] = [ + "app_fleets", + "app_info", + "app_vars", + "comment", + "device_activity", + "device_health", + "device_info", + "device_vars", + ] + + 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 JobDefinitionReportOptions 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 JobDefinitionReportOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "app_fleets": obj.get("app_fleets"), + "app_info": obj.get("app_info"), + "app_vars": obj.get("app_vars"), + "comment": obj.get("comment"), + "device_activity": obj.get("device_activity"), + "device_health": obj.get("device_health"), + "device_info": obj.get("device_info"), + "device_vars": obj.get("device_vars"), + } + ) + return _obj diff --git a/src/notehub_py/models/job_definition_select.py b/src/notehub_py/models/job_definition_select.py new file mode 100644 index 0000000..b7b7435 --- /dev/null +++ b/src/notehub_py/models/job_definition_select.py @@ -0,0 +1,111 @@ +# 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class JobDefinitionSelect(BaseModel): + """ + Device selection criteria + """ # noqa: E501 + + all_devices: Optional[StrictBool] = Field( + default=None, description="Select all devices in the project" + ) + comment: Optional[StrictStr] = None + devices: Optional[List[StrictStr]] = Field( + default=None, description="Specific device UIDs to include" + ) + devices_by_sn: Optional[List[StrictStr]] = Field( + default=None, + description="Serial number patterns to match (supports glob wildcards *, ?, [...])", + ) + devices_in_fleets: Optional[List[StrictStr]] = Field( + default=None, description="Fleet UIDs whose devices should be included" + ) + __properties: ClassVar[List[str]] = [ + "all_devices", + "comment", + "devices", + "devices_by_sn", + "devices_in_fleets", + ] + + 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 JobDefinitionSelect 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 JobDefinitionSelect from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "all_devices": obj.get("all_devices"), + "comment": obj.get("comment"), + "devices": obj.get("devices"), + "devices_by_sn": obj.get("devices_by_sn"), + "devices_in_fleets": obj.get("devices_in_fleets"), + } + ) + return _obj diff --git a/src/notehub_py/models/job_detail.py b/src/notehub_py/models/job_detail.py new file mode 100644 index 0000000..7397bf7 --- /dev/null +++ b/src/notehub_py/models/job_detail.py @@ -0,0 +1,128 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from notehub_py.models.job_definition import JobDefinition +from typing import Optional, Set +from typing_extensions import Self + + +class JobDetail(BaseModel): + """ + Batch job with full definition + """ # noqa: E501 + + created: StrictInt = Field(description="Unix timestamp when job was created") + created_by: StrictStr = Field(description="User who created the job") + job_uid: StrictStr = Field(description="Unique identifier for the job") + last_run_completed: Optional[StrictInt] = Field( + default=None, + description="Unix timestamp when the most recent run completed (0 if still in progress)", + ) + last_run_status: Optional[StrictStr] = Field( + default=None, + description='Status of the most recent job run. Terminal values are: "submitted", "completed successfully", "dry run completed successfully", "completed with errors", "cancelled". While a job is running, intermediate per-device progress updates may appear (e.g. "dev:000000000000000 completed", "dev:000000000000000 updated: ...").', + ) + last_run_submitted: Optional[StrictInt] = Field( + default=None, + description="Unix timestamp when the most recent run was submitted", + ) + name: StrictStr = Field(description="Human-readable job name") + definition: Optional[JobDefinition] = None + __properties: ClassVar[List[str]] = [ + "created", + "created_by", + "job_uid", + "last_run_completed", + "last_run_status", + "last_run_submitted", + "name", + "definition", + ] + + 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 JobDetail 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, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict["definition"] = self.definition.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "created": obj.get("created"), + "created_by": obj.get("created_by"), + "job_uid": obj.get("job_uid"), + "last_run_completed": obj.get("last_run_completed"), + "last_run_status": obj.get("last_run_status"), + "last_run_submitted": obj.get("last_run_submitted"), + "name": obj.get("name"), + "definition": ( + JobDefinition.from_dict(obj["definition"]) + if obj.get("definition") is not None + else None + ), + } + ) + return _obj diff --git a/src/notehub_py/models/monitor.py b/src/notehub_py/models/monitor.py index 9b09779..15b715e 100644 --- a/src/notehub_py/models/monitor.py +++ b/src/notehub_py/models/monitor.py @@ -90,6 +90,18 @@ class Monitor(BaseModel): description="The type of condition to apply to the value selected by the source_selector", ) uid: Optional[StrictStr] = None + usage_scope: Optional[StrictStr] = Field( + default=None, + description='For usage monitors: the scope of aggregation. Supported values are "device" and "fleet".', + ) + usage_type: Optional[StrictStr] = Field( + default=None, + description='For usage monitors: the type of data usage to monitor. Supported values are "cellular" and "satellite".', + ) + usage_window: Optional[StrictInt] = Field( + default=None, + description="For usage monitors: the rolling time window in days to sum usage over (e.g. 30 for 30 days).", + ) __properties: ClassVar[List[str]] = [ "aggregate_function", "aggregate_window", @@ -109,6 +121,9 @@ class Monitor(BaseModel): "source_type", "threshold", "uid", + "usage_scope", + "usage_type", + "usage_window", ] @field_validator("aggregate_function") @@ -257,6 +272,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "source_type": obj.get("source_type"), "threshold": obj.get("threshold"), "uid": obj.get("uid"), + "usage_scope": obj.get("usage_scope"), + "usage_type": obj.get("usage_type"), + "usage_window": obj.get("usage_window"), } ) return _obj diff --git a/src/notehub_py/models/project_secret.py b/src/notehub_py/models/project_secret.py new file mode 100644 index 0000000..a8d1e3e --- /dev/null +++ b/src/notehub_py/models/project_secret.py @@ -0,0 +1,109 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class ProjectSecret(BaseModel): + """ + Metadata for a project secret. The value is never returned. + """ # noqa: E501 + + created: datetime = Field(description="When the secret was first created.") + created_by: StrictStr = Field(description="The actor who created the secret.") + modified: Optional[datetime] = Field( + default=None, description="When the secret was last updated." + ) + modified_by: Optional[StrictStr] = Field( + default=None, description="The actor who last updated the secret." + ) + name: StrictStr = Field( + description="The secret name (alphanumeric and underscores only)." + ) + __properties: ClassVar[List[str]] = [ + "created", + "created_by", + "modified", + "modified_by", + "name", + ] + + 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 ProjectSecret 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 ProjectSecret from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "created": obj.get("created"), + "created_by": obj.get("created_by"), + "modified": obj.get("modified"), + "modified_by": obj.get("modified_by"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/src/notehub_py/models/repository_list_response.py b/src/notehub_py/models/repository_list_response.py new file mode 100644 index 0000000..f13cfa0 --- /dev/null +++ b/src/notehub_py/models/repository_list_response.py @@ -0,0 +1,100 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from notehub_py.models.repository import Repository +from typing import Optional, Set +from typing_extensions import Self + + +class RepositoryListResponse(BaseModel): + """ + RepositoryListResponse + """ # noqa: E501 + + repositories: List[Repository] + __properties: ClassVar[List[str]] = ["repositories"] + + 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 RepositoryListResponse 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in repositories (list) + _items = [] + if self.repositories: + for _item in self.repositories: + if _item: + _items.append(_item.to_dict()) + _dict["repositories"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RepositoryListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "repositories": ( + [Repository.from_dict(_item) for _item in obj["repositories"]] + if obj.get("repositories") is not None + else None + ) + } + ) + return _obj diff --git a/src/notehub_py/models/repository_token_request.py b/src/notehub_py/models/repository_token_request.py new file mode 100644 index 0000000..01cbf6d --- /dev/null +++ b/src/notehub_py/models/repository_token_request.py @@ -0,0 +1,113 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + + +class RepositoryTokenRequest(BaseModel): + """ + RepositoryTokenRequest + """ # noqa: E501 + + intent: Optional[StrictStr] = Field( + default="read", + description="Access intent for the vended credentials. Only `read` is supported today; `write` and `admin` are reserved for future use. ", + ) + ttl_seconds: Optional[Annotated[int, Field(le=3600, strict=True, ge=60)]] = Field( + default=900, + description="Requested credential lifetime in seconds. Clamped server-side to [60, 3600]. Defaults to 900 (15 minutes) if omitted. ", + ) + __properties: ClassVar[List[str]] = ["intent", "ttl_seconds"] + + @field_validator("intent") + def intent_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["read"]): + raise ValueError("must be one of enum values ('read')") + return value + + 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 RepositoryTokenRequest 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 RepositoryTokenRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "intent": ( + obj.get("intent") if obj.get("intent") is not None else "read" + ), + "ttl_seconds": ( + obj.get("ttl_seconds") + if obj.get("ttl_seconds") is not None + else 900 + ), + } + ) + return _obj diff --git a/src/notehub_py/models/repository_token_response.py b/src/notehub_py/models/repository_token_response.py new file mode 100644 index 0000000..76ca36a --- /dev/null +++ b/src/notehub_py/models/repository_token_response.py @@ -0,0 +1,116 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class RepositoryTokenResponse(BaseModel): + """ + RepositoryTokenResponse + """ # noqa: E501 + + database: StrictStr = Field( + description="Storage service database name scoped to this repository" + ) + expires_at: datetime = Field( + description="Absolute expiration time of the ephemeral user. The storage service will reject connections and queries after this instant. " + ) + host: StrictStr = Field( + description="Storage service hostname the caller should connect to" + ) + password: StrictStr = Field( + description="Ephemeral password. Returned once; not stored by Notehub. Hold this in memory only and discard after `expires_at`. " + ) + port: StrictInt = Field(description="Storage service port") + username: StrictStr = Field( + description="Ephemeral storage service username (prefixed with `u_`)" + ) + __properties: ClassVar[List[str]] = [ + "database", + "expires_at", + "host", + "password", + "port", + "username", + ] + + 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 RepositoryTokenResponse 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 RepositoryTokenResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "database": obj.get("database"), + "expires_at": obj.get("expires_at"), + "host": obj.get("host"), + "password": obj.get("password"), + "port": obj.get("port"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/src/notehub_py/models/update_project_secret_request.py b/src/notehub_py/models/update_project_secret_request.py new file mode 100644 index 0000000..7588304 --- /dev/null +++ b/src/notehub_py/models/update_project_secret_request.py @@ -0,0 +1,86 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class UpdateProjectSecretRequest(BaseModel): + """ + UpdateProjectSecretRequest + """ # noqa: E501 + + value: StrictStr = Field( + description="The new secret value (encrypted at rest, never returned)." + ) + __properties: ClassVar[List[str]] = ["value"] + + 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 UpdateProjectSecretRequest 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 UpdateProjectSecretRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"value": obj.get("value")}) + return _obj diff --git a/src/pyproject.toml b/src/pyproject.toml index bf91336..d476b77 100644 --- a/src/pyproject.toml +++ b/src/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "notehub_py" -version = "6.2.0" +version = "6.3.0" description = "Notehub API" authors = ["Blues Engineering "] license = "MIT" diff --git a/src/setup.py b/src/setup.py index 7693316..1da97ea 100644 --- a/src/setup.py +++ b/src/setup.py @@ -25,7 +25,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "notehub-py" -VERSION = "6.2.0" +VERSION = "6.3.0" PYTHON_REQUIRES = ">=3.10" REQUIRES = [ "urllib3 >= 2.5.0", diff --git a/src/test/test_batch_job_requests.py b/src/test/test_batch_job_requests.py new file mode 100644 index 0000000..70ef059 --- /dev/null +++ b/src/test/test_batch_job_requests.py @@ -0,0 +1,76 @@ +# 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.batch_job_requests import BatchJobRequests + + +class TestBatchJobRequests(unittest.TestCase): + """BatchJobRequests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BatchJobRequests: + """Test BatchJobRequests + 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 `BatchJobRequests` + """ + model = BatchJobRequests() + if include_optional: + return BatchJobRequests( + comment = '', + connectivity_assurance_disable = True, + connectivity_assurance_enable = True, + disable = True, + enable = True, + fleets_to_default = [ + '' + ], + fleets_to_join = [ + '' + ], + fleets_to_leave = [ + '' + ], + provision_product = '', + sn_to_default = '', + sn_to_set = '', + vars_to_default = { + 'key' : '' + }, + vars_to_set = { + 'key' : '' + } + ) + else: + return BatchJobRequests( + ) + """ + + def testBatchJobRequests(self): + """Test BatchJobRequests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_create_legacy_webhook_event_request.py b/src/test/test_create_legacy_webhook_event_request.py new file mode 100644 index 0000000..474218a --- /dev/null +++ b/src/test/test_create_legacy_webhook_event_request.py @@ -0,0 +1,58 @@ +# 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.create_legacy_webhook_event_request import ( + CreateLegacyWebhookEventRequest, +) + + +class TestCreateLegacyWebhookEventRequest(unittest.TestCase): + """CreateLegacyWebhookEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateLegacyWebhookEventRequest: + """Test CreateLegacyWebhookEventRequest + 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 `CreateLegacyWebhookEventRequest` + """ + model = CreateLegacyWebhookEventRequest() + if include_optional: + return CreateLegacyWebhookEventRequest( + body = { }, + file = '', + payload = '' + ) + else: + return CreateLegacyWebhookEventRequest( + ) + """ + + def testCreateLegacyWebhookEventRequest(self): + """Test CreateLegacyWebhookEventRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_create_project_secret_request.py b/src/test/test_create_project_secret_request.py new file mode 100644 index 0000000..09d48ce --- /dev/null +++ b/src/test/test_create_project_secret_request.py @@ -0,0 +1,57 @@ +# 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.create_project_secret_request import CreateProjectSecretRequest + + +class TestCreateProjectSecretRequest(unittest.TestCase): + """CreateProjectSecretRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateProjectSecretRequest: + """Test CreateProjectSecretRequest + 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 `CreateProjectSecretRequest` + """ + model = CreateProjectSecretRequest() + if include_optional: + return CreateProjectSecretRequest( + name = '', + value = '' + ) + else: + return CreateProjectSecretRequest( + name = '', + value = '', + ) + """ + + def testCreateProjectSecretRequest(self): + """Test CreateProjectSecretRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_get_device_journey200_response.py b/src/test/test_get_device_journey200_response.py new file mode 100644 index 0000000..2120d31 --- /dev/null +++ b/src/test/test_get_device_journey200_response.py @@ -0,0 +1,189 @@ +# 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.get_device_journey200_response import GetDeviceJourney200Response + + +class TestGetDeviceJourney200Response(unittest.TestCase): + """GetDeviceJourney200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDeviceJourney200Response: + """Test GetDeviceJourney200Response + 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 `GetDeviceJourney200Response` + """ + model = GetDeviceJourney200Response() + if include_optional: + return GetDeviceJourney200Response( + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + journey = notehub_py.models.get_device_journey_200_response_journey.GetDeviceJourney_200_response_journey( + events = [ + notehub_py.models.event.Event( + app = '', + bars = 1.337, + best_country = '', + best_id = '', + best_lat = 1.337, + best_location = '', + best_location_type = '', + best_location_when = 1.337, + best_lon = 1.337, + best_timezone = '', + body = notehub_py.models.body.body(), + bssid = '', + device = '', + environment = notehub_py.models.environment.environment(), + event = '', + file = '', + moved = 1.337, + note = '', + ordering_code = '', + orientation = '', + payload = '', + product = '', + rat = '', + received = 1.337, + req = '', + rsrp = 1.337, + rsrq = 1.337, + rssi = 1.337, + session = '', + sinr = 1.337, + sku = '', + sn = '', + ssid = '', + temp = 1.337, + tls = True, + tower_country = '', + tower_id = '', + tower_lat = 1.337, + tower_location = '', + tower_lon = 1.337, + tower_timezone = '', + tower_when = 1.337, + transport = '', + tri_country = '', + tri_lat = 1.337, + tri_location = '', + tri_lon = 1.337, + tri_points = 1.337, + tri_timezone = '', + tri_when = 1.337, + updates = 1.337, + voltage = 1.337, + when = 1.337, + where_country = '', + where_lat = 1.337, + where_location = '', + where_lon = 1.337, + where_olc = '', + where_timezone = '', + where_when = 1.337, ) + ], + has_more = True, ), + journey_id = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return GetDeviceJourney200Response( + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + journey = notehub_py.models.get_device_journey_200_response_journey.GetDeviceJourney_200_response_journey( + events = [ + notehub_py.models.event.Event( + app = '', + bars = 1.337, + best_country = '', + best_id = '', + best_lat = 1.337, + best_location = '', + best_location_type = '', + best_location_when = 1.337, + best_lon = 1.337, + best_timezone = '', + body = notehub_py.models.body.body(), + bssid = '', + device = '', + environment = notehub_py.models.environment.environment(), + event = '', + file = '', + moved = 1.337, + note = '', + ordering_code = '', + orientation = '', + payload = '', + product = '', + rat = '', + received = 1.337, + req = '', + rsrp = 1.337, + rsrq = 1.337, + rssi = 1.337, + session = '', + sinr = 1.337, + sku = '', + sn = '', + ssid = '', + temp = 1.337, + tls = True, + tower_country = '', + tower_id = '', + tower_lat = 1.337, + tower_location = '', + tower_lon = 1.337, + tower_timezone = '', + tower_when = 1.337, + transport = '', + tri_country = '', + tri_lat = 1.337, + tri_location = '', + tri_lon = 1.337, + tri_points = 1.337, + tri_timezone = '', + tri_when = 1.337, + updates = 1.337, + voltage = 1.337, + when = 1.337, + where_country = '', + where_lat = 1.337, + where_location = '', + where_lon = 1.337, + where_olc = '', + where_timezone = '', + where_when = 1.337, ) + ], + has_more = True, ), + journey_id = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testGetDeviceJourney200Response(self): + """Test GetDeviceJourney200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_get_device_journey200_response_journey.py b/src/test/test_get_device_journey200_response_journey.py new file mode 100644 index 0000000..28647c1 --- /dev/null +++ b/src/test/test_get_device_journey200_response_journey.py @@ -0,0 +1,183 @@ +# 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.get_device_journey200_response_journey import ( + GetDeviceJourney200ResponseJourney, +) + + +class TestGetDeviceJourney200ResponseJourney(unittest.TestCase): + """GetDeviceJourney200ResponseJourney unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDeviceJourney200ResponseJourney: + """Test GetDeviceJourney200ResponseJourney + 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 `GetDeviceJourney200ResponseJourney` + """ + model = GetDeviceJourney200ResponseJourney() + if include_optional: + return GetDeviceJourney200ResponseJourney( + events = [ + notehub_py.models.event.Event( + app = '', + bars = 1.337, + best_country = '', + best_id = '', + best_lat = 1.337, + best_location = '', + best_location_type = '', + best_location_when = 1.337, + best_lon = 1.337, + best_timezone = '', + body = notehub_py.models.body.body(), + bssid = '', + device = '', + environment = notehub_py.models.environment.environment(), + event = '', + file = '', + moved = 1.337, + note = '', + ordering_code = '', + orientation = '', + payload = '', + product = '', + rat = '', + received = 1.337, + req = '', + rsrp = 1.337, + rsrq = 1.337, + rssi = 1.337, + session = '', + sinr = 1.337, + sku = '', + sn = '', + ssid = '', + temp = 1.337, + tls = True, + tower_country = '', + tower_id = '', + tower_lat = 1.337, + tower_location = '', + tower_lon = 1.337, + tower_timezone = '', + tower_when = 1.337, + transport = '', + tri_country = '', + tri_lat = 1.337, + tri_location = '', + tri_lon = 1.337, + tri_points = 1.337, + tri_timezone = '', + tri_when = 1.337, + updates = 1.337, + voltage = 1.337, + when = 1.337, + where_country = '', + where_lat = 1.337, + where_location = '', + where_lon = 1.337, + where_olc = '', + where_timezone = '', + where_when = 1.337, ) + ], + has_more = True + ) + else: + return GetDeviceJourney200ResponseJourney( + events = [ + notehub_py.models.event.Event( + app = '', + bars = 1.337, + best_country = '', + best_id = '', + best_lat = 1.337, + best_location = '', + best_location_type = '', + best_location_when = 1.337, + best_lon = 1.337, + best_timezone = '', + body = notehub_py.models.body.body(), + bssid = '', + device = '', + environment = notehub_py.models.environment.environment(), + event = '', + file = '', + moved = 1.337, + note = '', + ordering_code = '', + orientation = '', + payload = '', + product = '', + rat = '', + received = 1.337, + req = '', + rsrp = 1.337, + rsrq = 1.337, + rssi = 1.337, + session = '', + sinr = 1.337, + sku = '', + sn = '', + ssid = '', + temp = 1.337, + tls = True, + tower_country = '', + tower_id = '', + tower_lat = 1.337, + tower_location = '', + tower_lon = 1.337, + tower_timezone = '', + tower_when = 1.337, + transport = '', + tri_country = '', + tri_lat = 1.337, + tri_location = '', + tri_lon = 1.337, + tri_points = 1.337, + tri_timezone = '', + tri_when = 1.337, + updates = 1.337, + voltage = 1.337, + when = 1.337, + where_country = '', + where_lat = 1.337, + where_location = '', + where_lon = 1.337, + where_olc = '', + where_timezone = '', + where_when = 1.337, ) + ], + has_more = True, + ) + """ + + def testGetDeviceJourney200ResponseJourney(self): + """Test GetDeviceJourney200ResponseJourney""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_get_device_journeys200_response.py b/src/test/test_get_device_journeys200_response.py new file mode 100644 index 0000000..8e5e29b --- /dev/null +++ b/src/test/test_get_device_journeys200_response.py @@ -0,0 +1,71 @@ +# 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.get_device_journeys200_response import ( + GetDeviceJourneys200Response, +) + + +class TestGetDeviceJourneys200Response(unittest.TestCase): + """GetDeviceJourneys200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDeviceJourneys200Response: + """Test GetDeviceJourneys200Response + 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 `GetDeviceJourneys200Response` + """ + model = GetDeviceJourneys200Response() + if include_optional: + return GetDeviceJourneys200Response( + has_more = True, + journeys = [ + notehub_py.models.get_device_journeys_200_response_journeys_inner.GetDeviceJourneys_200_response_journeys_inner( + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + journey_id = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + total_events = 56, ) + ] + ) + else: + return GetDeviceJourneys200Response( + has_more = True, + journeys = [ + notehub_py.models.get_device_journeys_200_response_journeys_inner.GetDeviceJourneys_200_response_journeys_inner( + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + journey_id = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + total_events = 56, ) + ], + ) + """ + + def testGetDeviceJourneys200Response(self): + """Test GetDeviceJourneys200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_get_device_journeys200_response_journeys_inner.py b/src/test/test_get_device_journeys200_response_journeys_inner.py new file mode 100644 index 0000000..d85d82a --- /dev/null +++ b/src/test/test_get_device_journeys200_response_journeys_inner.py @@ -0,0 +1,65 @@ +# 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.get_device_journeys200_response_journeys_inner import ( + GetDeviceJourneys200ResponseJourneysInner, +) + + +class TestGetDeviceJourneys200ResponseJourneysInner(unittest.TestCase): + """GetDeviceJourneys200ResponseJourneysInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> GetDeviceJourneys200ResponseJourneysInner: + """Test GetDeviceJourneys200ResponseJourneysInner + 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 `GetDeviceJourneys200ResponseJourneysInner` + """ + model = GetDeviceJourneys200ResponseJourneysInner() + if include_optional: + return GetDeviceJourneys200ResponseJourneysInner( + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + journey_id = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + total_events = 56 + ) + else: + return GetDeviceJourneys200ResponseJourneysInner( + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + journey_id = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + total_events = 56, + ) + """ + + def testGetDeviceJourneys200ResponseJourneysInner(self): + """Test GetDeviceJourneys200ResponseJourneysInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_get_project_secrets_response.py b/src/test/test_get_project_secrets_response.py new file mode 100644 index 0000000..d330da9 --- /dev/null +++ b/src/test/test_get_project_secrets_response.py @@ -0,0 +1,69 @@ +# 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.get_project_secrets_response import GetProjectSecretsResponse + + +class TestGetProjectSecretsResponse(unittest.TestCase): + """GetProjectSecretsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetProjectSecretsResponse: + """Test GetProjectSecretsResponse + 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 `GetProjectSecretsResponse` + """ + model = GetProjectSecretsResponse() + if include_optional: + return GetProjectSecretsResponse( + secrets = [ + notehub_py.models.project_secret.ProjectSecret( + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = '', + modified = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + modified_by = '', + name = '', ) + ] + ) + else: + return GetProjectSecretsResponse( + secrets = [ + notehub_py.models.project_secret.ProjectSecret( + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = '', + modified = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + modified_by = '', + name = '', ) + ], + ) + """ + + def testGetProjectSecretsResponse(self): + """Test GetProjectSecretsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_job_definition.py b/src/test/test_job_definition.py new file mode 100644 index 0000000..038faf4 --- /dev/null +++ b/src/test/test_job_definition.py @@ -0,0 +1,125 @@ +# 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.job_definition import JobDefinition + + +class TestJobDefinition(unittest.TestCase): + """JobDefinition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JobDefinition: + """Test JobDefinition + 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 `JobDefinition` + """ + model = JobDefinition() + if include_optional: + return JobDefinition( + comment = '', + default_requests = notehub_py.models.batch_job_requests.BatchJobRequests( + comment = '', + connectivity_assurance_disable = True, + connectivity_assurance_enable = True, + disable = True, + enable = True, + fleets_to_default = [ + '' + ], + fleets_to_join = [ + '' + ], + fleets_to_leave = [ + '' + ], + provision_product = '', + sn_to_default = '', + sn_to_set = '', + vars_to_default = { + 'key' : '' + }, + vars_to_set = { + 'key' : '' + }, ), + device_requests = { + 'key' : notehub_py.models.batch_job_requests.BatchJobRequests( + comment = '', + connectivity_assurance_disable = True, + connectivity_assurance_enable = True, + disable = True, + enable = True, + fleets_to_default = [ + '' + ], + fleets_to_join = [ + '' + ], + fleets_to_leave = [ + '' + ], + provision_product = '', + sn_to_default = '', + sn_to_set = '', + vars_to_default = { + 'key' : '' + }, + vars_to_set = { + 'key' : '' + }, ) + }, + report_options = notehub_py.models.job_definition_report_options.JobDefinition_report_options( + app_fleets = True, + app_info = True, + app_vars = True, + comment = '', + device_activity = True, + device_health = True, + device_info = True, + device_vars = True, ), + select = notehub_py.models.job_definition_select.JobDefinition_select( + all_devices = True, + comment = '', + devices = [ + '' + ], + devices_by_sn = [ + '' + ], + devices_in_fleets = [ + '' + ], ) + ) + else: + return JobDefinition( + ) + """ + + def testJobDefinition(self): + """Test JobDefinition""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_job_definition_report_options.py b/src/test/test_job_definition_report_options.py new file mode 100644 index 0000000..be3de14 --- /dev/null +++ b/src/test/test_job_definition_report_options.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.job_definition_report_options import JobDefinitionReportOptions + + +class TestJobDefinitionReportOptions(unittest.TestCase): + """JobDefinitionReportOptions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JobDefinitionReportOptions: + """Test JobDefinitionReportOptions + 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 `JobDefinitionReportOptions` + """ + model = JobDefinitionReportOptions() + if include_optional: + return JobDefinitionReportOptions( + app_fleets = True, + app_info = True, + app_vars = True, + comment = '', + device_activity = True, + device_health = True, + device_info = True, + device_vars = True + ) + else: + return JobDefinitionReportOptions( + ) + """ + + def testJobDefinitionReportOptions(self): + """Test JobDefinitionReportOptions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_job_definition_select.py b/src/test/test_job_definition_select.py new file mode 100644 index 0000000..a579ecf --- /dev/null +++ b/src/test/test_job_definition_select.py @@ -0,0 +1,64 @@ +# 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.job_definition_select import JobDefinitionSelect + + +class TestJobDefinitionSelect(unittest.TestCase): + """JobDefinitionSelect unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JobDefinitionSelect: + """Test JobDefinitionSelect + 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 `JobDefinitionSelect` + """ + model = JobDefinitionSelect() + if include_optional: + return JobDefinitionSelect( + all_devices = True, + comment = '', + devices = [ + '' + ], + devices_by_sn = [ + '' + ], + devices_in_fleets = [ + '' + ] + ) + else: + return JobDefinitionSelect( + ) + """ + + def testJobDefinitionSelect(self): + """Test JobDefinitionSelect""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_job_detail.py b/src/test/test_job_detail.py new file mode 100644 index 0000000..0e8df56 --- /dev/null +++ b/src/test/test_job_detail.py @@ -0,0 +1,65 @@ +# 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.job_detail import JobDetail + + +class TestJobDetail(unittest.TestCase): + """JobDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JobDetail: + """Test JobDetail + 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 `JobDetail` + """ + model = JobDetail() + if include_optional: + return JobDetail( + created = 56, + created_by = '', + job_uid = '', + last_run_completed = 1775252922, + last_run_status = 'dry run completed successfully', + last_run_submitted = 1775252900, + name = '', + definition = {"comment":"Set environment variables on all devices in a fleet","default_requests":{"vars_to_set":{"firmware_channel":"production","log_level":"1"}},"select":{"devices_in_fleets":["fleet:00000000-0000-0000-0000-000000000000"]}} + ) + else: + return JobDetail( + created = 56, + created_by = '', + job_uid = '', + name = '', + ) + """ + + def testJobDetail(self): + """Test JobDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_project_secret.py b/src/test/test_project_secret.py new file mode 100644 index 0000000..f26163b --- /dev/null +++ b/src/test/test_project_secret.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.project_secret import ProjectSecret + + +class TestProjectSecret(unittest.TestCase): + """ProjectSecret unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectSecret: + """Test ProjectSecret + 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 `ProjectSecret` + """ + model = ProjectSecret() + if include_optional: + return ProjectSecret( + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = '', + modified = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + modified_by = '', + name = '' + ) + else: + return ProjectSecret( + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = '', + name = '', + ) + """ + + def testProjectSecret(self): + """Test ProjectSecret""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_repository_list_response.py b/src/test/test_repository_list_response.py new file mode 100644 index 0000000..3a9acc3 --- /dev/null +++ b/src/test/test_repository_list_response.py @@ -0,0 +1,75 @@ +# 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.repository_list_response import RepositoryListResponse + + +class TestRepositoryListResponse(unittest.TestCase): + """RepositoryListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RepositoryListResponse: + """Test RepositoryListResponse + 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 `RepositoryListResponse` + """ + model = RepositoryListResponse() + if include_optional: + return RepositoryListResponse( + repositories = [ + notehub_py.models.repository.Repository( + fleet_uids = [ + '' + ], + name = '', + project_uids = [ + '' + ], + uid = '', ) + ] + ) + else: + return RepositoryListResponse( + repositories = [ + notehub_py.models.repository.Repository( + fleet_uids = [ + '' + ], + name = '', + project_uids = [ + '' + ], + uid = '', ) + ], + ) + """ + + def testRepositoryListResponse(self): + """Test RepositoryListResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_repository_token_request.py b/src/test/test_repository_token_request.py new file mode 100644 index 0000000..81a72e4 --- /dev/null +++ b/src/test/test_repository_token_request.py @@ -0,0 +1,55 @@ +# 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.repository_token_request import RepositoryTokenRequest + + +class TestRepositoryTokenRequest(unittest.TestCase): + """RepositoryTokenRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RepositoryTokenRequest: + """Test RepositoryTokenRequest + 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 `RepositoryTokenRequest` + """ + model = RepositoryTokenRequest() + if include_optional: + return RepositoryTokenRequest( + intent = 'read', + ttl_seconds = 60 + ) + else: + return RepositoryTokenRequest( + ) + """ + + def testRepositoryTokenRequest(self): + """Test RepositoryTokenRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_repository_token_response.py b/src/test/test_repository_token_response.py new file mode 100644 index 0000000..5dad89a --- /dev/null +++ b/src/test/test_repository_token_response.py @@ -0,0 +1,65 @@ +# 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.repository_token_response import RepositoryTokenResponse + + +class TestRepositoryTokenResponse(unittest.TestCase): + """RepositoryTokenResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RepositoryTokenResponse: + """Test RepositoryTokenResponse + 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 `RepositoryTokenResponse` + """ + model = RepositoryTokenResponse() + if include_optional: + return RepositoryTokenResponse( + database = '', + expires_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + host = '', + password = '', + port = 56, + username = '' + ) + else: + return RepositoryTokenResponse( + database = '', + expires_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + host = '', + password = '', + port = 56, + username = '', + ) + """ + + def testRepositoryTokenResponse(self): + """Test RepositoryTokenResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_update_project_secret_request.py b/src/test/test_update_project_secret_request.py new file mode 100644 index 0000000..80bf2d6 --- /dev/null +++ b/src/test/test_update_project_secret_request.py @@ -0,0 +1,55 @@ +# 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.update_project_secret_request import UpdateProjectSecretRequest + + +class TestUpdateProjectSecretRequest(unittest.TestCase): + """UpdateProjectSecretRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateProjectSecretRequest: + """Test UpdateProjectSecretRequest + 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 `UpdateProjectSecretRequest` + """ + model = UpdateProjectSecretRequest() + if include_optional: + return UpdateProjectSecretRequest( + value = '' + ) + else: + return UpdateProjectSecretRequest( + value = '', + ) + """ + + def testUpdateProjectSecretRequest(self): + """Test UpdateProjectSecretRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main()