Skip to content

pollination/csharp-sdk

Repository files navigation

Build NuGet Version and Downloads count

PollinationSDK - the C# library for the pollination-server

Pollination Server OpenAPI Definition

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.1.0
  • SDK version: 1.1.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://pollination.solutions

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.5

Dependencies

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 RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

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 PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

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 PollinationSDK.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration.Default.BasePath = "http://localhost";
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new APITokensApi(Configuration.Default);
            var aPITokenCreate = new APITokenCreate(); // APITokenCreate | 

            try
            {
                // Create a new API token
                APITokenPrivate result = apiInstance.CreateToken(aPITokenCreate);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling APITokensApi.CreateToken: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
APITokensApi CreateToken POST /tokens Create a new API token
APITokensApi DeleteToken DELETE /tokens/{token_id} Delete an API Token
APITokensApi ListTokens GET /tokens List user API tokens
APITokensApi RegenerateToken PUT /tokens/{token_id} Regenerate an API token
AccountsApi CheckAccountName GET /accounts/check/{name} Check if an account with this name exists
AccountsApi GetAccount GET /accounts/{name} Get an account by name
AccountsApi ListAccounts GET /accounts List Accounts on the Pollination platform
AccountsApi ListQuotas GET /accounts/{name}/quotas List Quotas
ApplicationsApi CreateApplication POST /applications/{owner} Create an Application
ApplicationsApi DeleteApplication DELETE /applications/{owner}/{slug} Delete a Application
ApplicationsApi DeleteApplicationOrgPermission DELETE /applications/{owner}/{slug}/permissions Remove a Application permissions
ApplicationsApi DeleteApplicationVersion DELETE /applications/{owner}/{slug}/versions/{tag} Remove a Application version
ApplicationsApi GetApplication GET /applications/{owner}/{slug} Get an application
ApplicationsApi GetApplicationAccessPermissions GET /applications/{owner}/{slug}/permissions Get application access permissions
ApplicationsApi GetApplicationDeployment GET /applications/{owner}/{slug}/deployment Get application deployment
ApplicationsApi GetApplicationVersions GET /applications/{owner}/{slug}/versions Get application versions
ApplicationsApi ListApplications GET /applications List Applications
ApplicationsApi UpdateApplication PUT /applications/{owner}/{slug} Update a Application
ApplicationsApi UpsertApplicationPermission PATCH /applications/{owner}/{slug}/permissions Upsert a new permission to a application
ApplicationsApi UpsertApplicationVersion PATCH /applications/{owner}/{slug}/versions Upsert a new version to a application
ArtifactsApi CreateArtifact POST /projects/{owner}/{name}/artifacts Get an Artifact upload link.
ArtifactsApi DeleteArtifact DELETE /projects/{owner}/{name}/artifacts Delete one or many artifacts by key/prefix
ArtifactsApi DownloadArtifact GET /projects/{owner}/{name}/artifacts/download Download an artifact from the project folder
ArtifactsApi ListArtifacts GET /projects/{owner}/{name}/artifacts List artifacts in a project folder
JobsApi CancelJob PUT /projects/{owner}/{name}/jobs/{job_id}/cancel Cancel a Job
JobsApi CreateJob POST /projects/{owner}/{name}/jobs Schedule a job
JobsApi DeleteJob DELETE /projects/{owner}/{name}/jobs/{job_id} Delete a Job
JobsApi DownloadJobArtifact GET /projects/{owner}/{name}/jobs/{job_id}/artifacts/download Download an artifact from the job folder
JobsApi GetJob GET /projects/{owner}/{name}/jobs/{job_id} Get a Job
JobsApi ListJobs GET /projects/{owner}/{name}/jobs List Jobs
JobsApi RetryJob PUT /projects/{owner}/{name}/jobs/{job_id}/retry Retry failed runs for a Job
JobsApi SearchJobFolder GET /projects/{owner}/{name}/jobs/{job_id}/artifacts List files/folders in a job folder
LicensesApi DeleteActivation DELETE /licenses/pools/{pool_id}/activations/{activation_id} Delete the activation
LicensesApi GetAvailablePools GET /licenses/pools Get license pools available to authenticated user
LicensesApi GetLicenseActivations GET /licenses/pools/{pool_id}/activations Get the activations for the license
LicensesApi GetPoolLicense GET /licenses/pools/{pool_id}/license Get the license associated with a pool
LicensesApi GrantAccessToPool PATCH /licenses/pools/{pool_id}/permissions Grant access to the license pool
LicensesApi RegenerateLicensePool POST /licenses/pools/{pool_id}/regenerate Regenerate the license associated with the pool
LicensesApi RevokeAccessToPool DELETE /licenses/pools/{pool_id}/permissions Revoke access to the license pool
LicensesApi UpdateLicensePool PUT /licenses/pools/{pool_id} Update the license pool
OrgsApi CreateOrg POST /orgs Create an Org
OrgsApi DeleteOrg DELETE /orgs/{name} Delete an Org
OrgsApi DeleteOrgMember DELETE /orgs/{name}/members/{username} Remove an Org member
OrgsApi GetOrg GET /orgs/{name} Get an Org
OrgsApi GetOrgMembers GET /orgs/{name}/members List organization members
OrgsApi ListOrgs GET /orgs List Orgs
OrgsApi UpdateOrg PUT /orgs/{name} Update an Org
OrgsApi UpsertOrgMember PATCH /orgs/{name}/members/{username}/{role} Add or update the role of an Org Member
PluginsApi CreatePlugin POST /plugins/{owner} Create a Plugin
PluginsApi CreatePluginPackage POST /plugins/{owner}/{name}/tags Create a new Plugin package
PluginsApi DeletePlugin DELETE /plugins/{owner}/{name} Delete a Plugin
PluginsApi DeletePluginOrgPermission DELETE /plugins/{owner}/{name}/permissions Remove a Repository permissions
PluginsApi GetPlugin GET /plugins/{owner}/{name} Get a plugin
PluginsApi GetPluginAccessPermissions GET /plugins/{owner}/{name}/permissions Get plugin access permissions
PluginsApi GetPluginByTag GET /plugins/{owner}/{name}/tags/{tag} Get a plugin tag
PluginsApi ListPluginTags GET /plugins/{owner}/{name}/tags Get a plugin tags
PluginsApi ListPlugins GET /plugins List plugins
PluginsApi UpdatePlugin PUT /plugins/{owner}/{name} Update a Plugin
PluginsApi UpsertPluginPermission PATCH /plugins/{owner}/{name}/permissions Upsert a new permission to a plugin
ProjectsApi CreateProject POST /projects/{owner} Create a Project
ProjectsApi CreateProjectRecipeFilter POST /projects/{owner}/{name}/recipes/filters Upsert a recipe filter to a project
ProjectsApi DeleteProject DELETE /projects/{owner}/{name} Delete a Project
ProjectsApi DeleteProjectOrgPermission DELETE /projects/{owner}/{name}/permissions Remove a Project permissions
ProjectsApi DeleteProjectRecipeFilter DELETE /projects/{owner}/{name}/recipes/filters Remove a Project recipe filter
ProjectsApi GetProject GET /projects/{owner}/{name} Get a project
ProjectsApi GetProjectAccessPermissions GET /projects/{owner}/{name}/permissions Get project access permissions
ProjectsApi GetProjectRecipeFilters GET /projects/{owner}/{name}/recipes/filters Get project recipe filters
ProjectsApi GetProjectRecipeRepositories GET /projects/{owner}/{name}/recipes/repositories Get project recipe repositories
ProjectsApi GetProjectRecipes GET /projects/{owner}/{name}/recipes Get project recipe versions
ProjectsApi ListProjects GET /projects List Projects
ProjectsApi Update PUT /projects/{owner}/{name} Update a Project
ProjectsApi UpsertProjectPermission PATCH /projects/{owner}/{name}/permissions Upsert a new permission to a project
RecipesApi CreateRecipe POST /recipes/{owner} Create a Recipe
RecipesApi CreateRecipePackage POST /recipes/{owner}/{name}/tags Create a new Recipe package
RecipesApi DeleteRecipe DELETE /recipes/{owner}/{name} Delete a Recipe
RecipesApi DeleteRecipeOrgPermission DELETE /recipes/{owner}/{name}/permissions Remove a Repository permissions
RecipesApi GetRecipe GET /recipes/{owner}/{name} Get a recipe
RecipesApi GetRecipeAccessPermissions GET /recipes/{owner}/{name}/permissions Get recipe access permissions
RecipesApi GetRecipeByTag GET /recipes/{owner}/{name}/tags/{tag} Get a recipe tag
RecipesApi ListRecipeTags GET /recipes/{owner}/{name}/tags Get a recipe tags
RecipesApi ListRecipes GET /recipes List recipes
RecipesApi UpdateRecipe PUT /recipes/{owner}/{name} Update a Recipe
RecipesApi UpsertRecipePermission PATCH /recipes/{owner}/{name}/permissions Upsert a new permission to a recipe
RegistriesApi GetPackage GET /registries/{owner}/{type}/{name}/{digest} Get Package
RegistriesApi GetPackageJson GET /registries/{owner}/{type}/{name}/{digest}/json Get Package in JSON format
RegistriesApi GetRegistryIndex GET /registries/{owner}/index.json Get Registry Index
RegistriesApi PostPlugin POST /registries/{owner}/plugins Push a plugin to the registry
RegistriesApi PostRecipe POST /registries/{owner}/recipes Push an Recipe to the registry
RunsApi CancelRun PUT /projects/{owner}/{name}/runs/{run_id}/cancel Cancel a run
RunsApi DownloadRunArtifact GET /projects/{owner}/{name}/runs/{run_id}/artifacts/download Download an artifact from the run folder
RunsApi GetAllRunSteps GET /projects/{owner}/{name}/runs/{run_id}/all-steps Query the steps of a run
RunsApi GetRun GET /projects/{owner}/{name}/runs/{run_id} Get a Run
RunsApi GetRunOutput GET /projects/{owner}/{name}/runs/{run_id}/outputs/{output_name} Get run output by name
RunsApi GetRunStepLogs GET /projects/{owner}/{name}/runs/{run_id}/steps/{step_id}/logs Get the logs of a specific step of the run
RunsApi GetRunSteps GET /projects/{owner}/{name}/runs/{run_id}/steps Query the steps of a run
RunsApi ListRunArtifacts GET /projects/{owner}/{name}/runs/{run_id}/artifacts List artifacts in a run folder
RunsApi ListRuns GET /projects/{owner}/{name}/runs List runs
RunsApi QueryResults GET /projects/{owner}/{name}/results Query run results
RunsApi RetryRun PUT /projects/{owner}/{name}/runs/{run_id}/retry Retry a run
SubscriptionPlansApi ListSubscriptionPlans GET /subscription-plans/ List Subscription Plans
SubscriptionsApi CancelSubscription DELETE /subscriptions/{subscription_id} Cancel a subscription
SubscriptionsApi CreateSubscription POST /subscriptions/ Subscribe account to subscritpion plan
SubscriptionsApi GetSubscription GET /subscriptions/{subscription_id} Retrieve a subscription by ID
SubscriptionsApi ListPollinationSubscriptions GET /subscriptions/ List Subscriptions
SubscriptionsApi ListSubscriptionPayments GET /subscriptions/{subscription_id}/payments List Payment for a Subscription
SubscriptionsApi ListSubscriptionQuotas GET /subscriptions/{subscription_id}/quotas List the quotas for a given subscription
SubscriptionsApi UpdateSubscription PUT /subscriptions/{subscription_id} Update a subscription
SubscriptionsApi UpdateSubscriptionPreivew PUT /subscriptions/{subscription_id}/preview Preview the effect of a subscription update
TeamsApi CreateTeam POST /orgs/{org_name}/teams Create a Team
TeamsApi DeleteOrgTeamMember DELETE /orgs/{org_name}/teams/{team_slug}/members/{username} Remove a team member
TeamsApi DeleteTeam DELETE /orgs/{org_name}/teams/{team_slug} Delete a Team
TeamsApi GetOrgTeamMembers GET /orgs/{org_name}/teams/{team_slug}/members List team members
TeamsApi GetTeam GET /orgs/{org_name}/teams/{team_slug} Get a Team
TeamsApi ListOrgTeams GET /orgs/{org_name}/teams List Teams
TeamsApi UpdateTeam PUT /orgs/{org_name}/teams/{team_slug} Update a Team
TeamsApi UpsertOrgTeamMember PATCH /orgs/{org_name}/teams/{team_slug}/members/{username}/{role} Add or update the role of an Team Member
UserApi CreateUser POST /user Register a new user
UserApi GetMe GET /user Get authenticated user profile.
UserApi GetRoles GET /user/roles Get the authenticated user roles
UserApi UpdateUserProfile PUT /user Update the authenticated user
UsersApi CheckUsername GET /users/check_username/{username} Check if a username is already taken
UsersApi GetOneUser GET /users/{name} Get a specific user profile
UsersApi ListUsers GET /users List Users

Documentation for Models

Documentation for Authorization

APIKeyAuth

  • Type: API key

  • API key parameter name: x-pollination-token

  • Location: HTTP header

JWTAuth

  • Type: HTTP bearer authentication

About

The Pollination API SDK for C#

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages