Pescheck.Client
0.4.3
dotnet add package Pescheck.Client --version 0.4.3
NuGet\Install-Package Pescheck.Client -Version 0.4.3
<PackageReference Include="Pescheck.Client" Version="0.4.3" />
<PackageVersion Include="Pescheck.Client" Version="0.4.3" />
<PackageReference Include="Pescheck.Client" />
paket add Pescheck.Client --version 0.4.3
#r "nuget: Pescheck.Client, 0.4.3"
#:package Pescheck.Client@0.4.3
#addin nuget:?package=Pescheck.Client&version=0.4.3
#tool nuget:?package=Pescheck.Client&version=0.4.3
Official Pescheck API client - part of the pescheck-clients SDKs.
Pescheck.Client - the C# library for the Pescheck API
Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 2.0.0
- SDK version: 0.1.0
- Generator version: 7.23.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
<a id="frameworks-supported"></a>
Frameworks supported
<a id="dependencies"></a>
Dependencies
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
<a id="installation"></a>
Installation
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh - [Windows]
build.bat
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using Pescheck.Client.Api;
using Pescheck.Client.Client;
using Pescheck.Client.Model;
<a id="packaging"></a>
Packaging
A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec uses placeholders from the .csproj, so build the .csproj directly:
nuget pack -Build -OutputDirectory out Pescheck.Client.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
<a id="usage"></a>
Usage
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
Connections
Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method.
To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see here for details). To use your own HttpClient instance just pass it to the ApiClass constructor.
HttpClientHandler yourHandler = new HttpClientHandler();
HttpClient yourHttpClient = new HttpClient(yourHandler);
var api = new YourApiClass(yourHttpClient, yourHandler);
If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory.
HttpClient yourHttpClient = new HttpClient();
var api = new YourApiClass(yourHttpClient);
You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available.
Here an example of DI setup in a sample web project:
services.AddHttpClient<YourApiClass>(httpClient =>
new PetApi(httpClient));
<a id="getting-started"></a>
Getting Started
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pescheck.Client.Api;
using Pescheck.Client.Client;
using Pescheck.Client.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.pescheck.io";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new AuthenticationApi(httpClient, config, httpClientHandler);
var jWTGeneration = new JWTGeneration(); // JWTGeneration |
try
{
JWTResponse result = apiInstance.GenerateJWTToken2(jWTGeneration);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthenticationApi.GenerateJWTToken2: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<a id="documentation-for-api-endpoints"></a>
Documentation for API Endpoints
All URIs are relative to https://api.pescheck.io
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthenticationApi | GenerateJWTToken2 | POST /api/v2/jwt/generate/ | |
| AuthenticationApi | JwtCreate | POST /api/jwt/ | |
| AuthenticationApi | JwtRefreshCreate | POST /api/jwt/refresh/ | |
| ChecksApi | V2ChecksList | GET /api/v2/checks/ | |
| ChecksApi | V2ChecksRetrieve | GET /api/v2/checks/{check_type}/ | |
| DivisionsApi | V2OrganisationsDivisionsCreate | POST /api/v2/organisations/divisions/ | |
| DivisionsApi | V2OrganisationsDivisionsList | GET /api/v2/organisations/divisions/ | |
| DivisionsApi | V2OrganisationsDivisionsPartialUpdate | PATCH /api/v2/organisations/divisions/{id}/ | |
| DivisionsApi | V2OrganisationsDivisionsRetrieve | GET /api/v2/organisations/divisions/{id}/ | |
| DivisionsApi | V2OrganisationsDivisionsUpdate | PUT /api/v2/organisations/divisions/{id}/ | |
| OAuthApi | CreateOAuthApplication2 | POST /api/v2/oauth/applications/ | |
| OAuthApi | DeleteOAuthApplication2 | DELETE /api/v2/oauth/applications/{application_id}/ | |
| OAuthApi | ListOAuthApplications2 | GET /api/v2/oauth/applications/list/ | |
| ProfilesApi | V2ProfilesCreate | POST /api/v2/profiles/ | |
| ProfilesApi | V2ProfilesDestroy | DELETE /api/v2/profiles/{id}/ | |
| ProfilesApi | V2ProfilesList | GET /api/v2/profiles/ | |
| ProfilesApi | V2ProfilesPartialUpdate | PATCH /api/v2/profiles/{id}/ | |
| ProfilesApi | V2ProfilesRetrieve | GET /api/v2/profiles/{id}/ | |
| ProfilesApi | V2ProfilesUpdate | PUT /api/v2/profiles/{id}/ | |
| ScreeningsApi | V2ScreeningsCreate | POST /api/v2/screenings/ | |
| ScreeningsApi | V2ScreeningsDocumentsList | GET /api/v2/screenings/{id}/documents/ | Retrieve screening documents |
| ScreeningsApi | V2ScreeningsList | GET /api/v2/screenings/ | |
| ScreeningsApi | V2ScreeningsRetrieve | GET /api/v2/screenings/{id}/ | |
| WebhooksApi | CreateWebhook2 | POST /api/v2/webhooks/ | |
| WebhooksApi | DeleteWebhook2 | DELETE /api/v2/webhooks/{webhook_id}/ | |
| WebhooksApi | ListWebhooks2 | GET /api/v2/webhooks/list/ | |
| WebhooksApi | VerifyWebhook2 | POST /api/v2/webhooks/{webhook_id}/verify/ |
<a id="documentation-for-models"></a>
Documentation for Models
- Model.CustomTokenObtainPair
- Model.DivisionReadOnly
- Model.DivisionWrite
- Model.JWTGeneration
- Model.JWTResponse
- Model.OAuthApplication
- Model.OAuthApplicationResponse
- Model.PaginatedDivisionReadOnlyList
- Model.PaginatedV2ProfileListItemList
- Model.PaginatedV2ScreeningListItemList
- Model.PatchedDivisionWrite
- Model.PatchedV2ProfilePartialUpdate
- Model.TokenRefresh
- Model.V2Candidate
- Model.V2CheckField
- Model.V2CheckInfo
- Model.V2Document
- Model.V2DocumentContent
- Model.V2Money
- Model.V2ProfileCheck
- Model.V2ProfileCheckEntry
- Model.V2ProfileCreate
- Model.V2ProfileDetail
- Model.V2ProfileListItem
- Model.V2ProfileUpdate
- Model.V2ProfileUpdateCheck
- Model.V2ScreeningCheck
- Model.V2ScreeningCheckEntry
- Model.V2ScreeningCheckListItem
- Model.V2ScreeningCreate
- Model.V2ScreeningDetail
- Model.V2ScreeningDetailProfile
- Model.V2ScreeningListItem
- Model.V2ScreeningNote
- Model.V2ScreeningNoteInput
- Model.VerifyWebhook
- Model.Webhook
- Model.WebhookResponse
<a id="documentation-for-authorization"></a>
Documentation for Authorization
Authentication schemes defined for the API: <a id="cookieAuth"></a>
cookieAuth
- Type: API key
- API key parameter name: __Secure-sessionid
- Location:
<a id="jwtAuth"></a>
jwtAuth
- Type: Bearer Authentication
<a id="oauth2"></a>
oauth2
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- read:api: read groups
- create:api: create groups
- update:api: update groups
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- JsonSubTypes (>= 2.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Minor update