Skip to content
Snippets Groups Projects
Commit 66f6d4dd authored by Klaus Fischer's avatar Klaus Fischer
Browse files

ReAdded explicit confirm

parent 4ed83a72
No related branches found
No related tags found
1 merge request!3Feature/440 mvp net sdk part 1
...@@ -11,21 +11,6 @@ ILogger _logger; ...@@ -11,21 +11,6 @@ ILogger _logger;
Client client; Client client;
X509Certificate2 certificate; X509Certificate2 certificate;
/*
* The easy way to call the FitConnect API
*/
async Task AbstractCall() {
client = new Client(
FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development),
"clientId", "clientSecret");
var success = await client.SendSubmissionAsync(new Submission());
var submissions = await client.GetSubmissionsAsync("destinationId");
foreach (var submission in submissions) Console.WriteLine(submission.Id);
}
void FluentSenderCall() { void FluentSenderCall() {
client.Sender client.Sender
...@@ -46,39 +31,10 @@ void FluentSubscriberCall() { ...@@ -46,39 +31,10 @@ void FluentSubscriberCall() {
.GetAvailableSubmissions(); .GetAvailableSubmissions();
client.Subscriber.RequestSubmission("submissionId") client.Subscriber.RequestSubmission("submissionId")
.GetAttachments(); .GetAttachments((attachments => {
} // Check if the attachments are valid
return true;
/* }));
* The more verbose way to call the FitConnect API
* Here to call the **Sender** interface
*/
async Task DetailSenderCall() {
var sender =
Sender.Create(
FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development), certificate);
var submissionDto = sender.AddSubmission(new Submission());
var encryptedAttachments = sender.Encrypt(publicKey, new List<Attachment>());
var success = await sender.UploadAttachmentsAsync(encryptedAttachments);
var encryptedMetadata = sender.Encrypt(publicKey, new Metadata());
var encryptedData = sender.Encrypt(publicKey, new Data());
success = await sender.SubmitAsync(encryptedData, encryptedMetadata);
}
/*
* The more verbose way to call the FitConnect API
* Here to call the **Subscriber** interface
*/
async Task DetailSubscriberCall() {
var subscriber =
Subscriber.Create(
FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development), certificate);
var submissions = await subscriber.GetSubmissionsAsync("destinationId");
/*
....
*/
} }
......
...@@ -36,7 +36,8 @@ public interface IFluentSubscriber { ...@@ -36,7 +36,8 @@ public interface IFluentSubscriber {
public interface IFluentSubscriberWithSubmission { public interface IFluentSubscriberWithSubmission {
public Submission Submission { get; } public Submission Submission { get; }
public IEnumerable<Attachment> GetAttachments(); public IFluentSenderWithAttachments GetAttachments(
Func<IEnumerable<Attachment>, bool> canSubmitSubmission);
public void ConfirmSubmission(string submissionId); public void ConfirmSubmission(string submissionId);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment