{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-rc.4/content-standards/get-media-buy-artifacts-response.json",
  "title": "Get Media Buy Artifacts Response",
  "description": "Response containing content artifacts from a media buy for validation",
  "type": "object",
  "allOf": [
    {
      "$ref": "/schemas/3.1.0-rc.4/core/version-envelope.json"
    },
    {
      "$ref": "/schemas/3.1.0-rc.4/core/protocol-envelope.json"
    }
  ],
  "oneOf": [
    {
      "type": "object",
      "description": "Success response with artifacts",
      "properties": {
        "media_buy_id": {
          "type": "string",
          "description": "Media buy these artifacts belong to"
        },
        "artifacts": {
          "type": "array",
          "description": "Delivery records with full artifact content",
          "items": {
            "type": "object",
            "properties": {
              "record_id": {
                "type": "string",
                "description": "Unique identifier for this delivery record"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "When the delivery occurred"
              },
              "package_id": {
                "type": "string",
                "description": "Which package this delivery belongs to"
              },
              "artifact": {
                "$ref": "/schemas/3.1.0-rc.4/content-standards/artifact.json",
                "description": "Full artifact with content assets"
              },
              "country": {
                "type": "string",
                "description": "ISO 3166-1 alpha-2 country code where delivery occurred"
              },
              "channel": {
                "type": "string",
                "description": "Channel type (e.g., display, video, audio, social)"
              },
              "brand_context": {
                "type": "object",
                "description": "Brand information for policy evaluation. Schema TBD - placeholder for brand identifiers.",
                "properties": {
                  "brand_id": {
                    "type": "string",
                    "description": "Brand identifier"
                  },
                  "sku_id": {
                    "type": "string",
                    "description": "Product/SKU identifier if applicable"
                  }
                }
              },
              "local_verdict": {
                "type": "string",
                "enum": [
                  "pass",
                  "fail",
                  "unevaluated"
                ],
                "description": "Seller's local model verdict for this artifact"
              }
            },
            "required": [
              "record_id",
              "artifact"
            ]
          }
        },
        "collection_info": {
          "type": "object",
          "description": "Information about artifact collection for this media buy. Sampling is configured at buy creation time — this reports what was actually collected.",
          "properties": {
            "total_deliveries": {
              "type": "integer",
              "description": "Total deliveries in the requested time range"
            },
            "total_collected": {
              "type": "integer",
              "description": "Total artifacts collected (per the buy's sampling configuration)"
            },
            "returned_count": {
              "type": "integer",
              "description": "Number of artifacts in this response (may be less than total_collected due to pagination or filters)"
            },
            "effective_rate": {
              "type": "number",
              "description": "Actual collection rate achieved (total_collected / total_deliveries)"
            }
          }
        },
        "pagination": {
          "$ref": "/schemas/3.1.0-rc.4/core/pagination-response.json"
        },
        "context": {
          "$ref": "/schemas/3.1.0-rc.4/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
        }
      },
      "required": [
        "media_buy_id",
        "artifacts"
      ]
    },
    {
      "type": "object",
      "description": "Error response",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "$ref": "/schemas/3.1.0-rc.4/core/error.json"
          }
        },
        "context": {
          "$ref": "/schemas/3.1.0-rc.4/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
        }
      },
      "required": [
        "errors"
      ]
    }
  ],
  "properties": {}
}
