properties=[],
                    references_used=references_used,
                )
            )
        return api_request_body_properties
[docs]    @classmethod
    def from_request_body(
        cls, request_body: RequestBody, spec: OpenAPISpec
    ) -> "APIRequestBody":
        """Instantiate from an OpenAPI RequestBody."""
        properties = []
        for media_type, media_type_obj in request_body.content.items():
            if media_type not in _SUPPORTED_MEDIA_TYPES:
                continue
            api_request_body_properties = cls._process_supported_media_type(
                media_type_obj,
                spec,
            )
            properties.extend(api_request_body_properties)
        return cls(
            description=request_body.description,
            properties=properties,
            media_type=media_type,
        )
# class APIRequestBodyProperty(APIPropertyBase):
#     class APIRequestBody(BaseModel):
[docs]class APIOperation(BaseModel):
    """A model for a single API operation."""
    operation_id: str = Field(alias="operation_id")
    """The unique identifier of the operation."""
    description: Optional[str] = Field(alias="description")
    """The description of the operation."""
    base_url: str = Field(alias="base_url")
    """The base URL of the operation."""
    path: str = Field(alias="path")
    """The path of the operation."""
    method: HTTPVerb = Field(alias="method")
    """The HTTP method of the operation."""
    properties: Sequence[APIProperty] = Field(alias="properties")
    # TODO: Add parse in used components to be able to specify what type of
    # referenced object it is.
    # """The properties of the operation."""
    # components: Dict[str, BaseModel] = Field(alias="components")