{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-cost-management/json-schema/microsoft-azure-cost-management-cost-details-operation-results-schema.json",
  "title": "CostDetailsOperationResults",
  "description": "The result of the long running operation for cost details Api.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-cost-management-generatecostdetailsreport-api-openapi.yml#/components/schemas/CostDetailsOperationResults",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The id of the long running operation."
    },
    "name": {
      "type": "string",
      "description": "The name of the long running operation."
    },
    "type": {
      "type": "string",
      "description": "The type of the long running operation."
    },
    "status": {
      "$ref": "#/$defs/CostDetailsStatusType",
      "description": "The status of the cost details operation"
    },
    "manifest": {
      "$ref": "#/$defs/ReportManifest",
      "description": "The manifest of the report generated by the operation.",
      "x-ms-client-flatten": true
    },
    "validTill": {
      "type": "string",
      "format": "date-time",
      "description": "The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z."
    },
    "error": {
      "$ref": "#/$defs/ErrorDetails",
      "description": "The details of the error."
    }
  },
  "$defs": {
    "BlobInfo": {
      "type": "object",
      "description": "The blob information generated by this operation.",
      "properties": {
        "blobLink": {
          "type": "string",
          "description": "Link to the blob to download file."
        },
        "byteCount": {
          "type": "integer",
          "format": "int64",
          "description": "Bytes in the blob."
        }
      }
    },
    "CostDetailsDataFormat": {
      "type": "string",
      "description": "The data format of the report",
      "enum": [
        "Csv"
      ],
      "x-ms-enum": {
        "name": "CostDetailsDataFormat",
        "modelAsString": true,
        "values": [
          {
            "name": "CsvCostDetailsDataFormat",
            "value": "Csv",
            "description": "Csv data format."
          }
        ]
      }
    },
    "CostDetailsMetricType": {
      "type": "string",
      "description": "The type of the detailed report. By default ActualCost is provided",
      "enum": [
        "ActualCost",
        "AmortizedCost"
      ],
      "x-ms-enum": {
        "name": "CostDetailsMetricType",
        "modelAsString": true,
        "values": [
          {
            "name": "ActualCostCostDetailsMetricType",
            "value": "ActualCost",
            "description": "Actual cost data."
          },
          {
            "name": "AmortizedCostCostDetailsMetricType",
            "value": "AmortizedCost",
            "description": "Amortized cost data."
          }
        ]
      }
    },
    "CostDetailsStatusType": {
      "type": "string",
      "description": "The status of the cost details operation",
      "enum": [
        "Completed",
        "NoDataFound",
        "Failed"
      ],
      "x-ms-enum": {
        "name": "CostDetailsStatusType",
        "modelAsString": true,
        "values": [
          {
            "name": "CompletedCostDetailsStatusType",
            "value": "Completed",
            "description": "Operation is Completed."
          },
          {
            "name": "NoDataFoundCostDetailsStatusType",
            "value": "NoDataFound",
            "description": "Operation is Completed and no cost data found."
          },
          {
            "name": "FailedCostDetailsStatusType",
            "value": "Failed",
            "description": "Operation Failed."
          }
        ]
      }
    },
    "CostDetailsTimePeriod": {
      "type": "object",
      "description": "The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months.",
      "properties": {
        "start": {
          "type": "string",
          "description": "The start date to pull data from. example format 2020-03-15"
        },
        "end": {
          "type": "string",
          "description": "The end date to pull data to. example format 2020-03-15"
        }
      },
      "required": [
        "start",
        "end"
      ]
    },
    "ErrorDetails": {
      "type": "object",
      "description": "The details of the error.",
      "properties": {
        "code": {
          "type": "string",
          "description": "Error code.",
          "readOnly": true
        },
        "message": {
          "type": "string",
          "description": "Error message indicating why the operation failed.",
          "readOnly": true
        }
      }
    },
    "GenerateCostDetailsReportRequestDefinition": {
      "type": "object",
      "description": "The definition of a cost detailed report.",
      "properties": {
        "metric": {
          "$ref": "#/$defs/CostDetailsMetricType",
          "description": "The type of the detailed report. By default ActualCost is provided"
        },
        "timePeriod": {
          "$ref": "#/$defs/CostDetailsTimePeriod",
          "description": "The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period"
        },
        "billingPeriod": {
          "type": "string",
          "description": "This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost."
        },
        "invoiceId": {
          "type": "string",
          "description": "This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost."
        }
      }
    },
    "ReportManifest": {
      "type": "object",
      "description": "The manifest of the report generated by the operation.",
      "properties": {
        "manifestVersion": {
          "type": "string",
          "description": "The Manifest version."
        },
        "dataFormat": {
          "$ref": "#/$defs/CostDetailsDataFormat",
          "description": "The data format of the report"
        },
        "byteCount": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of bytes in all blobs."
        },
        "blobCount": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of blobs."
        },
        "compressData": {
          "type": "boolean",
          "description": "Is the data in compressed format."
        },
        "requestContext": {
          "$ref": "#/$defs/RequestContext",
          "description": "The context of the Cost Details request.",
          "x-ms-client-flatten": true
        },
        "blobs": {
          "type": "array",
          "description": "List of blob information generated by this operation.",
          "items": {
            "$ref": "#/$defs/BlobInfo"
          },
          "x-ms-identifiers": [
            "blobLink"
          ]
        }
      }
    },
    "RequestContext": {
      "type": "object",
      "description": "The context of the Cost Details request.",
      "properties": {
        "requestScope": {
          "type": "string",
          "description": "The request scope of the request."
        },
        "requestBody": {
          "$ref": "#/$defs/GenerateCostDetailsReportRequestDefinition",
          "description": "The request payload body provided in Cost Details call"
        }
      }
    }
  }
}