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  };
40 
42  const ConstructorOptions = {
43  "api": <DataProviderOptionInfo>{
44  "type": AbstractDataProviderType::get(StringType),
45  "desc": "the CDS API version to use",
46  },
47  "cdsrestclient": <DataProviderOptionInfo>{
48  "type": AbstractDataProviderType::get(new Type("CdsRestClient")),
49  "desc": "the CdsRestClient object",
50  },
51  "cdsrestclient_options": <DataProviderOptionInfo>{
52  "type": AbstractDataProviderType::get(AutoHashType),
53  "desc": "options to the CdsRestClient constructor; only used if a CdsRestClient object "
54  "is created for a call",
55  },
56  "client_id": <DataProviderOptionInfo>{
57  "type": AbstractDataProviderType::get(StringType),
58  "desc": "the client ID (required if 'client_secret' provided)",
59  },
60  "client_secret": <DataProviderOptionInfo>{
61  "type": AbstractDataProviderType::get(StringType),
62  "desc": "the client secret (required if 'client_id' provided)",
63  },
64  "scope": <DataProviderOptionInfo>{
65  "type": AbstractDataProviderType::get(StringType),
66  "desc": "the scope string",
67  },
68  "tenant": <DataProviderOptionInfo>{
69  "type": AbstractDataProviderType::get(StringType),
70  "desc": "the tenant string",
71  },
72  "url": <DataProviderOptionInfo>{
73  "type": AbstractDataProviderType::get(StringType),
74  "desc": "the URL to the CDS server; overrides any URL in the schema or in any RestClient object "
75  "passed as an option",
76  },
77  };
78 
80  const EnvOptions = {
81  "url": "CDS_URL",
82  "client_id": "CDS_CLIENT_ID",
83  "client_secret": "CDS_CLIENT_SECRET",
84  "tenant": "CDS_TENANT",
85  "scope": "CDS_SCOPE",
86  };
87 
89  const HttpMethods = {
90  "GET": True,
91  "PUT": True,
92  "PATCH": True,
93  "POST": True,
94  "DELETE": True,
95  };
96 
97 protected:
99  *hash<auto> meta;
100 
103 
104 public:
105 
107  constructor(CdsRestClient::CdsRestClient rest);
108 
109 
111  constructor(*hash<auto> options);
112 
113 
115  string getName();
116 
117 
119 
121 protected:
122  *list<string> getChildProviderNamesImpl();
123 public:
124 
125 
127 
131 protected:
132  *DataProvider::AbstractDataProvider getChildProviderImpl(string name);
133 public:
134 
135 
137 protected:
138  *hash<auto> getMetadata();
139 public:
140 
141 
143 protected:
144  hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
145 public:
146 
147 
149 protected:
150  static *hash<auto> getClientOptions(*hash<auto> copts);
151 public:
152 
153 };
154 };
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.
CdsRestClient::CdsRestClient rest
The REST client object for API calls.
Definition: CdsRestDataProvider.qc.dox.h:32
*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:99
constructor(*hash< auto > options)
Creates the object from constructor options.
Qore::Thread::Mutex lck()
Metadata mutex.
*hash< auto > getMetadata()
Returns metadata.
const True
Qore CdsRestDataProvider module definition.
Definition: CdsEntityDataProvider.qc.dox.h:26