Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Fozzy Windows VPS APIs Client library for C#

License

Notifications You must be signed in to change notification settings

FozzyHosting/winvps-api-csharp

Repository files navigation

This library is not supported anymore. If you need a C# SDK for Fozzy Windows VPS service, please register your interest with our support (support@fozzy.com) so we could let you know when we release a new version.

Fozzy Windows VPS APIs Client library for C#

The API Client Library enables you to work with Fozzy Windows VPS APIs for creating or managing your machines.

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

Authorization

To be able to send requests you need to get API key as described in API Documentation.

Full example

using System;
using System.Diagnostics;
using FozzyHosting.WinVPS.Api;
using FozzyHosting.WinVPS.Client;
using FozzyHosting.WinVPS.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {
            Configuration.Default.ApiKey.Add("Api-Key", "API key from WinVPS client area");

            var apiInstance = new BrandsApi();

            try
            {
                // Returns list of all available preinstalled software set.
                BrandsListResponse result = apiInstance.BrandsGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling BrandsApi.BrandsGet: " + e.Message );
            }
        }
    }
}

About

Fozzy Windows VPS APIs Client library for C#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages