{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/power-bi/json-schema/power-bi-pipeline-operation-schema.json",
  "title": "PipelineOperation",
  "description": "A Power BI deployment pipeline operation",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/power-bi-pipelines-api-openapi.yml#/components/schemas/PipelineOperation",
  "required": [
    "id",
    "status",
    "lastUpdatedTime"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The operation ID"
    },
    "type": {
      "type": "string",
      "description": "The operation type",
      "enum": [
        "Deploy"
      ],
      "x-ms-enum": {
        "name": "PipelineOperationType",
        "modelAsExtensible": true,
        "values": [
          {
            "value": "Deploy",
            "description": "Deploy content between stages"
          }
        ]
      }
    },
    "status": {
      "type": "string",
      "description": "The pipeline operation status",
      "enum": [
        "NotStarted",
        "Executing",
        "Succeeded",
        "Failed"
      ],
      "x-ms-enum": {
        "name": "PipelineOperationStatus",
        "modelAsExtensible": true,
        "values": [
          {
            "value": "NotStarted",
            "description": "Operation not started"
          },
          {
            "value": "Executing",
            "description": "Operation executing"
          },
          {
            "value": "Succeeded",
            "description": "Operation succeeded"
          },
          {
            "value": "Failed",
            "description": "Operation failed"
          }
        ]
      }
    },
    "lastUpdatedTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time that the operation was last updated"
    },
    "executionStartTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time that the operation started"
    },
    "executionEndTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time that the operation ended"
    },
    "sourceStageOrder": {
      "type": "integer",
      "description": "The numeric identifier of a source pipeline deployment stage. Development (0), Test (1), Production (2)."
    },
    "targetStageOrder": {
      "type": "integer",
      "description": "The numeric identifier of a target pipeline deployment stage. Development (0), Test (1), Production (2)."
    },
    "performedBy": {
      "description": "User or service principal that performed the pipeline operation.",
      "$ref": "#/$defs/PipelineOperationUser"
    },
    "note": {
      "description": "A note representing a description of the operation.",
      "$ref": "#/$defs/PipelineOperationNote"
    },
    "executionPlan": {
      "description": "The deployment execution plan. Only applicable to a single pipeline operation.",
      "$ref": "#/$defs/DeploymentExecutionPlan"
    },
    "preDeploymentDiffInformation": {
      "description": "The amount of deployed items in the source stage, that are new, identical or different to items in the target stage, before deployment.",
      "$ref": "#/$defs/PreDeploymentDiffInformation"
    }
  },
  "$defs": {
    "DeploymentError": {
      "description": "Error details for the deployment step",
      "properties": {
        "errorCode": {
          "type": "string",
          "description": "The error code"
        },
        "errorDetails": {
          "type": "string",
          "description": "Additional error details"
        }
      }
    },
    "DeploymentExecutionPlan": {
      "description": "A deployment execution plan",
      "properties": {
        "steps": {
          "type": "array",
          "description": "The collection of execution plan steps",
          "items": {
            "$ref": "#/$defs/DeploymentExecutionStep"
          }
        }
      }
    },
    "DeploymentExecutionStep": {
      "required": [
        "index",
        "type",
        "status",
        "lastUpdatedTime"
      ],
      "description": "A deployment execution step",
      "properties": {
        "index": {
          "type": "integer",
          "description": "The step index"
        },
        "type": {
          "type": "string",
          "description": "The type of deployment step",
          "enum": [
            "DatasetDeployment",
            "ReportDeployment",
            "DashboardDeployment",
            "DataflowDeployment",
            "DatamartDeployment"
          ],
          "x-ms-enum": {
            "name": "DeploymentStepType",
            "modelAsExtensible": true,
            "values": [
              {
                "value": "DatasetDeployment",
                "description": "A step for deploying a single dataset"
              },
              {
                "value": "ReportDeployment",
                "description": "A step for deploying a single report"
              },
              {
                "value": "DashboardDeployment",
                "description": "A step for deploying a single dashboard"
              },
              {
                "value": "DataflowDeployment",
                "description": "A step for deploying a single dataflow"
              },
              {
                "value": "DatamartDeployment",
                "description": "A step for deploying a single datamart"
              }
            ]
          }
        },
        "status": {
          "type": "string",
          "description": "The status of the pipeline operation",
          "enum": [
            "NotStarted",
            "Executing",
            "Succeeded",
            "Failed"
          ],
          "x-ms-enum": {
            "name": "PipelineOperationStatus",
            "modelAsExtensible": true,
            "values": [
              {
                "value": "NotStarted",
                "description": "The pipeline operation didn't start"
              },
              {
                "value": "Executing",
                "description": "The pipeline operation is executing"
              },
              {
                "value": "Succeeded",
                "description": "The pipeline operation succeeded"
              },
              {
                "value": "Failed",
                "description": "The pipeline operation failed"
              }
            ]
          }
        },
        "preDeploymentDiffState": {
          "description": "Is an item new, different or identical to items in the target stage before deployment.",
          "$ref": "#/$defs/DeploymentExecutionStepPreDeploymentDiffState"
        },
        "sourceAndTarget": {
          "description": "The source and target items of the step",
          "$ref": "#/$defs/DeploymentSourceAndTarget"
        },
        "error": {
          "description": "The error details. Only applicable if the pipeline operation failed.",
          "$ref": "#/$defs/DeploymentError"
        }
      }
    },
    "DeploymentExecutionStepPreDeploymentDiffState": {
      "type": "string",
      "description": "Is an item new, different or identical to items in the target stage before deployment.",
      "enum": [
        "New",
        "Different",
        "NoDifference"
      ],
      "x-ms-enum": {
        "name": "DeploymentExecutionStepPreDeploymentDiffState",
        "modelAsExtensible": true,
        "values": [
          {
            "value": "New",
            "description": "A new deployed item that doesn't exist in the target stage."
          },
          {
            "value": "Different",
            "description": "Before deployment, the item in the source stage wasn't identical to the one in the target stage."
          },
          {
            "value": "NoDifference",
            "description": "Before deployment, the item in the source stage was identical to the one in the target stage."
          }
        ]
      }
    },
    "DeploymentSourceAndTarget": {
      "required": [
        "source"
      ],
      "description": "Source and target items",
      "properties": {
        "source": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the Power BI item that's deployed from the source stage"
        },
        "sourceDisplayName": {
          "type": "string",
          "description": "The display name of the Power BI item that's deployed from the source stage"
        },
        "target": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the Power BI item that will be overwritten in the target stage. Only applies when overwriting a Power BI item."
        },
        "targetDisplayName": {
          "type": "string",
          "description": "The name of the Power BI item that will be overwritten in the target stage. Only applies when overwriting a Power BI item."
        },
        "type": {
          "type": "string",
          "description": "The type of the Power BI item that will be overwritten in the target stage. Only applies when overwriting a Power BI item."
        }
      }
    },
    "PipelineOperationNote": {
      "description": "A note describing the deployment.",
      "required": [
        "content",
        "isTruncated"
      ],
      "properties": {
        "content": {
          "type": "string",
          "description": "Text describing the deployment."
        },
        "isTruncated": {
          "type": "boolean",
          "description": "Indicates if the note is incomplete. True, only part of the note is returned. False, the note is complete."
        }
      }
    },
    "PipelineOperationUser": {
      "description": "User or service principal that performed the pipeline operation.",
      "required": [
        "principalType"
      ],
      "properties": {
        "userPrincipalName": {
          "type": "string",
          "description": "The UPN of the user who performed the deployment."
        },
        "principalObjectID": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the service principal that performed the deployment."
        },
        "principalType": {
          "description": "The type of user who performed the deployment.",
          "$ref": "#/$defs/PrincipalType"
        }
      }
    },
    "PreDeploymentDiffInformation": {
      "required": [
        "newArtifactsCount",
        "differentArtifactsCount",
        "noDifferenceArtifactsCount"
      ],
      "description": "The amount of new, different and identical deployed items before deployment.",
      "properties": {
        "newArtifactsCount": {
          "type": "integer",
          "description": "The number of new items deployed to the target stage."
        },
        "differentArtifactsCount": {
          "type": "integer",
          "description": "The number of deployed items with differences between source and target stages, before deployment."
        },
        "noDifferenceArtifactsCount": {
          "type": "integer",
          "description": "The number of identical deployed items in the source and target stages, before deployment."
        }
      }
    },
    "PrincipalType": {
      "type": "string",
      "description": "The principal type",
      "enum": [
        "None",
        "User",
        "Group",
        "App"
      ],
      "x-ms-enum": {
        "name": "PrincipalType",
        "modelAsExtensible": true,
        "values": [
          {
            "value": "None",
            "description": "No principal type. Use for whole organization level access."
          },
          {
            "value": "User",
            "description": "User principal type"
          },
          {
            "value": "Group",
            "description": "Group principal type"
          },
          {
            "value": "App",
            "description": "Service principal type"
          }
        ]
      }
    }
  }
}