Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FIT-Connect-SDK - .NET
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
FIT-Connect-SDK - .NET
Commits
66f6d4dd
Commit
66f6d4dd
authored
2 years ago
by
Klaus Fischer
Browse files
Options
Downloads
Patches
Plain Diff
ReAdded explicit confirm
parent
4ed83a72
No related branches found
No related tags found
1 merge request
!3
Feature/440 mvp net sdk part 1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DummyClient/Program.cs
+4
-48
4 additions, 48 deletions
DummyClient/Program.cs
FitConnect/Interfaces/IFluentApi.cs
+2
-1
2 additions, 1 deletion
FitConnect/Interfaces/IFluentApi.cs
with
6 additions
and
49 deletions
DummyClient/Program.cs
+
4
−
48
View file @
66f6d4dd
...
@@ -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"
);
/*
....
*/
}
}
...
...
This diff is collapsed.
Click to expand it.
FitConnect/Interfaces/IFluentApi.cs
+
2
−
1
View file @
66f6d4dd
...
@@ -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
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment