AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DiscoveryUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_UTILS_DISCOVERYUTILS_H_
17 #define ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_UTILS_DISCOVERYUTILS_H_
18 
19 #include <map>
20 #include <utility>
21 #include <string>
22 #include <vector>
23 
26 
27 namespace alexaClientSDK {
28 namespace capabilitiesDelegate {
29 namespace utils {
30 
32 static constexpr int MAX_DISCOVERY_PAYLOAD_SIZE = 256 * 1024;
33 
35 static constexpr int MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE = 10 * 1024;
36 
38 static constexpr int MAX_ENDPOINTS_SIZE_IN_PAYLOAD = MAX_DISCOVERY_PAYLOAD_SIZE - MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE;
39 
47 
55 
66  const std::string& firstEndpointConfigJson,
67  const std::string& secondEndpointConfigJson);
68 
77 std::string getEndpointConfigJson(
78  const avsCommon::avs::AVSDiscoveryEndpointAttributes& endpointAttributes,
79  const std::vector<avsCommon::avs::CapabilityConfiguration>& capabilities);
80 
89 std::pair<std::string, std::string> getAddOrUpdateReportEventJson(
90  const std::vector<std::string>& endpointConfigurations,
91  const std::string& authToken);
92 
100 std::string getDeleteReportEndpointConfigJson(const std::string& endpointId);
101 
109 std::string getDeleteReportEventJson(
110  const std::vector<std::string>& endpointConfigurations,
111  const std::string& authToken);
112 
113 } // namespace utils
114 } // namespace capabilitiesDelegate
115 } // namespace alexaClientSDK
116 
117 #endif // ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_UTILS_DISCOVERYUTILS_H_
std::string getDeleteReportEventJson(const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
Definition: DiscoveryUtils.cpp:400
std::pair< std::string, std::string > getAddOrUpdateReportEventJson(const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
Definition: DiscoveryUtils.cpp:382
bool compareEndpointConfigurations(const std::string &firstEndpointConfigJson, const std::string &secondEndpointConfigJson)
Definition: DiscoveryUtils.cpp:280
static constexpr int MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE
Maximum size of header and scope fields in the Discovery event (Choosing a sufficiently large size of...
Definition: DiscoveryUtils.h:35
Definition: AVSDiscoveryEndpointAttributes.h:41
bool validateEndpointAttributes(const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes)
Definition: DiscoveryUtils.cpp:256
bool validateCapabilityConfiguration(const avsCommon::avs::CapabilityConfiguration &capabilityConfig)
Definition: DiscoveryUtils.cpp:222
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string getDeleteReportEndpointConfigJson(const std::string &endpointId)
Definition: DiscoveryUtils.cpp:376
std::string getEndpointConfigJson(const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes, const std::vector< avsCommon::avs::CapabilityConfiguration > &capabilities)
Definition: DiscoveryUtils.cpp:296
Definition: CapabilityConfiguration.h:42
static constexpr int MAX_DISCOVERY_PAYLOAD_SIZE
Maximum size of the Discovery event (256 KB)
Definition: DiscoveryUtils.h:32
static constexpr int MAX_ENDPOINTS_SIZE_IN_PAYLOAD
Maximum size of endpoint configurations in Event payload.
Definition: DiscoveryUtils.h:38

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0