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 
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 };
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:97
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