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

Premerge commit

parent e835c472
No related branches found
No related tags found
1 merge request!3Feature/440 mvp net sdk part 1
namespace FitConnect.Models;
/// <summary>
/// Representation of FitConnect error responses
/// </summary>
public class FitConnectException : Exception {
public enum ErrorTypeEnum {
Unknown,
}
public ErrorTypeEnum ErrorType { get; set; }
public FitConnectException(string message, ErrorTypeEnum errorType = ErrorTypeEnum.Unknown,
Exception? innerException = null) : base(message, innerException) {
ErrorType = errorType;
}
}
# Example
```csharp
using FitConnect;
using FitConnect.Models;
```
## The easy way to call the FitConnect API
The authentication process is done by the FitConnectClient. And the token is handled within the SDK.
```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
### Here to call the **Sender** interface
```csharp
void DetailSenderCall() {
var sender =
new Sender(
FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development));
sender.CreateSubmissionDto(new Submission());
/*
....
*/
}
```
### Here to call the **Subscriber** interface
```csharp
async Task DetailSubscriberCall() {
var subscriber =
new Subscriber(
FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development));
var submissions = await subscriber.GetSubmissionsAsync("destinationId");
/*
....
*/
}
```
\ No newline at end of file
...@@ -98,6 +98,21 @@ You need a secret file for e2e test like: ...@@ -98,6 +98,21 @@ You need a secret file for e2e test like:
} }
``` ```
# API Abstraction
```mermaid
sequenceDiagram
Client->>FitConnectServer: SendSubmission
FitConnectServer->>Client: Success
```
## The sender process
```mermaid
sequenceDiagram
Sender->>FitConnectServer: GetSubmissions
FitConnectServer->>Sender: Success
```
[glossary](https://docs.fitko.de/fit-connect/docs/glossary/) [glossary](https://docs.fitko.de/fit-connect/docs/glossary/)
### Tickets ### Tickets
......
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