Qore GoogleDataProvider Module Reference 2.0
Loading...
Searching...
No Matches
GoogleDataProvider::GoogleApiDataProvider Class Reference

The Google generic API data provider class. More...

#include <GoogleApiDataProvider.qc.dox.h>

Inheritance diagram for GoogleDataProvider::GoogleApiDataProvider:
[legend]

Public Member Methods

 constructor (RestClient::RestClient rest, string api, string resource_action, *hash< auto > path_args)
 Creates the object.
 
*string getDesc ()
 Returns the data provider description.
 
string getName ()
 Returns the data provider name.
 
- Public Member Methods inherited from GoogleDataProvider::GoogleDataProviderBase
 constructor ()
 Creates the object.
 
 constructor (RestClient::RestClient rest)
 Creates the object.
 
*hash< auto > prepareRequest (auto req, *hash< string, softstring > implicit_path_args, *bool backfill_request_body)
 Prepares a request with a request type created from the Discovery API.
 
*hash< auto > prepareRequestIntern (AbstractDataProviderType request_type, auto req0, *hash< string, softstring > implicit_path_args, *bool backfill_request_body)
 Prepares a request with a request type created from the Discovery API.
 
 setLogger (*LoggerInterface logger)
 Accepts a LoggerInterface object for logging (or clears it)
 
 setRestClient (RestClient rest)
 Override REST client.
 
 updateConnectionObjects (object conn, object connobj)
 Update any connection used by the data provider.
 

Private Member Methods

hash< auto > backfillRequestBody (auto req)
 Used to set attributes in the request body that are not set in the request.
 
auto doRequestImpl (auto req, *hash< auto > request_options)
 Makes a request and returns the response.
 
AbstractDataProviderType getGoogleRequestType ()
 Returns the Google request type for the operation.
 
*DataProvider::AbstractDataProviderType getRequestTypeImpl ()
 Returns the description of a successful request message, if any.
 
*DataProvider::AbstractDataProviderType getResponseTypeImpl ()
 Returns the description of a response message, if this object represents a response message.
 
hash< DataProvider::DataProviderInfogetStaticInfoImpl ()
 Returns data provider static info.
 
bool needsBackfillRequestBody ()
 If the request body should be populated with missing values.
 
*hash< auto > prepareRequestForSchema (auto req)
 Prepares information for an API request.
 
*hash< auto > prepareRequestForSchema (string api, string resource_action, auto req, *bool in_backfill)
 Prepares information for an API request.
 
- Private Member Methods inherited from GoogleDataProvider::GoogleDataProviderBase
hash< auto > backfillRequestBody (auto req)
 Used to set attributes in the request body that are not set in the request.
 
bool needsBackfillRequestBody ()
 If the request body should be populated with missing values.
 

Private Attributes

string api
 The Google API name (ex: "calendar")
 
string category
 The resource name.
 
string desc
 Data provider description.
 
string name
 The action name.
 
*hash< string, softstring > path_args
 Any path args associated with this data provider.
 
string resource_action
 resource and action (ex: "events/get")
 
string type
 Data provider type name.
 
- Private Attributes inherited from GoogleDataProvider::GoogleDataProviderBase
*RestClient::RestClient rest
 The REST client object for API calls.
 

Additional Inherited Members

- Static Public Member Methods inherited from GoogleDataProvider::GoogleDataProviderBase
static string cap (string word)
 Returns the given word capitalized.
 
static checkResource (string api, list< string > resource_path)
 Check the given path for resources.
 
static hash< string, AbstractDataProviderType > getApi (string api)
 Returns all output schemas for the given API.
 
static hash< string, AbstractDataProviderType > getInputSchemaMap (string api, hash< auto > api_info)
 Creates the input schema map for the given API.
 
static hash< string, AbstractDataProviderType > getInputSchemasForApi (string api)
 Returns all input schemas for the given API.
 
static DataProvider::AbstractDataProviderType getInputTypeForSchema (string api, string schema)
 Returns an input / inbound data type for the given Google schema.
 
static string getMethodForSchema (string api, string path)
 Returns the HTTP method for the given API.
 
static *hash< string, bool > getMethodsForResource (string api, list< string > resource_path, *hash< auto > path_args)
 Returns a hash of all non-subscription methods for the given resource.
 
static hash< string, AbstractDataProviderType > getOutputSchemaMap (string api, hash< auto > api_info)
 Creates the output schema map for the given API.
 
static string getPathForSchema (string api, string resource)
 Returns the path for the given API.
 
static hash< auto > getRequestInfo (string api)
 Returns all request types for the given API.
 
static DataProvider::AbstractDataProviderType getRequestTypeForSchema (string api, string resource,...)
 Returns a request data type for the given API.
 
static DataProvider::AbstractDataProviderType getRequestTypeForSchemaArgs (string api, string path, *list< auto > args)
 Returns a data type for the given request.
 
static DataProvider::AbstractDataProviderType getResponseTypeForSchema (string api, string resource)
 Returns a response data type for the given API.
 
static RestClient::RestClient getRestConnection (*hash< auto > options)
 Returns a GoogleRestClient connection from the options.
 
static DataProvider::AbstractDataProviderType getTypeForSchema (string api, string schema)
 Returns a data type for the given Google schema.
 
static string getUrlForApi (string api, RestClient::RestClient rest)
 Returns the URL for the given API.
 
static QoreDataField makeFieldFromProperty (HashDataType h, string key, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a hash from a Google schema description.
 
static HashDataType makeHashFromSchemaInfo (string key, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a hash from a Google schema description.
 
static ListDataType makeListFromSchemaInfo (string key, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a list from a Google schema description.
 
static hash< auto > processRequest (string key, hash< auto > info, TypeResolverHelper unresolved)
 Returns a hash from a Google schema description.
 
- Public Attributes inherited from GoogleDataProvider::GoogleDataProviderBase
const DiscoveryUrlBase = "https://discovery.googleapis.com/discovery/v1/apis"
 Discovery URL base.
 
const InitTimeout = 10s
 Initialization I/O timeout.
 
- Static Private Member Methods inherited from GoogleDataProvider::GoogleDataProviderBase
static Mutex m ()
 schema cache lock
 
static AbstractDataProviderType makeTypeFromSchemaInfo (HashDataType type, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a type from a Google schema description.
 
static AbstractDataProviderType makeTypeFromSchemaInfo (ListDataType type, string key, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a type from a Google schema description.
 
static AbstractDataProviderType makeTypeFromSchemaInfo (QoreDataField field, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a type from a Google schema description.
 
static AbstractDataProviderType makeTypeFromSchemaInfo (string key, hash< auto > info, TypeResolverHelper unresolved, *bool for_input)
 Returns a type from a Google schema description.
 
static hash< auto > processRequests (string api, hash< auto > h, TypeResolverHelper unresolved)
 Process requests.
 
- Static Private Attributes inherited from GoogleDataProvider::GoogleDataProviderBase
static hash< string, string > api_map
 API -> URL map.
 
static hash< string, hash< auto > > info_map
 Schema info: API -> info.
 
static hash< string, hash< string, AbstractDataProviderType > > input_schema_map
 input schema cache; API -> schema name -> type
 
static hash< string, hash< string, AbstractDataProviderType > > output_schema_map
 output schema cache; API -> schema name -> type
 
static hash< string, hash< auto > > request_map
 schema cache; API -> request path ->
 

Detailed Description

The Google generic API data provider class.

Member Function Documentation

◆ doRequestImpl()

auto GoogleDataProvider::GoogleApiDataProvider::doRequestImpl ( auto  req,
*hash< auto >  request_options 
)
private

Makes a request and returns the response.

Parameters
reqthe request to serialize and make according to the request type
request_optionsthe request options; will be processed by validateRequestOptions()
Returns
the response to the request

◆ getRequestTypeImpl()

*DataProvider::AbstractDataProviderType GoogleDataProvider::GoogleApiDataProvider::getRequestTypeImpl ( )
private

Returns the description of a successful request message, if any.

Returns
the request type for this provider

◆ getResponseTypeImpl()

*DataProvider::AbstractDataProviderType GoogleDataProvider::GoogleApiDataProvider::getResponseTypeImpl ( )
private

Returns the description of a response message, if this object represents a response message.

Returns
the response type for this response message