Giter VIP home page Giter VIP logo

sdk-dotnet's Introduction

Directus Logo

Directus .NET/C# SDK

 

This codebase is a work-in-progress. The repo is here as a placeholder for anyone interested in contributing to the software development kit. Pull-requests and contributions are welcome!

 

This C# SDK was initially automatically generated by the Swagger Codegen project, and later adapted by @mghextreme to support .NET Core and .NET Standard.

  • API version: 1.1
  • SDK version: 2.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET Standard 2.0
    • .NET Core 2.0 or later
    • .NET Framework 4.6.1 or later

Dependencies

To restore the latest versions using [NuGet] (https://docs.nuget.org/consume/installing-nuget), run the following command:

dotnet restore

Building

To build the package, either run the VSCode key shortcut Ctrl + Shift + B or run the dotnet build command.

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

If you use VSCode, you can easily pack by using the Ctrl + Shift + P key shortcut, Run Task and selecting pack

It is not mandatory, but you may publish to a local feed or other host and consume the new package via Nuget as usual.

Installation

The package may now be installed in your project using either dotnet add (.NET CLI) or Install-Package (Package Manager).

In your project, use the following namespaces to use the Directus SDK.

using IO.Directus.Api;
using IO.Directus.Client;
using IO.Directus.Model;

Getting Started

using System;
using System.Diagnostics;
using IO.Directus.Api;
using IO.Directus.Client;
using IO.Directus.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            // Configure API key authorization: api_key
            Configuration.Default.ApiKey.Add("access_token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("access_token", "Bearer");
            Configuration.Default.BasePath = "https://myinstance.directus.io/api/1.1";

            var apiInstance = new ActivityApi();

            try
            {
                // Returns activity
                GetActivity result = apiInstance.GetActivity();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ActivityApi.GetActivity: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to your configured base path, as per example.

Class Method HTTP request Description
ActivityApi GetActivity GET /activity Returns activity
BookmarksApi AddBookmark POST /bookmarks Create a bookmark
BookmarksApi DeleteBookmark DELETE /bookmarks/{bookmarkId} Deletes specific bookmark
BookmarksApi GetBookmark GET /bookmarks/{bookmarkId} Returns specific bookmark
BookmarksApi GetBookmarks GET /bookmarks Returns bookmarks
BookmarksApi GetBookmarksSelf GET /bookmarks/self Returns bookmarks of current user
FilesApi CreateFile POST /files Creates file
FilesApi GetFile GET /files/{fileId} Returns specific file by id
FilesApi GetFiles GET /files Returns files
FilesApi UpdateFile PUT /files/{fileId} Creates file
GroupsApi AddGroup POST /groups Add a new group
GroupsApi AddPrivilege POST /privileges/{groupId} Create new table privileges for the specified user group
GroupsApi GetGroup GET /groups/{groupId} Returns specific group
GroupsApi GetGroups GET /groups Returns groups
GroupsApi GetPrivileges GET /privileges/{groupId} Returns group privileges
GroupsApi GetPrivilegesForTable GET /privileges/{groupId}/{tableNameOrPrivilegeId} Returns group privileges by tableName
GroupsApi UpdatePrivileges PUT /privileges/{groupId}/{tableNameOrPrivilegeId} Update privileges by privilegeId
MessagesApi GetMessage GET /messages/{messageId} Returns specific message
MessagesApi GetMessages GET /messages/self Returns messages
PreferencesApi GetPreferences GET /tables/{tableId}/preferences Returns table preferences
PreferencesApi UpdatePreferences PUT /tables/{tableId}/preferences Update table preferences
SettingsApi GetSettings GET /settings Returns settings
SettingsApi GetSettingsFor GET /settings/{collectionName} Returns settings for collection
SettingsApi UpdateSettings PUT /settings/{collectionName} Update settings
TablesApi AddColumn POST /tables/{tableId}/columns Create a column in a given table
TablesApi AddRow POST /tables/{tableId}/rows Add a new row
TablesApi AddTable POST /tables Add a new table
TablesApi DeleteColumn DELETE /tables/{tableId}/columns/{columnName} Delete row
TablesApi DeleteRow DELETE /tables/{tableId}/rows/{rowId} Delete row
TablesApi DeleteTable DELETE /tables/{tableId} Delete Table
TablesApi GetTable GET /tables/{tableId} Returns specific table
TablesApi GetTableColumn GET /tables/{tableId}/columns/{columnName} Returns specific table column
TablesApi GetTableColumns GET /tables/{tableId}/columns Returns table columns
TablesApi GetTableRow GET /tables/{tableId}/rows/{rowId} Returns specific table row
TablesApi GetTableRows GET /tables/{tableId}/rows Returns table rows
TablesApi GetTables GET /tables Returns tables
TablesApi UpdateColumn PUT /tables/{tableId}/columns/{columnName} Update column
TablesApi UpdateRow PUT /tables/{tableId}/rows/{rowId} Update row
UtilsApi GetHash POST /hash Get a hashed value
UtilsApi GetRandom POST /random Returns random alphanumeric string

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: access_token
  • Location: URL query string

 


Directus is released under the GPLv3 license. RANGER Studio LLC owns all Directus trademarks and logos on behalf of our project's community. Copyright © 2006-2018, RANGER Studio LLC.

sdk-dotnet's People

Contributors

mghextreme avatar benhaynes avatar rijkvanzanten avatar kipergil avatar wellingguzman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.