| Qore CdsRestDataProvider Module Reference 1.0.0

CdsRestDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
26 namespace CdsRestDataProvider {
28 class CdsRestDataProvider : public DataProvider::AbstractDataProvider {
29
30 public:
32 CdsRestClient::CdsRestClient rest;
33
35 const ProviderInfo = <DataProviderInfo>{
36 "type": "CdsRestDataProvider",
37 "supports_children": True,
38 "constructor_options": ConstructorOptions,
39 "children_can_support_apis": False,
40 "children_can_support_records": True,
41 "children_can_support_observers": False,
42 };
43
45 const ConstructorOptions = {
46 "api": <DataProviderOptionInfo>{
47 "type": AbstractDataProviderType::get(StringType),
48 "desc": "the CDS API version to use",
49 },
50 "cdsrestclient_options": <DataProviderOptionInfo>{
51 "type": AbstractDataProviderType::get(AutoHashType),
52 "desc": "options to the CdsRestClient constructor",
53 },
54 "client_id": <DataProviderOptionInfo>{
55 "type": AbstractDataProviderType::get(StringType),
56 "desc": "the client ID (required if 'client_secret' provided)",
57 },
58 "client_secret": <DataProviderOptionInfo>{
59 "type": AbstractDataProviderType::get(StringType),
60 "desc": "the client secret (required if 'client_id' provided)",
61 },
62 "scope": <DataProviderOptionInfo>{
63 "type": AbstractDataProviderType::get(StringType),
64 "desc": "the scope string",
65 },
66 "tenant": <DataProviderOptionInfo>{
67 "type": AbstractDataProviderType::get(StringType),
68 "desc": "the tenant string",
69 },
70 "url": <DataProviderOptionInfo>{
71 "type": AbstractDataProviderType::get(StringType),
72 "desc": "the URL to the CDS server",
73 "required": True,
74 },
75 };
76
78 const EnvOptions = {
79 "url": "CDS_URL",
80 "client_id": "CDS_CLIENT_ID",
81 "client_secret": "CDS_CLIENT_SECRET",
82 "tenant": "CDS_TENANT",
83 "scope": "CDS_SCOPE",
84 };
85
87 const HttpMethods = {
88 "GET": True,
89 "PUT": True,
90 "PATCH": True,
91 "POST": True,
92 "DELETE": True,
93 };
94
95 protected:
97 *hash<auto> meta;
98
100 Qore::Thread::Mutex lck();
101
102 public:
103
105 constructor(CdsRestClient::CdsRestClient rest);
106
107
109 constructor(*hash<auto> options);
110
111
113 string getName();
114
115
117
119 protected:
120 *list<string> getChildProviderNamesImpl();
121 public:
122
123
125
129 protected:
130 *DataProvider::AbstractDataProvider getChildProviderImpl(string name);
131 public:
132
133
135 protected:
136 *hash<auto> getMetadata();
137 public:
138
139
141 protected:
142 hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
143 public:
144
145
147 protected:
148 static *hash<auto> getClientOptions(*hash<auto> copts);
149 public:
150
151 };
152 };
CdsRestDataProvider::CdsRestDataProvider::getClientOptions
static *hash< auto > getClientOptions(*hash< auto > copts)
Returns options for the CdsRestClient.
CdsRestDataProvider::CdsRestDataProvider::getStaticInfoImpl
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
CdsRestDataProvider::CdsRestDataProvider::constructor
constructor(CdsRestClient::CdsRestClient rest)
Creates the object from the arguments.
CdsRestDataProvider::CdsRestDataProvider::rest
CdsRestClient::CdsRestClient rest
The REST client object for API calls.
Definition: CdsRestDataProvider.qc.dox.h:32
CdsRestDataProvider::CdsRestDataProvider::getChildProviderImpl
*DataProvider::AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
CdsRestDataProvider::CdsRestDataProvider::getChildProviderNamesImpl
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
CdsRestDataProvider::CdsRestDataProvider::getName
string getName()
Returns the data provider name.
CdsRestDataProvider::CdsRestDataProvider::meta
*hash< auto > meta
Metadata keyed by entity type.
Definition: CdsRestDataProvider.qc.dox.h:97
CdsRestDataProvider::CdsRestDataProvider::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
CdsRestDataProvider::CdsRestDataProvider::lck
Qore::Thread::Mutex lck()
Metadata mutex.
CdsRestDataProvider::CdsRestDataProvider::getMetadata
*hash< auto > getMetadata()
Returns metadata.
Qore::Thread::Mutex
True
const True
False
const False
CdsRestDataProvider
Qore CdsRestDataProvider module definition.
Definition: CdsEntityDataProvider.qc.dox.h:26