{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reddit/json-schema/reddit-components-schema-asset-library-asset-result-schema.json",
  "title": "AssetResult",
  "description": "Stored creative asset returned by the asset library.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reddit-creative-assets-api-openapi.yml#/components/schemas/components_schema_asset_library_asset_result",
  "oneOf": [
    {
      "$ref": "#/$defs/components_schema_asset_library_stored_image_asset"
    },
    {
      "$ref": "#/$defs/components_schema_asset_library_stored_video_asset"
    },
    {
      "$ref": "#/$defs/components_schema_asset_library_stored_headline_asset"
    },
    {
      "$ref": "#/$defs/components_schema_asset_library_stored_cta_asset"
    }
  ],
  "$defs": {
    "components_enums_asset_source": {
      "type": "string",
      "description": "The asset source",
      "enum": [
        "USER",
        "GENERATED"
      ]
    },
    "components_enums_asset_status": {
      "type": "string",
      "description": "The asset status",
      "enum": [
        "DELETED",
        "ACTIVE",
        "PROCESSING_MEDIA",
        "INVALID_MEDIA",
        "DUPLICATE_ASSET"
      ]
    },
    "components_enums_non_null_call_to_action": {
      "type": "string",
      "description": "The call to action text.",
      "enum": [
        "Apply Now",
        "Contact Us",
        "Download",
        "Get a Quote",
        "Get Showtimes",
        "Install",
        "Learn More",
        "Order Now",
        "Play Now",
        "Pre-order Now",
        "See Menu",
        "Shop Now",
        "Sign Up",
        "View More",
        "Watch Now",
        "Book Now",
        "Buy Tickets",
        "Get Directions",
        "Listen Now",
        "Read More",
        "Subscribe",
        "Visit Store",
        "Donate Now",
        "Remind Me"
      ]
    },
    "components_schema_asset_library_media_info": {
      "title": "MediaInfo",
      "type": "object",
      "description": "Information about the stored asset's media.",
      "additionalProperties": true,
      "required": [
        "url",
        "permanent_url",
        "height",
        "width"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "The publicly accessible URL of the hosted media."
        },
        "permanent_url": {
          "type": "string",
          "description": "The media's URL."
        },
        "mime_type": {
          "type": "string",
          "description": "The media's MIME type.",
          "readOnly": true
        },
        "height": {
          "type": "integer",
          "description": "The media height (pixels).",
          "readOnly": true
        },
        "width": {
          "type": "integer",
          "description": "The media width (pixels).",
          "readOnly": true
        },
        "aspect_ratio": {
          "type": "string",
          "description": "The media's aspect ratio.",
          "readOnly": true
        }
      }
    },
    "components_schema_asset_library_stored_cta_asset": {
      "title": "StoredCtaAsset",
      "type": "object",
      "description": "A stored call to action (CTA) asset from asset library.",
      "additionalProperties": false,
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The stored asset ID."
        },
        "name": {
          "type": "string",
          "description": "The asset's name."
        },
        "type": {
          "type": "string",
          "description": "The creative asset type.",
          "const": "CTA"
        },
        "status": {
          "$ref": "#/$defs/components_enums_asset_status",
          "description": "The asset's status."
        },
        "source": {
          "$ref": "#/$defs/components_enums_asset_source",
          "description": "The asset's source."
        },
        "errors": {
          "description": "Validation or processing errors currently associated with the creative asset, if available.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/components_schema_creative_asset_error"
          }
        },
        "call_to_action": {
          "$ref": "#/$defs/components_enums_non_null_call_to_action"
        }
      }
    },
    "components_schema_asset_library_stored_headline_asset": {
      "title": "StoredHeadlineAsset",
      "type": "object",
      "additionalProperties": false,
      "description": "A stored headline asset from asset library.",
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The stored asset ID."
        },
        "name": {
          "type": "string",
          "description": "The asset's name."
        },
        "type": {
          "type": "string",
          "description": "The creative asset type.",
          "const": "HEADLINE"
        },
        "status": {
          "$ref": "#/$defs/components_enums_asset_status",
          "description": "The asset's status."
        },
        "source": {
          "$ref": "#/$defs/components_enums_asset_source",
          "description": "The asset's source."
        },
        "errors": {
          "description": "Validation or processing errors currently associated with the creative asset, if available.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/components_schema_creative_asset_error"
          }
        },
        "text": {
          "type": "string",
          "description": "The headline's text."
        }
      }
    },
    "components_schema_asset_library_stored_image_asset": {
      "title": "StoredImageAsset",
      "type": "object",
      "description": "A stored image asset from asset library.",
      "additionalProperties": false,
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The stored asset ID."
        },
        "name": {
          "type": "string",
          "description": "The asset's name."
        },
        "type": {
          "type": "string",
          "description": "The creative asset type.",
          "const": "IMAGE"
        },
        "status": {
          "$ref": "#/$defs/components_enums_asset_status",
          "description": "The asset's status."
        },
        "source": {
          "$ref": "#/$defs/components_enums_asset_source",
          "description": "The asset's source."
        },
        "errors": {
          "description": "Validation or processing errors currently associated with the creative asset, if available.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/components_schema_creative_asset_error"
          }
        },
        "media": {
          "$ref": "#/$defs/components_schema_asset_library_media_info"
        }
      }
    },
    "components_schema_asset_library_stored_video_asset": {
      "title": "StoredVideoAsset",
      "type": "object",
      "description": "A stored video asset from asset library.",
      "additionalProperties": false,
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The stored asset ID."
        },
        "name": {
          "type": "string",
          "description": "The asset's name."
        },
        "type": {
          "type": "string",
          "description": "The creative asset type.",
          "const": "VIDEO"
        },
        "status": {
          "$ref": "#/$defs/components_enums_asset_status",
          "description": "The asset's status."
        },
        "source": {
          "$ref": "#/$defs/components_enums_asset_source",
          "description": "The asset's source."
        },
        "errors": {
          "description": "Validation or processing errors currently associated with the creative asset, if available.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/components_schema_creative_asset_error"
          }
        },
        "media": {
          "$ref": "#/$defs/components_schema_asset_library_media_info"
        },
        "poster": {
          "$ref": "#/$defs/components_schema_asset_library_media_info"
        }
      }
    },
    "components_schema_creative_asset_error": {
      "title": "CreativeAssetError",
      "type": "object",
      "description": "Error associated with a stored creative asset.",
      "additionalProperties": false,
      "required": [
        "field",
        "message"
      ],
      "properties": {
        "field": {
          "type": "string",
          "description": "The creative asset field most closely associated with the error."
        },
        "message": {
          "type": "string",
          "description": "The human-readable message explaining the error."
        }
      }
    }
  }
}