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