diff --git a/config.json b/config.json index ffa5658..5cf8783 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.0.2" + "packageVersion": "6.1.0" } diff --git a/openapi.yaml b/openapi.yaml index ae220c1..2f796c0 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3,14 +3,14 @@ info: contact: email: engineering@blues.io name: Blues Engineering - url: "https://dev.blues.io/support/" + url: 'https://dev.blues.io/support/' description: | The OpenAPI definition for the Notehub.io API. title: Notehub API version: 1.2.0 servers: - description: Production server - url: "https://api.notefile.net" + url: 'https://api.notefile.net' paths: /auth/login: post: @@ -31,7 +31,7 @@ paths: username: type: string responses: - "200": + '200': description: Successful operation content: application/json: @@ -40,9 +40,9 @@ paths: properties: session_token: type: string - "400": + '400': description: Bad Request - "500": + '500': description: Internal Server Error tags: - authorization @@ -81,7 +81,7 @@ paths: - client_id - client_secret responses: - "200": + '200': description: Successful token response content: application/json: @@ -91,17 +91,17 @@ paths: scope: openid token_type: bearer schema: - $ref: "#/components/schemas/OAuth2TokenResponse" - "400": + $ref: '#/components/schemas/OAuth2TokenResponse' + '400': description: Invalid request (missing or malformed parameters) content: application/json: example: error: invalid_request - error_description: "Missing parameter: client_id" + error_description: 'Missing parameter: client_id' schema: - $ref: "#/components/schemas/OAuth2Error" - "401": + $ref: '#/components/schemas/OAuth2Error' + '401': description: Invalid client authentication content: application/json: @@ -109,8 +109,8 @@ paths: error: invalid_client error_description: Client authentication failed schema: - $ref: "#/components/schemas/OAuth2Error" - "403": + $ref: '#/components/schemas/OAuth2Error' + '403': description: Unauthorized scope content: application/json: @@ -118,7 +118,7 @@ paths: error: invalid_scope error_description: Requested scope is invalid schema: - $ref: "#/components/schemas/OAuth2Error" + $ref: '#/components/schemas/OAuth2Error' tags: - authorization /v1/billing-accounts: @@ -126,7 +126,7 @@ paths: operationId: GetBillingAccounts description: Get Billing Accounts accessible by the api_key responses: - "200": + '200': description: Successful operation content: application/json: @@ -136,28 +136,116 @@ paths: billing_accounts: type: array items: - $ref: "#/components/schemas/BillingAccount" + $ref: '#/components/schemas/BillingAccount' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - billing_account - "/v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin": + '/v1/billing-accounts/{billingAccountUID}': + get: + operationId: GetBillingAccount + description: Get Billing Account Information + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + name: + type: string + owner: + type: string + plan: + type: object + properties: + current_balance: + type: integer + format: int64 + end_date: + type: string + format: date-time + event_capacity: + type: integer + format: int64 + start_date: + type: string + format: date-time + type: + type: string + enum: + - Enterprise + - Essentials + suspended: + type: boolean + uid: + type: string + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account + '/v1/billing-accounts/{billingAccountUID}/balance-history': + get: + operationId: GetBillingAccountBalanceHistory + description: 'Get Billing Account Balance history, only enterprise supported' + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + properties: + period: + type: string + format: date-time + remaining_event_capacity: + type: integer + format: int64 + total_event_capacity_used: + type: integer + format: int64 + required: + - remaining_event_capacity + - total_event_capacity_used + - period + type: object + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account + '/v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin': get: operationId: GetDeviceEnvironmentVariablesByPin description: Get environment variables of a device with device pin authorization responses: - "200": - $ref: "#/components/responses/GetDeviceEnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' tags: - device parameters: - - $ref: "#/components/parameters/productUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/XAuthTokenHeader" + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/XAuthTokenHeader' put: operationId: SetDeviceEnvironmentVariablesByPin description: Set environment variables of a device with device pin authorization @@ -167,84 +255,84 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EnvironmentVariables" + $ref: '#/components/schemas/EnvironmentVariables' responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' tags: - device - "/v1/products/{productUID}/ext-devices/{deviceUID}/event": + '/v1/products/{productUID}/ext-devices/{deviceUID}/event': post: operationId: CreateEventExtDevice description: Creates an event using specified webhook parameters: - - $ref: "#/components/parameters/productUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Event Object required: true content: application/json: schema: - $ref: "#/components/schemas/Event" + $ref: '#/components/schemas/Event' responses: - "200": + '200': description: Event Created Successfully default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - external devices - "/v1/products/{productUID}/ext-devices/{deviceUID}/session/close": + '/v1/products/{productUID}/ext-devices/{deviceUID}/session/close': post: operationId: ExtDeviceSessionClose description: Closes the session for the specified device if open parameters: - - $ref: "#/components/parameters/productUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Session Object required: true content: application/json: schema: - $ref: "#/components/schemas/DeviceSession" + $ref: '#/components/schemas/DeviceSession' responses: - "200": + '200': description: Session closed default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - external devices - "/v1/products/{productUID}/ext-devices/{deviceUID}/session/open": + '/v1/products/{productUID}/ext-devices/{deviceUID}/session/open': post: operationId: ExtDeviceSessionOpen description: Create a Session for the specified device. | If a session is currently open it will be closed and a new one opened. parameters: - - $ref: "#/components/parameters/productUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/productUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Session Object required: true content: application/json: schema: - $ref: "#/components/schemas/DeviceSession" + $ref: '#/components/schemas/DeviceSession' responses: - "200": + '200': description: Session Created Successfully default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - external devices - "/v1/products/{productUID}/project": + '/v1/products/{productUID}/project': get: operationId: GetProjectByProduct description: Get a Project by ProductUID @@ -256,14 +344,14 @@ paths: type: string example: com.blues.airnote responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: '#/components/schemas/Project' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -273,7 +361,7 @@ paths: operationId: GetProjects description: Get Projects accessible by the api_key responses: - "200": + '200': description: Successful operation content: application/json: @@ -283,9 +371,9 @@ paths: projects: type: array items: - $ref: "#/components/schemas/Project" + $ref: '#/components/schemas/Project' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -312,29 +400,29 @@ paths: - label - billing_account_uid responses: - "201": + '201': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: '#/components/schemas/Project' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}": + '/v1/projects/{projectOrProductUID}': delete: operationId: DeleteProject description: Delete a Project by ProjectUID parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -343,44 +431,66 @@ paths: operationId: GetProject description: Get a Project by ProjectUID parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: '#/components/schemas/Project' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/alerts": + '/v1/projects/{projectOrProductUID}/alerts': get: operationId: GetAlerts description: Get list of defined Alerts parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/monitorUIDQueryParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/monitorUIDQueryParam' responses: - "200": - $ref: "#/components/responses/AlertsResponse" + '200': + $ref: '#/components/responses/AlertsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - alert - "/v1/projects/{projectOrProductUID}/clone": + '/v1/projects/{projectOrProductUID}/aws-role-config': + get: + operationId: GetAWSRoleConfig + summary: Get AWS role configuration for role-based authentication + description: | + Returns the AWS Account ID and External ID needed to configure an IAM role + trust policy for role-based authentication on AWS routes. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + '200': + description: AWS role configuration + content: + application/json: + schema: + $ref: '#/components/schemas/AWSRoleConfig' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project + '/v1/projects/{projectOrProductUID}/clone': post: operationId: CloneProject description: Clone a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' requestBody: description: Project to be cloned required: true @@ -390,7 +500,7 @@ paths: type: object properties: billing_account_uid: - description: "The billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned." + description: 'The billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned.' type: string disable_clone_fleets: description: Whether to disallow the cloning of the fleets from the parent project. Default is false if not specified. @@ -405,53 +515,53 @@ paths: - label - billing_account_uid responses: - "201": + '201': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: '#/components/schemas/Project' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/devices": + '/v1/projects/{projectOrProductUID}/devices': get: operationId: GetDevices description: Get Devices of a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/tagParam" - - $ref: "#/components/parameters/serialNumberParam" - - $ref: "#/components/parameters/fleetUIDsQueryParam" - - $ref: "#/components/parameters/notecardFirmwareParam" - - $ref: "#/components/parameters/locationParam" - - $ref: "#/components/parameters/hostFirmwareParam" - - $ref: "#/components/parameters/productUIDQueryParam" - - $ref: "#/components/parameters/skuParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/tagParam' + - $ref: '#/components/parameters/serialNumberParam' + - $ref: '#/components/parameters/fleetUIDsQueryParam' + - $ref: '#/components/parameters/notecardFirmwareParam' + - $ref: '#/components/parameters/locationParam' + - $ref: '#/components/parameters/hostFirmwareParam' + - $ref: '#/components/parameters/productUIDQueryParam' + - $ref: '#/components/parameters/skuParam' responses: - "200": - $ref: "#/components/responses/DevicesResponse" + '200': + $ref: '#/components/responses/DevicesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}': delete: operationId: DeleteDevice description: Delete Device responses: - "204": + '204': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -460,133 +570,133 @@ paths: operationId: GetDevice description: Get Device responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Device" + $ref: '#/components/schemas/Device' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history": + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history': get: operationId: GetDeviceDfuHistory description: Get device DFU history for host or Notecard firmware parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' responses: - "200": + '200': description: Success content: application/json: schema: - $ref: "#/components/schemas/DeviceDfuHistory" + $ref: '#/components/schemas/DeviceDfuHistory' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status': get: operationId: GetDeviceDfuStatus description: Get device DFU history for host or Notecard firmware parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' responses: - "200": + '200': description: Success content: application/json: schema: - $ref: "#/components/schemas/DeviceDfuStatus" + $ref: '#/components/schemas/DeviceDfuStatus' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable': post: operationId: DisableDevice description: Disable Device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' responses: - "200": + '200': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable': post: operationId: EnableDevice description: Enable Device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' responses: - "200": + '200': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy': get: operationId: GetDeviceEnvironmentHierarchy summary: Get environment variable hierarchy for a device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' responses: - "200": + '200': description: Successfully retrieved device environment hierarchy content: application/json: schema: - $ref: "#/components/schemas/EnvTreeJsonNode" - "404": + $ref: '#/components/schemas/EnvTreeJsonNode' + '404': description: Project or device not found - "500": + '500': description: Server error security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables': get: operationId: GetDeviceEnvironmentVariables description: Get environment variables of a device responses: - "200": - $ref: "#/components/responses/GetDeviceEnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' put: operationId: SetDeviceEnvironmentVariables description: Set environment variables of a device @@ -596,23 +706,23 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EnvironmentVariables" + $ref: '#/components/schemas/EnvironmentVariables' responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key}": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key}': delete: operationId: DeleteDeviceEnvironmentVariable description: Delete environment variable of a device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' - name: key in: path description: The environment variable key to delete. @@ -620,21 +730,21 @@ paths: schema: type: string responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/files": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/files': delete: operationId: DeleteNotefiles description: Deletes Notefiles and the Notes they contain. parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' requestBody: required: true content: @@ -648,10 +758,10 @@ paths: items: type: string responses: - "200": + '200': description: An empty object means success default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -660,8 +770,8 @@ paths: operationId: ListNotefiles description: Lists .qi and .db files for the device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' - name: files in: query description: One or more files to obtain change information from. @@ -677,19 +787,19 @@ paths: schema: type: boolean responses: - "200": + '200': description: All notefiles and their notes content: application/json: schema: - $ref: "#/components/schemas/NotefileList" + $ref: '#/components/schemas/NotefileList' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets': delete: operationId: DeleteDeviceFromFleets description: Remove Device from Fleets @@ -710,10 +820,10 @@ paths: required: - fleet_uids responses: - "200": - $ref: "#/components/responses/FleetsResponse" + '200': + $ref: '#/components/responses/FleetsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -722,17 +832,17 @@ paths: operationId: GetDeviceFleets description: Get Device Fleets responses: - "200": - $ref: "#/components/responses/FleetsResponse" + '200': + $ref: '#/components/responses/FleetsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' put: operationId: AddDeviceToFleets description: Add Device to Fleets @@ -753,23 +863,23 @@ paths: required: - fleet_uids responses: - "200": - $ref: "#/components/responses/FleetsResponse" + '200': + $ref: '#/components/responses/FleetsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log': get: operationId: GetDeviceHealthLog description: Get Device Health Log parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' - name: log_type in: query description: Return only specified log types @@ -782,7 +892,7 @@ paths: - dfu_completed type: string responses: - "200": + '200': description: Successful operation content: application/json: @@ -808,35 +918,52 @@ paths: required: - health_log default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest': get: operationId: GetDeviceLatestEvents description: Get Device Latest Events parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' responses: - "200": - $ref: "#/components/responses/LatestResponse" + '200': + $ref: '#/components/responses/LatestResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}': + post: + operationId: CreateNotefile + description: Creates an empty Notefile on the device. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + responses: + '200': + description: An empty object means success + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}': get: operationId: GetNotefile - description: "For .qi files, returns the queued up notes. For .db files, returns all notes in the notefile" + description: 'For .qi files, returns the queued up notes. For .db files, returns all notes in the notefile' parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/notefileIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' - name: max in: query description: The maximum number of Notes to return in the request. @@ -856,7 +983,7 @@ paths: schema: type: boolean responses: - "200": + '200': description: The note changes object content: application/json: @@ -873,48 +1000,48 @@ paths: description: The total number of notes. type: integer default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device post: operationId: AddQiNote - description: "Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist." + description: 'Adds a Note to a Notefile, creating the Notefile if it doesn''t yet exist.' parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/notefileIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' requestBody: description: Body or payload of note to be added to the device required: true content: application/json: schema: - $ref: "#/components/schemas/NoteInput" + $ref: '#/components/schemas/NoteInput' responses: - "200": + '200': description: An empty object means success default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}': delete: operationId: DeleteNote description: Delete a note from a .db or .qi notefile parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/notefileIDParam" - - $ref: "#/components/parameters/noteIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + - $ref: '#/components/parameters/noteIDParam' responses: - "200": + '200': description: An empty object means success default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -923,10 +1050,10 @@ paths: operationId: GetDbNote description: Get a note from a .db or .qi notefile parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/notefileIDParam" - - $ref: "#/components/parameters/noteIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + - $ref: '#/components/parameters/noteIDParam' - name: delete in: query description: Whether to delete the note from the DB notefile @@ -940,7 +1067,7 @@ paths: schema: type: boolean responses: - "200": + '200': description: The requested note content: application/json: @@ -957,7 +1084,7 @@ paths: description: The time the Note was added to the Notecard or Notehub type: integer default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -966,22 +1093,22 @@ paths: operationId: AddDbNote description: Add a Note to a .db notefile. if noteID is '-' then payload is ignored and empty notefile is created parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/notefileIDParam" - - $ref: "#/components/parameters/noteIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + - $ref: '#/components/parameters/noteIDParam' requestBody: description: Body or payload of note to be added to the device required: true content: application/json: schema: - $ref: "#/components/schemas/NoteInput" + $ref: '#/components/schemas/NoteInput' responses: - "200": + '200': description: An empty object means success default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -990,49 +1117,49 @@ paths: operationId: UpdateDbNote description: Update a note in a .db or .qi notefile parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/notefileIDParam" - - $ref: "#/components/parameters/noteIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + - $ref: '#/components/parameters/noteIDParam' requestBody: description: Body or payload of note to be added to the device required: true content: application/json: schema: - $ref: "#/components/schemas/NoteInput" + $ref: '#/components/schemas/NoteInput' responses: - "200": + '200': description: An empty object means success default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans': get: operationId: GetDevicePlans - description: "Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections." + description: 'Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections.' responses: - "200": - $ref: "#/components/responses/DevicePlansResponse" + '200': + $ref: '#/components/responses/DevicePlansResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision": + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision': post: operationId: ProvisionDevice description: Provision Device for a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Provision a device to a specific ProductUID required: true @@ -1056,7 +1183,7 @@ paths: required: - product_uid responses: - "200": + '200': description: Successful operation content: application/json: @@ -1064,20 +1191,20 @@ paths: type: object default: {} default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key': get: operationId: GetDevicePublicKey description: Get Device Public Key parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: @@ -1092,47 +1219,48 @@ paths: - uid - key default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions': get: operationId: GetDeviceSessions description: Get Device Sessions parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/firstSyncParam' responses: - "200": - $ref: "#/components/responses/SessionResponse" + '200': + $ref: '#/components/responses/SessionResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal": + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal': post: operationId: SignalDevice description: Send a signal from Notehub to a Notecard. parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/deviceUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Body or payload of signal to be sent to the device required: true content: application/json: schema: - $ref: "#/components/schemas/Body" + $ref: '#/components/schemas/Body' responses: - "200": + '200': description: A status response. content: application/json: @@ -1143,21 +1271,21 @@ paths: description: true if the Notecard is connected to Notehub. type: boolean default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/devices/public-keys": + '/v1/projects/{projectOrProductUID}/devices/public-keys': get: operationId: GetDevicePublicKeys description: Get Device Public Keys of a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' responses: - "200": + '200': description: Successful operation content: application/json: @@ -1179,146 +1307,146 @@ paths: - device_public_keys - has_more default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action}": + '/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action}': post: operationId: PerformDfuAction description: Update/cancel host or notecard firmware updates parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" - - $ref: "#/components/parameters/dfuActionParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/tagParam" - - $ref: "#/components/parameters/serialNumberParam" - - $ref: "#/components/parameters/fleetUIDQueryParam" - - $ref: "#/components/parameters/notecardFirmwareParam" - - $ref: "#/components/parameters/locationParam" - - $ref: "#/components/parameters/hostFirmwareParam" - - $ref: "#/components/parameters/productUIDQueryParam" - - $ref: "#/components/parameters/skuParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' + - $ref: '#/components/parameters/dfuActionParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/tagParam' + - $ref: '#/components/parameters/serialNumberParam' + - $ref: '#/components/parameters/fleetUIDQueryParam' + - $ref: '#/components/parameters/notecardFirmwareParam' + - $ref: '#/components/parameters/locationParam' + - $ref: '#/components/parameters/hostFirmwareParam' + - $ref: '#/components/parameters/productUIDQueryParam' + - $ref: '#/components/parameters/skuParam' requestBody: description: Which firmware in the case of an update action required: false content: application/json: schema: - $ref: "#/components/schemas/DfuActionRequest" + $ref: '#/components/schemas/DfuActionRequest' responses: - "200": + '200': description: Success default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history": + '/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history': get: operationId: GetDevicesDfuHistory description: Get host or Notecard DFU history for all devices that match the filter criteria parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/sortByParam" - - $ref: "#/components/parameters/sortOrderParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/tagParam" - - $ref: "#/components/parameters/serialNumberParam" - - $ref: "#/components/parameters/fleetUIDQueryParam" - - $ref: "#/components/parameters/notecardFirmwareParam" - - $ref: "#/components/parameters/locationParam" - - $ref: "#/components/parameters/hostFirmwareParam" - - $ref: "#/components/parameters/productUIDQueryParam" - - $ref: "#/components/parameters/skuParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/sortByParam' + - $ref: '#/components/parameters/sortOrderParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/tagParam' + - $ref: '#/components/parameters/serialNumberParam' + - $ref: '#/components/parameters/fleetUIDQueryParam' + - $ref: '#/components/parameters/notecardFirmwareParam' + - $ref: '#/components/parameters/locationParam' + - $ref: '#/components/parameters/hostFirmwareParam' + - $ref: '#/components/parameters/productUIDQueryParam' + - $ref: '#/components/parameters/skuParam' responses: - "200": + '200': description: Success content: application/json: schema: - $ref: "#/components/schemas/DeviceDfuHistoryPage" + $ref: '#/components/schemas/DeviceDfuHistoryPage' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status": + '/v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status': get: operationId: GetDevicesDfuStatus description: Get host or Notecard DFU history for all devices that match the filter criteria parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/sortByParam" - - $ref: "#/components/parameters/sortOrderParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/tagParam" - - $ref: "#/components/parameters/serialNumberParam" - - $ref: "#/components/parameters/fleetUIDQueryParam" - - $ref: "#/components/parameters/notecardFirmwareParam" - - $ref: "#/components/parameters/locationParam" - - $ref: "#/components/parameters/hostFirmwareParam" - - $ref: "#/components/parameters/productUIDQueryParam" - - $ref: "#/components/parameters/skuParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/sortByParam' + - $ref: '#/components/parameters/sortOrderParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/tagParam' + - $ref: '#/components/parameters/serialNumberParam' + - $ref: '#/components/parameters/fleetUIDQueryParam' + - $ref: '#/components/parameters/notecardFirmwareParam' + - $ref: '#/components/parameters/locationParam' + - $ref: '#/components/parameters/hostFirmwareParam' + - $ref: '#/components/parameters/productUIDQueryParam' + - $ref: '#/components/parameters/skuParam' responses: - "200": + '200': description: Success content: application/json: schema: - $ref: "#/components/schemas/DeviceDfuStatusPage" + $ref: '#/components/schemas/DeviceDfuStatusPage' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/environment_hierarchy": + '/v1/projects/{projectOrProductUID}/environment_hierarchy': get: operationId: GetProjectEnvironmentHierarchy summary: Get environment variable hierarchy for a device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Successfully retrieved project environment hierarchy content: application/json: schema: - $ref: "#/components/schemas/EnvTreeJsonNode" - "404": + $ref: '#/components/schemas/EnvTreeJsonNode' + '404': description: Project or device not found - "500": + '500': description: Server error security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/environment_variables": + '/v1/projects/{projectOrProductUID}/environment_variables': get: operationId: GetProjectEnvironmentVariables description: Get environment variables of a project responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' put: operationId: SetProjectEnvironmentVariables description: Set environment variables of a project @@ -1326,22 +1454,22 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EnvironmentVariables" + $ref: '#/components/schemas/EnvironmentVariables' responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/environment_variables/{key}": + '/v1/projects/{projectOrProductUID}/environment_variables/{key}': delete: operationId: DeleteProjectEnvironmentVariable description: Delete an environment variable of a project by key parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' - name: key in: path description: The environment variable key to delete. @@ -1349,36 +1477,36 @@ paths: schema: type: string responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/events": + '/v1/projects/{projectOrProductUID}/events': get: operationId: GetEvents description: Get Events of a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/sortByParam" - - $ref: "#/components/parameters/sortOrderParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/dateTypeParam" - - $ref: "#/components/parameters/systemFilesOnlyParam" - - $ref: "#/components/parameters/filesQueryParam" - - $ref: "#/components/parameters/formatParam" - - $ref: "#/components/parameters/serialNumberFilterParam" - - $ref: "#/components/parameters/fleetUIDFilterQueryParam" - - $ref: "#/components/parameters/sessionUIDFilterParam" - - $ref: "#/components/parameters/eventUIDFilterQueryParam" - - $ref: "#/components/parameters/selectFieldsParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/sortByParam' + - $ref: '#/components/parameters/sortOrderParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/dateTypeParam' + - $ref: '#/components/parameters/systemFilesOnlyParam' + - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/formatParam' + - $ref: '#/components/parameters/serialNumberFilterParam' + - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/sessionUIDFilterParam' + - $ref: '#/components/parameters/eventUIDFilterQueryParam' + - $ref: '#/components/parameters/selectFieldsParam' - name: deviceUIDs in: query description: Deprecated. @@ -1396,102 +1524,102 @@ paths: type: string deprecated: true responses: - "200": - $ref: "#/components/responses/EventsResponse" + '200': + $ref: '#/components/responses/EventsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - event - "/v1/projects/{projectOrProductUID}/events-cursor": + '/v1/projects/{projectOrProductUID}/events-cursor': get: operationId: GetEventsByCursor description: Get Events of a Project by cursor parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/limitParam" - - $ref: "#/components/parameters/cursorParam" - - $ref: "#/components/parameters/sortOrderParam" - - $ref: "#/components/parameters/systemFilesOnlyParam" - - $ref: "#/components/parameters/filesQueryParam" - - $ref: "#/components/parameters/fleetUIDQueryParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/limitParam' + - $ref: '#/components/parameters/cursorParam' + - $ref: '#/components/parameters/sortOrderParam' + - $ref: '#/components/parameters/systemFilesOnlyParam' + - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/fleetUIDQueryParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' responses: - "200": - $ref: "#/components/responses/EventsByCursorResponse" + '200': + $ref: '#/components/responses/EventsByCursorResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - event - "/v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs": + '/v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs': get: operationId: GetRouteLogsByEvent description: Get Route Logs by Event UID parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/eventUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/eventUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: schema: type: array items: - $ref: "#/components/schemas/RouteLog" + $ref: '#/components/schemas/RouteLog' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - event - "/v1/projects/{projectOrProductUID}/firmware": + '/v1/projects/{projectOrProductUID}/firmware': get: operationId: GetFirmwareInfo description: Get Available Firmware Information parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/productQueryParam" - - $ref: "#/components/parameters/firmwareTypeQueryParam" - - $ref: "#/components/parameters/versionQueryParam" - - $ref: "#/components/parameters/targetQueryParam" - - $ref: "#/components/parameters/filenameQueryParam" - - $ref: "#/components/parameters/md5QueryParam" - - $ref: "#/components/parameters/unpublishedQueryParam" - - $ref: "#/components/parameters/firmwareSortByParam" - - $ref: "#/components/parameters/firmwareSortOrderParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/productQueryParam' + - $ref: '#/components/parameters/firmwareTypeQueryParam' + - $ref: '#/components/parameters/versionQueryParam' + - $ref: '#/components/parameters/targetQueryParam' + - $ref: '#/components/parameters/filenameQueryParam' + - $ref: '#/components/parameters/md5QueryParam' + - $ref: '#/components/parameters/unpublishedQueryParam' + - $ref: '#/components/parameters/firmwareSortByParam' + - $ref: '#/components/parameters/firmwareSortOrderParam' responses: - "200": + '200': description: Success content: application/json: schema: type: array items: - $ref: "#/components/schemas/FirmwareInfo" + $ref: '#/components/schemas/FirmwareInfo' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}": + '/v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}': get: operationId: DownloadFirmware description: Download firmware binary parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' - name: filename in: path required: true schema: type: string responses: - "200": + '200': description: Firmware binary content: application/octet-stream: @@ -1499,7 +1627,7 @@ paths: type: string format: binary default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -1508,8 +1636,8 @@ paths: operationId: UploadFirmware description: Upload firmware binary parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/firmwareTypeParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' - name: filename in: path required: true @@ -1517,7 +1645,7 @@ paths: type: string - name: version in: query - description: "Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty" + description: 'Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty' required: false schema: type: string @@ -1536,33 +1664,33 @@ paths: type: string format: binary responses: - "200": + '200': description: Upload successful content: application/json: schema: - $ref: "#/components/schemas/FirmwareInfo" + $ref: '#/components/schemas/FirmwareInfo' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/fleets": + '/v1/projects/{projectOrProductUID}/fleets': get: operationId: GetFleets description: Get Project Fleets responses: - "200": - $ref: "#/components/responses/FleetsResponse" + '200': + $ref: '#/components/responses/FleetsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' post: operationId: CreateFleet description: Create Fleet @@ -1575,36 +1703,36 @@ paths: type: object properties: connectivity_assurance: - $ref: "#/components/schemas/FleetConnectivityAssurance" + $ref: '#/components/schemas/FleetConnectivityAssurance' label: - description: "The label, or name, for the Fleet." + description: 'The label, or name, for the Fleet.' type: string smart_rule: - $ref: "#/components/schemas/FleetRule" + $ref: '#/components/schemas/FleetRule' smart_rule_enabled: type: boolean responses: - "201": + '201': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Fleet" + $ref: '#/components/schemas/Fleet' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}': delete: operationId: DeleteFleet description: Delete Fleet responses: - "204": + '204': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -1613,19 +1741,19 @@ paths: operationId: GetFleet description: Get Fleet responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Fleet" + $ref: '#/components/schemas/Fleet' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' put: operationId: UpdateFleet description: Update Fleet @@ -1643,7 +1771,7 @@ paths: items: type: string connectivity_assurance: - $ref: "#/components/schemas/FleetConnectivityAssurance" + $ref: '#/components/schemas/FleetConnectivityAssurance' label: description: The label for the Fleet. type: string @@ -1653,7 +1781,7 @@ paths: items: type: string smart_rule: - $ref: "#/components/schemas/FleetRule" + $ref: '#/components/schemas/FleetRule' smart_rule_enabled: type: boolean watchdog_mins: @@ -1661,82 +1789,82 @@ paths: type: integer format: int64 responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Fleet" + $ref: '#/components/schemas/Fleet' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices': get: operationId: GetFleetDevices description: Get Devices of a Fleet within a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/tagParam" - - $ref: "#/components/parameters/serialNumberParam" - - $ref: "#/components/parameters/notecardFirmwareParam" - - $ref: "#/components/parameters/locationParam" - - $ref: "#/components/parameters/hostFirmwareParam" - - $ref: "#/components/parameters/productUIDQueryParam" - - $ref: "#/components/parameters/skuParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/tagParam' + - $ref: '#/components/parameters/serialNumberParam' + - $ref: '#/components/parameters/notecardFirmwareParam' + - $ref: '#/components/parameters/locationParam' + - $ref: '#/components/parameters/hostFirmwareParam' + - $ref: '#/components/parameters/productUIDQueryParam' + - $ref: '#/components/parameters/skuParam' responses: - "200": - $ref: "#/components/responses/DevicesResponse" + '200': + $ref: '#/components/responses/DevicesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy': get: operationId: GetFleetEnvironmentHierarchy summary: Get environment variable hierarchy for a device parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' responses: - "200": + '200': description: Successfully retrieved fleet environment hierarchy content: application/json: schema: - $ref: "#/components/schemas/EnvTreeJsonNode" - "404": + $ref: '#/components/schemas/EnvTreeJsonNode' + '404': description: Project or device not found - "500": + '500': description: Server error security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables': get: operationId: GetFleetEnvironmentVariables description: Get environment variables of a fleet responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' put: operationId: SetFleetEnvironmentVariables description: Set environment variables of a fleet @@ -1746,23 +1874,23 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EnvironmentVariables" + $ref: '#/components/schemas/EnvironmentVariables' responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables/{key}": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables/{key}': delete: operationId: DeleteFleetEnvironmentVariable description: Delete environment variables of a fleet parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' - name: key in: path description: The environment variable key to delete. @@ -1770,36 +1898,36 @@ paths: schema: type: string responses: - "200": - $ref: "#/components/responses/EnvironmentVariablesResponse" + '200': + $ref: '#/components/responses/EnvironmentVariablesResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events': get: operationId: GetFleetEvents description: Get Events of a Fleet parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/sortByParam" - - $ref: "#/components/parameters/sortOrderParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/dateTypeParam" - - $ref: "#/components/parameters/systemFilesOnlyParam" - - $ref: "#/components/parameters/filesQueryParam" - - $ref: "#/components/parameters/formatParam" - - $ref: "#/components/parameters/serialNumberFilterParam" - - $ref: "#/components/parameters/sessionUIDFilterParam" - - $ref: "#/components/parameters/eventUIDFilterQueryParam" - - $ref: "#/components/parameters/selectFieldsParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/sortByParam' + - $ref: '#/components/parameters/sortOrderParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/dateTypeParam' + - $ref: '#/components/parameters/systemFilesOnlyParam' + - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/formatParam' + - $ref: '#/components/parameters/serialNumberFilterParam' + - $ref: '#/components/parameters/sessionUIDFilterParam' + - $ref: '#/components/parameters/eventUIDFilterQueryParam' + - $ref: '#/components/parameters/selectFieldsParam' - name: deviceUIDs in: query description: Deprecated. @@ -1817,96 +1945,268 @@ paths: type: string deprecated: true responses: - "200": - $ref: "#/components/responses/EventsResponse" + '200': + $ref: '#/components/responses/EventsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - event - "/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor": + '/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor': get: operationId: GetFleetEventsByCursor description: Get Events of a Fleet by cursor parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/fleetUIDParam" - - $ref: "#/components/parameters/limitParam" - - $ref: "#/components/parameters/cursorParam" - - $ref: "#/components/parameters/sortOrderParam" - - $ref: "#/components/parameters/systemFilesOnlyParam" - - $ref: "#/components/parameters/filesQueryParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/fleetUIDParam' + - $ref: '#/components/parameters/limitParam' + - $ref: '#/components/parameters/cursorParam' + - $ref: '#/components/parameters/sortOrderParam' + - $ref: '#/components/parameters/systemFilesOnlyParam' + - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' responses: - "200": - $ref: "#/components/responses/EventsByCursorResponse" + '200': + $ref: '#/components/responses/EventsByCursorResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - event - "/v1/projects/{projectOrProductUID}/global-transformation": + '/v1/projects/{projectOrProductUID}/global-transformation': post: operationId: SetGlobalEventTransformation description: Set the project-level event JSONata transformation parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' requestBody: description: JSONata expression which will be applied to each event before it is persisted and routed required: true content: application/json: schema: - $ref: "#/components/schemas/JSONata" + $ref: '#/components/schemas/JSONata' responses: - "200": + '200': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/global-transformation/disable": + '/v1/projects/{projectOrProductUID}/global-transformation/disable': post: operationId: DisableGlobalEventTransformation description: Disable the project-level event JSONata transformation parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/global-transformation/enable": + '/v1/projects/{projectOrProductUID}/global-transformation/enable': post: operationId: EnableGlobalEventTransformation description: Enable the project-level event JSONata transformation parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/members": + '/v1/projects/{projectOrProductUID}/jobs': + get: + operationId: GetJobs + description: List all batch jobs for a project + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobsResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + post: + operationId: CreateJob + description: Create a new batch job with an optional name + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - name: name + in: query + description: Name for the job + required: true + schema: + type: string + requestBody: + description: The job definition as raw JSON + required: true + content: + application/json: + schema: + description: Job definition (structure varies by job type) + type: object + responses: + '201': + $ref: '#/components/responses/CreateJobResponse' + '400': + description: Missing required name parameter or invalid job definition + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/{jobUID}': + delete: + operationId: DeleteJob + description: Delete a batch job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + responses: + '200': + $ref: '#/components/responses/DeleteJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + get: + operationId: GetJob + description: Get a specific batch job definition + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/{jobUID}/run': + post: + operationId: RunJob + description: Execute a batch job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + - name: dry_run + in: query + description: Run job in dry-run mode without making actual changes + required: false + schema: + type: boolean + default: false + responses: + '200': + $ref: '#/components/responses/RunJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs': + get: + operationId: GetJobRuns + description: List all runs for a specific job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + - name: status + in: query + description: Filter runs by status + required: false + schema: + type: string + - name: dry_run + in: query + description: Filter runs by dry run flag + required: false + schema: + type: boolean + nullable: true + responses: + '200': + $ref: '#/components/responses/GetJobRunsResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}': + get: + operationId: GetJobRun + description: Get the result of a job execution + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobRunResponse' + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel': + post: + operationId: CancelJobRun + description: Cancel a running job execution + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + $ref: '#/components/responses/CancelJobRunResponse' + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + '/v1/projects/{projectOrProductUID}/members': get: operationId: GetProjectMembers description: Get Project Members responses: - "200": + '200': description: Successful operation content: application/json: @@ -1916,28 +2216,28 @@ paths: members: type: array items: - $ref: "#/components/schemas/ProjectMember" + $ref: '#/components/schemas/ProjectMember' required: - members default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - "/v1/projects/{projectOrProductUID}/monitors": + - $ref: '#/components/parameters/projectOrProductUIDParam' + '/v1/projects/{projectOrProductUID}/monitors': get: operationId: GetMonitors description: Get list of defined Monitors parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": - $ref: "#/components/responses/MonitorsResponse" + '200': + $ref: '#/components/responses/MonitorsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -1946,43 +2246,43 @@ paths: operationId: CreateMonitor description: Create a new Monitor parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' requestBody: description: Body or payload of monitor to be created required: true content: application/json: schema: - $ref: "#/components/schemas/CreateMonitor" + $ref: '#/components/schemas/CreateMonitor' responses: - "201": + '201': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Monitor" + $ref: '#/components/schemas/Monitor' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - monitor - "/v1/projects/{projectOrProductUID}/monitors/{monitorUID}": + '/v1/projects/{projectOrProductUID}/monitors/{monitorUID}': delete: operationId: DeleteMonitor description: Delete Monitor parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/monitorUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/monitorUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Monitor" + $ref: '#/components/schemas/Monitor' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -1991,17 +2291,17 @@ paths: operationId: GetMonitor description: Get Monitor parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/monitorUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/monitorUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Monitor" + $ref: '#/components/schemas/Monitor' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2010,34 +2310,34 @@ paths: operationId: UpdateMonitor description: Update Monitor parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/monitorUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/monitorUIDParam' requestBody: description: Body or payload of monitor to be created required: true content: application/json: schema: - $ref: "#/components/schemas/Monitor" + $ref: '#/components/schemas/Monitor' responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Monitor" + $ref: '#/components/schemas/Monitor' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - monitor - "/v1/projects/{projectOrProductUID}/products": + '/v1/projects/{projectOrProductUID}/products': get: operationId: GetProducts description: Get Products within a Project responses: - "200": + '200': description: Successful operation content: application/json: @@ -2047,15 +2347,15 @@ paths: products: type: array items: - $ref: "#/components/schemas/Product" + $ref: '#/components/schemas/Product' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' post: operationId: CreateProduct description: Create Product within a Project @@ -2072,7 +2372,7 @@ paths: items: type: string disable_devices_by_default: - description: "If `true`, devices provisioned to this product will be automatically disabled by default." + description: 'If `true`, devices provisioned to this product will be automatically disabled by default.' type: boolean label: description: The label for the Product. @@ -2084,83 +2384,83 @@ paths: - product_uid - label responses: - "201": + '201': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Product" + $ref: '#/components/schemas/Product' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project - "/v1/projects/{projectOrProductUID}/products/{productUID}": + '/v1/projects/{projectOrProductUID}/products/{productUID}': delete: operationId: DeleteProduct description: Delete a product responses: - "204": + '204': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/productUIDParam" - "/v1/projects/{projectOrProductUID}/routes": + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/productUIDParam' + '/v1/projects/{projectOrProductUID}/routes': get: operationId: GetRoutes description: Get all Routes within a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: example: - disabled: false label: success route - modified: "2020-03-09T17:58:37Z" + modified: '2020-03-09T17:58:37Z' type: http - uid: "route:8d65a087d5d290ce5bdf03aeff2becc0" + uid: 'route:8d65a087d5d290ce5bdf03aeff2becc0' - disabled: false label: failing route - modified: "2020-03-09T17:59:15Z" + modified: '2020-03-09T17:59:15Z' type: http - uid: "route:a9eaad31d5cee8d01a42762f71fb777a" + uid: 'route:a9eaad31d5cee8d01a42762f71fb777a' - disabled: true label: disabled route - modified: "2020-03-09T17:59:44Z" + modified: '2020-03-09T17:59:44Z' type: http - uid: "route:02ddc0e6e236c2a7e482da62047229ad" + uid: 'route:02ddc0e6e236c2a7e482da62047229ad' - disabled: false label: Proxy Route - modified: "2020-03-09T17:58:36Z" + modified: '2020-03-09T17:58:36Z' type: proxy - uid: "route:0ac565deb7b478a250bb82348b9cfdd4" + uid: 'route:0ac565deb7b478a250bb82348b9cfdd4' - disabled: false label: Myjsonlive Webtest - modified: "2020-03-09T17:58:35Z" + modified: '2020-03-09T17:58:35Z' type: proxy - uid: "route:fb1b9e0aba1bf030311ba2c3c1e3efd7" + uid: 'route:fb1b9e0aba1bf030311ba2c3c1e3efd7' - disabled: false label: Myjsonlive Echo - modified: "2020-03-09T17:58:34Z" + modified: '2020-03-09T17:58:34Z' type: proxy - uid: "route:7804818f84a3be6193e14d804fe7fca7" + uid: 'route:7804818f84a3be6193e14d804fe7fca7' schema: type: array items: - $ref: "#/components/schemas/NotehubRouteSummary" + $ref: '#/components/schemas/NotehubRouteSummary' minItems: 0 default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2169,7 +2469,7 @@ paths: operationId: CreateRoute description: Create Route within a Project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' requestBody: description: Route to be created required: true @@ -2183,59 +2483,59 @@ paths: disable_http_headers: false filter: {} fleets: - - "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d" + - 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' http_headers: X-My-Header: value throttle_ms: 100 timeout: 5000 transform: {} - url: "https://example.com/ingest" + url: 'https://example.com/ingest' label: Route Label schema: - $ref: "#/components/schemas/NotehubRoute" + $ref: '#/components/schemas/NotehubRoute' responses: - "201": + '201': description: Created content: application/json: example: - disabled: "false" + disabled: 'false' http: disable_http_headers: false filter: system_notefiles: false - type: "" + type: '' fleets: - - "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d" + - 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' http_headers: null throttle_ms: 100 timeout: 0 transform: {} - url: "http://route.url" + url: 'http://route.url' label: Route Label - modified: "2020-03-09T17:59:44Z" + modified: '2020-03-09T17:59:44Z' type: http - uid: "route:8d65a087d5d290ce5bdf03aeff2becc0" + uid: 'route:8d65a087d5d290ce5bdf03aeff2becc0' schema: - $ref: "#/components/schemas/NotehubRoute" + $ref: '#/components/schemas/NotehubRoute' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - route - "/v1/projects/{projectOrProductUID}/routes/{routeUID}": + '/v1/projects/{projectOrProductUID}/routes/{routeUID}': delete: operationId: DeleteRoute description: Delete single route within a project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/routeUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/routeUIDParam' responses: - "204": + '204': description: Successful operation default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2244,35 +2544,35 @@ paths: operationId: GetRoute description: Get single route within a project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/routeUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/routeUIDParam' responses: - "200": + '200': description: Successful operation content: application/json: example: - disabled: "false" + disabled: 'false' http: disable_http_headers: false filter: system_notefiles: false - type: "" + type: '' fleets: - - "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d" + - 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' http_headers: null throttle_ms: 100 timeout: 0 transform: {} - url: "http://route.url" + url: 'http://route.url' label: Route Label - modified: "2020-03-09T17:59:44Z" + modified: '2020-03-09T17:59:44Z' type: http - uid: "route:8d65a087d5d290ce5bdf03aeff2becc0" + uid: 'route:8d65a087d5d290ce5bdf03aeff2becc0' schema: - $ref: "#/components/schemas/NotehubRoute" + $ref: '#/components/schemas/NotehubRoute' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2281,8 +2581,8 @@ paths: operationId: UpdateRoute description: Update route by UID parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/routeUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/routeUIDParam' requestBody: description: Route settings to be updated required: true @@ -2301,9 +2601,9 @@ paths: }, } schema: - $ref: "#/components/schemas/NotehubRoute" + $ref: '#/components/schemas/NotehubRoute' responses: - "200": + '200': description: Successful operation content: application/json: @@ -2330,75 +2630,75 @@ paths: "timeout": 0 } schema: - $ref: "#/components/schemas/NotehubRoute" + $ref: '#/components/schemas/NotehubRoute' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - route - "/v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs": + '/v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs': get: operationId: GetRouteLogsByRoute description: Get Route Logs by Route UID parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/routeUIDParam" - - $ref: "#/components/parameters/pageSizeParam" - - $ref: "#/components/parameters/pageNumParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/routeLogsSortByParam" - - $ref: "#/components/parameters/routeLogsSortOrderParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/systemFilesOnlyParam" - - $ref: "#/components/parameters/mostRecentOnlyParam" - - $ref: "#/components/parameters/filesQueryParam" - - $ref: "#/components/parameters/routingStatusParam" - - $ref: "#/components/parameters/responseStatusParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/routeUIDParam' + - $ref: '#/components/parameters/pageSizeParam' + - $ref: '#/components/parameters/pageNumParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/routeLogsSortByParam' + - $ref: '#/components/parameters/routeLogsSortOrderParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/systemFilesOnlyParam' + - $ref: '#/components/parameters/mostRecentOnlyParam' + - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/routingStatusParam' + - $ref: '#/components/parameters/responseStatusParam' responses: - "200": + '200': description: Successful operation content: application/json: schema: type: array items: - $ref: "#/components/schemas/RouteLog" + $ref: '#/components/schemas/RouteLog' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - route - "/v1/projects/{projectOrProductUID}/schemas": + '/v1/projects/{projectOrProductUID}/schemas': get: operationId: GetNotefileSchemas summary: Get variable format for a notefile parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: List of notefile schema definitions content: application/json: schema: type: array items: - $ref: "#/components/schemas/NotefileSchema" + $ref: '#/components/schemas/NotefileSchema' tags: - project - "/v1/projects/{projectOrProductUID}/usage/data": + '/v1/projects/{projectOrProductUID}/usage/data': get: operationId: GetDataUsage description: Get data usage in bytes for a project with time range and period aggregation parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/fleetUIDFilterQueryParam" - - $ref: "#/components/parameters/usageLimitQueryParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2421,25 +2721,25 @@ paths: - fleet - project responses: - "200": - $ref: "#/components/responses/UsageDataResponse" + '200': + $ref: '#/components/responses/UsageDataResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - usage - "/v1/projects/{projectOrProductUID}/usage/events": + '/v1/projects/{projectOrProductUID}/usage/events': get: operationId: GetEventsUsage - description: "Get events usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied" + description: 'Get events usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied' parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/fleetUIDFilterQueryParam" - - $ref: "#/components/parameters/usageLimitQueryParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2473,7 +2773,7 @@ paths: style: form - name: skipRecentData in: query - description: "When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects." + description: 'When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.' required: false schema: type: boolean @@ -2486,28 +2786,28 @@ paths: type: boolean default: false responses: - "200": + '200': description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/UsageEventsResponse" + $ref: '#/components/schemas/UsageEventsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - usage - "/v1/projects/{projectOrProductUID}/usage/route-logs": + '/v1/projects/{projectOrProductUID}/usage/route-logs': get: operationId: GetRouteLogsUsage - description: "Get route logs usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied" + description: 'Get route logs usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied' parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/routeUIDParamQuery" - - $ref: "#/components/parameters/usageLimitQueryParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/routeUIDParamQuery' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2530,31 +2830,31 @@ paths: - project - name: skipRecentData in: query - description: "When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects." + description: 'When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.' required: false schema: type: boolean default: false responses: - "200": - $ref: "#/components/responses/UsageRouteLogsResponse" + '200': + $ref: '#/components/responses/UsageRouteLogsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - usage - "/v1/projects/{projectOrProductUID}/usage/sessions": + '/v1/projects/{projectOrProductUID}/usage/sessions': get: operationId: GetSessionsUsage - description: "Get sessions usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied" + description: 'Get sessions usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied' parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/startDateParam" - - $ref: "#/components/parameters/endDateParam" - - $ref: "#/components/parameters/deviceUIDParamQuery" - - $ref: "#/components/parameters/fleetUIDFilterQueryParam" - - $ref: "#/components/parameters/usageLimitQueryParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/deviceUIDParamQuery' + - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2578,28 +2878,28 @@ paths: - project - name: skipRecentData in: query - description: "When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects." + description: 'When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.' required: false schema: type: boolean default: false responses: - "200": - $ref: "#/components/responses/UsageSessionsResponse" + '200': + $ref: '#/components/responses/UsageSessionsResponse' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - usage - "/v1/projects/{projectOrProductUID}/webhooks": + '/v1/projects/{projectOrProductUID}/webhooks': get: operationId: GetWebhooks description: Retrieves all webhooks for the specified project parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' responses: - "200": + '200': description: Webhooks retrieved successfully content: application/json: @@ -2609,25 +2909,25 @@ paths: webhooks: type: array items: - $ref: "#/components/schemas/WebhookSettings" + $ref: '#/components/schemas/WebhookSettings' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - webhook - "/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}": + '/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}': delete: operationId: DeleteWebhook description: Deletes the specified webhook parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/webhookUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' responses: - "200": + '200': description: Webhook deleted successfully default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2636,17 +2936,17 @@ paths: operationId: GetWebhook description: Retrieves the configuration settings for the specified webhook parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/webhookUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' responses: - "200": + '200': description: Webhook settings retrieved successfully content: application/json: schema: - $ref: "#/components/schemas/WebhookSettings" + $ref: '#/components/schemas/WebhookSettings' default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2655,8 +2955,8 @@ paths: operationId: CreateWebhook description: Creates a webhook for the specified product with the given name. The name | must be unique within the project. parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/webhookUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' requestBody: required: true content: @@ -2667,12 +2967,12 @@ paths: id: Abc_123-2646f411-dc56-44a0-9743-4130f47a74h8 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" + $ref: '#/components/schemas/WebhookSettings' responses: - "200": + '200': description: Webhook created successfully default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: @@ -2681,8 +2981,8 @@ paths: 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. parameters: - - $ref: "#/components/parameters/projectOrProductUIDParam" - - $ref: "#/components/parameters/webhookUIDParam" + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/webhookUIDParam' requestBody: required: true content: @@ -2691,18 +2991,25 @@ paths: 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" + $ref: '#/components/schemas/WebhookSettings' responses: - "200": + '200': description: Webhook updated successfully default: - $ref: "#/components/responses/ErrorResponse" + $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - webhook components: parameters: + billingAccountUIDParam: + example: 00000000-0000-0000-000000000001 + in: path + name: billingAccountUID + required: true + schema: + type: string cursorParam: description: | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. @@ -2712,7 +3019,7 @@ components: schema: type: string datasetAggregateWindowQueryParam: - description: "Aggregate results into buckets for a time duration, expressed in Postgres INTERVAL format" + description: 'Aggregate results into buckets for a time duration, expressed in Postgres INTERVAL format' in: query name: aggregate_window required: false @@ -2726,7 +3033,7 @@ components: schema: type: boolean datasetEndQueryParam: - description: "End of the time range, as an ISO-8601 date or relative to now. If omitted, current time is used." + description: 'End of the time range, as an ISO-8601 date or relative to now. If omitted, current time is used.' in: query name: end required: false @@ -2740,15 +3047,15 @@ components: schema: type: integer datasetLocationNearQueryParam: - description: "Latitude and Longitude for location-based filtering, location_near_radius must also be provided" + description: 'Latitude and Longitude for location-based filtering, location_near_radius must also be provided' in: query name: location_near required: false schema: type: string - example: "42.393125,-71.185015" + example: '42.393125,-71.185015' datasetLocationRadiusQueryParam: - description: "Distance from location_near in meters, location_near must also be provided" + description: 'Distance from location_near in meters, location_near must also be provided' in: query name: location_near_radius required: false @@ -2769,28 +3076,28 @@ components: schema: type: string datasetSelectQueryParam: - description: "Comma separated list of fields to include. Supports aggregate functions (avg, sum, min, max, count, most_recent)." + description: 'Comma separated list of fields to include. Supports aggregate functions (avg, sum, min, max, count, most_recent).' in: query name: select required: false schema: type: string datasetStartQueryParam: - description: "Start of the time range, as an ISO-8601 date or relative to now (e.g. -1y). Relative dates follow the Postgres INTERVAL format." + description: 'Start of the time range, as an ISO-8601 date or relative to now (e.g. -1y). Relative dates follow the Postgres INTERVAL format.' in: query name: start required: true schema: type: string datasetWhereQueryParam: - description: "Additional filters using boolean logic mini-language (e.g. and.(device.eq.dev:123,temp.gt.100))" + description: 'Additional filters using boolean logic mini-language (e.g. and.(device.eq.dev:123,temp.gt.100))' in: query name: where required: false schema: type: string dateTypeParam: - description: "Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters" + description: 'Which date to filter on, either ''captured'' or ''uploaded''. This will apply to the startDate and endDate parameters' example: uploaded in: query name: dateType @@ -2810,7 +3117,7 @@ components: items: type: string deviceUIDParam: - example: "dev:000000000000000" + example: 'dev:000000000000000' in: path name: deviceUID required: true @@ -2846,7 +3153,7 @@ components: - update - cancel endDateParam: - description: "End date for filtering results, specified as a Unix timestamp" + description: 'End date for filtering results, specified as a Unix timestamp' example: 1657894210 in: query name: endDate @@ -2880,7 +3187,7 @@ components: schema: type: string filesQueryParam: - example: "_health.qo, data.qo" + example: '_health.qo, data.qo' in: query name: files required: false @@ -2900,7 +3207,7 @@ components: - version - length firmwareSortOrderParam: - description: "Sort order (asc for ascending, desc for descending)" + description: 'Sort order (asc for ascending, desc for descending)' in: query name: sortOrder required: false @@ -2925,6 +3232,14 @@ components: required: false schema: type: string + firstSyncParam: + description: 'When true, filters results to only show first sync sessions' + in: query + name: firstSync + required: false + schema: + type: boolean + default: false fleetUIDFilterQueryParam: description: Filter by Fleet UID explode: true @@ -2986,6 +3301,14 @@ components: items: type: string style: form + jobUIDParam: + description: Unique identifier for a batch job + example: my-reconciliation-job + in: path + name: jobUID + required: true + schema: + type: string limitParam: in: query name: limit @@ -3012,7 +3335,7 @@ components: schema: type: string monitorUIDParam: - example: "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" + example: 'monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad' in: path name: monitorUID required: true @@ -3079,7 +3402,7 @@ components: schema: type: string productUIDParam: - example: "com.blues.bridge:sensors" + example: 'com.blues.bridge:sensors' in: path name: productUID required: true @@ -3096,12 +3419,20 @@ components: type: string style: form projectOrProductUIDParam: - example: "app:2606f411-dea6-44a0-9743-1130f57d77d8" + example: 'app:2606f411-dea6-44a0-9743-1130f57d77d8' in: path name: projectOrProductUID required: true schema: type: string + reportUIDParam: + description: Unique identifier for a job run report + example: my-reconciliation-job-1707654321000 + in: path + name: reportUID + required: true + schema: + type: string repositoryKey: description: The secret key used to access this repository in: header @@ -3115,7 +3446,7 @@ components: required: true schema: type: string - example: "rid:2606f411-dea6-44a0-9743-1130f57d77d8" + example: 'rid:2606f411-dea6-44a0-9743-1130f57d77d8' responseStatusParam: example: 500 in: query @@ -3146,7 +3477,7 @@ components: - asc - desc routeUIDParam: - example: "route:cbd20093cba58392c9f9bbdd0cdeb1a0" + example: 'route:cbd20093cba58392c9f9bbdd0cdeb1a0' in: path name: routeUID required: true @@ -3254,7 +3585,7 @@ components: - asc - desc startDateParam: - description: "Start date for filtering results, specified as a Unix timestamp" + description: 'Start date for filtering results, specified as a Unix timestamp' example: 1628631763 in: query name: startDate @@ -3323,6 +3654,19 @@ components: schema: type: string schemas: + AWSRoleConfig: + description: Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes + type: object + properties: + aws_account_id: + description: The Blues AWS Account ID to trust in your IAM role's trust policy + type: string + external_id: + description: The External ID to use in your IAM role's trust policy condition + type: string + required: + - aws_account_id + - external_id Alert: type: object properties: @@ -3400,7 +3744,7 @@ components: type: number type: object resolved: - description: "If true, the alert has been resolved" + description: 'If true, the alert has been resolved' type: boolean source: description: The UID of the source of the alert @@ -3431,7 +3775,7 @@ components: disable_http_headers: type: boolean filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -3446,12 +3790,15 @@ components: type: string region: type: string + role_arn: + description: IAM Role ARN for role-based authentication via STS AssumeRole + type: string throttle_ms: type: integer timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -3460,7 +3807,7 @@ components: type: object properties: filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -3476,7 +3823,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -3487,7 +3834,7 @@ components: name: type: string role: - $ref: "#/components/schemas/BillingAccountRole" + $ref: '#/components/schemas/BillingAccountRole' uid: type: string required: @@ -3505,7 +3852,7 @@ components: type: object properties: filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -3517,7 +3864,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' additionalProperties: false Body: type: object @@ -3533,18 +3880,18 @@ components: format: int64 example: 1656010061 data_usage: - $ref: "#/components/schemas/DataUsage" + $ref: '#/components/schemas/DataUsage' expires_at: type: integer format: int64 iccid: description: The Integrated Circuit Card Identifier of the SIM card type: string - example: "345678432765434567890765746354465786" + example: '345678432765434567890765746354465786' imsi: description: IMSI of the SIM card type: string - example: "310170830688975" + example: '310170830688975' last_updated: description: Time this plan information was last updated type: integer @@ -3555,13 +3902,13 @@ components: type: integer format: int64 plan_type: - description: "Description of the SIM plan type including data allowance, region, and validity period" + description: 'Description of the SIM plan type including data allowance, region, and validity period' type: string - example: "500MB, North America, 10-year lifetime" + example: '500MB, North America, 10-year lifetime' CellularUsage: type: array items: - $ref: "#/components/schemas/SimUsage" + $ref: '#/components/schemas/SimUsage' properties: {} Contact: type: object @@ -3576,10 +3923,10 @@ components: type: string nullable: true CreateMonitor: - type: "" + type: '' properties: {} allOf: - - $ref: "#/components/schemas/Monitor" + - $ref: '#/components/schemas/Monitor' - required: - name - description @@ -3590,25 +3937,25 @@ components: type: object properties: fleet_uids: - $ref: "#/components/schemas/FleetsUIDList" + $ref: '#/components/schemas/FleetsUIDList' name: type: string project_uids: - $ref: "#/components/schemas/AppUIDList" + $ref: '#/components/schemas/AppUIDList' CurrentFirmware: type: object properties: metadata: - $ref: "#/components/schemas/Firmware" + $ref: '#/components/schemas/Firmware' version: type: string DFUEnv: type: object properties: card: - $ref: "#/components/schemas/DFUState" + $ref: '#/components/schemas/DFUState' user: - $ref: "#/components/schemas/DFUState" + $ref: '#/components/schemas/DFUState' nullable: true DFUState: type: object @@ -3669,7 +4016,7 @@ components: description: Last updated timestamp type: number version: - description: "Last known version, which is generally a JSON object contained within the firmware image" + description: 'Last known version, which is generally a JSON object contained within the firmware image' type: string nullable: true DataField: @@ -3679,12 +4026,12 @@ components: description: The name of the field type: string DataSet: - type: "" + type: '' properties: fields: type: array items: - $ref: "#/components/schemas/DataSetField" + $ref: '#/components/schemas/DataSetField' lat: description: JSONata expression resulting in the latitude field type: string @@ -3741,7 +4088,7 @@ components: disable_http_headers: type: boolean filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -3755,7 +4102,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -3764,13 +4111,13 @@ components: type: object properties: best_location: - $ref: "#/components/schemas/Location" + $ref: '#/components/schemas/Location' cellular_usage: - $ref: "#/components/schemas/CellularUsage" + $ref: '#/components/schemas/CellularUsage' contact: - $ref: "#/components/schemas/Contact" + $ref: '#/components/schemas/Contact' dfu: - $ref: "#/components/schemas/DFUEnv" + $ref: '#/components/schemas/DFUEnv' disabled: type: boolean firmware_host: @@ -3782,7 +4129,7 @@ components: items: type: string gps_location: - $ref: "#/components/schemas/Location" + $ref: '#/components/schemas/Location' last_activity: type: string format: date-time @@ -3812,9 +4159,9 @@ components: mnc: type: integer tower_location: - $ref: "#/components/schemas/Location" + $ref: '#/components/schemas/Location' triangulated_location: - $ref: "#/components/schemas/Location" + $ref: '#/components/schemas/Location' uid: type: string voltage: @@ -3858,14 +4205,14 @@ components: history: type: array items: - $ref: "#/components/schemas/DeviceDfuStateMachine" + $ref: '#/components/schemas/DeviceDfuStateMachine' DeviceDfuHistoryPage: type: object properties: devices: type: array items: - $ref: "#/components/schemas/DeviceDfuHistory" + $ref: '#/components/schemas/DeviceDfuHistory' has_more: type: boolean default: false @@ -3885,7 +4232,7 @@ components: updates: type: array items: - $ref: "#/components/schemas/DeviceDfuStateMachineNode" + $ref: '#/components/schemas/DeviceDfuStateMachineNode' DeviceDfuStateMachineNode: description: Represents a single request to update the host or Notecard firmware type: object @@ -3934,14 +4281,14 @@ components: description: true if there is a DFU currently in progress type: boolean status: - $ref: "#/components/schemas/DeviceDfuStateMachine" + $ref: '#/components/schemas/DeviceDfuStateMachine' DeviceDfuStatusPage: type: object properties: devices: type: array items: - $ref: "#/components/schemas/DeviceDfuStatus" + $ref: '#/components/schemas/DeviceDfuStatus' has_more: type: boolean default: false @@ -4012,7 +4359,7 @@ components: type: integer format: int64 period: - $ref: "#/components/schemas/DeviceUsage" + $ref: '#/components/schemas/DeviceUsage' power_charging: type: boolean power_mah: @@ -4065,12 +4412,12 @@ components: description: Was TLS used? type: boolean tower: - $ref: "#/components/schemas/TowerLocation" + $ref: '#/components/schemas/TowerLocation' transport: description: Type of network transport type: string tri: - $ref: "#/components/schemas/TowerLocation" + $ref: '#/components/schemas/TowerLocation' triangulate: type: object usage_actual: @@ -4172,7 +4519,7 @@ components: children: type: array items: - $ref: "#/components/schemas/EnvTreeJsonNode" + $ref: '#/components/schemas/EnvTreeJsonNode' device_uid: type: string fleet_label: @@ -4191,7 +4538,7 @@ components: variables: type: array items: - $ref: "#/components/schemas/EnvVar" + $ref: '#/components/schemas/EnvVar' required: - var_count - inherited_var_count @@ -4255,7 +4602,7 @@ components: description: Country type: string best_id: - description: "The device serial number, or the DeviceUID if the serial number is not set" + description: 'The device serial number, or the DeviceUID if the serial number is not set' type: string best_lat: description: Latitude @@ -4497,9 +4844,15 @@ components: filename: description: The name of the firmware file. type: string + info: + description: User-defined metadata + type: object md5: description: The MD5 hash of the firmware file. type: string + notes: + description: User-defined notes + type: string organization: description: The organization that owns the firmware. type: string @@ -4525,7 +4878,7 @@ components: type: object properties: connectivity_assurance: - $ref: "#/components/schemas/FleetConnectivityAssurance" + $ref: '#/components/schemas/FleetConnectivityAssurance' created: description: RFC3339 timestamp in UTC type: string @@ -4539,7 +4892,7 @@ components: description: Fleet label type: string smart_rule: - $ref: "#/components/schemas/FleetRule" + $ref: '#/components/schemas/FleetRule' smart_rule_enabled: type: boolean uid: @@ -4564,7 +4917,7 @@ components: enabled: true nullable: true FleetRule: - description: "JSONata expression that will be evaluated to determine device membership into this fleet, if the expression evaluates to a 1, the device will be included, if it evaluates to -1 it will be removed, and if it evaluates to 0 or errors it will be left unchanged." + description: 'JSONata expression that will be evaluated to determine device membership into this fleet, if the expression evaluates to a 1, the device will be included, if it evaluates to -1 it will be removed, and if it evaluates to 0 or errors it will be left unchanged.' type: string properties: {} FleetsUIDList: @@ -4576,7 +4929,7 @@ components: type: object properties: filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -4588,7 +4941,7 @@ components: token: type: string transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -4599,9 +4952,9 @@ components: disable_http_headers: type: boolean filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: - description: "If non-empty, applies only to the listed fleets." + description: 'If non-empty, applies only to the listed fleets.' type: array items: type: string @@ -4614,7 +4967,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -4622,6 +4975,84 @@ components: JSONata: type: object properties: {} + Job: + type: object + properties: + created: + description: Unix timestamp when job was created + type: integer + format: int64 + 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 + name: + description: Human-readable job name + type: string + required: + - job_uid + - name + - created + - created_by + JobRun: + type: object + properties: + cancel: + description: Whether cancellation was requested + type: boolean + completed: + description: Unix timestamp when completed + type: integer + format: int64 + dry_run: + description: Whether this was a dry run + type: boolean + job_name: + description: Name of the job + type: string + job_uid: + description: Unique identifier for the job + type: string + report_uid: + description: Unique identifier for this run + type: string + results: + description: Full results (only in detail view) + type: object + additionalProperties: true + started: + description: Unix timestamp when started + type: integer + format: int64 + status: + description: 'Current status (submitted, running, completed, cancelled, failed)' + type: string + submitted: + description: Unix timestamp when submitted + type: integer + format: int64 + submitted_by: + description: User who submitted the run + type: string + updated: + description: Unix timestamp of last update + type: integer + format: int64 + required: + - report_uid + - job_uid + - job_name + - status + - dry_run + - submitted_by + - submitted + - updated Location: type: object properties: @@ -4651,7 +5082,7 @@ components: type: object properties: aggregate_function: - description: "Aggregate function to apply to the selected values before applying the condition. [none, sum, average, max, min]" + description: 'Aggregate function to apply to the selected values before applying the condition. [none, sum, average, max, min]' type: string enum: - none @@ -4663,19 +5094,19 @@ components: description: The time window to aggregate the selected values. It follows the format of a number followed by a time unit type: string example: 10m or 5h30m40s - pattern: "^[0-9]+[smh]$" + pattern: '^[0-9]+[smh]$' alert: - description: "If true, the monitor is in alert state." + description: 'If true, the monitor is in alert state.' type: boolean alert_routes: type: array items: oneOf: - - $ref: "#/components/schemas/SlackWebHookNotification" - - $ref: "#/components/schemas/SlackBearerNotification" - - $ref: "#/components/schemas/EmailNotification" + - $ref: '#/components/schemas/SlackWebHookNotification' + - $ref: '#/components/schemas/SlackBearerNotification' + - $ref: '#/components/schemas/EmailNotification' condition_type: - description: "A comparison operation to apply to the value selected by the source_selector [greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, equal_to, not_equal_to]" + description: 'A comparison operation to apply to the value selected by the source_selector [greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, equal_to, not_equal_to]' type: string enum: - greater_than @@ -4684,10 +5115,11 @@ components: - less_than_or_equal_to - equal_to - not_equal_to + - count description: type: string disabled: - description: "If true, the monitor will not be evaluated." + description: 'If true, the monitor will not be evaluated.' type: boolean fleet_filter: type: array @@ -4703,18 +5135,18 @@ components: items: type: string per_device: - description: "Only relevant when using an aggregate_function. If true, the monitor will be evaluated per device, | rather than across the set of selected devices. If true then if a single device matches the specified criteria, | and alert will be created, otherwise the aggregate function will be applied across all devices." + description: 'Only relevant when using an aggregate_function. If true, the monitor will be evaluated per device, | rather than across the set of selected devices. If true then if a single device matches the specified criteria, | and alert will be created, otherwise the aggregate function will be applied across all devices.' type: boolean routing_cooldown_period: description: The time period to wait before routing another event after the monitor | has been triggered. It follows the format of a number followed by a time unit. type: string example: 10m or 5h30m40s - pattern: "^[0-9]+[smh]$" + pattern: '^[0-9]+[smh]$' silenced: - description: "If true, alerts will be created, but no notifications will be sent." + description: 'If true, alerts will be created, but no notifications will be sent.' type: boolean source_selector: - description: "A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value." + description: 'A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.' type: string example: body.temperature source_type: @@ -4738,7 +5170,7 @@ components: certificate_name: type: string filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -4759,7 +5191,7 @@ components: topic: type: string transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' username: type: string additionalProperties: false @@ -4814,7 +5246,7 @@ components: notes: type: array items: - $ref: "#/components/schemas/Note" + $ref: '#/components/schemas/Note' minItems: 0 template: type: string @@ -4822,10 +5254,10 @@ components: - id - notes NotefileList: - description: "Array of notefiles, each containing its notes." + description: 'Array of notefiles, each containing its notes.' type: array items: - $ref: "#/components/schemas/Notefile" + $ref: '#/components/schemas/Notefile' properties: {} NotefileSchema: type: object @@ -4835,7 +5267,7 @@ components: properties: type: array items: - $ref: "#/components/schemas/SchemaProperty" + $ref: '#/components/schemas/SchemaProperty' required: - notefile - properties @@ -4844,20 +5276,20 @@ components: type: object properties: aws: - $ref: "#/components/schemas/AwsRoute" + $ref: '#/components/schemas/AwsRoute' azure: - $ref: "#/components/schemas/AzureRoute" + $ref: '#/components/schemas/AzureRoute' blynk: - $ref: "#/components/schemas/BlynkRoute" + $ref: '#/components/schemas/BlynkRoute' datacake: - $ref: "#/components/schemas/DatacakeRoute" + $ref: '#/components/schemas/DatacakeRoute' disabled: type: boolean default: false google: - $ref: "#/components/schemas/GoogleRoute" + $ref: '#/components/schemas/GoogleRoute' http: - $ref: "#/components/schemas/HttpRoute" + $ref: '#/components/schemas/HttpRoute' label: type: string modified: @@ -4865,25 +5297,25 @@ components: format: date-time readOnly: true mqtt: - $ref: "#/components/schemas/MqttRoute" + $ref: '#/components/schemas/MqttRoute' proxy: - $ref: "#/components/schemas/ProxyRoute" + $ref: '#/components/schemas/ProxyRoute' qubitro: - $ref: "#/components/schemas/QubitroRoute" + $ref: '#/components/schemas/QubitroRoute' radnote: - $ref: "#/components/schemas/RadRoute" + $ref: '#/components/schemas/RadRoute' s3archive: - $ref: "#/components/schemas/S3ArchiveRoute" + $ref: '#/components/schemas/S3ArchiveRoute' slack: - $ref: "#/components/schemas/SlackRoute" + $ref: '#/components/schemas/SlackRoute' snowflake: - $ref: "#/components/schemas/SnowflakeRoute" + $ref: '#/components/schemas/SnowflakeRoute' snowpipe_streaming: - $ref: "#/components/schemas/SnowpipeStreamingRoute" + $ref: '#/components/schemas/SnowpipeStreamingRoute' thingworx: - $ref: "#/components/schemas/ThingworxRoute" + $ref: '#/components/schemas/ThingworxRoute' twilio: - $ref: "#/components/schemas/TwilioRoute" + $ref: '#/components/schemas/TwilioRoute' type: description: Mirrors hublib.RouteType. type: string @@ -4909,7 +5341,7 @@ components: default: http uid: type: string - default: "route:8d65a087d5d290ce5bdf03aeff2becc0" + default: 'route:8d65a087d5d290ce5bdf03aeff2becc0' OAuth2Error: type: object properties: @@ -4976,7 +5408,7 @@ components: format: date-time nullable: true last_used: - description: "When it was last used, if ever" + description: 'When it was last used, if ever' type: string format: date-time nullable: true @@ -4984,7 +5416,7 @@ components: description: Name for this API Key type: string suspended: - description: "if true, this token cannot be used" + description: 'if true, this token cannot be used' type: boolean uid: description: Unique and public identifier @@ -5002,7 +5434,7 @@ components: name: type: string suspended: - description: "if true, the token is temporarily suspended" + description: 'if true, the token is temporarily suspended' type: boolean required: - expiresAt @@ -5037,16 +5469,16 @@ components: type: object properties: administrative_contact: - $ref: "#/components/schemas/Contact" + $ref: '#/components/schemas/Contact' created: type: string format: date-time label: type: string role: - $ref: "#/components/schemas/Role" + $ref: '#/components/schemas/Role' technical_contact: - $ref: "#/components/schemas/Contact" + $ref: '#/components/schemas/Contact' uid: type: string required: @@ -5064,7 +5496,7 @@ components: name: type: string role: - $ref: "#/components/schemas/Role" + $ref: '#/components/schemas/Role' required: - name - email @@ -5085,7 +5517,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -5094,7 +5526,7 @@ components: type: object properties: filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5106,7 +5538,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' webhook_signing_key: type: string additionalProperties: false @@ -5135,12 +5567,12 @@ components: type: object properties: fleet_uids: - $ref: "#/components/schemas/FleetsUIDList" + $ref: '#/components/schemas/FleetsUIDList' name: description: repository name type: string project_uids: - $ref: "#/components/schemas/AppUIDList" + $ref: '#/components/schemas/AppUIDList' uid: description: The unique identifier for the data repository type: string @@ -5158,7 +5590,7 @@ components: type: object properties: attn: - description: "If true, an error was returned when routing" + description: 'If true, an error was returned when routing' type: boolean date: description: The date of the logs. @@ -5221,7 +5653,7 @@ components: file_format: type: string filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5235,7 +5667,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -5252,7 +5684,7 @@ components: description: Total bytes included in the plan type: integer format: int64 - example: 18650 + example: 10000 bytes_used: description: Bytes used to date type: integer @@ -5293,9 +5725,9 @@ components: psid: description: Provider-specific identifier for the satellite subscription type: string - example: "skylo:5746354465786" + example: 'skylo:5746354465786' satellite_data_usage: - $ref: "#/components/schemas/SatelliteDataUsage" + $ref: '#/components/schemas/SatelliteDataUsage' nullable: true required: - ntn_provider @@ -5309,7 +5741,7 @@ components: description: Used if type is array type: array items: - $ref: "#/components/schemas/SchemaProperty" + $ref: '#/components/schemas/SchemaProperty' name: description: Name of the field (optional for array/object children) type: string @@ -5317,7 +5749,7 @@ components: description: Used if type is object type: array items: - $ref: "#/components/schemas/SchemaProperty" + $ref: '#/components/schemas/SchemaProperty' type: type: string enum: @@ -5367,7 +5799,7 @@ components: - text - blocks text: - description: "The text of the message, or the blocks definition" + description: 'The text of the message, or the blocks definition' type: string token: description: The bearer token for the Slack app. @@ -5382,7 +5814,7 @@ components: channel: type: string filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5394,7 +5826,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' webhook_url: type: string format: uri @@ -5409,7 +5841,7 @@ components: - text - blocks text: - description: "The text of the message, or the blocks definition" + description: 'The text of the message, or the blocks definition' type: string url: description: The URL of the Slack webhook. @@ -5420,7 +5852,7 @@ components: account_name: type: string filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5434,7 +5866,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' user_name: type: string additionalProperties: false @@ -5446,7 +5878,7 @@ components: database_name: type: string filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5464,7 +5896,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' user_name: type: string additionalProperties: false @@ -5474,7 +5906,7 @@ components: app_key: type: string filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5484,7 +5916,7 @@ components: timeout: type: integer transform: - $ref: "#/components/schemas/RouteTransformSettings" + $ref: '#/components/schemas/RouteTransformSettings' url: type: string format: uri @@ -5518,7 +5950,7 @@ components: mnc: description: Mobile Network Code type: integer - "n": + 'n': description: Name of the location type: string source: @@ -5546,7 +5978,7 @@ components: type: string format: password filter: - $ref: "#/components/schemas/Filter" + $ref: '#/components/schemas/Filter' fleets: type: array items: @@ -5572,7 +6004,7 @@ components: created: type: integer firmware: - $ref: "#/components/schemas/Firmware" + $ref: '#/components/schemas/Firmware' found: type: string length: @@ -5616,7 +6048,7 @@ components: period: type: string format: date-time - example: "2025-07-23T00:00:00Z" + example: '2025-07-23T00:00:00Z' total_bytes: type: integer format: int64 @@ -5640,16 +6072,16 @@ components: type: object properties: billable_events: - description: "Events that are billable, this include all events except platform events" + description: 'Events that are billable, this include all events except platform events' type: integer format: int64 example: 10 device: type: string - example: "dev:123456789012345" + example: 'dev:123456789012345' fleet: type: string - example: "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d" + example: 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' notefiles: description: Count of events per notefile. Only present when includeNotefiles=true is specified. type: object @@ -5663,14 +6095,14 @@ components: period: type: string format: date-time - example: "2025-07-23T00:00:00Z" + example: '2025-07-23T00:00:00Z' platform_events: - description: "Total platform events. Platform events are _log, _session, _health, and _geolocate events some of which are send from the device, some generated by notehub. These events are not billed." + description: 'Total platform events. Platform events are _log, _session, _health, and _geolocate events some of which are send from the device, some generated by notehub. These events are not billed.' type: integer format: int64 example: 15 total_days_in_period: - description: "The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future." + description: 'The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future.' type: integer format: int32 total_devices: @@ -5678,12 +6110,24 @@ components: type: integer format: int64 total_events: - description: "Total events the device sent to notehub, including associated notehub generated events" + description: 'Total events the device sent to notehub, including associated notehub generated events' type: integer format: int64 example: 42 + total_fw_updates: + description: Number of firmware updates in this period (from _health.qo DFU events) + type: integer + format: int64 + example: 1 + nullable: true + total_reboots: + description: Number of device reboots in this period (from _health.qo boot events) + type: integer + format: int64 + example: 2 + nullable: true watchdog_events: - description: "Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time." + description: 'Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time.' type: integer format: int64 example: 10 @@ -5699,14 +6143,20 @@ components: data: type: array items: - $ref: "#/components/schemas/UsageEventsData" + $ref: '#/components/schemas/UsageEventsData' truncated: - $ref: "#/components/schemas/UsageTruncatedField" + $ref: '#/components/schemas/UsageTruncatedField' required: - data UsageRouteLogsData: type: object properties: + avg_latency_ms: + description: Average routing latency in milliseconds for route logs with recorded duration + type: number + format: double + example: 342.5 + nullable: true failed_routes: type: integer format: int64 @@ -5714,11 +6164,11 @@ components: period: type: string format: date-time - example: "2025-07-23T00:00:00Z" + example: '2025-07-23T00:00:00Z' route: description: The route UID (only present when aggregate is 'route') type: string - example: "route:cbd20093cba58392c9f9bbdd0cdeb1a0" + example: 'route:cbd20093cba58392c9f9bbdd0cdeb1a0' successful_routes: type: integer format: int64 @@ -5737,18 +6187,39 @@ components: properties: device: type: string - example: "dev:123456789012345" + example: 'dev:123456789012345' + first_sync_sessions: + description: Number of first sync sessions in this period + type: integer + format: int64 + example: 2 fleet: type: string - example: "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d" + example: 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' period: type: string format: date-time - example: "2025-07-23T00:00:00Z" + example: '2025-07-23T00:00:00Z' sessions: type: integer format: int64 example: 12 + sessions_by_transport: + description: 'Count of sessions grouped by transport type prefix (e.g. cell, wifi, ntn, lorawan)' + type: object + example: + cell: 8 + ntn: 1 + wifi: 3 + additionalProperties: + format: int64 + type: integer + tls_sessions: + description: Number of TLS sessions in this period + type: integer + format: int64 + example: 3 + nullable: true total_bytes: type: integer format: int64 @@ -5760,10 +6231,11 @@ components: required: - period - sessions + - first_sync_sessions - total_bytes - total_devices UsageTruncatedField: - description: "If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure" + description: 'If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure' type: boolean properties: {} UserDfuStateMachine: @@ -5776,9 +6248,9 @@ components: from_version: type: string metadata: - $ref: "#/components/schemas/UploadMetadata" + $ref: '#/components/schemas/UploadMetadata' status: - $ref: "#/components/schemas/UserDfuStateMachineStatus" + $ref: '#/components/schemas/UserDfuStateMachineStatus' UserDfuStateMachineStatus: type: object properties: @@ -5796,9 +6268,9 @@ components: type: object properties: current_firmware: - $ref: "#/components/schemas/CurrentFirmware" + $ref: '#/components/schemas/CurrentFirmware' firmware_update: - $ref: "#/components/schemas/UserDfuStateMachine" + $ref: '#/components/schemas/UserDfuStateMachine' nullable: true WebhookSettings: type: object @@ -5824,13 +6296,49 @@ components: description: The list of alerts type: array items: - $ref: "#/components/schemas/Alert" + $ref: '#/components/schemas/Alert' has_more: description: True if there are more alerts type: boolean required: - alerts - has_more + CancelJobRunResponse: + description: Cancel operation completed + content: + application/json: + schema: + type: object + properties: + successful: + description: True if cancellation was successful + type: boolean + required: + - successful + CreateJobResponse: + description: Job created successfully + content: + application/json: + schema: + type: object + properties: + job_uid: + description: The unique identifier for the created job + type: string + required: + - job_uid + DeleteJobResponse: + description: Job deleted successfully + content: + application/json: + schema: + type: object + properties: + success: + description: True if deletion was successful + type: boolean + required: + - success DevicePlansResponse: description: Response body for /plans content: @@ -5841,7 +6349,7 @@ components: cellular_plans: type: array items: - $ref: "#/components/schemas/CellularPlan" + $ref: '#/components/schemas/CellularPlan' nullable: true DevicesResponse: description: List of Devices @@ -5853,7 +6361,7 @@ components: devices: type: array items: - $ref: "#/components/schemas/Device" + $ref: '#/components/schemas/Device' has_more: type: boolean required: @@ -5864,17 +6372,17 @@ components: content: application/json: schema: - type: "" + type: '' properties: {} - $ref: "#/components/schemas/EnvironmentVariables" + $ref: '#/components/schemas/EnvironmentVariables' ErrorResponse: description: The response body in case of an API error. content: application/json: schema: - type: "" + type: '' properties: {} - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' EventsByCursorResponse: description: The response body from a GET events by cursor request. content: @@ -5885,7 +6393,7 @@ components: events: type: array items: - $ref: "#/components/schemas/Event" + $ref: '#/components/schemas/Event' has_more: description: True if there are more events type: boolean @@ -5899,7 +6407,7 @@ components: - has_more example: events: - - app: "app:218f6217-9f78-432e-9fe0-02ca8b5a216c" + - app: 'app:218f6217-9f78-432e-9fe0-02ca8b5a216c' best_country: US best_id: My Device best_lat: 34.82476372 @@ -5913,15 +6421,15 @@ components: pressure: 97705.66 temperature: 24.0625 voltage: 2.598 - device: "dev:5c0272311928" + device: 'dev:5c0272311928' event: dfa3747d-688b-4250-935b-5dd60354313c file: air.qo - product: "product:com.blues.project.demo" + product: 'product:com.blues.project.demo' received: 1656011227.006928 req: note.add session: b623132c-6afb-4740-bc39-e3634e38f064 sn: My Device - tower_id: "0,0,0,0" + tower_id: '0,0,0,0' tri_country: US tri_lat: 34.82475372 tri_location: Atlanta GA @@ -5932,7 +6440,7 @@ components: updates: 1 when: 1656010061 has_more: false - next_cursor: "" + next_cursor: '' EventsResponse: description: The response body from a GET events request. headers: @@ -5948,7 +6456,7 @@ components: events: type: array items: - $ref: "#/components/schemas/Event" + $ref: '#/components/schemas/Event' has_more: description: True if there are more events type: boolean @@ -5960,7 +6468,7 @@ components: - has_more example: events: - - app: "app:218f6217-9f78-432e-9fe0-02ca8b5a216c" + - app: 'app:218f6217-9f78-432e-9fe0-02ca8b5a216c' best_country: US best_id: My Device best_lat: 34.82476372 @@ -5974,15 +6482,15 @@ components: pressure: 97705.66 temperature: 24.0625 voltage: 2.598 - device: "dev:5c0272311928" + device: 'dev:5c0272311928' event: dfa3747d-688b-4250-935b-5dd60354313c file: air.qo - product: "product:com.blues.project.demo" + product: 'product:com.blues.project.demo' received: 1656011227.006928 req: note.add session: b623132c-6afb-4740-bc39-e3634e38f064 sn: My Device - tower_id: "0,0,0,0" + tower_id: '0,0,0,0' tri_country: US tri_lat: 34.82475372 tri_location: Atlanta GA @@ -6013,7 +6521,7 @@ components: fleets: type: array items: - $ref: "#/components/schemas/Fleet" + $ref: '#/components/schemas/Fleet' required: - fleets GetDeviceEnvironmentVariablesResponse: @@ -6029,7 +6537,7 @@ components: additionalProperties: type: string environment_variables_effective: - description: "The environment variables as they will be seen by the device, fully resolved with project/fleet/device prioritization rules." + description: 'The environment variables as they will be seen by the device, fully resolved with project/fleet/device prioritization rules.' type: object additionalProperties: type: string @@ -6041,6 +6549,48 @@ components: required: - environment_variables - environment_variables_env_default + GetJobResponse: + description: Batch job details + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/Job' + GetJobRunResponse: + description: Job run details + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/JobRun' + GetJobRunsResponse: + description: List of job runs + content: + application/json: + schema: + type: object + properties: + runs: + type: array + items: + $ref: '#/components/schemas/JobRun' + required: + - runs + GetJobsResponse: + description: List of batch jobs + content: + application/json: + schema: + type: object + properties: + jobs: + type: array + items: + $ref: '#/components/schemas/Job' + required: + - jobs LatestResponse: description: The response body for a Latest Events request. content: @@ -6052,62 +6602,62 @@ components: description: The set of latest events. Will always include the current "session.begin" event. type: array items: - $ref: "#/components/schemas/Event" + $ref: '#/components/schemas/Event' example: latest_events: - - app: "app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446" + - app: 'app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446' body: why: sensors.qo requested sync (sensors.qo) (TLS) - device: "dev:864475040523995" + device: 'dev:864475040523995' event: 81bd2bf1-0399-4978-bc46-8f779b4af350 file: _session.qo - product: "product:com.blues.app:myapp" + product: 'product:com.blues.app:myapp' received: 1669667707.564694 req: session.begin session: ed18884b-f2a6-419f-b856-d28dc8f0892b tls: true tower_country: US - tower_id: "310,410,20483,184692495" + tower_id: '310,410,20483,184692495' tower_lat: 43.769062500000004 tower_location: Waverly MI tower_lon: -83.657359375 tower_timezone: America/Detroit tower_when: 1669667691 when: 1669667707 - - app: "app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446" + - app: 'app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446' body: humid: 56.23 temp: 35.5 - device: "dev:864475040523995" + device: 'dev:864475040523995' event: 916d4c81-06ae-4263-9b55-7a3a0f73cb5a file: data.qo - product: "product:com.blues.app:myapp" + product: 'product:com.blues.app:myapp' received: 1669667713.221659 req: note.add session: 28cdc39f-9f62-4789-b0a3-2f35f9448ced sn: tj-1 tower_country: US - tower_id: "310,410,20483,184692495" + tower_id: '310,410,20483,184692495' tower_lat: 43.769062500000004 tower_location: Waverly MI tower_lon: -83.657359375 tower_timezone: America/Detroit tower_when: 1669667677 when: 1669667689 - - app: "app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446" + - app: 'app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446' body: humidity: 69.88647200683693 pressure: 993.6294496104914 temp: 21.273027181770885 - device: "dev:864475040523995" + device: 'dev:864475040523995' event: e98c2c3b-edbe-4fe7-af57-2196cc843eb7 file: sensors.qo - product: "product:com.blues.app:myapp" + product: 'product:com.blues.app:myapp' received: 1669667711.85316 req: note.add session: 7211392c-6895-43f8-9256-790655348be5 tower_country: US - tower_id: "310,410,20483,184692496" + tower_id: '310,410,20483,184692496' tower_lat: 43.747037500000005 tower_location: Waverly MI tower_lon: -83.665859375 @@ -6121,7 +6671,7 @@ components: schema: type: array items: - $ref: "#/components/schemas/Monitor" + $ref: '#/components/schemas/Monitor' properties: {} required: - monitors @@ -6138,6 +6688,18 @@ components: total: description: The total number of notes active on the Notefile. type: integer + RunJobResponse: + description: Job execution started + content: + application/json: + schema: + type: object + properties: + report_uid: + description: Unique identifier for this job run + type: string + required: + - report_uid SessionResponse: description: The response body for a session request. content: @@ -6150,7 +6712,7 @@ components: sessions: type: array items: - $ref: "#/components/schemas/DeviceSession" + $ref: '#/components/schemas/DeviceSession' required: - sessions - has_more @@ -6160,17 +6722,17 @@ components: - apn: a-notehub.com.attz bars: 2 bearer: LTE FDD - cell: "310,410,17169,77315594" + cell: '310,410,17169,77315594' continuous: true - device: "dev:000000000000000" + device: 'dev:000000000000000' events: 14 fleets: - - "fleet:46be9834-5te6-42c1-0000-b5ea05e248d7" + - 'fleet:46be9834-5te6-42c1-0000-b5ea05e248d7' hp_cycles_data: 3 hp_cycles_total: 3 hp_secs_data: 7659 hp_secs_total: 7659 - iccid: "89011704278500000000" + iccid: '89011704278500000000' ip: 10.68.56.193 moved: 1667250807 orientation: face-up @@ -6181,7 +6743,7 @@ components: notes_sent: 12 sessions_tls: 1 since: 1667250832 - product: "product:com.blues.demo:project" + product: 'product:com.blues.demo:project' rat: lte rsrp: -91 rsrq: -13 @@ -6200,7 +6762,7 @@ components: lon: -89.44239062499999 mcc: 310 mnc: 410 - "n": Shorewood Hills WI + 'n': Shorewood Hills WI time: 1667250835 towers: 1 zone: America/Chicago @@ -6223,26 +6785,26 @@ components: data: type: array items: - $ref: "#/components/schemas/UsageData" + $ref: '#/components/schemas/UsageData' device: description: The device UID this usage data belongs to (only present when aggregate is 'device') type: string - example: "dev:123456789012345" + example: 'dev:123456789012345' device_count: description: the number of devices represented by this data point type: integer fleet: description: The fleet UID this usage data belongs to (only present when aggregate is 'fleet') type: string - example: "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d" + example: 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' iccid: description: The ICCID of the cellular SIM card (only present when type is 'cellular') type: string - example: "12345678901234567890" + example: '12345678901234567890' psid: description: The PSID (Packet Service ID) of the satellite (or other packet-based device) type: string - example: "skylo:5746354465786" + example: 'skylo:5746354465786' type: description: The type of connectivity type: string @@ -6254,7 +6816,7 @@ components: - data type: object truncated: - $ref: "#/components/schemas/UsageTruncatedField" + $ref: '#/components/schemas/UsageTruncatedField' UsageRouteLogsResponse: description: Response body for Route Log Usage content: @@ -6265,9 +6827,9 @@ components: route_logs: type: array items: - $ref: "#/components/schemas/UsageRouteLogsData" + $ref: '#/components/schemas/UsageRouteLogsData' truncated: - $ref: "#/components/schemas/UsageTruncatedField" + $ref: '#/components/schemas/UsageTruncatedField' required: - route_logs UsageSessionsResponse: @@ -6280,9 +6842,9 @@ components: sessions: type: array items: - $ref: "#/components/schemas/UsageSessionsData" + $ref: '#/components/schemas/UsageSessionsData' truncated: - $ref: "#/components/schemas/UsageTruncatedField" + $ref: '#/components/schemas/UsageTruncatedField' required: - sessions - truncated @@ -6311,8 +6873,10 @@ tags: name: webhook - description: APIs for events and sessions for external devices name: external devices - - description: "Project Usage information related to events, route logs, sessions, and data usage" + - description: 'Project Usage information related to events, route logs, sessions, and data usage' name: usage + - description: Batch job operations + name: jobs externalDocs: description: Find out more about Blues - url: "https://blues.io" + url: 'https://blues.io' diff --git a/openapi_filtered.yaml b/openapi_filtered.yaml index f5c529e..65d0783 100644 --- a/openapi_filtered.yaml +++ b/openapi_filtered.yaml @@ -146,6 +146,94 @@ paths: - personalAccessToken: [] tags: - billing_account + /v1/billing-accounts/{billingAccountUID}: + get: + operationId: GetBillingAccount + description: Get Billing Account Information + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + name: + type: string + owner: + type: string + plan: + type: object + properties: + current_balance: + type: integer + format: int64 + end_date: + type: string + format: date-time + event_capacity: + type: integer + format: int64 + start_date: + type: string + format: date-time + type: + type: string + enum: + - Enterprise + - Essentials + suspended: + type: boolean + uid: + type: string + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account + /v1/billing-accounts/{billingAccountUID}/balance-history: + get: + operationId: GetBillingAccountBalanceHistory + description: Get Billing Account Balance history, only enterprise supported + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + properties: + period: + type: string + format: date-time + remaining_event_capacity: + type: integer + format: int64 + total_event_capacity_used: + type: integer + format: int64 + required: + - remaining_event_capacity + - total_event_capacity_used + - period + type: object + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin: get: operationId: GetDeviceEnvironmentVariablesByPin @@ -386,6 +474,31 @@ paths: - personalAccessToken: [] tags: - alert + /v1/projects/{projectOrProductUID}/aws-role-config: + get: + operationId: GetAWSRoleConfig + summary: Get AWS role configuration for role-based authentication + description: 'Returns the AWS Account ID and External ID needed to configure + an IAM role + + trust policy for role-based authentication on AWS routes. + + ' + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + '200': + description: AWS role configuration + content: + application/json: + schema: + $ref: '#/components/schemas/AWSRoleConfig' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project /v1/projects/{projectOrProductUID}/clone: post: operationId: CloneProject @@ -854,6 +967,23 @@ paths: - personalAccessToken: [] tags: - device + /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}: + post: + operationId: CreateNotefile + description: Creates an empty Notefile on the device. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + responses: + '200': + description: An empty object means success + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}: get: operationId: GetNotefile @@ -1141,6 +1271,7 @@ paths: - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/firstSyncParam' responses: '200': $ref: '#/components/responses/SessionResponse' @@ -1914,6 +2045,179 @@ paths: - personalAccessToken: [] tags: - project + /v1/projects/{projectOrProductUID}/jobs: + get: + operationId: GetJobs + description: List all batch jobs for a project + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobsResponse' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + post: + operationId: CreateJob + description: Create a new batch job with an optional name + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - name: name + in: query + description: Name for the job + required: true + schema: + type: string + requestBody: + description: The job definition as raw JSON + required: true + content: + application/json: + schema: + description: Job definition (structure varies by job type) + type: object + properties: {} + responses: + '201': + $ref: '#/components/responses/CreateJobResponse' + '400': + description: Missing required name parameter or invalid job definition + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + /v1/projects/{projectOrProductUID}/jobs/{jobUID}: + delete: + operationId: DeleteJob + description: Delete a batch job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + responses: + '200': + $ref: '#/components/responses/DeleteJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + get: + operationId: GetJob + description: Get a specific batch job definition + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run: + post: + operationId: RunJob + description: Execute a batch job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + - name: dry_run + in: query + description: Run job in dry-run mode without making actual changes + required: false + schema: + type: boolean + default: false + responses: + '200': + $ref: '#/components/responses/RunJobResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs: + get: + operationId: GetJobRuns + description: List all runs for a specific job + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/jobUIDParam' + - name: status + in: query + description: Filter runs by status + required: false + schema: + type: string + - name: dry_run + in: query + description: Filter runs by dry run flag + required: false + schema: + type: boolean + nullable: true + responses: + '200': + $ref: '#/components/responses/GetJobRunsResponse' + '404': + description: Job not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}: + get: + operationId: GetJobRun + description: Get the result of a job execution + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + $ref: '#/components/responses/GetJobRunResponse' + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs + /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel: + post: + operationId: CancelJobRun + description: Cancel a running job execution + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/reportUIDParam' + responses: + '200': + $ref: '#/components/responses/CancelJobRunResponse' + '404': + description: Run not found + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - jobs /v1/projects/{projectOrProductUID}/members: get: operationId: GetProjectMembers @@ -2716,6 +3020,13 @@ paths: - webhook components: parameters: + billingAccountUIDParam: + example: 00000000-0000-0000-000000000001 + in: path + name: billingAccountUID + required: true + schema: + type: string cursorParam: description: 'A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this @@ -2950,6 +3261,14 @@ components: required: false schema: type: string + firstSyncParam: + description: When true, filters results to only show first sync sessions + in: query + name: firstSync + required: false + schema: + type: boolean + default: false fleetUIDFilterQueryParam: description: Filter by Fleet UID explode: true @@ -3011,6 +3330,14 @@ components: items: type: string style: form + jobUIDParam: + description: Unique identifier for a batch job + example: my-reconciliation-job + in: path + name: jobUID + required: true + schema: + type: string limitParam: in: query name: limit @@ -3127,6 +3454,14 @@ components: required: true schema: type: string + reportUIDParam: + description: Unique identifier for a job run report + example: my-reconciliation-job-1707654321000 + in: path + name: reportUID + required: true + schema: + type: string repositoryKey: description: The secret key used to access this repository in: header @@ -3350,6 +3685,21 @@ components: schema: type: string schemas: + AWSRoleConfig: + description: Configuration needed to set up an IAM role trust policy for role-based + authentication on AWS routes + type: object + properties: + aws_account_id: + description: The Blues AWS Account ID to trust in your IAM role's trust + policy + type: string + external_id: + description: The External ID to use in your IAM role's trust policy condition + type: string + required: + - aws_account_id + - external_id Alert: type: object properties: @@ -3473,6 +3823,9 @@ components: type: string region: type: string + role_arn: + description: IAM Role ARN for role-based authentication via STS AssumeRole + type: string throttle_ms: type: integer timeout: @@ -4546,9 +4899,15 @@ components: filename: description: The name of the firmware file. type: string + info: + description: User-defined metadata + type: object md5: description: The MD5 hash of the firmware file. type: string + notes: + description: User-defined notes + type: string organization: description: The organization that owns the firmware. type: string @@ -4676,6 +5035,84 @@ components: JSONata: type: object properties: {} + Job: + type: object + properties: + created: + description: Unix timestamp when job was created + type: integer + format: int64 + 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 + name: + description: Human-readable job name + type: string + required: + - job_uid + - name + - created + - created_by + JobRun: + type: object + properties: + cancel: + description: Whether cancellation was requested + type: boolean + completed: + description: Unix timestamp when completed + type: integer + format: int64 + dry_run: + description: Whether this was a dry run + type: boolean + job_name: + description: Name of the job + type: string + job_uid: + description: Unique identifier for the job + type: string + report_uid: + description: Unique identifier for this run + type: string + results: + description: Full results (only in detail view) + type: object + additionalProperties: true + started: + description: Unix timestamp when started + type: integer + format: int64 + status: + description: Current status (submitted, running, completed, cancelled, failed) + type: string + submitted: + description: Unix timestamp when submitted + type: integer + format: int64 + submitted_by: + description: User who submitted the run + type: string + updated: + description: Unix timestamp of last update + type: integer + format: int64 + required: + - report_uid + - job_uid + - job_name + - status + - dry_run + - submitted_by + - submitted + - updated Location: type: object properties: @@ -4742,6 +5179,7 @@ components: - less_than_or_equal_to - equal_to - not_equal_to + - count description: type: string disabled: @@ -5326,7 +5764,7 @@ components: description: Total bytes included in the plan type: integer format: int64 - example: 18650 + example: 10000 bytes_used: description: Bytes used to date type: integer @@ -5764,6 +6202,20 @@ components: type: integer format: int64 example: 42 + total_fw_updates: + description: Number of firmware updates in this period (from _health.qo + DFU events) + type: integer + format: int64 + example: 1 + nullable: true + total_reboots: + description: Number of device reboots in this period (from _health.qo boot + events) + type: integer + format: int64 + example: 2 + nullable: true watchdog_events: description: Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for @@ -5792,6 +6244,13 @@ components: UsageRouteLogsData: type: object properties: + avg_latency_ms: + description: Average routing latency in milliseconds for route logs with + recorded duration + type: number + format: double + example: 342.5 + nullable: true failed_routes: type: integer format: int64 @@ -5823,6 +6282,11 @@ components: device: type: string example: dev:123456789012345 + first_sync_sessions: + description: Number of first sync sessions in this period + type: integer + format: int64 + example: 2 fleet: type: string example: fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d @@ -5834,6 +6298,23 @@ components: type: integer format: int64 example: 12 + sessions_by_transport: + description: Count of sessions grouped by transport type prefix (e.g. cell, + wifi, ntn, lorawan) + type: object + example: + cell: 8 + ntn: 1 + wifi: 3 + additionalProperties: + format: int64 + type: integer + tls_sessions: + description: Number of TLS sessions in this period + type: integer + format: int64 + example: 3 + nullable: true total_bytes: type: integer format: int64 @@ -5845,6 +6326,7 @@ components: required: - period - sessions + - first_sync_sessions - total_bytes - total_devices UsageTruncatedField: @@ -5918,6 +6400,42 @@ components: required: - alerts - has_more + CancelJobRunResponse: + description: Cancel operation completed + content: + application/json: + schema: + type: object + properties: + successful: + description: True if cancellation was successful + type: boolean + required: + - successful + CreateJobResponse: + description: Job created successfully + content: + application/json: + schema: + type: object + properties: + job_uid: + description: The unique identifier for the created job + type: string + required: + - job_uid + DeleteJobResponse: + description: Job deleted successfully + content: + application/json: + schema: + type: object + properties: + success: + description: True if deletion was successful + type: boolean + required: + - success DevicePlansResponse: description: Response body for /plans content: @@ -6140,6 +6658,48 @@ components: required: - environment_variables - environment_variables_env_default + GetJobResponse: + description: Batch job details + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/Job' + GetJobRunResponse: + description: Job run details + content: + application/json: + schema: + type: '' + properties: {} + $ref: '#/components/schemas/JobRun' + GetJobRunsResponse: + description: List of job runs + content: + application/json: + schema: + type: object + properties: + runs: + type: array + items: + $ref: '#/components/schemas/JobRun' + required: + - runs + GetJobsResponse: + description: List of batch jobs + content: + application/json: + schema: + type: object + properties: + jobs: + type: array + items: + $ref: '#/components/schemas/Job' + required: + - jobs LatestResponse: description: The response body for a Latest Events request. content: @@ -6238,6 +6798,18 @@ components: total: description: The total number of notes active on the Notefile. type: integer + RunJobResponse: + description: Job execution started + content: + application/json: + schema: + type: object + properties: + report_uid: + description: Unique identifier for this job run + type: string + required: + - report_uid SessionResponse: description: The response body for a session request. content: @@ -6420,6 +6992,8 @@ tags: - description: Project Usage information related to events, route logs, sessions, and data usage name: usage +- description: Batch job operations + name: jobs externalDocs: description: Find out more about Blues url: https://blues.io diff --git a/src/.openapi-generator/FILES b/src/.openapi-generator/FILES index a893511..72777a7 100644 --- a/src/.openapi-generator/FILES +++ b/src/.openapi-generator/FILES @@ -3,6 +3,7 @@ .gitlab-ci.yml .travis.yml README.md +docs/AWSRoleConfig.md docs/AddDeviceToFleetsRequest.md docs/Alert.md docs/AlertApi.md @@ -16,10 +17,12 @@ docs/BillingAccountApi.md docs/BillingAccountRole.md docs/BlynkRoute.md docs/Body.md +docs/CancelJobRun200Response.md docs/CellularPlan.md docs/CloneProjectRequest.md docs/Contact.md docs/CreateFleetRequest.md +docs/CreateJob201Response.md docs/CreateMonitor.md docs/CreateProductRequest.md docs/CreateProjectRequest.md @@ -32,6 +35,7 @@ docs/DataSetField.md docs/DataUsage.md docs/DatacakeRoute.md docs/DeleteDeviceFromFleetsRequest.md +docs/DeleteJob200Response.md docs/DeleteNotefilesRequest.md docs/Device.md docs/DeviceApi.md @@ -60,6 +64,10 @@ docs/FirmwareInfo.md docs/Fleet.md docs/FleetConnectivityAssurance.md docs/GetAlerts200Response.md +docs/GetBillingAccount200Response.md +docs/GetBillingAccount200ResponsePlan.md +docs/GetBillingAccountBalanceHistory200Response.md +docs/GetBillingAccountBalanceHistory200ResponseDataInner.md docs/GetBillingAccounts200Response.md docs/GetDataUsage200Response.md docs/GetDataUsage200ResponseDataInner.md @@ -77,6 +85,8 @@ docs/GetDeviceSessions200Response.md docs/GetDevices200Response.md docs/GetEvents200Response.md docs/GetEventsByCursor200Response.md +docs/GetJobRuns200Response.md +docs/GetJobs200Response.md docs/GetNotefile200Response.md docs/GetProducts200Response.md docs/GetProjectMembers200Response.md @@ -86,6 +96,9 @@ docs/GetSessionsUsage200Response.md docs/GetWebhooks200Response.md docs/GoogleRoute.md docs/HttpRoute.md +docs/Job.md +docs/JobRun.md +docs/JobsApi.md docs/Location.md docs/Login200Response.md docs/LoginRequest.md @@ -118,6 +131,7 @@ docs/Role.md docs/RouteApi.md docs/RouteLog.md docs/RouteTransformSettings.md +docs/RunJob200Response.md docs/S3ArchiveRoute.md docs/SatelliteDataUsage.md docs/SatellitePlan.md @@ -154,6 +168,7 @@ notehub_py/api/billing_account_api.py notehub_py/api/device_api.py notehub_py/api/event_api.py notehub_py/api/external_devices_api.py +notehub_py/api/jobs_api.py notehub_py/api/monitor_api.py notehub_py/api/project_api.py notehub_py/api/route_api.py @@ -168,16 +183,19 @@ notehub_py/models/add_device_to_fleets_request.py notehub_py/models/alert.py notehub_py/models/alert_data_inner.py 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/billing_account.py notehub_py/models/billing_account_role.py notehub_py/models/blynk_route.py notehub_py/models/body.py +notehub_py/models/cancel_job_run200_response.py notehub_py/models/cellular_plan.py 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_monitor.py notehub_py/models/create_product_request.py notehub_py/models/create_project_request.py @@ -188,6 +206,7 @@ notehub_py/models/data_set_field.py notehub_py/models/data_usage.py notehub_py/models/datacake_route.py notehub_py/models/delete_device_from_fleets_request.py +notehub_py/models/delete_job200_response.py notehub_py/models/delete_notefiles_request.py notehub_py/models/device.py notehub_py/models/device_dfu_history.py @@ -215,6 +234,10 @@ notehub_py/models/firmware_info.py notehub_py/models/fleet.py notehub_py/models/fleet_connectivity_assurance.py notehub_py/models/get_alerts200_response.py +notehub_py/models/get_billing_account200_response.py +notehub_py/models/get_billing_account200_response_plan.py +notehub_py/models/get_billing_account_balance_history200_response.py +notehub_py/models/get_billing_account_balance_history200_response_data_inner.py notehub_py/models/get_billing_accounts200_response.py notehub_py/models/get_data_usage200_response.py notehub_py/models/get_data_usage200_response_data_inner.py @@ -232,6 +255,8 @@ notehub_py/models/get_device_sessions200_response.py notehub_py/models/get_devices200_response.py notehub_py/models/get_events200_response.py notehub_py/models/get_events_by_cursor200_response.py +notehub_py/models/get_job_runs200_response.py +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 @@ -241,6 +266,8 @@ notehub_py/models/get_sessions_usage200_response.py 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_run.py notehub_py/models/location.py notehub_py/models/login200_response.py notehub_py/models/login_request.py @@ -270,6 +297,7 @@ notehub_py/models/repository.py notehub_py/models/role.py notehub_py/models/route_log.py notehub_py/models/route_transform_settings.py +notehub_py/models/run_job200_response.py notehub_py/models/s3_archive_route.py notehub_py/models/satellite_data_usage.py notehub_py/models/satellite_plan.py diff --git a/src/README.md b/src/README.md index 6d12a55..bde48aa 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.0.2 +- Package version: 6.1.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/) @@ -108,9 +108,12 @@ Class | Method | HTTP request | Description *AlertApi* | [**get_alerts**](docs/AlertApi.md#get_alerts) | **GET** /v1/projects/{projectOrProductUID}/alerts | *AuthorizationApi* | [**login**](docs/AuthorizationApi.md#login) | **POST** /auth/login | *AuthorizationApi* | [**o_auth2_client_credentials**](docs/AuthorizationApi.md#o_auth2_client_credentials) | **POST** /oauth2/token | Issue an OAuth 2.0 access token (Client Credentials) +*BillingAccountApi* | [**get_billing_account**](docs/BillingAccountApi.md#get_billing_account) | **GET** /v1/billing-accounts/{billingAccountUID} | +*BillingAccountApi* | [**get_billing_account_balance_history**](docs/BillingAccountApi.md#get_billing_account_balance_history) | **GET** /v1/billing-accounts/{billingAccountUID}/balance-history | *BillingAccountApi* | [**get_billing_accounts**](docs/BillingAccountApi.md#get_billing_accounts) | **GET** /v1/billing-accounts | *DeviceApi* | [**add_db_note**](docs/DeviceApi.md#add_db_note) | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | *DeviceApi* | [**add_qi_note**](docs/DeviceApi.md#add_qi_note) | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | +*DeviceApi* | [**create_notefile**](docs/DeviceApi.md#create_notefile) | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID} | *DeviceApi* | [**delete_device**](docs/DeviceApi.md#delete_device) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID} | *DeviceApi* | [**delete_device_environment_variable**](docs/DeviceApi.md#delete_device_environment_variable) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key} | *DeviceApi* | [**delete_note**](docs/DeviceApi.md#delete_note) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | @@ -145,6 +148,14 @@ Class | Method | HTTP request | Description *ExternalDevicesApi* | [**create_event_ext_device**](docs/ExternalDevicesApi.md#create_event_ext_device) | **POST** /v1/products/{productUID}/ext-devices/{deviceUID}/event | *ExternalDevicesApi* | [**ext_device_session_close**](docs/ExternalDevicesApi.md#ext_device_session_close) | **POST** /v1/products/{productUID}/ext-devices/{deviceUID}/session/close | *ExternalDevicesApi* | [**ext_device_session_open**](docs/ExternalDevicesApi.md#ext_device_session_open) | **POST** /v1/products/{productUID}/ext-devices/{deviceUID}/session/open | +*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* | [**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 | +*JobsApi* | [**get_jobs**](docs/JobsApi.md#get_jobs) | **GET** /v1/projects/{projectOrProductUID}/jobs | +*JobsApi* | [**run_job**](docs/JobsApi.md#run_job) | **POST** /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run | *MonitorApi* | [**create_monitor**](docs/MonitorApi.md#create_monitor) | **POST** /v1/projects/{projectOrProductUID}/monitors | *MonitorApi* | [**delete_monitor**](docs/MonitorApi.md#delete_monitor) | **DELETE** /v1/projects/{projectOrProductUID}/monitors/{monitorUID} | *MonitorApi* | [**get_monitor**](docs/MonitorApi.md#get_monitor) | **GET** /v1/projects/{projectOrProductUID}/monitors/{monitorUID} | @@ -164,6 +175,7 @@ Class | Method | HTTP request | Description *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 | +*ProjectApi* | [**get_aws_role_config**](docs/ProjectApi.md#get_aws_role_config) | **GET** /v1/projects/{projectOrProductUID}/aws-role-config | Get AWS role configuration for role-based authentication *ProjectApi* | [**get_device_dfu_history**](docs/ProjectApi.md#get_device_dfu_history) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history | *ProjectApi* | [**get_device_dfu_status**](docs/ProjectApi.md#get_device_dfu_status) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status | *ProjectApi* | [**get_device_fleets**](docs/ProjectApi.md#get_device_fleets) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | @@ -207,6 +219,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AWSRoleConfig](docs/AWSRoleConfig.md) - [AddDeviceToFleetsRequest](docs/AddDeviceToFleetsRequest.md) - [Alert](docs/Alert.md) - [AlertDataInner](docs/AlertDataInner.md) @@ -217,10 +230,12 @@ Class | Method | HTTP request | Description - [BillingAccountRole](docs/BillingAccountRole.md) - [BlynkRoute](docs/BlynkRoute.md) - [Body](docs/Body.md) + - [CancelJobRun200Response](docs/CancelJobRun200Response.md) - [CellularPlan](docs/CellularPlan.md) - [CloneProjectRequest](docs/CloneProjectRequest.md) - [Contact](docs/Contact.md) - [CreateFleetRequest](docs/CreateFleetRequest.md) + - [CreateJob201Response](docs/CreateJob201Response.md) - [CreateMonitor](docs/CreateMonitor.md) - [CreateProductRequest](docs/CreateProductRequest.md) - [CreateProjectRequest](docs/CreateProjectRequest.md) @@ -233,6 +248,7 @@ Class | Method | HTTP request | Description - [DataUsage](docs/DataUsage.md) - [DatacakeRoute](docs/DatacakeRoute.md) - [DeleteDeviceFromFleetsRequest](docs/DeleteDeviceFromFleetsRequest.md) + - [DeleteJob200Response](docs/DeleteJob200Response.md) - [DeleteNotefilesRequest](docs/DeleteNotefilesRequest.md) - [Device](docs/Device.md) - [DeviceDfuHistory](docs/DeviceDfuHistory.md) @@ -258,6 +274,10 @@ Class | Method | HTTP request | Description - [Fleet](docs/Fleet.md) - [FleetConnectivityAssurance](docs/FleetConnectivityAssurance.md) - [GetAlerts200Response](docs/GetAlerts200Response.md) + - [GetBillingAccount200Response](docs/GetBillingAccount200Response.md) + - [GetBillingAccount200ResponsePlan](docs/GetBillingAccount200ResponsePlan.md) + - [GetBillingAccountBalanceHistory200Response](docs/GetBillingAccountBalanceHistory200Response.md) + - [GetBillingAccountBalanceHistory200ResponseDataInner](docs/GetBillingAccountBalanceHistory200ResponseDataInner.md) - [GetBillingAccounts200Response](docs/GetBillingAccounts200Response.md) - [GetDataUsage200Response](docs/GetDataUsage200Response.md) - [GetDataUsage200ResponseDataInner](docs/GetDataUsage200ResponseDataInner.md) @@ -275,6 +295,8 @@ Class | Method | HTTP request | Description - [GetDevices200Response](docs/GetDevices200Response.md) - [GetEvents200Response](docs/GetEvents200Response.md) - [GetEventsByCursor200Response](docs/GetEventsByCursor200Response.md) + - [GetJobRuns200Response](docs/GetJobRuns200Response.md) + - [GetJobs200Response](docs/GetJobs200Response.md) - [GetNotefile200Response](docs/GetNotefile200Response.md) - [GetProducts200Response](docs/GetProducts200Response.md) - [GetProjectMembers200Response](docs/GetProjectMembers200Response.md) @@ -284,6 +306,8 @@ Class | Method | HTTP request | Description - [GetWebhooks200Response](docs/GetWebhooks200Response.md) - [GoogleRoute](docs/GoogleRoute.md) - [HttpRoute](docs/HttpRoute.md) + - [Job](docs/Job.md) + - [JobRun](docs/JobRun.md) - [Location](docs/Location.md) - [Login200Response](docs/Login200Response.md) - [LoginRequest](docs/LoginRequest.md) @@ -313,6 +337,7 @@ Class | Method | HTTP request | Description - [Role](docs/Role.md) - [RouteLog](docs/RouteLog.md) - [RouteTransformSettings](docs/RouteTransformSettings.md) + - [RunJob200Response](docs/RunJob200Response.md) - [S3ArchiveRoute](docs/S3ArchiveRoute.md) - [SatelliteDataUsage](docs/SatelliteDataUsage.md) - [SatellitePlan](docs/SatellitePlan.md) diff --git a/src/docs/AWSRoleConfig.md b/src/docs/AWSRoleConfig.md new file mode 100644 index 0000000..f6ecb61 --- /dev/null +++ b/src/docs/AWSRoleConfig.md @@ -0,0 +1,30 @@ +# AWSRoleConfig + +Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes + +## Properties + +| Name | Type | Description | Notes | +| ------------------ | ------- | --------------------------------------------------------------------- | ----- | +| **aws_account_id** | **str** | The Blues AWS Account ID to trust in your IAM role's trust policy | +| **external_id** | **str** | The External ID to use in your IAM role's trust policy condition | + +## Example + +```python +from notehub_py.models.aws_role_config import AWSRoleConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of AWSRoleConfig from a JSON string +aws_role_config_instance = AWSRoleConfig.from_json(json) +# print the JSON string representation of the object +print(AWSRoleConfig.to_json()) + +# convert the object into a dict +aws_role_config_dict = aws_role_config_instance.to_dict() +# create an instance of AWSRoleConfig from a dict +aws_role_config_from_dict = AWSRoleConfig.from_dict(aws_role_config_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/AwsRoute.md b/src/docs/AwsRoute.md index c3b7351..c3e3814 100644 --- a/src/docs/AwsRoute.md +++ b/src/docs/AwsRoute.md @@ -2,22 +2,23 @@ ## Properties -| Name | Type | Description | Notes | -| ---------------------------- | ------------------------------------------------------- | ----------- | ---------- | -| **access_key_id** | **str** | | [optional] | -| **access_key_secret** | **str** | | [optional] | -| **channel** | **str** | | [optional] | -| **disable_http_headers** | **bool** | | [optional] | -| **filter** | [**Filter**](Filter.md) | | [optional] | -| **fleets** | **List[str]** | | [optional] | -| **http_headers** | **Dict[str, str]** | | [optional] | -| **message_deduplication_id** | **str** | | [optional] | -| **message_group_id** | **str** | | [optional] | -| **region** | **str** | | [optional] | -| **throttle_ms** | **int** | | [optional] | -| **timeout** | **int** | | [optional] | -| **transform** | [**RouteTransformSettings**](RouteTransformSettings.md) | | [optional] | -| **url** | **str** | | [optional] | +| Name | Type | Description | Notes | +| ---------------------------- | ------------------------------------------------------- | ------------------------------------------------------------- | ---------- | +| **access_key_id** | **str** | | [optional] | +| **access_key_secret** | **str** | | [optional] | +| **channel** | **str** | | [optional] | +| **disable_http_headers** | **bool** | | [optional] | +| **filter** | [**Filter**](Filter.md) | | [optional] | +| **fleets** | **List[str]** | | [optional] | +| **http_headers** | **Dict[str, str]** | | [optional] | +| **message_deduplication_id** | **str** | | [optional] | +| **message_group_id** | **str** | | [optional] | +| **region** | **str** | | [optional] | +| **role_arn** | **str** | IAM Role ARN for role-based authentication via STS AssumeRole | [optional] | +| **throttle_ms** | **int** | | [optional] | +| **timeout** | **int** | | [optional] | +| **transform** | [**RouteTransformSettings**](RouteTransformSettings.md) | | [optional] | +| **url** | **str** | | [optional] | ## Example diff --git a/src/docs/BillingAccountApi.md b/src/docs/BillingAccountApi.md index e0c5458..b1b717b 100644 --- a/src/docs/BillingAccountApi.md +++ b/src/docs/BillingAccountApi.md @@ -2,9 +2,163 @@ All URIs are relative to *https://api.notefile.net* -| Method | HTTP request | Description | -| --------------------------------------------------------------------- | ---------------------------- | ----------- | -| [**get_billing_accounts**](BillingAccountApi.md#get_billing_accounts) | **GET** /v1/billing-accounts | +| Method | HTTP request | Description | +| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ----------- | +| [**get_billing_account**](BillingAccountApi.md#get_billing_account) | **GET** /v1/billing-accounts/{billingAccountUID} | +| [**get_billing_account_balance_history**](BillingAccountApi.md#get_billing_account_balance_history) | **GET** /v1/billing-accounts/{billingAccountUID}/balance-history | +| [**get_billing_accounts**](BillingAccountApi.md#get_billing_accounts) | **GET** /v1/billing-accounts | + +# **get_billing_account** + +> GetBillingAccount200Response get_billing_account(billing_account_uid) + +Get Billing Account Information + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.get_billing_account200_response import GetBillingAccount200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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.BillingAccountApi(api_client) + billing_account_uid = '00000000-0000-0000-000000000001' # str | + + try: + api_response = api_instance.get_billing_account(billing_account_uid) + print("The response of BillingAccountApi->get_billing_account:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BillingAccountApi->get_billing_account: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------------------- | ------- | ----------- | ----- | +| **billing_account_uid** | **str** | | + +### Return type + +[**GetBillingAccount200Response**](GetBillingAccount200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Successful operation | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_billing_account_balance_history** + +> GetBillingAccountBalanceHistory200Response get_billing_account_balance_history(billing_account_uid, start_date=start_date, end_date=end_date) + +Get Billing Account Balance history, only enterprise supported + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.get_billing_account_balance_history200_response import GetBillingAccountBalanceHistory200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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.BillingAccountApi(api_client) + billing_account_uid = '00000000-0000-0000-000000000001' # 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_billing_account_balance_history(billing_account_uid, start_date=start_date, end_date=end_date) + print("The response of BillingAccountApi->get_billing_account_balance_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BillingAccountApi->get_billing_account_balance_history: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------------------- | ------- | --------------------------------------------------------------- | ---------- | +| **billing_account_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 + +[**GetBillingAccountBalanceHistory200Response**](GetBillingAccountBalanceHistory200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Successful operation | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_billing_accounts** diff --git a/src/docs/CancelJobRun200Response.md b/src/docs/CancelJobRun200Response.md new file mode 100644 index 0000000..3e2429f --- /dev/null +++ b/src/docs/CancelJobRun200Response.md @@ -0,0 +1,27 @@ +# CancelJobRun200Response + +## Properties + +| Name | Type | Description | Notes | +| -------------- | -------- | ----------------------------------- | ----- | +| **successful** | **bool** | True if cancellation was successful | + +## Example + +```python +from notehub_py.models.cancel_job_run200_response import CancelJobRun200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CancelJobRun200Response from a JSON string +cancel_job_run200_response_instance = CancelJobRun200Response.from_json(json) +# print the JSON string representation of the object +print(CancelJobRun200Response.to_json()) + +# convert the object into a dict +cancel_job_run200_response_dict = cancel_job_run200_response_instance.to_dict() +# create an instance of CancelJobRun200Response from a dict +cancel_job_run200_response_from_dict = CancelJobRun200Response.from_dict(cancel_job_run200_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/CreateJob201Response.md b/src/docs/CreateJob201Response.md new file mode 100644 index 0000000..d2158ac --- /dev/null +++ b/src/docs/CreateJob201Response.md @@ -0,0 +1,27 @@ +# CreateJob201Response + +## Properties + +| Name | Type | Description | Notes | +| ----------- | ------- | ----------------------------------------- | ----- | +| **job_uid** | **str** | The unique identifier for the created job | + +## Example + +```python +from notehub_py.models.create_job201_response import CreateJob201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateJob201Response from a JSON string +create_job201_response_instance = CreateJob201Response.from_json(json) +# print the JSON string representation of the object +print(CreateJob201Response.to_json()) + +# convert the object into a dict +create_job201_response_dict = create_job201_response_instance.to_dict() +# create an instance of CreateJob201Response from a dict +create_job201_response_from_dict = CreateJob201Response.from_dict(create_job201_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/DeleteJob200Response.md b/src/docs/DeleteJob200Response.md new file mode 100644 index 0000000..7ac83f4 --- /dev/null +++ b/src/docs/DeleteJob200Response.md @@ -0,0 +1,27 @@ +# DeleteJob200Response + +## Properties + +| Name | Type | Description | Notes | +| ----------- | -------- | ------------------------------- | ----- | +| **success** | **bool** | True if deletion was successful | + +## Example + +```python +from notehub_py.models.delete_job200_response import DeleteJob200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteJob200Response from a JSON string +delete_job200_response_instance = DeleteJob200Response.from_json(json) +# print the JSON string representation of the object +print(DeleteJob200Response.to_json()) + +# convert the object into a dict +delete_job200_response_dict = delete_job200_response_instance.to_dict() +# create an instance of DeleteJob200Response from a dict +delete_job200_response_from_dict = DeleteJob200Response.from_dict(delete_job200_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/DeviceApi.md b/src/docs/DeviceApi.md index 45613e0..5128770 100644 --- a/src/docs/DeviceApi.md +++ b/src/docs/DeviceApi.md @@ -6,6 +6,7 @@ All URIs are relative to *https://api.notefile.net* | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ----------------------------------------------- | | [**add_db_note**](DeviceApi.md#add_db_note) | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | | [**add_qi_note**](DeviceApi.md#add_qi_note) | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | +| [**create_notefile**](DeviceApi.md#create_notefile) | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID} | | [**delete_device**](DeviceApi.md#delete_device) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID} | | [**delete_device_environment_variable**](DeviceApi.md#delete_device_environment_variable) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key} | | [**delete_note**](DeviceApi.md#delete_note) | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | @@ -191,6 +192,81 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_notefile** + +> create_notefile(project_or_product_uid, device_uid, notefile_id) + +Creates an empty Notefile on the device. + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + notefile_id = 'notefile_id_example' # str | + + try: + api_instance.create_notefile(project_or_product_uid, device_uid, notefile_id) + except Exception as e: + print("Exception when calling DeviceApi->create_notefile: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | ----------- | ----- | +| **project_or_product_uid** | **str** | | +| **device_uid** | **str** | | +| **notefile_id** | **str** | | + +### Return type + +void (empty response body) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | An empty object means success | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_device** > delete_device(project_or_product_uid, device_uid) @@ -1412,7 +1488,7 @@ with notehub_py.ApiClient(configuration) as api_client: # **get_device_sessions** -> GetDeviceSessions200Response get_device_sessions(project_or_product_uid, device_uid, page_size=page_size, page_num=page_num, start_date=start_date, end_date=end_date) +> GetDeviceSessions200Response get_device_sessions(project_or_product_uid, device_uid, page_size=page_size, page_num=page_num, start_date=start_date, end_date=end_date, first_sync=first_sync) Get Device Sessions @@ -1452,9 +1528,10 @@ with notehub_py.ApiClient(configuration) as api_client: page_num = 1 # int | (optional) (default to 1) 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) + first_sync = False # bool | When true, filters results to only show first sync sessions (optional) (default to False) try: - api_response = api_instance.get_device_sessions(project_or_product_uid, device_uid, page_size=page_size, page_num=page_num, start_date=start_date, end_date=end_date) + api_response = api_instance.get_device_sessions(project_or_product_uid, device_uid, page_size=page_size, page_num=page_num, start_date=start_date, end_date=end_date, first_sync=first_sync) print("The response of DeviceApi->get_device_sessions:\n") pprint(api_response) except Exception as e: @@ -1463,14 +1540,15 @@ with notehub_py.ApiClient(configuration) as api_client: ### Parameters -| Name | Type | Description | Notes | -| -------------------------- | ------- | --------------------------------------------------------------- | -------------------------- | -| **project_or_product_uid** | **str** | | -| **device_uid** | **str** | | -| **page_size** | **int** | | [optional] [default to 50] | -| **page_num** | **int** | | [optional] [default to 1] | -| **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] | +| Name | Type | Description | Notes | +| -------------------------- | -------- | --------------------------------------------------------------- | ----------------------------- | +| **project_or_product_uid** | **str** | | +| **device_uid** | **str** | | +| **page_size** | **int** | | [optional] [default to 50] | +| **page_num** | **int** | | [optional] [default to 1] | +| **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] | +| **first_sync** | **bool** | When true, filters results to only show first sync sessions | [optional] [default to False] | ### Return type diff --git a/src/docs/FirmwareInfo.md b/src/docs/FirmwareInfo.md index 824b372..d2291e6 100644 --- a/src/docs/FirmwareInfo.md +++ b/src/docs/FirmwareInfo.md @@ -2,20 +2,22 @@ ## Properties -| Name | Type | Description | Notes | -| ---------------- | -------- | -------------------------------------------- | ---------- | -| **built** | **str** | The date the firmware was built. | [optional] | -| **created** | **str** | The date the firmware was created. | [optional] | -| **description** | **str** | A description of the firmware. | [optional] | -| **filename** | **str** | The name of the firmware file. | [optional] | -| **md5** | **str** | The MD5 hash of the firmware file. | [optional] | -| **organization** | **str** | The organization that owns the firmware. | [optional] | -| **product** | **str** | The product that the firmware is for. | [optional] | -| **published** | **bool** | True if the firmware is published. | [optional] | -| **tags** | **str** | A list of tags associated with the firmware. | [optional] | -| **target** | **str** | The target device for the firmware. | [optional] | -| **type** | **str** | The type of firmware. | [optional] | -| **version** | **str** | The version of the firmware. | [optional] | +| Name | Type | Description | Notes | +| ---------------- | ---------- | -------------------------------------------- | ---------- | +| **built** | **str** | The date the firmware was built. | [optional] | +| **created** | **str** | The date the firmware was created. | [optional] | +| **description** | **str** | A description of the firmware. | [optional] | +| **filename** | **str** | The name of the firmware file. | [optional] | +| **info** | **object** | User-defined metadata | [optional] | +| **md5** | **str** | The MD5 hash of the firmware file. | [optional] | +| **notes** | **str** | User-defined notes | [optional] | +| **organization** | **str** | The organization that owns the firmware. | [optional] | +| **product** | **str** | The product that the firmware is for. | [optional] | +| **published** | **bool** | True if the firmware is published. | [optional] | +| **tags** | **str** | A list of tags associated with the firmware. | [optional] | +| **target** | **str** | The target device for the firmware. | [optional] | +| **type** | **str** | The type of firmware. | [optional] | +| **version** | **str** | The version of the firmware. | [optional] | ## Example diff --git a/src/docs/GetBillingAccount200Response.md b/src/docs/GetBillingAccount200Response.md new file mode 100644 index 0000000..883de2c --- /dev/null +++ b/src/docs/GetBillingAccount200Response.md @@ -0,0 +1,31 @@ +# GetBillingAccount200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------- | --------------------------------------------------------------------------- | ----------- | ---------- | +| **name** | **str** | | [optional] | +| **owner** | **str** | | [optional] | +| **plan** | [**GetBillingAccount200ResponsePlan**](GetBillingAccount200ResponsePlan.md) | | [optional] | +| **suspended** | **bool** | | [optional] | +| **uid** | **str** | | [optional] | + +## Example + +```python +from notehub_py.models.get_billing_account200_response import GetBillingAccount200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBillingAccount200Response from a JSON string +get_billing_account200_response_instance = GetBillingAccount200Response.from_json(json) +# print the JSON string representation of the object +print(GetBillingAccount200Response.to_json()) + +# convert the object into a dict +get_billing_account200_response_dict = get_billing_account200_response_instance.to_dict() +# create an instance of GetBillingAccount200Response from a dict +get_billing_account200_response_from_dict = GetBillingAccount200Response.from_dict(get_billing_account200_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/GetBillingAccount200ResponsePlan.md b/src/docs/GetBillingAccount200ResponsePlan.md new file mode 100644 index 0000000..8ff8279 --- /dev/null +++ b/src/docs/GetBillingAccount200ResponsePlan.md @@ -0,0 +1,31 @@ +# GetBillingAccount200ResponsePlan + +## Properties + +| Name | Type | Description | Notes | +| ------------------- | ------------ | ----------- | ---------- | +| **current_balance** | **int** | | [optional] | +| **end_date** | **datetime** | | [optional] | +| **event_capacity** | **int** | | [optional] | +| **start_date** | **datetime** | | [optional] | +| **type** | **str** | | [optional] | + +## Example + +```python +from notehub_py.models.get_billing_account200_response_plan import GetBillingAccount200ResponsePlan + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBillingAccount200ResponsePlan from a JSON string +get_billing_account200_response_plan_instance = GetBillingAccount200ResponsePlan.from_json(json) +# print the JSON string representation of the object +print(GetBillingAccount200ResponsePlan.to_json()) + +# convert the object into a dict +get_billing_account200_response_plan_dict = get_billing_account200_response_plan_instance.to_dict() +# create an instance of GetBillingAccount200ResponsePlan from a dict +get_billing_account200_response_plan_from_dict = GetBillingAccount200ResponsePlan.from_dict(get_billing_account200_response_plan_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/GetBillingAccountBalanceHistory200Response.md b/src/docs/GetBillingAccountBalanceHistory200Response.md new file mode 100644 index 0000000..4f1a630 --- /dev/null +++ b/src/docs/GetBillingAccountBalanceHistory200Response.md @@ -0,0 +1,27 @@ +# GetBillingAccountBalanceHistory200Response + +## Properties + +| Name | Type | Description | Notes | +| -------- | ----------------------------------------------------------------------------------------------------------------------- | ----------- | ---------- | +| **data** | [**List[GetBillingAccountBalanceHistory200ResponseDataInner]**](GetBillingAccountBalanceHistory200ResponseDataInner.md) | | [optional] | + +## Example + +```python +from notehub_py.models.get_billing_account_balance_history200_response import GetBillingAccountBalanceHistory200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBillingAccountBalanceHistory200Response from a JSON string +get_billing_account_balance_history200_response_instance = GetBillingAccountBalanceHistory200Response.from_json(json) +# print the JSON string representation of the object +print(GetBillingAccountBalanceHistory200Response.to_json()) + +# convert the object into a dict +get_billing_account_balance_history200_response_dict = get_billing_account_balance_history200_response_instance.to_dict() +# create an instance of GetBillingAccountBalanceHistory200Response from a dict +get_billing_account_balance_history200_response_from_dict = GetBillingAccountBalanceHistory200Response.from_dict(get_billing_account_balance_history200_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/GetBillingAccountBalanceHistory200ResponseDataInner.md b/src/docs/GetBillingAccountBalanceHistory200ResponseDataInner.md new file mode 100644 index 0000000..eb16cd5 --- /dev/null +++ b/src/docs/GetBillingAccountBalanceHistory200ResponseDataInner.md @@ -0,0 +1,29 @@ +# GetBillingAccountBalanceHistory200ResponseDataInner + +## Properties + +| Name | Type | Description | Notes | +| ----------------------------- | ------------ | ----------- | ----- | +| **period** | **datetime** | | +| **remaining_event_capacity** | **int** | | +| **total_event_capacity_used** | **int** | | + +## Example + +```python +from notehub_py.models.get_billing_account_balance_history200_response_data_inner import GetBillingAccountBalanceHistory200ResponseDataInner + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBillingAccountBalanceHistory200ResponseDataInner from a JSON string +get_billing_account_balance_history200_response_data_inner_instance = GetBillingAccountBalanceHistory200ResponseDataInner.from_json(json) +# print the JSON string representation of the object +print(GetBillingAccountBalanceHistory200ResponseDataInner.to_json()) + +# convert the object into a dict +get_billing_account_balance_history200_response_data_inner_dict = get_billing_account_balance_history200_response_data_inner_instance.to_dict() +# create an instance of GetBillingAccountBalanceHistory200ResponseDataInner from a dict +get_billing_account_balance_history200_response_data_inner_from_dict = GetBillingAccountBalanceHistory200ResponseDataInner.from_dict(get_billing_account_balance_history200_response_data_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/GetJobRuns200Response.md b/src/docs/GetJobRuns200Response.md new file mode 100644 index 0000000..975305d --- /dev/null +++ b/src/docs/GetJobRuns200Response.md @@ -0,0 +1,27 @@ +# GetJobRuns200Response + +## Properties + +| Name | Type | Description | Notes | +| -------- | ----------------------------- | ----------- | ----- | +| **runs** | [**List[JobRun]**](JobRun.md) | | + +## Example + +```python +from notehub_py.models.get_job_runs200_response import GetJobRuns200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetJobRuns200Response from a JSON string +get_job_runs200_response_instance = GetJobRuns200Response.from_json(json) +# print the JSON string representation of the object +print(GetJobRuns200Response.to_json()) + +# convert the object into a dict +get_job_runs200_response_dict = get_job_runs200_response_instance.to_dict() +# create an instance of GetJobRuns200Response from a dict +get_job_runs200_response_from_dict = GetJobRuns200Response.from_dict(get_job_runs200_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/GetJobs200Response.md b/src/docs/GetJobs200Response.md new file mode 100644 index 0000000..5c977d4 --- /dev/null +++ b/src/docs/GetJobs200Response.md @@ -0,0 +1,27 @@ +# GetJobs200Response + +## Properties + +| Name | Type | Description | Notes | +| -------- | ----------------------- | ----------- | ----- | +| **jobs** | [**List[Job]**](Job.md) | | + +## Example + +```python +from notehub_py.models.get_jobs200_response import GetJobs200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetJobs200Response from a JSON string +get_jobs200_response_instance = GetJobs200Response.from_json(json) +# print the JSON string representation of the object +print(GetJobs200Response.to_json()) + +# convert the object into a dict +get_jobs200_response_dict = get_jobs200_response_instance.to_dict() +# create an instance of GetJobs200Response from a dict +get_jobs200_response_from_dict = GetJobs200Response.from_dict(get_jobs200_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 new file mode 100644 index 0000000..a78f4d2 --- /dev/null +++ b/src/docs/Job.md @@ -0,0 +1,31 @@ +# Job + +## 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 | + +## Example + +```python +from notehub_py.models.job import Job + +# TODO update the JSON string below +json = "{}" +# create an instance of Job from a JSON string +job_instance = Job.from_json(json) +# print the JSON string representation of the object +print(Job.to_json()) + +# convert the object into a dict +job_dict = job_instance.to_dict() +# create an instance of Job from a dict +job_from_dict = Job.from_dict(job_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/JobRun.md b/src/docs/JobRun.md new file mode 100644 index 0000000..469d265 --- /dev/null +++ b/src/docs/JobRun.md @@ -0,0 +1,38 @@ +# JobRun + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | --------------------- | ----------------------------------------------------------------- | ---------- | +| **cancel** | **bool** | Whether cancellation was requested | [optional] | +| **completed** | **int** | Unix timestamp when completed | [optional] | +| **dry_run** | **bool** | Whether this was a dry run | +| **job_name** | **str** | Name of the job | +| **job_uid** | **str** | Unique identifier for the job | +| **report_uid** | **str** | Unique identifier for this run | +| **results** | **Dict[str, object]** | Full results (only in detail view) | [optional] | +| **started** | **int** | Unix timestamp when started | [optional] | +| **status** | **str** | Current status (submitted, running, completed, cancelled, failed) | +| **submitted** | **int** | Unix timestamp when submitted | +| **submitted_by** | **str** | User who submitted the run | +| **updated** | **int** | Unix timestamp of last update | + +## Example + +```python +from notehub_py.models.job_run import JobRun + +# TODO update the JSON string below +json = "{}" +# create an instance of JobRun from a JSON string +job_run_instance = JobRun.from_json(json) +# print the JSON string representation of the object +print(JobRun.to_json()) + +# convert the object into a dict +job_run_dict = job_run_instance.to_dict() +# create an instance of JobRun from a dict +job_run_from_dict = JobRun.from_dict(job_run_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 new file mode 100644 index 0000000..6c49929 --- /dev/null +++ b/src/docs/JobsApi.md @@ -0,0 +1,635 @@ +# notehub_py.JobsApi + +All URIs are relative to *https://api.notefile.net* + +| Method | HTTP request | Description | +| ----------------------------------------------- | ------------------------------------------------------------------------ | ----------- | +| [**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} | +| [**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 | +| [**get_jobs**](JobsApi.md#get_jobs) | **GET** /v1/projects/{projectOrProductUID}/jobs | +| [**run_job**](JobsApi.md#run_job) | **POST** /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run | + +# **cancel_job_run** + +> CancelJobRun200Response cancel_job_run(project_or_product_uid, report_uid) + +Cancel a running job execution + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.cancel_job_run200_response import CancelJobRun200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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_response = api_instance.cancel_job_run(project_or_product_uid, report_uid) + print("The response of JobsApi->cancel_job_run:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->cancel_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 + +[**CancelJobRun200Response**](CancelJobRun200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Cancel operation completed | - | +| **404** | Run not found | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_job** + +> CreateJob201Response create_job(project_or_product_uid, name, body) + +Create a new batch job with an optional name + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.create_job201_response import CreateJob201Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + name = 'name_example' # str | Name for the job + body = None # object | The job definition as raw JSON + + try: + api_response = api_instance.create_job(project_or_product_uid, name, body) + print("The response of JobsApi->create_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->create_job: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ---------- | ------------------------------ | ----- | +| **project_or_product_uid** | **str** | | +| **name** | **str** | Name for the job | +| **body** | **object** | The job definition as raw JSON | + +### Return type + +[**CreateJob201Response**](CreateJob201Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------------------------------------------- | ---------------- | +| **201** | Job created successfully | - | +| **400** | Missing required name parameter or invalid job definition | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_job** + +> DeleteJob200Response delete_job(project_or_product_uid, job_uid) + +Delete a batch job + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.delete_job200_response import DeleteJob200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + job_uid = 'my-reconciliation-job' # str | Unique identifier for a batch job + + try: + api_response = api_instance.delete_job(project_or_product_uid, job_uid) + print("The response of JobsApi->delete_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->delete_job: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | --------------------------------- | ----- | +| **project_or_product_uid** | **str** | | +| **job_uid** | **str** | Unique identifier for a batch job | + +### Return type + +[**DeleteJob200Response**](DeleteJob200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Job deleted successfully | - | +| **404** | Job not found | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_job** + +> Job get_job(project_or_product_uid, job_uid) + +Get a specific batch job definition + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.job import Job +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + job_uid = 'my-reconciliation-job' # str | Unique identifier for a batch job + + try: + api_response = api_instance.get_job(project_or_product_uid, job_uid) + print("The response of JobsApi->get_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->get_job: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | --------------------------------- | ----- | +| **project_or_product_uid** | **str** | | +| **job_uid** | **str** | Unique identifier for a batch job | + +### Return type + +[**Job**](Job.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Batch job details | - | +| **404** | Job not found | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_job_run** + +> JobRun get_job_run(project_or_product_uid, report_uid) + +Get the result of a job execution + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.job_run import JobRun +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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_response = api_instance.get_job_run(project_or_product_uid, report_uid) + print("The response of JobsApi->get_job_run:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->get_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 + +[**JobRun**](JobRun.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Job run details | - | +| **404** | Run not found | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_job_runs** + +> GetJobRuns200Response get_job_runs(project_or_product_uid, job_uid, status=status, dry_run=dry_run) + +List all runs for a specific job + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.get_job_runs200_response import GetJobRuns200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + job_uid = 'my-reconciliation-job' # str | Unique identifier for a batch job + status = 'status_example' # str | Filter runs by status (optional) + dry_run = True # bool | Filter runs by dry run flag (optional) + + try: + api_response = api_instance.get_job_runs(project_or_product_uid, job_uid, status=status, dry_run=dry_run) + print("The response of JobsApi->get_job_runs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->get_job_runs: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | -------- | --------------------------------- | ---------- | +| **project_or_product_uid** | **str** | | +| **job_uid** | **str** | Unique identifier for a batch job | +| **status** | **str** | Filter runs by status | [optional] | +| **dry_run** | **bool** | Filter runs by dry run flag | [optional] | + +### Return type + +[**GetJobRuns200Response**](GetJobRuns200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | List of job runs | - | +| **404** | Job not found | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_jobs** + +> GetJobs200Response get_jobs(project_or_product_uid) + +List all batch jobs for a project + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.get_jobs200_response import GetJobs200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + + try: + api_response = api_instance.get_jobs(project_or_product_uid) + print("The response of JobsApi->get_jobs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->get_jobs: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | ----------- | ----- | +| **project_or_product_uid** | **str** | | + +### Return type + +[**GetJobs200Response**](GetJobs200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | List of batch jobs | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **run_job** + +> RunJob200Response run_job(project_or_product_uid, job_uid, dry_run=dry_run) + +Execute a batch job + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.run_job200_response import RunJob200Response +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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 | + job_uid = 'my-reconciliation-job' # str | Unique identifier for a batch job + dry_run = False # bool | Run job in dry-run mode without making actual changes (optional) (default to False) + + try: + api_response = api_instance.run_job(project_or_product_uid, job_uid, dry_run=dry_run) + print("The response of JobsApi->run_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling JobsApi->run_job: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | -------- | ----------------------------------------------------- | ----------------------------- | +| **project_or_product_uid** | **str** | | +| **job_uid** | **str** | Unique identifier for a batch job | +| **dry_run** | **bool** | Run job in dry-run mode without making actual changes | [optional] [default to False] | + +### Return type + +[**RunJob200Response**](RunJob200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | Job execution started | - | +| **404** | Job not found | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/src/docs/ProjectApi.md b/src/docs/ProjectApi.md index 0a55570..4a2bceb 100644 --- a/src/docs/ProjectApi.md +++ b/src/docs/ProjectApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.notefile.net* -| Method | HTTP request | Description | -| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------- | +| Method | HTTP request | Description | +| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | [**add_device_to_fleets**](ProjectApi.md#add_device_to_fleets) | **PUT** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | | [**clone_project**](ProjectApi.md#clone_project) | **POST** /v1/projects/{projectOrProductUID}/clone | | [**create_fleet**](ProjectApi.md#create_fleet) | **POST** /v1/projects/{projectOrProductUID}/fleets | @@ -18,6 +18,7 @@ All URIs are relative to *https://api.notefile.net* | [**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 | +| [**get_aws_role_config**](ProjectApi.md#get_aws_role_config) | **GET** /v1/projects/{projectOrProductUID}/aws-role-config | Get AWS role configuration for role-based authentication | | [**get_device_dfu_history**](ProjectApi.md#get_device_dfu_history) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history | | [**get_device_dfu_status**](ProjectApi.md#get_device_dfu_status) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status | | [**get_device_fleets**](ProjectApi.md#get_device_fleets) | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | @@ -25,14 +26,14 @@ All URIs are relative to *https://api.notefile.net* | [**get_devices_dfu_status**](ProjectApi.md#get_devices_dfu_status) | **GET** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status | | [**get_firmware_info**](ProjectApi.md#get_firmware_info) | **GET** /v1/projects/{projectOrProductUID}/firmware | | [**get_fleet**](ProjectApi.md#get_fleet) | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | -| [**get_fleet_environment_hierarchy**](ProjectApi.md#get_fleet_environment_hierarchy) | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy | Get environment variable hierarchy for a device | +| [**get_fleet_environment_hierarchy**](ProjectApi.md#get_fleet_environment_hierarchy) | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy | Get environment variable hierarchy for a device | | [**get_fleet_environment_variables**](ProjectApi.md#get_fleet_environment_variables) | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | | [**get_fleets**](ProjectApi.md#get_fleets) | **GET** /v1/projects/{projectOrProductUID}/fleets | -| [**get_notefile_schemas**](ProjectApi.md#get_notefile_schemas) | **GET** /v1/projects/{projectOrProductUID}/schemas | Get variable format for a notefile | +| [**get_notefile_schemas**](ProjectApi.md#get_notefile_schemas) | **GET** /v1/projects/{projectOrProductUID}/schemas | Get variable format for a notefile | | [**get_products**](ProjectApi.md#get_products) | **GET** /v1/projects/{projectOrProductUID}/products | | [**get_project**](ProjectApi.md#get_project) | **GET** /v1/projects/{projectOrProductUID} | | [**get_project_by_product**](ProjectApi.md#get_project_by_product) | **GET** /v1/products/{productUID}/project | -| [**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_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_projects**](ProjectApi.md#get_projects) | **GET** /v1/projects | @@ -1097,6 +1098,83 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_aws_role_config** + +> AWSRoleConfig get_aws_role_config(project_or_product_uid) + +Get AWS role configuration for role-based authentication + +Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes. + +### Example + +- Bearer Authentication (personalAccessToken): + +```python +import notehub_py +from notehub_py.models.aws_role_config import AWSRoleConfig +from notehub_py.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.notefile.net +# See configuration.py for a list of all supported configuration parameters. +configuration = notehub_py.Configuration( + host = "https://api.notefile.net" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: personalAccessToken +configuration = notehub_py.Configuration( + access_token = os.environ["BEARER_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: + # Get AWS role configuration for role-based authentication + api_response = api_instance.get_aws_role_config(project_or_product_uid) + print("The response of ProjectApi->get_aws_role_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->get_aws_role_config: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------------- | ------- | ----------- | ----- | +| **project_or_product_uid** | **str** | | + +### Return type + +[**AWSRoleConfig**](AWSRoleConfig.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------ | ---------------- | +| **200** | AWS role configuration | - | +| **0** | The response body in case of an API error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_device_dfu_history** > DeviceDfuHistory get_device_dfu_history(project_or_product_uid, device_uid, firmware_type) diff --git a/src/docs/RunJob200Response.md b/src/docs/RunJob200Response.md new file mode 100644 index 0000000..1a1e20f --- /dev/null +++ b/src/docs/RunJob200Response.md @@ -0,0 +1,27 @@ +# RunJob200Response + +## Properties + +| Name | Type | Description | Notes | +| -------------- | ------- | ---------------------------------- | ----- | +| **report_uid** | **str** | Unique identifier for this job run | + +## Example + +```python +from notehub_py.models.run_job200_response import RunJob200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of RunJob200Response from a JSON string +run_job200_response_instance = RunJob200Response.from_json(json) +# print the JSON string representation of the object +print(RunJob200Response.to_json()) + +# convert the object into a dict +run_job200_response_dict = run_job200_response_instance.to_dict() +# create an instance of RunJob200Response from a dict +run_job200_response_from_dict = RunJob200Response.from_dict(run_job200_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/UsageEventsData.md b/src/docs/UsageEventsData.md index f7f8e8a..ac6de29 100644 --- a/src/docs/UsageEventsData.md +++ b/src/docs/UsageEventsData.md @@ -13,6 +13,8 @@ | **total_days_in_period** | **int** | The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future. | [optional] | | **total_devices** | **int** | Total devices represented in this count | | **total_events** | **int** | Total events the device sent to notehub, including associated notehub generated events | +| **total_fw_updates** | **int** | Number of firmware updates in this period (from \_health.qo DFU events) | [optional] | +| **total_reboots** | **int** | Number of device reboots in this period (from \_health.qo boot events) | [optional] | | **watchdog_events** | **int** | Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time. | ## Example diff --git a/src/docs/UsageRouteLogsData.md b/src/docs/UsageRouteLogsData.md index 1737977..712238a 100644 --- a/src/docs/UsageRouteLogsData.md +++ b/src/docs/UsageRouteLogsData.md @@ -2,13 +2,14 @@ ## Properties -| Name | Type | Description | Notes | -| --------------------- | ------------ | -------------------------------------------------------------- | ---------- | -| **failed_routes** | **int** | | -| **period** | **datetime** | | -| **route** | **str** | The route UID (only present when aggregate is 'route') | [optional] | -| **successful_routes** | **int** | | -| **total_routes** | **int** | | +| Name | Type | Description | Notes | +| --------------------- | ------------ | ----------------------------------------------------------------------------- | ---------- | +| **avg_latency_ms** | **float** | Average routing latency in milliseconds for route logs with recorded duration | [optional] | +| **failed_routes** | **int** | | +| **period** | **datetime** | | +| **route** | **str** | The route UID (only present when aggregate is 'route') | [optional] | +| **successful_routes** | **int** | | +| **total_routes** | **int** | | ## Example diff --git a/src/docs/UsageSessionsData.md b/src/docs/UsageSessionsData.md index 82f792e..9994e43 100644 --- a/src/docs/UsageSessionsData.md +++ b/src/docs/UsageSessionsData.md @@ -2,14 +2,17 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | ------------ | ----------- | ---------- | -| **device** | **str** | | [optional] | -| **fleet** | **str** | | [optional] | -| **period** | **datetime** | | -| **sessions** | **int** | | -| **total_bytes** | **int** | | -| **total_devices** | **int** | | +| Name | Type | Description | Notes | +| ------------------------- | ------------------ | ---------------------------------------------------------------------------------- | ---------- | +| **device** | **str** | | [optional] | +| **first_sync_sessions** | **int** | Number of first sync sessions in this period | +| **fleet** | **str** | | [optional] | +| **period** | **datetime** | | +| **sessions** | **int** | | +| **sessions_by_transport** | **Dict[str, int]** | Count of sessions grouped by transport type prefix (e.g. cell, wifi, ntn, lorawan) | [optional] | +| **tls_sessions** | **int** | Number of TLS sessions in this period | [optional] | +| **total_bytes** | **int** | | +| **total_devices** | **int** | | ## Example diff --git a/src/notehub_py/__init__.py b/src/notehub_py/__init__.py index aa4522d..20f59b2 100644 --- a/src/notehub_py/__init__.py +++ b/src/notehub_py/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "6.0.2" +__version__ = "6.1.0" # import apis into sdk package from notehub_py.api.alert_api import AlertApi @@ -24,6 +24,7 @@ from notehub_py.api.device_api import DeviceApi from notehub_py.api.event_api import EventApi from notehub_py.api.external_devices_api import ExternalDevicesApi +from notehub_py.api.jobs_api import JobsApi from notehub_py.api.monitor_api import MonitorApi from notehub_py.api.project_api import ProjectApi from notehub_py.api.route_api import RouteApi @@ -42,6 +43,7 @@ from notehub_py.exceptions import ApiException # import models into sdk package +from notehub_py.models.aws_role_config import AWSRoleConfig from notehub_py.models.add_device_to_fleets_request import AddDeviceToFleetsRequest from notehub_py.models.alert import Alert from notehub_py.models.alert_data_inner import AlertDataInner @@ -52,10 +54,12 @@ from notehub_py.models.billing_account_role import BillingAccountRole from notehub_py.models.blynk_route import BlynkRoute from notehub_py.models.body import Body +from notehub_py.models.cancel_job_run200_response import CancelJobRun200Response from notehub_py.models.cellular_plan import CellularPlan from notehub_py.models.clone_project_request import CloneProjectRequest 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_monitor import CreateMonitor from notehub_py.models.create_product_request import CreateProductRequest from notehub_py.models.create_project_request import CreateProjectRequest @@ -70,6 +74,7 @@ from notehub_py.models.delete_device_from_fleets_request import ( DeleteDeviceFromFleetsRequest, ) +from notehub_py.models.delete_job200_response import DeleteJob200Response from notehub_py.models.delete_notefiles_request import DeleteNotefilesRequest from notehub_py.models.device import Device from notehub_py.models.device_dfu_history import DeviceDfuHistory @@ -95,6 +100,18 @@ from notehub_py.models.fleet import Fleet from notehub_py.models.fleet_connectivity_assurance import FleetConnectivityAssurance from notehub_py.models.get_alerts200_response import GetAlerts200Response +from notehub_py.models.get_billing_account200_response import ( + GetBillingAccount200Response, +) +from notehub_py.models.get_billing_account200_response_plan import ( + GetBillingAccount200ResponsePlan, +) +from notehub_py.models.get_billing_account_balance_history200_response import ( + GetBillingAccountBalanceHistory200Response, +) +from notehub_py.models.get_billing_account_balance_history200_response_data_inner import ( + GetBillingAccountBalanceHistory200ResponseDataInner, +) from notehub_py.models.get_billing_accounts200_response import ( GetBillingAccounts200Response, ) @@ -134,6 +151,8 @@ from notehub_py.models.get_events_by_cursor200_response import ( GetEventsByCursor200Response, ) +from notehub_py.models.get_job_runs200_response import GetJobRuns200Response +from notehub_py.models.get_jobs200_response import GetJobs200Response from notehub_py.models.get_notefile200_response import GetNotefile200Response from notehub_py.models.get_products200_response import GetProducts200Response from notehub_py.models.get_project_members200_response import ( @@ -147,6 +166,8 @@ from notehub_py.models.get_webhooks200_response import GetWebhooks200Response 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_run import JobRun from notehub_py.models.location import Location from notehub_py.models.login200_response import Login200Response from notehub_py.models.login_request import LoginRequest @@ -178,6 +199,7 @@ from notehub_py.models.role import Role from notehub_py.models.route_log import RouteLog from notehub_py.models.route_transform_settings import RouteTransformSettings +from notehub_py.models.run_job200_response import RunJob200Response from notehub_py.models.s3_archive_route import S3ArchiveRoute from notehub_py.models.satellite_data_usage import SatelliteDataUsage from notehub_py.models.satellite_plan import SatellitePlan diff --git a/src/notehub_py/api/__init__.py b/src/notehub_py/api/__init__.py index 4589ad4..5a580e2 100644 --- a/src/notehub_py/api/__init__.py +++ b/src/notehub_py/api/__init__.py @@ -7,6 +7,7 @@ from notehub_py.api.device_api import DeviceApi from notehub_py.api.event_api import EventApi from notehub_py.api.external_devices_api import ExternalDevicesApi +from notehub_py.api.jobs_api import JobsApi from notehub_py.api.monitor_api import MonitorApi from notehub_py.api.project_api import ProjectApi from notehub_py.api.route_api import RouteApi diff --git a/src/notehub_py/api/billing_account_api.py b/src/notehub_py/api/billing_account_api.py index 7ec2b88..b008d87 100644 --- a/src/notehub_py/api/billing_account_api.py +++ b/src/notehub_py/api/billing_account_api.py @@ -17,6 +17,15 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from notehub_py.models.get_billing_account200_response import ( + GetBillingAccount200Response, +) +from notehub_py.models.get_billing_account_balance_history200_response import ( + GetBillingAccountBalanceHistory200Response, +) from notehub_py.models.get_billing_accounts200_response import ( GetBillingAccounts200Response, ) @@ -38,6 +47,548 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call + def get_billing_account( + self, + billing_account_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, + ) -> GetBillingAccount200Response: + """get_billing_account + + Get Billing Account Information + + :param billing_account_uid: (required) + :type billing_account_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_billing_account_serialize( + billing_account_uid=billing_account_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBillingAccount200Response", + } + 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_billing_account_with_http_info( + self, + billing_account_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[GetBillingAccount200Response]: + """get_billing_account + + Get Billing Account Information + + :param billing_account_uid: (required) + :type billing_account_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_billing_account_serialize( + billing_account_uid=billing_account_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBillingAccount200Response", + } + 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_billing_account_without_preload_content( + self, + billing_account_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_billing_account + + Get Billing Account Information + + :param billing_account_uid: (required) + :type billing_account_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_billing_account_serialize( + billing_account_uid=billing_account_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBillingAccount200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_billing_account_serialize( + self, + billing_account_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 billing_account_uid is not None: + _path_params["billingAccountUID"] = billing_account_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/billing-accounts/{billingAccountUID}", + 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_billing_account_balance_history( + self, + billing_account_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)], + 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, + ) -> GetBillingAccountBalanceHistory200Response: + """get_billing_account_balance_history + + Get Billing Account Balance history, only enterprise supported + + :param billing_account_uid: (required) + :type billing_account_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 + (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_billing_account_balance_history_serialize( + billing_account_uid=billing_account_uid, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBillingAccountBalanceHistory200Response", + } + 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_billing_account_balance_history_with_http_info( + self, + billing_account_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)], + 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[GetBillingAccountBalanceHistory200Response]: + """get_billing_account_balance_history + + Get Billing Account Balance history, only enterprise supported + + :param billing_account_uid: (required) + :type billing_account_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 + (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_billing_account_balance_history_serialize( + billing_account_uid=billing_account_uid, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBillingAccountBalanceHistory200Response", + } + 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_billing_account_balance_history_without_preload_content( + self, + billing_account_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)], + 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_billing_account_balance_history + + Get Billing Account Balance history, only enterprise supported + + :param billing_account_uid: (required) + :type billing_account_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 + (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_billing_account_balance_history_serialize( + billing_account_uid=billing_account_uid, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBillingAccountBalanceHistory200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_billing_account_balance_history_serialize( + self, + billing_account_uid, + start_date, + end_date, + _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 billing_account_uid is not None: + _path_params["billingAccountUID"] = billing_account_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 + + # 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/billing-accounts/{billingAccountUID}/balance-history", + 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_billing_accounts( self, diff --git a/src/notehub_py/api/device_api.py b/src/notehub_py/api/device_api.py index efb15bd..c04a911 100644 --- a/src/notehub_py/api/device_api.py +++ b/src/notehub_py/api/device_api.py @@ -690,6 +690,275 @@ def _add_qi_note_serialize( _request_auth=_request_auth, ) + @validate_call + def create_notefile( + self, + project_or_product_uid: StrictStr, + device_uid: StrictStr, + notefile_id: 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, + ) -> None: + """create_notefile + + Creates an empty Notefile on the device. + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param device_uid: (required) + :type device_uid: str + :param notefile_id: (required) + :type notefile_id: 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._create_notefile_serialize( + project_or_product_uid=project_or_product_uid, + device_uid=device_uid, + notefile_id=notefile_id, + _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 create_notefile_with_http_info( + self, + project_or_product_uid: StrictStr, + device_uid: StrictStr, + notefile_id: 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[None]: + """create_notefile + + Creates an empty Notefile on the device. + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param device_uid: (required) + :type device_uid: str + :param notefile_id: (required) + :type notefile_id: 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._create_notefile_serialize( + project_or_product_uid=project_or_product_uid, + device_uid=device_uid, + notefile_id=notefile_id, + _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 create_notefile_without_preload_content( + self, + project_or_product_uid: StrictStr, + device_uid: StrictStr, + notefile_id: 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: + """create_notefile + + Creates an empty Notefile on the device. + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param device_uid: (required) + :type device_uid: str + :param notefile_id: (required) + :type notefile_id: 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._create_notefile_serialize( + project_or_product_uid=project_or_product_uid, + device_uid=device_uid, + notefile_id=notefile_id, + _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 _create_notefile_serialize( + self, + project_or_product_uid, + device_uid, + notefile_id, + _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 + if notefile_id is not None: + _path_params["notefileID"] = notefile_id + # 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="POST", + resource_path="/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}", + 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( self, @@ -5063,6 +5332,12 @@ def get_device_sessions( description="End date for filtering results, specified as a Unix timestamp" ), ] = None, + first_sync: Annotated[ + Optional[StrictBool], + Field( + description="When true, filters results to only show first sync sessions" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5091,6 +5366,8 @@ def get_device_sessions( :type start_date: int :param end_date: End date for filtering results, specified as a Unix timestamp :type end_date: int + :param first_sync: When true, filters results to only show first sync sessions + :type first_sync: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5120,6 +5397,7 @@ def get_device_sessions( page_num=page_num, start_date=start_date, end_date=end_date, + first_sync=first_sync, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5157,6 +5435,12 @@ def get_device_sessions_with_http_info( description="End date for filtering results, specified as a Unix timestamp" ), ] = None, + first_sync: Annotated[ + Optional[StrictBool], + Field( + description="When true, filters results to only show first sync sessions" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5185,6 +5469,8 @@ def get_device_sessions_with_http_info( :type start_date: int :param end_date: End date for filtering results, specified as a Unix timestamp :type end_date: int + :param first_sync: When true, filters results to only show first sync sessions + :type first_sync: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5214,6 +5500,7 @@ def get_device_sessions_with_http_info( page_num=page_num, start_date=start_date, end_date=end_date, + first_sync=first_sync, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5251,6 +5538,12 @@ def get_device_sessions_without_preload_content( description="End date for filtering results, specified as a Unix timestamp" ), ] = None, + first_sync: Annotated[ + Optional[StrictBool], + Field( + description="When true, filters results to only show first sync sessions" + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5279,6 +5572,8 @@ def get_device_sessions_without_preload_content( :type start_date: int :param end_date: End date for filtering results, specified as a Unix timestamp :type end_date: int + :param first_sync: When true, filters results to only show first sync sessions + :type first_sync: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5308,6 +5603,7 @@ def get_device_sessions_without_preload_content( page_num=page_num, start_date=start_date, end_date=end_date, + first_sync=first_sync, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5330,6 +5626,7 @@ def _get_device_sessions_serialize( page_num, start_date, end_date, + first_sync, _request_auth, _content_type, _headers, @@ -5369,6 +5666,10 @@ def _get_device_sessions_serialize( _query_params.append(("endDate", end_date)) + if first_sync is not None: + + _query_params.append(("firstSync", first_sync)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/src/notehub_py/api/jobs_api.py b/src/notehub_py/api/jobs_api.py new file mode 100644 index 0000000..8cc1d68 --- /dev/null +++ b/src/notehub_py/api/jobs_api.py @@ -0,0 +1,2226 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +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 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_run import JobRun +from notehub_py.models.run_job200_response import RunJob200Response + +from notehub_py.api_client import ApiClient, RequestSerialized +from notehub_py.api_response import ApiResponse +from notehub_py.rest import RESTResponseType + + +class JobsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def cancel_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, + ) -> CancelJobRun200Response: + """cancel_job_run + + Cancel a running job execution + + :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._cancel_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": "CancelJobRun200Response", + "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 cancel_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[CancelJobRun200Response]: + """cancel_job_run + + Cancel a running job execution + + :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._cancel_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": "CancelJobRun200Response", + "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 cancel_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: + """cancel_job_run + + Cancel a running job execution + + :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._cancel_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": "CancelJobRun200Response", + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _cancel_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="POST", + resource_path="/v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel", + 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 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") + ], + _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, + ) -> CreateJob201Response: + """create_job + + Create a new batch job with an optional name + + :param project_or_product_uid: (required) + :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 _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_job_serialize( + project_or_product_uid=project_or_product_uid, + name=name, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CreateJob201Response", + "400": 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 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") + ], + _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[CreateJob201Response]: + """create_job + + Create a new batch job with an optional name + + :param project_or_product_uid: (required) + :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 _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_job_serialize( + project_or_product_uid=project_or_product_uid, + name=name, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CreateJob201Response", + "400": 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 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") + ], + _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_job + + Create a new batch job with an optional name + + :param project_or_product_uid: (required) + :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 _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_job_serialize( + project_or_product_uid=project_or_product_uid, + name=name, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CreateJob201Response", + "400": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_job_serialize( + self, + project_or_product_uid, + name, + 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 project_or_product_uid is not None: + _path_params["projectOrProductUID"] = project_or_product_uid + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = 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="POST", + resource_path="/v1/projects/{projectOrProductUID}/jobs", + 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_job( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + _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, + ) -> DeleteJob200Response: + """delete_job + + Delete a batch job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_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_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DeleteJob200Response", + "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_with_http_info( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + _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[DeleteJob200Response]: + """delete_job + + Delete a batch job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_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_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DeleteJob200Response", + "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_without_preload_content( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + _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 + + Delete a batch job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_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_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DeleteJob200Response", + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_job_serialize( + self, + project_or_product_uid, + job_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 job_uid is not None: + _path_params["jobUID"] = job_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/{jobUID}", + 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, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + _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, + ) -> Job: + """get_job + + Get a specific batch job definition + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_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_job_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Job", + "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 get_job_with_http_info( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + _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[Job]: + """get_job + + Get a specific batch job definition + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_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_job_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Job", + "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 get_job_without_preload_content( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + _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_job + + Get a specific batch job definition + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_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_job_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Job", + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_job_serialize( + self, + project_or_product_uid, + job_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 job_uid is not None: + _path_params["jobUID"] = job_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}/jobs/{jobUID}", + 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_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, + ) -> JobRun: + """get_job_run + + Get the result of a job execution + + :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._get_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": "JobRun", + "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 get_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[JobRun]: + """get_job_run + + Get the result of a job execution + + :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._get_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": "JobRun", + "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 get_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: + """get_job_run + + Get the result of a job execution + + :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._get_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": "JobRun", + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_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="GET", + 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_runs( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + status: Annotated[ + Optional[StrictStr], Field(description="Filter runs by status") + ] = None, + dry_run: Annotated[ + Optional[StrictBool], Field(description="Filter runs by dry run flag") + ] = 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, + ) -> GetJobRuns200Response: + """get_job_runs + + List all runs for a specific job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_uid: str + :param status: Filter runs by status + :type status: str + :param dry_run: Filter runs by dry run flag + :type dry_run: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_job_runs_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + status=status, + dry_run=dry_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetJobRuns200Response", + "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 get_job_runs_with_http_info( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + status: Annotated[ + Optional[StrictStr], Field(description="Filter runs by status") + ] = None, + dry_run: Annotated[ + Optional[StrictBool], Field(description="Filter runs by dry run flag") + ] = 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[GetJobRuns200Response]: + """get_job_runs + + List all runs for a specific job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_uid: str + :param status: Filter runs by status + :type status: str + :param dry_run: Filter runs by dry run flag + :type dry_run: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_job_runs_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + status=status, + dry_run=dry_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetJobRuns200Response", + "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 get_job_runs_without_preload_content( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + status: Annotated[ + Optional[StrictStr], Field(description="Filter runs by status") + ] = None, + dry_run: Annotated[ + Optional[StrictBool], Field(description="Filter runs by dry run flag") + ] = 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_job_runs + + List all runs for a specific job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_uid: str + :param status: Filter runs by status + :type status: str + :param dry_run: Filter runs by dry run flag + :type dry_run: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_job_runs_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + status=status, + dry_run=dry_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetJobRuns200Response", + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_job_runs_serialize( + self, + project_or_product_uid, + job_uid, + status, + dry_run, + _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 job_uid is not None: + _path_params["jobUID"] = job_uid + # process the query parameters + if status is not None: + + _query_params.append(("status", status)) + + if dry_run is not None: + + _query_params.append(("dry_run", dry_run)) + + # 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}/jobs/{jobUID}/runs", + 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_jobs( + 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, + ) -> GetJobs200Response: + """get_jobs + + List all batch jobs for a 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_jobs_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": "GetJobs200Response", + } + 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_jobs_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[GetJobs200Response]: + """get_jobs + + List all batch jobs for a 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_jobs_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": "GetJobs200Response", + } + 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_jobs_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_jobs + + List all batch jobs for a 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_jobs_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": "GetJobs200Response", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_jobs_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}/jobs", + 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 run_job( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + dry_run: Annotated[ + Optional[StrictBool], + Field(description="Run job in dry-run mode without making actual changes"), + ] = 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, + ) -> RunJob200Response: + """run_job + + Execute a batch job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_uid: str + :param dry_run: Run job in dry-run mode without making actual changes + :type dry_run: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._run_job_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + dry_run=dry_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunJob200Response", + "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 run_job_with_http_info( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + dry_run: Annotated[ + Optional[StrictBool], + Field(description="Run job in dry-run mode without making actual changes"), + ] = 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[RunJob200Response]: + """run_job + + Execute a batch job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_uid: str + :param dry_run: Run job in dry-run mode without making actual changes + :type dry_run: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._run_job_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + dry_run=dry_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunJob200Response", + "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 run_job_without_preload_content( + self, + project_or_product_uid: StrictStr, + job_uid: Annotated[ + StrictStr, Field(description="Unique identifier for a batch job") + ], + dry_run: Annotated[ + Optional[StrictBool], + Field(description="Run job in dry-run mode without making actual changes"), + ] = 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: + """run_job + + Execute a batch job + + :param project_or_product_uid: (required) + :type project_or_product_uid: str + :param job_uid: Unique identifier for a batch job (required) + :type job_uid: str + :param dry_run: Run job in dry-run mode without making actual changes + :type dry_run: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._run_job_serialize( + project_or_product_uid=project_or_product_uid, + job_uid=job_uid, + dry_run=dry_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunJob200Response", + "404": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _run_job_serialize( + self, + project_or_product_uid, + job_uid, + dry_run, + _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 job_uid is not None: + _path_params["jobUID"] = job_uid + # process the query parameters + if dry_run is not None: + + _query_params.append(("dry_run", dry_run)) + + # 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="POST", + resource_path="/v1/projects/{projectOrProductUID}/jobs/{jobUID}/run", + 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/project_api.py b/src/notehub_py/api/project_api.py index 424116f..648663e 100644 --- a/src/notehub_py/api/project_api.py +++ b/src/notehub_py/api/project_api.py @@ -20,6 +20,7 @@ from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator from typing import Any, Dict, 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 from notehub_py.models.clone_project_request import CloneProjectRequest from notehub_py.models.create_fleet_request import CreateFleetRequest @@ -3747,6 +3748,245 @@ def _enable_global_event_transformation_serialize( _request_auth=_request_auth, ) + @validate_call + def get_aws_role_config( + 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, + ) -> AWSRoleConfig: + """Get AWS role configuration for role-based authentication + + Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes. + + :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_aws_role_config_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": "AWSRoleConfig", + } + 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_aws_role_config_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[AWSRoleConfig]: + """Get AWS role configuration for role-based authentication + + Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes. + + :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_aws_role_config_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": "AWSRoleConfig", + } + 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_aws_role_config_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 AWS role configuration for role-based authentication + + Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes. + + :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_aws_role_config_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": "AWSRoleConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_aws_role_config_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}/aws-role-config", + 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_dfu_history( self, diff --git a/src/notehub_py/api_client.py b/src/notehub_py/api_client.py index c3e90a8..2c47d63 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.0.2/python" + self.user_agent = "OpenAPI-Generator/6.1.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 ad14cf8..40186fd 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.0.2".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 6.1.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 e27213d..0098e0f 100644 --- a/src/notehub_py/models/__init__.py +++ b/src/notehub_py/models/__init__.py @@ -15,6 +15,7 @@ # import models into model package +from notehub_py.models.aws_role_config import AWSRoleConfig from notehub_py.models.add_device_to_fleets_request import AddDeviceToFleetsRequest from notehub_py.models.alert import Alert from notehub_py.models.alert_data_inner import AlertDataInner @@ -25,10 +26,12 @@ from notehub_py.models.billing_account_role import BillingAccountRole from notehub_py.models.blynk_route import BlynkRoute from notehub_py.models.body import Body +from notehub_py.models.cancel_job_run200_response import CancelJobRun200Response from notehub_py.models.cellular_plan import CellularPlan from notehub_py.models.clone_project_request import CloneProjectRequest 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_monitor import CreateMonitor from notehub_py.models.create_product_request import CreateProductRequest from notehub_py.models.create_project_request import CreateProjectRequest @@ -43,6 +46,7 @@ from notehub_py.models.delete_device_from_fleets_request import ( DeleteDeviceFromFleetsRequest, ) +from notehub_py.models.delete_job200_response import DeleteJob200Response from notehub_py.models.delete_notefiles_request import DeleteNotefilesRequest from notehub_py.models.device import Device from notehub_py.models.device_dfu_history import DeviceDfuHistory @@ -68,6 +72,18 @@ from notehub_py.models.fleet import Fleet from notehub_py.models.fleet_connectivity_assurance import FleetConnectivityAssurance from notehub_py.models.get_alerts200_response import GetAlerts200Response +from notehub_py.models.get_billing_account200_response import ( + GetBillingAccount200Response, +) +from notehub_py.models.get_billing_account200_response_plan import ( + GetBillingAccount200ResponsePlan, +) +from notehub_py.models.get_billing_account_balance_history200_response import ( + GetBillingAccountBalanceHistory200Response, +) +from notehub_py.models.get_billing_account_balance_history200_response_data_inner import ( + GetBillingAccountBalanceHistory200ResponseDataInner, +) from notehub_py.models.get_billing_accounts200_response import ( GetBillingAccounts200Response, ) @@ -107,6 +123,8 @@ from notehub_py.models.get_events_by_cursor200_response import ( GetEventsByCursor200Response, ) +from notehub_py.models.get_job_runs200_response import GetJobRuns200Response +from notehub_py.models.get_jobs200_response import GetJobs200Response from notehub_py.models.get_notefile200_response import GetNotefile200Response from notehub_py.models.get_products200_response import GetProducts200Response from notehub_py.models.get_project_members200_response import ( @@ -120,6 +138,8 @@ from notehub_py.models.get_webhooks200_response import GetWebhooks200Response 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_run import JobRun from notehub_py.models.location import Location from notehub_py.models.login200_response import Login200Response from notehub_py.models.login_request import LoginRequest @@ -151,6 +171,7 @@ from notehub_py.models.role import Role from notehub_py.models.route_log import RouteLog from notehub_py.models.route_transform_settings import RouteTransformSettings +from notehub_py.models.run_job200_response import RunJob200Response from notehub_py.models.s3_archive_route import S3ArchiveRoute from notehub_py.models.satellite_data_usage import SatelliteDataUsage from notehub_py.models.satellite_plan import SatellitePlan diff --git a/src/notehub_py/models/aws_role_config.py b/src/notehub_py/models/aws_role_config.py new file mode 100644 index 0000000..f4fe3d8 --- /dev/null +++ b/src/notehub_py/models/aws_role_config.py @@ -0,0 +1,94 @@ +# 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 AWSRoleConfig(BaseModel): + """ + Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes + """ # noqa: E501 + + aws_account_id: StrictStr = Field( + description="The Blues AWS Account ID to trust in your IAM role's trust policy" + ) + external_id: StrictStr = Field( + description="The External ID to use in your IAM role's trust policy condition" + ) + __properties: ClassVar[List[str]] = ["aws_account_id", "external_id"] + + 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 AWSRoleConfig 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 AWSRoleConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "aws_account_id": obj.get("aws_account_id"), + "external_id": obj.get("external_id"), + } + ) + return _obj diff --git a/src/notehub_py/models/aws_route.py b/src/notehub_py/models/aws_route.py index 12e677e..e0524b8 100644 --- a/src/notehub_py/models/aws_route.py +++ b/src/notehub_py/models/aws_route.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from notehub_py.models.filter import Filter from notehub_py.models.route_transform_settings import RouteTransformSettings @@ -41,6 +41,10 @@ class AwsRoute(BaseModel): message_deduplication_id: Optional[StrictStr] = None message_group_id: Optional[StrictStr] = None region: Optional[StrictStr] = None + role_arn: Optional[StrictStr] = Field( + default=None, + description="IAM Role ARN for role-based authentication via STS AssumeRole", + ) throttle_ms: Optional[StrictInt] = None timeout: Optional[StrictInt] = None transform: Optional[RouteTransformSettings] = None @@ -56,6 +60,7 @@ class AwsRoute(BaseModel): "message_deduplication_id", "message_group_id", "region", + "role_arn", "throttle_ms", "timeout", "transform", @@ -132,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "message_deduplication_id": obj.get("message_deduplication_id"), "message_group_id": obj.get("message_group_id"), "region": obj.get("region"), + "role_arn": obj.get("role_arn"), "throttle_ms": obj.get("throttle_ms"), "timeout": obj.get("timeout"), "transform": ( diff --git a/src/notehub_py/models/cancel_job_run200_response.py b/src/notehub_py/models/cancel_job_run200_response.py new file mode 100644 index 0000000..385848b --- /dev/null +++ b/src/notehub_py/models/cancel_job_run200_response.py @@ -0,0 +1,84 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class CancelJobRun200Response(BaseModel): + """ + CancelJobRun200Response + """ # noqa: E501 + + successful: StrictBool = Field(description="True if cancellation was successful") + __properties: ClassVar[List[str]] = ["successful"] + + 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 CancelJobRun200Response 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 CancelJobRun200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"successful": obj.get("successful")}) + return _obj diff --git a/src/notehub_py/models/create_job201_response.py b/src/notehub_py/models/create_job201_response.py new file mode 100644 index 0000000..3d64b6a --- /dev/null +++ b/src/notehub_py/models/create_job201_response.py @@ -0,0 +1,84 @@ +# 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 CreateJob201Response(BaseModel): + """ + CreateJob201Response + """ # noqa: E501 + + job_uid: StrictStr = Field(description="The unique identifier for the created job") + __properties: ClassVar[List[str]] = ["job_uid"] + + 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 CreateJob201Response 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 CreateJob201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"job_uid": obj.get("job_uid")}) + return _obj diff --git a/src/notehub_py/models/create_monitor.py b/src/notehub_py/models/create_monitor.py index c6c2221..a7739f6 100644 --- a/src/notehub_py/models/create_monitor.py +++ b/src/notehub_py/models/create_monitor.py @@ -145,10 +145,11 @@ def condition_type_validate_enum(cls, value): "less_than_or_equal_to", "equal_to", "not_equal_to", + "count", ] ): raise ValueError( - "must be one of enum values ('greater_than', 'greater_than_or_equal_to', 'less_than', 'less_than_or_equal_to', 'equal_to', 'not_equal_to')" + "must be one of enum values ('greater_than', 'greater_than_or_equal_to', 'less_than', 'less_than_or_equal_to', 'equal_to', 'not_equal_to', 'count')" ) return value diff --git a/src/notehub_py/models/delete_job200_response.py b/src/notehub_py/models/delete_job200_response.py new file mode 100644 index 0000000..4baff1e --- /dev/null +++ b/src/notehub_py/models/delete_job200_response.py @@ -0,0 +1,84 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class DeleteJob200Response(BaseModel): + """ + DeleteJob200Response + """ # noqa: E501 + + success: StrictBool = Field(description="True if deletion was successful") + __properties: ClassVar[List[str]] = ["success"] + + 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 DeleteJob200Response 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 DeleteJob200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"success": obj.get("success")}) + return _obj diff --git a/src/notehub_py/models/firmware_info.py b/src/notehub_py/models/firmware_info.py index a2f422f..16e3fa9 100644 --- a/src/notehub_py/models/firmware_info.py +++ b/src/notehub_py/models/firmware_info.py @@ -41,9 +41,13 @@ class FirmwareInfo(BaseModel): filename: Optional[StrictStr] = Field( default=None, description="The name of the firmware file." ) + info: Optional[Dict[str, Any]] = Field( + default=None, description="User-defined metadata" + ) md5: Optional[StrictStr] = Field( default=None, description="The MD5 hash of the firmware file." ) + notes: Optional[StrictStr] = Field(default=None, description="User-defined notes") organization: Optional[StrictStr] = Field( default=None, description="The organization that owns the firmware." ) @@ -68,7 +72,9 @@ class FirmwareInfo(BaseModel): "created", "description", "filename", + "info", "md5", + "notes", "organization", "product", "published", @@ -132,7 +138,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created": obj.get("created"), "description": obj.get("description"), "filename": obj.get("filename"), + "info": obj.get("info"), "md5": obj.get("md5"), + "notes": obj.get("notes"), "organization": obj.get("organization"), "product": obj.get("product"), "published": obj.get("published"), diff --git a/src/notehub_py/models/get_billing_account200_response.py b/src/notehub_py/models/get_billing_account200_response.py new file mode 100644 index 0000000..56ada2a --- /dev/null +++ b/src/notehub_py/models/get_billing_account200_response.py @@ -0,0 +1,106 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from notehub_py.models.get_billing_account200_response_plan import ( + GetBillingAccount200ResponsePlan, +) +from typing import Optional, Set +from typing_extensions import Self + + +class GetBillingAccount200Response(BaseModel): + """ + GetBillingAccount200Response + """ # noqa: E501 + + name: Optional[StrictStr] = None + owner: Optional[StrictStr] = None + plan: Optional[GetBillingAccount200ResponsePlan] = None + suspended: Optional[StrictBool] = None + uid: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "owner", "plan", "suspended", "uid"] + + 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 GetBillingAccount200Response 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 plan + if self.plan: + _dict["plan"] = self.plan.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetBillingAccount200Response 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"), + "owner": obj.get("owner"), + "plan": ( + GetBillingAccount200ResponsePlan.from_dict(obj["plan"]) + if obj.get("plan") is not None + else None + ), + "suspended": obj.get("suspended"), + "uid": obj.get("uid"), + } + ) + return _obj diff --git a/src/notehub_py/models/get_billing_account200_response_plan.py b/src/notehub_py/models/get_billing_account200_response_plan.py new file mode 100644 index 0000000..63e62b6 --- /dev/null +++ b/src/notehub_py/models/get_billing_account200_response_plan.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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class GetBillingAccount200ResponsePlan(BaseModel): + """ + GetBillingAccount200ResponsePlan + """ # noqa: E501 + + current_balance: Optional[StrictInt] = None + end_date: Optional[datetime] = None + event_capacity: Optional[StrictInt] = None + start_date: Optional[datetime] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [ + "current_balance", + "end_date", + "event_capacity", + "start_date", + "type", + ] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["Enterprise", "Essentials"]): + raise ValueError("must be one of enum values ('Enterprise', 'Essentials')") + 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 GetBillingAccount200ResponsePlan 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 GetBillingAccount200ResponsePlan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "current_balance": obj.get("current_balance"), + "end_date": obj.get("end_date"), + "event_capacity": obj.get("event_capacity"), + "start_date": obj.get("start_date"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/src/notehub_py/models/get_billing_account_balance_history200_response.py b/src/notehub_py/models/get_billing_account_balance_history200_response.py new file mode 100644 index 0000000..0713e0c --- /dev/null +++ b/src/notehub_py/models/get_billing_account_balance_history200_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 +from typing import Any, ClassVar, Dict, List, Optional +from notehub_py.models.get_billing_account_balance_history200_response_data_inner import ( + GetBillingAccountBalanceHistory200ResponseDataInner, +) +from typing import Optional, Set +from typing_extensions import Self + + +class GetBillingAccountBalanceHistory200Response(BaseModel): + """ + GetBillingAccountBalanceHistory200Response + """ # noqa: E501 + + data: Optional[List[GetBillingAccountBalanceHistory200ResponseDataInner]] = None + __properties: ClassVar[List[str]] = ["data"] + + 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 GetBillingAccountBalanceHistory200Response 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict["data"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetBillingAccountBalanceHistory200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": ( + [ + GetBillingAccountBalanceHistory200ResponseDataInner.from_dict( + _item + ) + for _item in obj["data"] + ] + if obj.get("data") is not None + else None + ) + } + ) + return _obj diff --git a/src/notehub_py/models/get_billing_account_balance_history200_response_data_inner.py b/src/notehub_py/models/get_billing_account_balance_history200_response_data_inner.py new file mode 100644 index 0000000..2285d2e --- /dev/null +++ b/src/notehub_py/models/get_billing_account_balance_history200_response_data_inner.py @@ -0,0 +1,97 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GetBillingAccountBalanceHistory200ResponseDataInner(BaseModel): + """ + GetBillingAccountBalanceHistory200ResponseDataInner + """ # noqa: E501 + + period: datetime + remaining_event_capacity: StrictInt + total_event_capacity_used: StrictInt + __properties: ClassVar[List[str]] = [ + "period", + "remaining_event_capacity", + "total_event_capacity_used", + ] + + 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 GetBillingAccountBalanceHistory200ResponseDataInner 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 GetBillingAccountBalanceHistory200ResponseDataInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "period": obj.get("period"), + "remaining_event_capacity": obj.get("remaining_event_capacity"), + "total_event_capacity_used": obj.get("total_event_capacity_used"), + } + ) + return _obj diff --git a/src/notehub_py/models/get_job_runs200_response.py b/src/notehub_py/models/get_job_runs200_response.py new file mode 100644 index 0000000..0b3aabf --- /dev/null +++ b/src/notehub_py/models/get_job_runs200_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.job_run import JobRun +from typing import Optional, Set +from typing_extensions import Self + + +class GetJobRuns200Response(BaseModel): + """ + GetJobRuns200Response + """ # noqa: E501 + + runs: List[JobRun] + __properties: ClassVar[List[str]] = ["runs"] + + 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 GetJobRuns200Response 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 runs (list) + _items = [] + if self.runs: + for _item in self.runs: + if _item: + _items.append(_item.to_dict()) + _dict["runs"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetJobRuns200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "runs": ( + [JobRun.from_dict(_item) for _item in obj["runs"]] + if obj.get("runs") is not None + else None + ) + } + ) + return _obj diff --git a/src/notehub_py/models/get_jobs200_response.py b/src/notehub_py/models/get_jobs200_response.py new file mode 100644 index 0000000..f168274 --- /dev/null +++ b/src/notehub_py/models/get_jobs200_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.job import Job +from typing import Optional, Set +from typing_extensions import Self + + +class GetJobs200Response(BaseModel): + """ + GetJobs200Response + """ # noqa: E501 + + jobs: List[Job] + __properties: ClassVar[List[str]] = ["jobs"] + + 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 GetJobs200Response 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 jobs (list) + _items = [] + if self.jobs: + for _item in self.jobs: + if _item: + _items.append(_item.to_dict()) + _dict["jobs"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetJobs200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "jobs": ( + [Job.from_dict(_item) for _item in obj["jobs"]] + if obj.get("jobs") is not None + else None + ) + } + ) + return _obj diff --git a/src/notehub_py/models/job.py b/src/notehub_py/models/job.py new file mode 100644 index 0000000..41020c4 --- /dev/null +++ b/src/notehub_py/models/job.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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class Job(BaseModel): + """ + Job + """ # noqa: E501 + + 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") + name: StrictStr = Field(description="Human-readable job name") + __properties: ClassVar[List[str]] = [ + "created", + "created_by", + "definition", + "job_uid", + "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 Job 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 Job 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"), + "definition": obj.get("definition"), + "job_uid": obj.get("job_uid"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/src/notehub_py/models/job_run.py b/src/notehub_py/models/job_run.py new file mode 100644 index 0000000..9a455f1 --- /dev/null +++ b/src/notehub_py/models/job_run.py @@ -0,0 +1,133 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class JobRun(BaseModel): + """ + JobRun + """ # noqa: E501 + + cancel: Optional[StrictBool] = Field( + default=None, description="Whether cancellation was requested" + ) + completed: Optional[StrictInt] = Field( + default=None, description="Unix timestamp when completed" + ) + dry_run: StrictBool = Field(description="Whether this was a dry run") + job_name: StrictStr = Field(description="Name of the job") + job_uid: StrictStr = Field(description="Unique identifier for the job") + report_uid: StrictStr = Field(description="Unique identifier for this run") + results: Optional[Dict[str, Any]] = Field( + default=None, description="Full results (only in detail view)" + ) + started: Optional[StrictInt] = Field( + default=None, description="Unix timestamp when started" + ) + status: StrictStr = Field( + description="Current status (submitted, running, completed, cancelled, failed)" + ) + submitted: StrictInt = Field(description="Unix timestamp when submitted") + submitted_by: StrictStr = Field(description="User who submitted the run") + updated: StrictInt = Field(description="Unix timestamp of last update") + __properties: ClassVar[List[str]] = [ + "cancel", + "completed", + "dry_run", + "job_name", + "job_uid", + "report_uid", + "results", + "started", + "status", + "submitted", + "submitted_by", + "updated", + ] + + 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 JobRun 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 JobRun from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "cancel": obj.get("cancel"), + "completed": obj.get("completed"), + "dry_run": obj.get("dry_run"), + "job_name": obj.get("job_name"), + "job_uid": obj.get("job_uid"), + "report_uid": obj.get("report_uid"), + "results": obj.get("results"), + "started": obj.get("started"), + "status": obj.get("status"), + "submitted": obj.get("submitted"), + "submitted_by": obj.get("submitted_by"), + "updated": obj.get("updated"), + } + ) + return _obj diff --git a/src/notehub_py/models/monitor.py b/src/notehub_py/models/monitor.py index f9d24ee..9b09779 100644 --- a/src/notehub_py/models/monitor.py +++ b/src/notehub_py/models/monitor.py @@ -147,10 +147,11 @@ def condition_type_validate_enum(cls, value): "less_than_or_equal_to", "equal_to", "not_equal_to", + "count", ] ): raise ValueError( - "must be one of enum values ('greater_than', 'greater_than_or_equal_to', 'less_than', 'less_than_or_equal_to', 'equal_to', 'not_equal_to')" + "must be one of enum values ('greater_than', 'greater_than_or_equal_to', 'less_than', 'less_than_or_equal_to', 'equal_to', 'not_equal_to', 'count')" ) return value diff --git a/src/notehub_py/models/run_job200_response.py b/src/notehub_py/models/run_job200_response.py new file mode 100644 index 0000000..fb0b480 --- /dev/null +++ b/src/notehub_py/models/run_job200_response.py @@ -0,0 +1,84 @@ +# 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 RunJob200Response(BaseModel): + """ + RunJob200Response + """ # noqa: E501 + + report_uid: StrictStr = Field(description="Unique identifier for this job run") + __properties: ClassVar[List[str]] = ["report_uid"] + + 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 RunJob200Response 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 RunJob200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"report_uid": obj.get("report_uid")}) + return _obj diff --git a/src/notehub_py/models/usage_events_data.py b/src/notehub_py/models/usage_events_data.py index 73f5760..9d74785 100644 --- a/src/notehub_py/models/usage_events_data.py +++ b/src/notehub_py/models/usage_events_data.py @@ -54,6 +54,14 @@ class UsageEventsData(BaseModel): total_events: StrictInt = Field( description="Total events the device sent to notehub, including associated notehub generated events" ) + total_fw_updates: Optional[StrictInt] = Field( + default=None, + description="Number of firmware updates in this period (from _health.qo DFU events)", + ) + total_reboots: Optional[StrictInt] = Field( + default=None, + description="Number of device reboots in this period (from _health.qo boot events)", + ) watchdog_events: StrictInt = Field( description="Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time." ) @@ -67,6 +75,8 @@ class UsageEventsData(BaseModel): "total_days_in_period", "total_devices", "total_events", + "total_fw_updates", + "total_reboots", "watchdog_events", ] @@ -107,6 +117,19 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if total_fw_updates (nullable) is None + # and model_fields_set contains the field + if ( + self.total_fw_updates is None + and "total_fw_updates" in self.model_fields_set + ): + _dict["total_fw_updates"] = None + + # set to None if total_reboots (nullable) is None + # and model_fields_set contains the field + if self.total_reboots is None and "total_reboots" in self.model_fields_set: + _dict["total_reboots"] = None + return _dict @classmethod @@ -129,6 +152,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total_days_in_period": obj.get("total_days_in_period"), "total_devices": obj.get("total_devices"), "total_events": obj.get("total_events"), + "total_fw_updates": obj.get("total_fw_updates"), + "total_reboots": obj.get("total_reboots"), "watchdog_events": obj.get("watchdog_events"), } ) diff --git a/src/notehub_py/models/usage_route_logs_data.py b/src/notehub_py/models/usage_route_logs_data.py index 18bd327..50df3fa 100644 --- a/src/notehub_py/models/usage_route_logs_data.py +++ b/src/notehub_py/models/usage_route_logs_data.py @@ -19,8 +19,8 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self @@ -30,6 +30,10 @@ class UsageRouteLogsData(BaseModel): UsageRouteLogsData """ # noqa: E501 + avg_latency_ms: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, + description="Average routing latency in milliseconds for route logs with recorded duration", + ) failed_routes: StrictInt period: datetime route: Optional[StrictStr] = Field( @@ -39,6 +43,7 @@ class UsageRouteLogsData(BaseModel): successful_routes: StrictInt total_routes: StrictInt __properties: ClassVar[List[str]] = [ + "avg_latency_ms", "failed_routes", "period", "route", @@ -83,6 +88,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if avg_latency_ms (nullable) is None + # and model_fields_set contains the field + if self.avg_latency_ms is None and "avg_latency_ms" in self.model_fields_set: + _dict["avg_latency_ms"] = None + return _dict @classmethod @@ -96,6 +106,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "avg_latency_ms": obj.get("avg_latency_ms"), "failed_routes": obj.get("failed_routes"), "period": obj.get("period"), "route": obj.get("route"), diff --git a/src/notehub_py/models/usage_sessions_data.py b/src/notehub_py/models/usage_sessions_data.py index 15fb958..a77c24c 100644 --- a/src/notehub_py/models/usage_sessions_data.py +++ b/src/notehub_py/models/usage_sessions_data.py @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -31,16 +31,29 @@ class UsageSessionsData(BaseModel): """ # noqa: E501 device: Optional[StrictStr] = None + first_sync_sessions: StrictInt = Field( + description="Number of first sync sessions in this period" + ) fleet: Optional[StrictStr] = None period: datetime sessions: StrictInt + sessions_by_transport: Optional[Dict[str, StrictInt]] = Field( + default=None, + description="Count of sessions grouped by transport type prefix (e.g. cell, wifi, ntn, lorawan)", + ) + tls_sessions: Optional[StrictInt] = Field( + default=None, description="Number of TLS sessions in this period" + ) total_bytes: StrictInt total_devices: StrictInt __properties: ClassVar[List[str]] = [ "device", + "first_sync_sessions", "fleet", "period", "sessions", + "sessions_by_transport", + "tls_sessions", "total_bytes", "total_devices", ] @@ -82,6 +95,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if tls_sessions (nullable) is None + # and model_fields_set contains the field + if self.tls_sessions is None and "tls_sessions" in self.model_fields_set: + _dict["tls_sessions"] = None + return _dict @classmethod @@ -96,9 +114,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "device": obj.get("device"), + "first_sync_sessions": obj.get("first_sync_sessions"), "fleet": obj.get("fleet"), "period": obj.get("period"), "sessions": obj.get("sessions"), + "sessions_by_transport": obj.get("sessions_by_transport"), + "tls_sessions": obj.get("tls_sessions"), "total_bytes": obj.get("total_bytes"), "total_devices": obj.get("total_devices"), } diff --git a/src/pyproject.toml b/src/pyproject.toml index f95c219..f577609 100644 --- a/src/pyproject.toml +++ b/src/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "notehub_py" -version = "6.0.2" +version = "6.1.0" description = "Notehub API" authors = ["Blues Engineering "] license = "MIT" diff --git a/src/setup.py b/src/setup.py index 72711b1..4ac9e8e 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.0.2" +VERSION = "6.1.0" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 2.5.0", diff --git a/src/test/test_aws_role_config.py b/src/test/test_aws_role_config.py new file mode 100644 index 0000000..1e94b5f --- /dev/null +++ b/src/test/test_aws_role_config.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.aws_role_config import AWSRoleConfig + + +class TestAWSRoleConfig(unittest.TestCase): + """AWSRoleConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AWSRoleConfig: + """Test AWSRoleConfig + 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 `AWSRoleConfig` + """ + model = AWSRoleConfig() + if include_optional: + return AWSRoleConfig( + aws_account_id = '', + external_id = '' + ) + else: + return AWSRoleConfig( + aws_account_id = '', + external_id = '', + ) + """ + + def testAWSRoleConfig(self): + """Test AWSRoleConfig""" + # 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_cancel_job_run200_response.py b/src/test/test_cancel_job_run200_response.py new file mode 100644 index 0000000..c353a61 --- /dev/null +++ b/src/test/test_cancel_job_run200_response.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.cancel_job_run200_response import CancelJobRun200Response + + +class TestCancelJobRun200Response(unittest.TestCase): + """CancelJobRun200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CancelJobRun200Response: + """Test CancelJobRun200Response + 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 `CancelJobRun200Response` + """ + model = CancelJobRun200Response() + if include_optional: + return CancelJobRun200Response( + successful = True + ) + else: + return CancelJobRun200Response( + successful = True, + ) + """ + + def testCancelJobRun200Response(self): + """Test CancelJobRun200Response""" + # 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_job201_response.py b/src/test/test_create_job201_response.py new file mode 100644 index 0000000..a81239b --- /dev/null +++ b/src/test/test_create_job201_response.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.create_job201_response import CreateJob201Response + + +class TestCreateJob201Response(unittest.TestCase): + """CreateJob201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateJob201Response: + """Test CreateJob201Response + 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 `CreateJob201Response` + """ + model = CreateJob201Response() + if include_optional: + return CreateJob201Response( + job_uid = '' + ) + else: + return CreateJob201Response( + job_uid = '', + ) + """ + + def testCreateJob201Response(self): + """Test CreateJob201Response""" + # 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_delete_job200_response.py b/src/test/test_delete_job200_response.py new file mode 100644 index 0000000..fc01155 --- /dev/null +++ b/src/test/test_delete_job200_response.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.delete_job200_response import DeleteJob200Response + + +class TestDeleteJob200Response(unittest.TestCase): + """DeleteJob200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeleteJob200Response: + """Test DeleteJob200Response + 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 `DeleteJob200Response` + """ + model = DeleteJob200Response() + if include_optional: + return DeleteJob200Response( + success = True + ) + else: + return DeleteJob200Response( + success = True, + ) + """ + + def testDeleteJob200Response(self): + """Test DeleteJob200Response""" + # 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_billing_account200_response.py b/src/test/test_get_billing_account200_response.py new file mode 100644 index 0000000..1917b5e --- /dev/null +++ b/src/test/test_get_billing_account200_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.get_billing_account200_response import ( + GetBillingAccount200Response, +) + + +class TestGetBillingAccount200Response(unittest.TestCase): + """GetBillingAccount200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetBillingAccount200Response: + """Test GetBillingAccount200Response + 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 `GetBillingAccount200Response` + """ + model = GetBillingAccount200Response() + if include_optional: + return GetBillingAccount200Response( + name = '', + owner = '', + plan = notehub_py.models.get_billing_account_200_response_plan.GetBillingAccount_200_response_plan( + current_balance = 56, + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + event_capacity = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + type = 'Enterprise', ), + suspended = True, + uid = '' + ) + else: + return GetBillingAccount200Response( + ) + """ + + def testGetBillingAccount200Response(self): + """Test GetBillingAccount200Response""" + # 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_billing_account200_response_plan.py b/src/test/test_get_billing_account200_response_plan.py new file mode 100644 index 0000000..6647ad2 --- /dev/null +++ b/src/test/test_get_billing_account200_response_plan.py @@ -0,0 +1,60 @@ +# 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_billing_account200_response_plan import ( + GetBillingAccount200ResponsePlan, +) + + +class TestGetBillingAccount200ResponsePlan(unittest.TestCase): + """GetBillingAccount200ResponsePlan unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetBillingAccount200ResponsePlan: + """Test GetBillingAccount200ResponsePlan + 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 `GetBillingAccount200ResponsePlan` + """ + model = GetBillingAccount200ResponsePlan() + if include_optional: + return GetBillingAccount200ResponsePlan( + current_balance = 56, + end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + event_capacity = 56, + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + type = 'Enterprise' + ) + else: + return GetBillingAccount200ResponsePlan( + ) + """ + + def testGetBillingAccount200ResponsePlan(self): + """Test GetBillingAccount200ResponsePlan""" + # 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_billing_account_balance_history200_response.py b/src/test/test_get_billing_account_balance_history200_response.py new file mode 100644 index 0000000..b5090ac --- /dev/null +++ b/src/test/test_get_billing_account_balance_history200_response.py @@ -0,0 +1,63 @@ +# 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_billing_account_balance_history200_response import ( + GetBillingAccountBalanceHistory200Response, +) + + +class TestGetBillingAccountBalanceHistory200Response(unittest.TestCase): + """GetBillingAccountBalanceHistory200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> GetBillingAccountBalanceHistory200Response: + """Test GetBillingAccountBalanceHistory200Response + 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 `GetBillingAccountBalanceHistory200Response` + """ + model = GetBillingAccountBalanceHistory200Response() + if include_optional: + return GetBillingAccountBalanceHistory200Response( + data = [ + notehub_py.models.get_billing_account_balance_history_200_response_data_inner.GetBillingAccountBalanceHistory_200_response_data_inner( + period = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + remaining_event_capacity = 56, + total_event_capacity_used = 56, ) + ] + ) + else: + return GetBillingAccountBalanceHistory200Response( + ) + """ + + def testGetBillingAccountBalanceHistory200Response(self): + """Test GetBillingAccountBalanceHistory200Response""" + # 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_billing_account_balance_history200_response_data_inner.py b/src/test/test_get_billing_account_balance_history200_response_data_inner.py new file mode 100644 index 0000000..62d118d --- /dev/null +++ b/src/test/test_get_billing_account_balance_history200_response_data_inner.py @@ -0,0 +1,63 @@ +# 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_billing_account_balance_history200_response_data_inner import ( + GetBillingAccountBalanceHistory200ResponseDataInner, +) + + +class TestGetBillingAccountBalanceHistory200ResponseDataInner(unittest.TestCase): + """GetBillingAccountBalanceHistory200ResponseDataInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> GetBillingAccountBalanceHistory200ResponseDataInner: + """Test GetBillingAccountBalanceHistory200ResponseDataInner + 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 `GetBillingAccountBalanceHistory200ResponseDataInner` + """ + model = GetBillingAccountBalanceHistory200ResponseDataInner() + if include_optional: + return GetBillingAccountBalanceHistory200ResponseDataInner( + period = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + remaining_event_capacity = 56, + total_event_capacity_used = 56 + ) + else: + return GetBillingAccountBalanceHistory200ResponseDataInner( + period = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + remaining_event_capacity = 56, + total_event_capacity_used = 56, + ) + """ + + def testGetBillingAccountBalanceHistory200ResponseDataInner(self): + """Test GetBillingAccountBalanceHistory200ResponseDataInner""" + # 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_job_runs200_response.py b/src/test/test_get_job_runs200_response.py new file mode 100644 index 0000000..066533c --- /dev/null +++ b/src/test/test_get_job_runs200_response.py @@ -0,0 +1,83 @@ +# 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_job_runs200_response import GetJobRuns200Response + + +class TestGetJobRuns200Response(unittest.TestCase): + """GetJobRuns200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetJobRuns200Response: + """Test GetJobRuns200Response + 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 `GetJobRuns200Response` + """ + model = GetJobRuns200Response() + if include_optional: + return GetJobRuns200Response( + runs = [ + notehub_py.models.job_run.JobRun( + cancel = True, + completed = 56, + dry_run = True, + job_name = '', + job_uid = '', + report_uid = '', + results = { }, + started = 56, + status = '', + submitted = 56, + submitted_by = '', + updated = 56, ) + ] + ) + else: + return GetJobRuns200Response( + runs = [ + notehub_py.models.job_run.JobRun( + cancel = True, + completed = 56, + dry_run = True, + job_name = '', + job_uid = '', + report_uid = '', + results = { }, + started = 56, + status = '', + submitted = 56, + submitted_by = '', + updated = 56, ) + ], + ) + """ + + def testGetJobRuns200Response(self): + """Test GetJobRuns200Response""" + # 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_jobs200_response.py b/src/test/test_get_jobs200_response.py new file mode 100644 index 0000000..2145ecc --- /dev/null +++ b/src/test/test_get_jobs200_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_jobs200_response import GetJobs200Response + + +class TestGetJobs200Response(unittest.TestCase): + """GetJobs200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetJobs200Response: + """Test GetJobs200Response + 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 `GetJobs200Response` + """ + model = GetJobs200Response() + if include_optional: + return GetJobs200Response( + jobs = [ + notehub_py.models.job.Job( + created = 56, + created_by = '', + definition = { }, + job_uid = '', + name = '', ) + ] + ) + else: + return GetJobs200Response( + jobs = [ + notehub_py.models.job.Job( + created = 56, + created_by = '', + definition = { }, + job_uid = '', + name = '', ) + ], + ) + """ + + def testGetJobs200Response(self): + """Test GetJobs200Response""" + # 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.py b/src/test/test_job.py new file mode 100644 index 0000000..2387d60 --- /dev/null +++ b/src/test/test_job.py @@ -0,0 +1,62 @@ +# 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 import Job + + +class TestJob(unittest.TestCase): + """Job unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Job: + """Test Job + 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 `Job` + """ + model = Job() + if include_optional: + return Job( + created = 56, + created_by = '', + definition = { }, + job_uid = '', + name = '' + ) + else: + return Job( + created = 56, + created_by = '', + job_uid = '', + name = '', + ) + """ + + def testJob(self): + """Test Job""" + # 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_run.py b/src/test/test_job_run.py new file mode 100644 index 0000000..2f78bf8 --- /dev/null +++ b/src/test/test_job_run.py @@ -0,0 +1,73 @@ +# 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_run import JobRun + + +class TestJobRun(unittest.TestCase): + """JobRun unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JobRun: + """Test JobRun + 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 `JobRun` + """ + model = JobRun() + if include_optional: + return JobRun( + cancel = True, + completed = 56, + dry_run = True, + job_name = '', + job_uid = '', + report_uid = '', + results = { }, + started = 56, + status = '', + submitted = 56, + submitted_by = '', + updated = 56 + ) + else: + return JobRun( + dry_run = True, + job_name = '', + job_uid = '', + report_uid = '', + status = '', + submitted = 56, + submitted_by = '', + updated = 56, + ) + """ + + def testJobRun(self): + """Test JobRun""" + # 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_jobs_api.py b/src/test/test_jobs_api.py new file mode 100644 index 0000000..e8171dc --- /dev/null +++ b/src/test/test_jobs_api.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.api.jobs_api import JobsApi + + +class TestJobsApi(unittest.TestCase): + """JobsApi unit test stubs""" + + def setUp(self) -> None: + self.api = JobsApi() + + def tearDown(self) -> None: + pass + + def test_cancel_job_run(self) -> None: + """Test case for cancel_job_run""" + pass + + def test_create_job(self) -> None: + """Test case for create_job""" + pass + + def test_delete_job(self) -> None: + """Test case for delete_job""" + pass + + def test_get_job(self) -> None: + """Test case for get_job""" + pass + + def test_get_job_run(self) -> None: + """Test case for get_job_run""" + pass + + def test_get_job_runs(self) -> None: + """Test case for get_job_runs""" + pass + + def test_get_jobs(self) -> None: + """Test case for get_jobs""" + pass + + def test_run_job(self) -> None: + """Test case for run_job""" + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/src/test/test_run_job200_response.py b/src/test/test_run_job200_response.py new file mode 100644 index 0000000..2489e9e --- /dev/null +++ b/src/test/test_run_job200_response.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.run_job200_response import RunJob200Response + + +class TestRunJob200Response(unittest.TestCase): + """RunJob200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RunJob200Response: + """Test RunJob200Response + 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 `RunJob200Response` + """ + model = RunJob200Response() + if include_optional: + return RunJob200Response( + report_uid = '' + ) + else: + return RunJob200Response( + report_uid = '', + ) + """ + + def testRunJob200Response(self): + """Test RunJob200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main()