SwaggerDataProvider.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace SwaggerDataProvider {
class SwaggerDataProvider : public AbstractDataProvider {
public:
SwaggerSchema schema;
*RestClient rest;
string uri_path = "/";
string display_name;
const ProviderInfo = <DataProviderInfo>{
"type": "SwaggerDataProvider",
"supports_read": False,
"supports_create": False,
"supports_update": False,
"supports_upsert": False,
"supports_delete": False,
"supports_native_search": False,
"supports_bulk_create": False,
"supports_bulk_upsert": False,
"supports_children": True,
"constructor_options": ConstructorOptions,
"search_options": NOTHING,
"create_options": NOTHING,
"upsert_options": NOTHING,
"transaction_management": False,
"supports_schema": True,
"schema_type": "swagger",
"children_can_support_apis": True,
"children_can_support_records": False,
"children_can_support_observers": False,
};
const ConstructorOptions = {
"schema": <DataProviderOptionInfo>{
"type": (
AbstractDataProviderType::get(StringType, NOTHING, {
DTT_FromFile: True,
DTT_FromLocation: True,
}),
AbstractDataProviderType::get(new Type("SwaggerSchema")),
),
"desc": "the Swagger schema object or source URL",
"required": True,
},
"restclient": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(new Type("RestClient"), NOTHING, {
DTT_ClientOnly: True,
}),
"desc": "the RestClient object",
},
"url": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType, NOTHING, {
DTT_ClientOnly: True,
}),
"desc": "the URL to the REST server; overrides any URL in the schema or in any RestClient object "
"passed as an option",
},
"restclient_options": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(AutoHashType, NOTHING, {
DTT_ClientOnly: True,
}),
"desc": "options to the RestClient constructor; only used if a RestClient object is created for a "
"call",
},
};
const HttpMethods = {
"GET": True,
"PUT": True,
"PATCH": True,
"POST": True,
"DELETE": True,
};
protected:
hash<auto> path_tree;
public:
protected:
constructor(hash<auto> path_tree, string uri_path, SwaggerSchema schema, *RestClient rest);
public:
constructor(SwaggerSchema schema, *RestClient rest);
constructor(*hash<auto> options);
string getName();
*string getDesc();
protected:
checkRestClient(RestClient rest);
public:
protected:
setupTree();
public:
protected:
*list<string> getChildProviderNamesImpl();
public:
protected:
*AbstractDataProvider getChildProviderImpl(string name);
public:
protected:
AbstractDataProvider getChildIntern(string name, *string real_name);
public:
protected:
hash<DataProviderInfo> getStaticInfoImpl();
public:
protected:
object getSchemaObjectImpl();
public:
};
}; // end namespace swagger
SwaggerDataProvider::SwaggerDataProvider::getStaticInfoImpl
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
SwaggerDataProvider::SwaggerDataProvider::getName
string getName()
Returns the data provider name.
SwaggerDataProvider::SwaggerDataProvider::checkRestClient
checkRestClient(RestClient rest)
Checks the REST client.
SwaggerDataProvider::SwaggerDataProvider::schema
SwaggerSchema schema
The Swagger schema.
Definition: SwaggerDataProvider.qc.dox.h:32
SwaggerDataProvider::SwaggerDataProvider::getChildProviderNamesImpl
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
SwaggerDataProvider::SwaggerDataProvider::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
SwaggerDataProvider::SwaggerDataProvider::getChildIntern
AbstractDataProvider getChildIntern(string name, *string real_name)
Returns the child provider for the given path component.
SwaggerDataProvider::SwaggerDataProvider::display_name
string display_name
The value to returns as the name of the object.
Definition: SwaggerDataProvider.qc.dox.h:41
SwaggerDataProvider::SwaggerDataProvider::constructor
constructor(SwaggerSchema schema, *RestClient rest)
Creates the object from the arguments.
SwaggerDataProvider::SwaggerDataProvider::getSchemaObjectImpl
object getSchemaObjectImpl()
Returns the schema supporting this data provider.
SwaggerDataProvider::SwaggerDataProvider::getChildProviderImpl
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
SwaggerDataProvider::SwaggerDataProvider::rest
*RestClient rest
The REST client object for API calls.
Definition: SwaggerDataProvider.qc.dox.h:35
SwaggerDataProvider::SwaggerDataProvider::constructor
constructor(hash< auto > path_tree, string uri_path, SwaggerSchema schema, *RestClient rest)
Private constructor; used when traversing the tree.
SwaggerDataProvider::SwaggerDataProvider::getDesc
*string getDesc()
Returns the data provider description.
SwaggerDataProvider::SwaggerDataProvider::path_tree
hash< auto > path_tree
hash of valid paths
Definition: SwaggerDataProvider.qc.dox.h:113
True
const True
False
const False
NOTHING
const NOTHING
RestClient
SwaggerDataProvider
Qore SwaggerDataProvider module definition.
Definition: SwaggerDataProvider.qc.dox.h:26