from typing import Dict
from typing import Any


def get_request_body_examples(endpoint_def: Dict[str, Any], examples_field: str) -> Dict[str, Any]:
    """Gets request body examples from OAS3 `examples` keyword or `x-examples` for Swagger 2."""
    request_bodies_items = endpoint_def.get("requestBody", {}).get("content", {}).items()
    if not request_bodies_items:
        return {}
    # first element in tuple in media type, second element is dict
    media_type, schema = next(iter(request_bodies_items))
    parameter_type = "body" if media_type != "multipart/form-data" else "form_data"
    return {
        "type": parameter_type,
        "examples": [example["value"] for example in schema.get(examples_field, {}).values()],
    }