From 7b582665536a35c16be89b5134b4187fe84b7d01 Mon Sep 17 00:00:00 2001 From: Klaus Fischer <klaus.fischer@eloware.com> Date: Mon, 13 Jun 2022 15:37:30 +0200 Subject: [PATCH] Updated documentation --- Documentation/all_in_one.md | 16 ++++++++ Documentation/detailed_calls.md | 30 ++++++++++++++ Documentation/documentation.md | 16 ++++++++ Documentation/example.md | 71 --------------------------------- Documentation/fluent_api.md | 14 +++++++ 5 files changed, 76 insertions(+), 71 deletions(-) create mode 100644 Documentation/all_in_one.md create mode 100644 Documentation/detailed_calls.md delete mode 100644 Documentation/example.md create mode 100644 Documentation/fluent_api.md diff --git a/Documentation/all_in_one.md b/Documentation/all_in_one.md new file mode 100644 index 00000000..0e3cb313 --- /dev/null +++ b/Documentation/all_in_one.md @@ -0,0 +1,16 @@ +# 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); +} + +``` diff --git a/Documentation/detailed_calls.md b/Documentation/detailed_calls.md new file mode 100644 index 00000000..27299ca1 --- /dev/null +++ b/Documentation/detailed_calls.md @@ -0,0 +1,30 @@ +# Example + +## Sender + +```csharp +void DetailSenderCall() { + var sender = + new Sender( + FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development)); + sender.CreateSubmissionDto(new Submission()); + /* + .... + */ +} + +``` + +## Subscriber + +```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 diff --git a/Documentation/documentation.md b/Documentation/documentation.md index abf54728..c154e19c 100644 --- a/Documentation/documentation.md +++ b/Documentation/documentation.md @@ -2,6 +2,22 @@ ## 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](./example.md) diff --git a/Documentation/example.md b/Documentation/example.md deleted file mode 100644 index 033abed9..00000000 --- a/Documentation/example.md +++ /dev/null @@ -1,71 +0,0 @@ -# Example - -```csharp -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 -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 diff --git a/Documentation/fluent_api.md b/Documentation/fluent_api.md new file mode 100644 index 00000000..9b88724a --- /dev/null +++ b/Documentation/fluent_api.md @@ -0,0 +1,14 @@ +# 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()); +} +``` -- GitLab