AlexaClientSDK  3.0.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 
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 
101 
110  const std::vector<std::string>& endpointConfigurations,
111  const std::string& authToken);
112 
117 size_t getMaxEndpoints();
118 
124 
125 } // namespace utils
126 } // namespace capabilitiesDelegate
127 } // namespace alexaClientSDK
128 
129 #endif // ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_UTILS_DISCOVERYUTILS_H_
std::string getDeleteReportEventJson(const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
::std::string string
Definition: gtest-port.h:1097
std::pair< std::string, std::string > getAddOrUpdateReportEventJson(const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
bool compareEndpointConfigurations(const std::string &firstEndpointConfigJson, const std::string &secondEndpointConfigJson)
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)
bool validateCapabilityConfiguration(const avsCommon::avs::CapabilityConfiguration &capabilityConfig)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string getDeleteReportEndpointConfigJson(const std::string &endpointId)
std::string getEndpointConfigJson(const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes, const std::vector< avsCommon::avs::CapabilityConfiguration > &capabilities)
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 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0