AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface Class Referenceabstract

#include <EndpointBuilderInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface:
Collaboration graph
[legend]

Public Member Functions

virtual ~EndpointBuilderInterface ()=default
 
virtual EndpointBuilderInterfacewithDerivedEndpointId (const std::string &suffix)=0
 
virtual EndpointBuilderInterfacewithDeviceRegistration ()=0
 
virtual EndpointBuilderInterfacewithEndpointId (const EndpointIdentifier &endpointId)=0
 
virtual EndpointBuilderInterfacewithFriendlyName (const std::string &friendlyName)=0
 
virtual EndpointBuilderInterfacewithDescription (const std::string &description)=0
 
virtual EndpointBuilderInterfacewithManufacturerName (const std::string &manufacturerName)=0
 
virtual EndpointBuilderInterfacewithDisplayCategory (const std::vector< std::string > &displayCategories)=0
 
virtual EndpointBuilderInterfacewithAdditionalAttributes (const std::string &manufacturer, const std::string &model, const std::string &serialNumber, const std::string &firmwareVersion, const std::string &softwareVersion, const std::string &customIdentifier)=0
 
virtual EndpointBuilderInterfacewithConnections (const std::vector< std::map< std::string, std::string >> &connections)=0
 
virtual EndpointBuilderInterfacewithCookies (const std::map< std::string, std::string > &cookies)=0
 
virtual EndpointBuilderInterfacewithPowerController (std::shared_ptr< avsCommon::sdkInterfaces::powerController::PowerControllerInterface > powerController, bool isProactivelyReported, bool isRetrievable)=0
 
virtual EndpointBuilderInterfacewithToggleController (std::shared_ptr< avsCommon::sdkInterfaces::toggleController::ToggleControllerInterface > toggleController, const std::string &instance, const avsCommon::sdkInterfaces::toggleController::ToggleControllerAttributes &toggleControllerAttributes, bool isProactivelyReported, bool isRetrievable, bool isNonControllable=false)=0
 
virtual EndpointBuilderInterfacewithModeController (std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerInterface > modeController, const std::string &instance, const avsCommon::sdkInterfaces::modeController::ModeControllerAttributes &modeControllerAttributes, bool isProactivelyReported, bool isRetrievable, bool isNonControllable=false)=0
 
virtual EndpointBuilderInterfacewithRangeController (std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerInterface > rangeController, const std::string &instance, const avsCommon::sdkInterfaces::rangeController::RangeControllerAttributes &rangeControllerAttributes, bool isProactivelyReported, bool isRetrievable, bool isNonControllable=false)=0
 
virtual EndpointBuilderInterfacewithEndpointCapabilitiesBuilder (const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesBuilderInterface > &endpointCapabilitiesBuilder)=0
 
virtual std::unique_ptr< EndpointInterfacebuild ()=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface
virtual ~EndpointCapabilitiesRegistrarInterface ()=default
 
virtual EndpointCapabilitiesRegistrarInterfacewithCapability (const avs::CapabilityConfiguration &configuration, std::shared_ptr< DirectiveHandlerInterface > directiveHandler)=0
 
virtual EndpointCapabilitiesRegistrarInterfacewithCapability (const std::shared_ptr< avsCommon::sdkInterfaces::CapabilityConfigurationInterface > &configurationInterface, std::shared_ptr< DirectiveHandlerInterface > directiveHandler)=0
 
virtual EndpointCapabilitiesRegistrarInterfacewithCapabilityConfiguration (const std::shared_ptr< avsCommon::sdkInterfaces::CapabilityConfigurationInterface > &configurationInterface)=0
 

Detailed Description

Interface for an endpoint builder.

The builder is responsible for building an endpoint object. Use the EndpointRegistrationManagerInterface to register the endpoint and EndpointRegistrationObserverInterface to be notified about any changes to the endpoint registration.

Note
The following attributes are mandatory and the build will fail if they are missing:
  • EndpointId
  • Manufacturer Name
  • Description
  • Friendly Name
  • Display Categories
  • At least one capability
Endpoints that represent part of this AVS device must generate their identifier by calling withDerivedEndpointId() with a suffix that is unique across other parts of this device. The final endpoint identifier will be generated by combining the default endpoint identifier and the suffix provided.
Endpoints that represent external devices connected to an AVS device must provide an identifier via withEndpointId(). The identifier must be unique across endpoints registered to the user and consistent for every build.

Constructor & Destructor Documentation

◆ ~EndpointBuilderInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::~EndpointBuilderInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ build()

virtual std::unique_ptr<EndpointInterface> alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::build ( )
pure virtual

Builds an endpoint with the configured properties / components.

Build will fail iff the format of any attribute is invalid or if a mandatory attribute is missing.

Returns
A unique endpoint if the build succeeds; otherwise, nullptr.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withAdditionalAttributes()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withAdditionalAttributes ( const std::string &  manufacturer,
const std::string &  model,
const std::string &  serialNumber,
const std::string &  firmwareVersion,
const std::string &  softwareVersion,
const std::string &  customIdentifier 
)
pure virtual

Configures builder to set additional attributes that can be used to identify an endpoint.

Note
This will override any previous additional attributes configuration.
The builder will fail if any of the additional attributes params are invalid.
Parameters
manufacturerThe name of the manufacturer of the device.
modelThe name of the model of the device.
serialNumberThe serial number of the device.
firmwareVersionThe firmware version of the device.
softwareVersionThe software version of the device.
customIdentifierYour custom identifier for the device.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withConnections()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withConnections ( const std::vector< std::map< std::string, std::string >> &  connections)
pure virtual

Configures builder to represent the methods that the endpoint uses to connect to the internet of smart home hub.

Note
This will override any previous connections configuration.
If the connections supplied is invalid, the builder will fail.
Parameters
connectionsThe available connection methods and their attributes.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withCookies()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withCookies ( const std::map< std::string, std::string > &  cookies)
pure virtual

Configures builder to store custom key value pair about the device.

Note
This will override any previous cookies configuration.
If the cookies supplied is invalid, the builder will fail.
Parameters
cookiesKey value pairs for additional of the endpoint.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withDerivedEndpointId()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withDerivedEndpointId ( const std::string &  suffix)
pure virtual

Configures builder to use an endpointId that is generated using the default endpoint id and the given suffix.

Note
This will override any previous endpoint identifier configuration.
This function will use the suffix to generate a unique identifier for endpoints that represent a component of the same device the client is running on. For example, if your device has a screen, you can create an endpoint to control this screen and use "screen" as a suffix. The suffix must be unique for this client and it must be consistent for every client execution.
The suffix can contain letters or numbers, spaces, and the following special characters: _ - = # ; : ? @ & and it should not exceed 10 characters.
Warning
Do not use this function if endpoint being created can be controlled by different AVS clients. The endpoint identifier must be consistent for every endpoint independently from the client that is controlling it.
Parameters
suffixA suffix that should be unique for the given client. The build() function fails if it exceeds 10 characters. If the suffix is not unique, the newly-built endpoint will replace the previous endpoint which had the same suffix when registered.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withDescription()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withDescription ( const std::string &  description)
pure virtual

Configures builder to use the given description.

Note
This will override any previous description configuration.
This value can contain up to 128 characters.
The builder will fail if the description param is invalid.
Parameters
descriptionThe description of the endpoint.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withDeviceRegistration()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withDeviceRegistration ( )
pure virtual

Includes default Registration information to the endpoint.

Note
This will include default endpoint's registration information into the endpoint. When this payload is included into the endpoint's discovery, cloud will be able to tell this endpoint represents the same device that the client is running on.
Warning
Do not use this function unless you want the new endpoint to be treated as same as the AVS endpoint that maintains HTTP2 connection. This function is added to support a legacy case and might be deprecated later. Please be aware of the risk while using this function.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withDisplayCategory()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withDisplayCategory ( const std::vector< std::string > &  displayCategories)
pure virtual

Configures builder to use the following display categories.

Note
This will override any previous display categories configuration.
The builder will fail if the displayCategories param is invalid.
Parameters
descriptionThe display category the device belongs to.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withEndpointCapabilitiesBuilder()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withEndpointCapabilitiesBuilder ( const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesBuilderInterface > &  endpointCapabilitiesBuilder)
pure virtual

Configures builder to use a EndpointCapabilitiesBuilder object that can be used to build multiple capability agents.

Note
The builder will fail if the endpointCapabilitiesBuilder fails in generating valid capability agents.
Parameters
endpointCapabilitiesBuilderA EndpointCapabilitiesBuilder object.
Returns
This builder which can be used to nest configuration function calls.

◆ withEndpointId()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withEndpointId ( const EndpointIdentifier endpointId)
pure virtual

Configures builder to use the given identifier for the new endpoint.

Note
This will override any previous endpoint identifier configuration.
The identifier must be unique across all devices for the user. Registering an endpoint with the same identifier as an existing endpoint will replace the original endpoint. In addition, the identifier must be consistent for all discovery requests for the same device. An identifier can contain letters or numbers, spaces, and the following special characters: _ - = # ; : ? @ &. The identifier cannot exceed 256 characters.
The builder will fail if the endpointId param is invalid.
Parameters
endpointIdAn endpointId that identifies this endpoint.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withFriendlyName()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withFriendlyName ( const std::string &  friendlyName)
pure virtual

Configures builder to use the given friendly name.

Note
This will override any previous friendly name configuration.
This value can contain up to 128 characters.
Parameters
friendlyNameThe friendly name used to identify the endpoint.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withManufacturerName()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withManufacturerName ( const std::string &  manufacturerName)
pure virtual

Configures builder to use name of the device manufacturer representing the endpoint.

Note
This will override any previous manufacturer configuration.
This value can contain up to 128 characters.
The builder will fail if the manufacturer name param is invalid.
Parameters
descriptionThe manufacturer name of the device representing the endpoint.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withModeController()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withModeController ( std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerInterface modeController,
const std::string &  instance,
const avsCommon::sdkInterfaces::modeController::ModeControllerAttributes modeControllerAttributes,
bool  isProactivelyReported,
bool  isRetrievable,
bool  isNonControllable = false 
)
pure virtual

Configures builder to use a ModeControllerInterface with instance identifier.

Note
The builder will fail if the instance name is already used in that endpoint.
Deprecated:
use the new withEndpointCapabilitiesBuilder() method instead.
Parameters
modeControllerAn interface that provides the mode operations.
instanceA non-empty string identifying an instance of a mode controller uniquely in a endpoint.
modeControllerAttributesThe attributes used in capability discovery message.
isProactivelyReportedWhether the property state change is proactively reported.
isRetrievableWhether the property state is retrievable.
isNonControllableWhether the property state can be controlled or not. This must be false for the property state to be controllable. Default is false.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withPowerController()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withPowerController ( std::shared_ptr< avsCommon::sdkInterfaces::powerController::PowerControllerInterface powerController,
bool  isProactivelyReported,
bool  isRetrievable 
)
pure virtual

Configures builder to use a PowerControllerInterface

Deprecated:
use the new withEndpointCapabilitiesBuilder() method instead.
Parameters
powerControllerAn interface that provides the power operations.
isProactivelyReportedWhether the property state change is proactively reported.
isRetrievableWhether the property state is retrievable.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withRangeController()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withRangeController ( std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerInterface rangeController,
const std::string &  instance,
const avsCommon::sdkInterfaces::rangeController::RangeControllerAttributes rangeControllerAttributes,
bool  isProactivelyReported,
bool  isRetrievable,
bool  isNonControllable = false 
)
pure virtual

Configures builder to use a RangeControllerInteface with instance identifier.

Note
The builder will fail if the instance name is already used in that endpoint.
Deprecated:
use the new withEndpointCapabilitiesBuilder() method instead.
Parameters
rangeControllerAn interface that provides the range operations.
instanceA non-empty string identifying an instance of a range controller uniquely in a endpoint.
rangeControllerAttributesThe attributes used in capability discovery message.
isProactivelyReportedWhether the property state change is proactively reported.
isRetrievableWhether the property state is retrievable.
isNonControllableWhether the property state can be controlled or not. This must be false for the property state to be controllable. Default is false.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.

◆ withToggleController()

virtual EndpointBuilderInterface& alexaClientSDK::avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface::withToggleController ( std::shared_ptr< avsCommon::sdkInterfaces::toggleController::ToggleControllerInterface toggleController,
const std::string &  instance,
const avsCommon::sdkInterfaces::toggleController::ToggleControllerAttributes toggleControllerAttributes,
bool  isProactivelyReported,
bool  isRetrievable,
bool  isNonControllable = false 
)
pure virtual

Configures builder to use a ToggleControllerInterface with instance identifier.

Note
The builder will fail if the instance name is already used in that endpoint.
Deprecated:
use the new withEndpointCapabilitiesBuilder() method instead.
Parameters
toggleControllerAn interface that performs the toggle operations.
instanceA non-empty string identifying an instance of a toggle controller uniquely in a endpoint.
toggleControllerAttributesThe attributes used in capability discovery message.
isProactivelyReportedWhether the property state change is proactively reported.
isRetrievableWhether the property state is retrievable.
isNonControllableWhether the property state can be controlled or not. This must be false for the property state to be controllable. Default is false.
Returns
This builder which can be used to nest configuration function calls.

Implemented in alexaClientSDK::endpoints::EndpointBuilder, and alexaClientSDK::endpoints::DefaultEndpointBuilder.


The documentation for this class was generated from the following file:

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