Code Monkey home page Code Monkey logo

libre-graph-api-cpp-qt-client's Introduction

C++ Qt API client

Libre Graph API

  • API version: v0.10.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. CMake 3.2+
  2. Qt
  3. C++ Compiler

Getting Started

example.h:

#include <iostream>
#include "../client/OAIDrivesApi.h"

using namespace test_namespace;

class Example : public QObject {
    Q_OBJECT
    OAIDrive create();
public slots:
   void exampleFunction1();
};

example.cpp:

#include "../client/OAIDrivesApi.h"
#include "example.h"
#include <QTimer>
#include <QEventLoop>

OAIDrive Example::create(){
    OAIDrive obj;
 return obj;
}

void Example::exampleFunction1(){
     OAIDrivesApi apiInstance;
     
      QEventLoop loop;
      connect(&apiInstance, &OAIDrivesApi::createDriveSignal, [&]() {
          loop.quit();
      });
      connect(&apiInstance, &OAIDrivesApi::createDriveSignalE, [&](QNetworkReply::NetworkError, QString error_str) {
          qDebug() << "Error happened while issuing request : " << error_str;
          loop.quit();
      });

      OAIDrive oai_drive = create(); // OAIDrive | New space property values
      apiInstance.createDrive(oai_drive);
      QTimer::singleShot(5000, &loop, &QEventLoop::quit);
      loop.exec();
  }

Documentation for Servers

Parameterized Servers are supported. Define a server in the API for each endpoint with arbitrary numbers of variables:

servers:
- url: http://{server}:{port}/{basePath}
  description: Description of the Server
  variables:
    server:
        enum:
          - 'petstore'
          - 'qa-petstore'
          - 'dev-petstore'
        default: 'petstore'
    port:
      enum:
        - '3000'
        - '1000'
      default: '3000'
    basePath:
      default: v1

To change the default variable, use this function in each Api:

int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val);

The parameter "serverIndex" will choose a server from the server list for each endpoint. There is always at least one server with index 0. The Parameter "operation" should be the desired endpoint operationid. Variable is the name of the variable you wish to change and the value is the new default Value. The function will return -1 when the variable does not exists, -2 if value is not defined in the variable enum and -3 if the operation is not found.

If your endpoint has multiple server objects in the servers array, you can set the server that will be used with this function:

void setServerIndex(const QString &operation, int serverIndex);

Parameter "operation" should be your operationid. "serverIndex" is the index you want to set as your default server. The function will check if there is a server with your index. Here is an example of multiple servers in the servers array. The first server will have index 0 and the second will have index 1.

servers:
- url: http://{server}:8080/
  description: Description of the Server
  variables:
    server:
        enum:
          - 'petstore'
          - 'qa-petstore'
          - 'dev-petstore'
        default: 'petstore'
- url: https://localhost:8080/v1

Documentation for Authorization

All endpoints do not require authorization. Authentication schemes defined for the API:

Author

License

Apache 2.0 for more information visit Apache 2.0

libre-graph-api-cpp-qt-client's People

Contributors

micbar avatar refs avatar rhafer avatar theonering avatar butonic avatar

Watchers

 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.