{
  "asyncapi": "3.0.0",
  "info": {
    "title": "data-assets",
    "version": ""
  },
  "channels": {
    "systemEventsDataAssetData": {
      "address": "system-events.data-asset.data",
      "messages": {
        "dataAssetDataChangeProcessingProgressed": {
          "$ref": "#/components/messages/data-asset.dataAssetDataChangeProcessingProgressed"
        }
      }
    }
  },
  "operations": {
    "dataAssetDataChangeProcessingProgressed": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/systemEventsDataAssetData"
      },
      "messages": [
        {
          "$ref": "#/channels/systemEventsDataAssetData/messages/dataAssetDataChangeProcessingProgressed"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "data-asset.dataAssetDataChangeProcessingProgressed": {
        "name": "com.qlik.v1.data-asset.data.change-processing.progressed",
        "title": "Data asset change processing batch progressed",
        "payload": {
          "type": "object",
          "allOf": [
            {
              "$ref": "#/components/schemas/cloudEventsContextAttributes"
            },
            {
              "$ref": "#/components/schemas/cloudEventsQlikExtensionsAttributes"
            },
            {
              "type": "object",
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/dataAssetChangeProcessingProgressedObject"
                },
                "type": {
                  "type": "string",
                  "default": "com.qlik.v1.data-asset.data.change-processing.progressed",
                  "description": "Data asset change processing batch progressed."
                }
              }
            }
          ]
        },
        "description": "Published when a data asset change processing batch makes progress, before the batch finishes.",
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public",
        "x-qlik-deprecated": false
      }
    },
    "schemas": {
      "changeProcessingConsumptionObject": {
        "type": "object",
        "properties": {
          "totalBytes": {
            "type": "number",
            "example": 30000,
            "description": "Harmonized total bytes property, same value as totalBytesProcessed."
          },
          "totalBytesProcessed": {
            "type": "number",
            "example": 30000,
            "description": "Total bytes in a specific change processing operation."
          }
        }
      },
      "changeProcessingOperationsObject": {
        "type": "object",
        "properties": {
          "numberOfDeletes": {
            "type": "number",
            "example": 30,
            "description": "Number of rows deletions in the specific change processing batch."
          },
          "numberOfInserts": {
            "type": "number",
            "example": 10,
            "description": "Number of rows inserts in the specific change processing batch."
          },
          "numberOfUpdates": {
            "type": "number",
            "example": 20,
            "description": "Number of rows updates in the specific change processing batch."
          }
        }
      },
      "cloudEventsContextAttributes": {
        "type": "object",
        "required": [
          "id",
          "source",
          "specversion",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "A234-1234-1234"
            ],
            "minLength": 1,
            "description": "Identifies the event."
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "minLength": 1,
            "description": "Timestamp of when the occurrence happened. Must adhere to RFC 3339."
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "description": "Describes the type of event related to the originating occurrence."
          },
          "source": {
            "type": "string",
            "format": "uri-reference",
            "examples": [
              "com.qlik/my-service"
            ],
            "minLength": 1,
            "description": "Identifies the context in which an event happened."
          },
          "specversion": {
            "type": "string",
            "examples": [
              "1.0"
            ],
            "minLength": 1,
            "description": "The version of the CloudEvents specification which the event uses."
          },
          "datacontenttype": {
            "type": "string",
            "default": "application/json",
            "minLength": 1,
            "description": "Content type of the data value. Must adhere to RFC 2046 format."
          }
        },
        "description": "CloudEvents Specification JSON Schema"
      },
      "cloudEventsQlikExtensionsAttributes": {
        "type": "object",
        "required": [
          "tenantid"
        ],
        "properties": {
          "userid": {
            "type": "string",
            "examples": [
              "id123"
            ],
            "description": "Unique identifier for the user related to the event."
          },
          "updates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/updateItem"
            },
            "example": [
              {}
            ],
            "description": "Updates of qemServer object"
          },
          "authtype": {
            "type": "string",
            "description": "Representing the type of principal that triggered the occurrence."
          },
          "tenantid": {
            "type": "string",
            "examples": [
              "id123"
            ],
            "description": "Unique identifier for the tenant related to the event."
          },
          "authclaims": {
            "type": "string",
            "description": "A JSON string representing claims of the principal that triggered the event"
          },
          "tracestate": {
            "type": "string",
            "description": "A comma-delimited list of key-value pairs."
          },
          "traceparent": {
            "type": "string",
            "description": "Contains a version, trace ID, span ID, and trace options."
          },
          "toplevelresourceid": {
            "type": "string",
            "examples": [
              "id123"
            ],
            "description": "Unique identifier referring to integration application related to the event."
          }
        }
      },
      "dataAssetChangeProcessingProgressedObject": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "format": "uid",
            "example": "id123",
            "description": "Unique identifier for the app related to the event."
          },
          "dataSets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/dataSetChangeProcessingObject"
            }
          },
          "consumption": {
            "$ref": "#/components/schemas/changeProcessingConsumptionObject"
          },
          "dataAssetId": {
            "type": "string",
            "example": "id123",
            "description": "Unique identifier for the data asset related to the event."
          },
          "dataAssetType": {
            "type": "string",
            "example": "STORAGE",
            "description": "Type of the data asset the change processing batch belongs to (e.g. STORAGE)."
          },
          "notChargeable": {
            "type": "boolean",
            "example": false,
            "description": "When this field is set to true the event should be discarded from consumption metrics."
          },
          "sourceDataProvider": {
            "type": "string",
            "example": "STITCH",
            "description": "Identifies the source system that produced the data (one of STITCH, REPLICATE, QCDI, OTHER)."
          },
          "notChargeableReason": {
            "type": "string",
            "example": "Transform to QCS",
            "description": "Description for why the event is set to notChargeable."
          },
          "changeProcessingEndedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the change processing batch ended. Must adhere to RFC 3339."
          },
          "changeProcessingStartedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the change processing batch started. Must adhere to RFC 3339."
          },
          "dataAssetChangeCountersDelta": {
            "$ref": "#/components/schemas/changeProcessingOperationsObject"
          }
        }
      },
      "dataSetChangeProcessingObject": {
        "type": "object",
        "properties": {
          "dataSetId": {
            "type": "string",
            "example": "id123",
            "description": "Unique identifier for the data set related to the item."
          },
          "updateEndedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the change processing update for the data set ended. Must adhere to RFC 3339."
          },
          "updateSuccess": {
            "type": "boolean",
            "example": true,
            "description": "Indicates whether the change processing update for this data set succeeded."
          },
          "updateStartedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the change processing update for the data set started. Must adhere to RFC 3339."
          },
          "dataSetSecureQRI": {
            "type": "string",
            "example": "qri:db:snowflake://Bh__CEOO2-D2Ty2f5egzjobOWnrxe6Cl8hHjJ6G08KE#w7OWgEHpy-iUi4EVNEGGQ6bJwU3FT6RdX38hbbrpJlM",
            "description": "Secure QRI (Qlik resource identifier) of the data set related to the item. It identifies the data set's underlying resource without exposing connection details."
          },
          "recordOperationCounters": {
            "$ref": "#/components/schemas/changeProcessingOperationsObject"
          }
        }
      },
      "updateItem": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "updated item path"
          },
          "newvalue": {
            "type": "string",
            "description": "new value at given path"
          },
          "oldvalue": {
            "type": "string",
            "description": "original value at given path"
          }
        }
      }
    }
  }
}