AWS IoT C++ SDK
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes
awsiotsdk::DiscoveryResponse Class Reference

Public Member Functions

 DiscoveryResponse (const DiscoveryResponse &)=delete
 
 DiscoveryResponse (DiscoveryResponse &&)=delete
 
DiscoveryResponseoperator= (const DiscoveryResponse &) &=delete
 
DiscoveryResponseoperator= (DiscoveryResponse &&) &=delete
 
 DiscoveryResponse (util::JsonDocument response_document)
 Constructor. More...
 
util::JsonDocument GetResponseDocument ()
 Return the full Discovery Response Json. More...
 
void SetResponseDocument (util::JsonDocument response_document)
 Set the Discovery Response Json Document in the Discovery Response Object. More...
 
ResponseCode GetParsedResponse (util::Vector< ConnectivityInfo > &connectivity_info_list, util::Map< util::String, util::Vector< util::String > > &root_ca_map)
 Get the parsed discovery response. More...
 
ResponseCode WriteToPath (util::String output_file_absolute_path)
 Write the complete Discovery Response Json out to a file. More...
 

Static Public Attributes

static const util::String GROUP_ARRAY_KEY = "GGGroups"
 Key for array of groups.
 
static const util::String GROUP_ID_KEY = "GGGroupId"
 Key for group ID.
 
static const util::String GGC_ARRAY_KEY = "Cores"
 Key for array of GGCs in the group.
 
static const util::String GGC_THING_ARN_KEY = "thingArn"
 Key for thing ARN of the GGC.
 
static const util::String ROOT_CA_KEY = "CAs"
 Key for the root CAs of the group.
 
static const util::String CONNECTIVITY_INFO_ARRAY_KEY = "Connectivity"
 Key for the array of connectivity information.
 
static const util::String ID_KEY = "Id"
 Key for the ID in the connectivity information.
 
static const util::String HOST_ADDRESS_KEY = "HostAddress"
 Key for host address in the connectivity information.
 
static const util::String PORT_KEY = "PortNumber"
 Key for port in the connectivity information.
 
static const util::String METADATA_KEY = "Metadata"
 Key for metadata for the connectivity information.
 
static const util::String DEFAULT_DISCOVERY_RESPONSE_FILE_NAME = "discovery_response.json"
 Default file into which the complete discovery response is stored.
 

Protected Attributes

util::JsonDocument response_document_
 Json document that contains the complete Discovery Response.
 

Constructor & Destructor Documentation

◆ DiscoveryResponse()

awsiotsdk::DiscoveryResponse::DiscoveryResponse ( util::JsonDocument  response_document)
Parameters
response_document- Json document containing full Discovery Response

Member Function Documentation

◆ GetParsedResponse()

ResponseCode awsiotsdk::DiscoveryResponse::GetParsedResponse ( util::Vector< ConnectivityInfo > &  connectivity_info_list,
util::Map< util::String, util::Vector< util::String > > &  root_ca_map 
)

Get the parse vector of all the connectivity information present in the Discovery Response Json along with a map of all the root CAs that correspond the the groups present in the Discovery Response. Returns SUCCESS if parsed successfully or DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR if the Json structure cannot be parsed

Parameters
connectivity_info_list- vector in which the connectivity information is stored
root_ca_map- mapping between groups and filenames of the root CAs
Returns
ResponseCode

◆ GetResponseDocument()

util::JsonDocument awsiotsdk::DiscoveryResponse::GetResponseDocument ( )
Returns
JsonDocument

◆ SetResponseDocument()

void awsiotsdk::DiscoveryResponse::SetResponseDocument ( util::JsonDocument  response_document)
Parameters
response_document

◆ WriteToPath()

ResponseCode awsiotsdk::DiscoveryResponse::WriteToPath ( util::String  output_file_absolute_path)

Function to write out the whole Discovery Response Json out to a file that can be consumed by other applications directly. Returns SUCCESS if it was able to write to the file correctly. Otherwise throws FILE_OPEN_ERROR if the file cannot be opened to write to it or FILE_NAME_INVALID if the file name passed in is invalid.

Parameters
output_file_absolute_path- absolute file path to which the Json will be written out to
Returns
ResponseCode