Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

lab5e/spanclient-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spanclient - the C# library for the The Span API

API for device, collection, output and firmware management

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

  • API version: 4.1.3 factual-kahlil
  • SDK version: 4.1.3
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit https://lab5e.com/span

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

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
Install-Package System.ComponentModel.Annotations

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

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using spanclient.Api;
using spanclient.Client;
using spanclient.Model;

Getting Started

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

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

            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com/span";
            // Configure API key authorization: APIToken
            config.ApiKey.Add("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("X-API-Token", "Bearer");

            var apiInstance = new CollectionsApi(config);
            var collectionId = collectionId_example;  // string | 
            var body = new SendMessageRequest(); // SendMessageRequest | 

            try
            {
                // Broadcast message
                MultiSendMessageResponse result = apiInstance.BroadcastMessage(collectionId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling CollectionsApi.BroadcastMessage: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.lab5e.com/span

Class Method HTTP request Description
CollectionsApi BroadcastMessage POST /collections/{collectionId}/to Broadcast message
CollectionsApi CreateCollection POST /collections Create collection
CollectionsApi DeleteCollection DELETE /collections/{collectionId} Delete collection
CollectionsApi ListCollectionData GET /collections/{collectionId}/data Get payloads
CollectionsApi ListCollections GET /collections List collections
CollectionsApi RetrieveCollection GET /collections/{collectionId} Retrieve collection
CollectionsApi UpdateCollection PATCH /collections/{collectionId} Update collection
DatadumpApi DataDump POST /datadump Data dump
DevicesApi CreateDevice POST /collections/{collectionId}/devices Create device
DevicesApi DeleteDevice DELETE /collections/{collectionId}/devices/{deviceId} Remove device
DevicesApi ListDeviceData GET /collections/{collectionId}/devices/{deviceId}/data Get payloads
DevicesApi ListDevices GET /collections/{collectionId}/devices List devices
DevicesApi RetrieveDevice GET /collections/{collectionId}/devices/{deviceId} Retrieve device
DevicesApi SendMessage POST /collections/{collectionId}/devices/{deviceId}/to Send message
DevicesApi UpdateDevice PATCH /collections/{existingCollectionId}/devices/{deviceId} Update device
FotaApi ClearFirmwareError DELETE /collections/{collectionId}/devices/{deviceId}/fwerror Clear FOTA error
FotaApi CreateFirmware POST /collections/{collectionId}/firmware Create firmware
FotaApi DeleteFirmware DELETE /collections/{collectionId}/firmware/{imageId} Delete firmware
FotaApi FirmwareUsage PATCH /collections/{collectionId}/firmware/{imageId}/usage Firmware usage
FotaApi ListFirmware GET /collections/{collectionId}/firmware List firmware
FotaApi RetrieveFirmware GET /collections/{collectionId}/firmware/{imageId} Retrieve firmware
FotaApi UpdateFirmware PATCH /collections/{collectionId}/firmware/{imageId} Update firmware
OutputsApi CreateOutput POST /collections/{collectionId}/outputs Create output
OutputsApi DeleteOutput DELETE /collections/{collectionId}/outputs/{outputId} Delete output
OutputsApi ListOutputs GET /collections/{collectionId}/outputs List outputs
OutputsApi Logs GET /collections/{collectionId}/outputs/{outputId}/logs Output logs
OutputsApi RetrieveOutput GET /collections/{collectionId}/outputs/{outputId} Retrieve output
OutputsApi Status GET /collections/{collectionId}/outputs/{outputId}/status Output status
OutputsApi UpdateOutput PATCH /collections/{collectionId}/outputs/{outputId} Update output
SystemApi GetSystemInfo GET /system System information

Documentation for Models

Documentation for Authorization

APIToken

  • Type: API key
  • API key parameter name: X-API-Token
  • Location: HTTP header

About

OpenAPI generated .NET/C# client library for Span

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors