From 2988a83557885379a9bd50197e1d55f47f34884c Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sun, 13 May 2018 17:02:04 +1200 Subject: [PATCH] fix(DagApi): get and put POCO --- src/CoreApi/IDagApi.cs | 51 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/CoreApi/IDagApi.cs b/src/CoreApi/IDagApi.cs index 6620922..43a242e 100644 --- a/src/CoreApi/IDagApi.cs +++ b/src/CoreApi/IDagApi.cs @@ -52,7 +52,7 @@ Task PutAsync( CancellationToken cancel = default(CancellationToken)); /// - /// Put a stream JSON data as an IPLD node. + /// Put a stream of JSON as an IPLD node. /// /// /// The stream of JSON. @@ -82,6 +82,37 @@ Task PutAsync( bool pin = true, CancellationToken cancel = default(CancellationToken)); + /// + /// Put an object as an IPLD node. + /// + /// + /// The object to add. + /// + /// + /// The content type or format of the ; such as "raw" or "cbor". + /// See for more details. Defaults to "cbor". + /// + /// + /// The algorithm name used to produce the . + /// + /// + /// If true the is pinned to local storage and will not be + /// garbage collected. The default is true. + /// + /// + /// Is used to stop the task. When cancelled, the is raised. + /// + /// + /// A task that represents the asynchronous put operation. The task's value is + /// the data's . + /// + Task PutAsync( + Object data, + string contentType = "cbor", + string multiHash = MultiHash.DefaultAlgorithmName, + bool pin = true, + CancellationToken cancel = default(CancellationToken)); + /// /// Get an IPLD node. /// @@ -111,5 +142,23 @@ Task PutAsync( /// contains the path's value. /// Task GetAsync(string path, CancellationToken cancel = default(CancellationToken)); + + /// + /// Get an IPLD node of a specific type. + /// + /// + /// The object type. + /// + /// + /// The of the IPLD node. + /// + /// + /// Is used to stop the task. When cancelled, the is raised. + /// + /// + /// A task that represents the asynchronous get operation. The task's value + /// is a new instance of the class. + /// + Task GetAsync(Cid id, CancellationToken cancel = default(CancellationToken)); } }