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

Updated documentation

parent 1b2f8719
No related branches found
No related tags found
1 merge request!3Feature/440 mvp net sdk part 1
# Example
```csharp
async Task AbstractCall() {
var 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);
}
```
# Example # Example
```csharp ## Sender
using FitConnect;
using FitConnect.Models;
```
## The easy way to call the FitConnect API
```csharp
async Task AbstractCall() {
var 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);
}
```
## The more verbose way to call the FitConnect API
### The Fluent Sender Api call
```csharp
void FluentSenderCall() {
var client =
new Client(FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development),
logger: _logger);
client.Sender
.Authenticate(clientId, clientSecret)
.CreateSubmission(new Submission())
.UploadAttachments(new List<Attachment>())
.SendSubmission(new Metadata(), new Data());
}
```
### Here to call the **Sender** interface
```csharp ```csharp
void DetailSenderCall() { void DetailSenderCall() {
...@@ -53,11 +15,9 @@ void DetailSenderCall() { ...@@ -53,11 +15,9 @@ void DetailSenderCall() {
``` ```
### Here to call the **Subscriber** interface ## Subscriber
```csharp ```csharp
async Task DetailSubscriberCall() { async Task DetailSubscriberCall() {
var subscriber = var subscriber =
new Subscriber( new Subscriber(
...@@ -67,5 +27,4 @@ async Task DetailSubscriberCall() { ...@@ -67,5 +27,4 @@ async Task DetailSubscriberCall() {
.... ....
*/ */
} }
``` ```
\ No newline at end of file
...@@ -2,6 +2,22 @@ ...@@ -2,6 +2,22 @@
## Introduction ## Introduction
The SDK supports a high-level support as well as a low-level support for the
FitConnect API and a fluent API.
## All in one
For not having to deal with the low-level API, the SDK provides a high-level support. This is
done by the [All in one](./all_in_one.md) class.
## Fluent Api
[Fluent Api](./fluent_api.md)
## Detailed calls
[Detailed calls](./detailed_calls.md)
## Examples ## Examples
[Examples](./example.md) [Examples](./example.md)
# Example
```csharp
void FluentSenderCall() {
var client =
new Client(FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development),
logger: _logger);
client.Sender
.Authenticate(clientId, clientSecret)
.CreateSubmission(new Submission())
.UploadAttachments(new List<Attachment>())
.SendSubmission(new Metadata(), new Data());
}
```
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