Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
provider.h File Reference
#include "grassroots_service_library.h"
#include "typedefs.h"
#include "jansson.h"
Include dependency graph for provider.h:

Go to the source code of this file.

Functions

const char * GetProviderName (const json_t *const data_p)
 Get the name of the Provider from a given JSON configuration fragment. More...
 
const char * GetProviderURI (const json_t *const data_p)
 Get the URI of the Provider from a given JSON configuration fragment. More...
 
const char * GetProviderDescription (const json_t *const data_p)
 Get the description of the Provider from a given JSON configuration fragment. More...
 
const char * GetProviderLogo (const json_t *const data_p)
 Get the URL of the logo of the Provider from a given JSON configuration fragment. More...
 
json_t * GetProviderDetails (const json_t *root_json_p)
 Get the JSON object containing the Provider details. More...
 
bool SetProviderType (json_t *provider_p)
 Ensure that the correct json-ld datatype is set for a given JSON object representing a Provider. More...
 

Function Documentation

◆ GetProviderName()

const char* GetProviderName ( const json_t *const  data_p)

Get the name of the Provider from a given JSON configuration fragment.

Parameters
data_pThe fragment to get the name of the Provider from.
Returns
The name of the Provider or NULL if it could not be found.

◆ GetProviderURI()

const char* GetProviderURI ( const json_t *const  data_p)

Get the URI of the Provider from a given JSON configuration fragment.

Parameters
data_pThe fragment to get the URI of the Provider from.
Returns
The URI of the Provider or NULL if it could not be found.

◆ GetProviderDescription()

const char* GetProviderDescription ( const json_t *const  data_p)

Get the description of the Provider from a given JSON configuration fragment.

Parameters
data_pThe fragment to get the description of the Provider from.
Returns
The description of the Provider or NULL if it could not be found.

◆ GetProviderLogo()

const char* GetProviderLogo ( const json_t *const  data_p)

Get the URL of the logo of the Provider from a given JSON configuration fragment.

Parameters
data_pThe fragment to get the logo of the Provider from.
Returns
The URL of the logo of the Provider or NULL if it could not be found.

◆ GetProviderDetails()

json_t* GetProviderDetails ( const json_t *  root_json_p)

Get the JSON object containing the Provider details.

Parameters
root_json_pThe JSON fragment to get the Provider details from.
Returns
Upon success, if there is only one Provider then the returned object will be JSON object. If there are multiple providers, then the returned value will be a JSON array with each object representing each provider. Upon failure NULL will be returned.

◆ SetProviderType()

bool SetProviderType ( json_t *  provider_p)

Ensure that the correct json-ld datatype is set for a given JSON object representing a Provider.

If the value is already set, then the object is unaltered.

Parameters
provider_pThe Provider to check.
Returns
true if the Provider has the correct datatype set successfully, false otherwise.