Dime.Scheduler.DotNetTool 0.0.1-alpha.6

This is a prerelease version of Dime.Scheduler.DotNetTool.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global Dime.Scheduler.DotNetTool --version 0.0.1-alpha.6
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Dime.Scheduler.DotNetTool --version 0.0.1-alpha.6
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Dime.Scheduler.DotNetTool&version=0.0.1-alpha.6&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package Dime.Scheduler.DotNetTool --version 0.0.1-alpha.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Dime.Scheduler SDK for .NET

This repository contains the .NET SDK for Dime.Scheduler's RESTful API services. The SDK is a gateway to connect any system to Dime.Scheduler through its extensive import pipeline and large collection of web APIs.

Check out the ๐Ÿ“š docs ยป for more info.

Installation

Use the package manager NuGet to install the base library of the SDK:

dotnet add package Dime.Scheduler.Sdk

Prerequisites

To clone and run this application, you'll need Visual Studio 16.7 or higher. The application is built with C# 9 and targets .NET Standard 2.0, .NET Standard 2.1 and .NET 5.

The SDK is currently only supported for the latest version of Dime.Scheduler.

Usage

The example below fetches the resources available in Dime.Scheduler:

string uri = "http://mydimescheduler.com";
IAuthenticator authenticator = new FormsAuthenticator(uri,"admin","admin");

DimeSchedulerClient client = new(uri, authenticator);

IResourceEndpoint resourceEndpoint = await client.Resources.Request();
IEnumerable<Resource> resources = await resourceEndpoint.GetAsync(new ResourceRequest());

foreach (Resource resource in resources)
    Console.WriteLine(resource.Email);

The DimeSchedulerClient class is the entry point and it is where all endpoints are exposed:

DimeSchedulerClient client = new(uri, authenticator);

Two arguments are required: the URI to Dime.Scheduler and credentials to connect to it. The IAuthenticator (with FormsAuthenticator as the default implementation) interface is called when an endpoint is requested:

IResourceEndpoint resourceEndpoint = await client.Resources.Request();

When the credentials are invalid, an exception is thrown. Otherwise, the user is authenticated and can access the endpoint:

IEnumerable<Resource> resources = await resourceEndpoint.GetAsync(new ResourceRequest());

Import

The import API is the entry point for external systems to feed data into Dime.Scheduler. The import endpoints expose a set of import pipelines to map and save data in the Dime.Scheduler database. Any class that implements the IImportRequestable interface is eligible to be processed by the import service in Dime.Scheduler.

This example adds or updates a category:

using Dime.Scheduler.Sdk.Import;

string uri = "http://mydimescheduler.com";
IAuthenticator authenticator = new FormsAuthenticator(uri, "admin", "admin");

DimeSchedulerClient client = new(uri, authenticator);

Category category = new("Category #1", "#6e62b5");
IImportEndpoint importEndpoint = await client.Import.Request();
await importEndpoint.RunAsync(category, TransactionType.Append);

This example adds or updates a filter group:

using Dime.Scheduler.Sdk.Import;

string uri = "http://mydimescheduler.com";
IAuthenticator authenticator = new FormsAuthenticator(uri, "admin", "admin");

DimeSchedulerClient client = new(uri, authenticator);

FilterGroup filterGroup = new FilterGroup { Name = "Group 1" };
IImportEndpoint importEndpoint = await client.Import.Request();
await importEndpoint.RunAsync(filterGroup, TransactionType.Append);

Read more

Check out the ๐Ÿ“š docs ยป for more info.

This package has no dependencies.

Version Downloads Last updated
0.0.1-alpha.7 235 10/13/2021
0.0.1-alpha.6 73 10/13/2021
0.0.1-alpha.4 75 3/31/2021
0.0.1-alpha.3 73 3/31/2021