Using ConnectApi Input and Output Classes
ConnectApi methods take either simple or complex types. Simple types are primitive Apex data like integers and strings. Complex types are ConnectApi input objects.
The successful execution of a ConnectApi method can return an output object from the ConnectApi namespace. ConnectApi output objects can be made up of other output objects. For example, the ConnectApi.ActorWithId output object contains properties such as id and url, which contain primitive data types. It also contains a mySubscription property, which contains a ConnectApi.Reference object.