Can you create AWSBehavior API calls from C++?
Is the feature of creating api calls with the CloudGemAWSScriptBehaviors intended to only be used by Lua? I am having trouble instantiating a CloudGemAWSScriptBehaviors::AWSBehaviorAPI class to begin structuring an API call and was curious if this was a feature intended for C++ or strictly for Lua.
My personal gem is currently connected to the APINotificationBus and am able to override the pure virtual functions such as GetResponse, OnError, and OnSuccess.
Error when trying to instantiate an API class:
Creating library c:\Amazon\Lumberyard\18.104.22.168\dev\Bin64vc140\Gem.IwMMO.de27effa01ec4b18ba00cd993b8adb63.v0.1.0.lib and object c:\Amazon\Lumberyard\22.214.171.124\dev\Bin64vc140\Gem.IwMMO.de27effa01ec4b18ba00cd993b8adb63.v0.1.0.exp LoginManagerSystemComponent.cpp.162.obj : error LNK2019: unresolved external symbol "public: __cdecl CloudGemAWSScriptBehaviors::AWSBehaviorAPI::AWSBehaviorAPI(void)" (??0AWSBehaviorAPI@CloudGemAWSScriptBehaviors@@QEAA@XZ) referenced in function "protected: virtual void __cdecl IwMMO::LoginManagerSystemComponent::GetPlayerProfile(int)" (?GetPlayerProfile@LoginManagerSystemComponent@IwMMO@@MEAAXH@Z) c:\Amazon\Lumberyard\126.96.36.199\dev\Bin64vc140\Gem.IwMMO.de27effa01ec4b18ba00cd993b8adb63.v0.1.0.dll : fatal error LNK1120: 1 unresolved externals
So after digging a little more into this, you would need to add an ebus handler to the AWSScriptBehavior gem to set those variables. Given that the AWSScriptBehavior is mainly a wrapper around the AWS C++ sdk functions to make them available to Lua and Scipt Canvas you might just want to call the C++ functions rather than use the AWSScriptBehavior.
Hope that helps
All ebuses are accessible in C++, functions that are refelcted to the behavior context are accessible in Lua and Script Canvas as well
Ex: the ones reflected in void AWSBehaviorHTTP::ReflectBehaviors(AZ::BehaviorContext* behaviorContext)
Just to be sure you have the CloudGemFramework and CloudCanvasCommon dependencies in your project as well right?
Thanks for posting! From my understanding that class was intended to allow developers to execute service API's directly from LUA. I'll confirm with the rest of the team and get back to you on Monday.
I do have both of those dependencies included and have my handlers set as well as the pure virtual functions in place to receive notifications.
Could you possibly explain to me how you would do the C++ equivalent of this Lua example?
local apiCall = AWSBehaviorAPI() apiCall.ResourceName = "myResource.ServiceApi" apiCall.Query = "/my/personal/api/path/" apiCall:Execute()
I imagined it would have been with utilizing the 'CloudGemAWSScriptBehaviors::AWSBehaviorAPI' class from 'Gems\CloudGemAWSScriptBehaviors\Code\Source\AWSBehaviorAPI.h' looking something like this:
const CloudGemAWSScriptBehaviors::AWSBehaviorAPI apiCall; apiCall.m_resourceName = "myResource.ServiceApi" apiCall.m_query = "my/personal/api/path" apiCall.m_httpMethod = "GET"
.. or something like that?
Makes a lot of sense! Thank you!
This post is closed: Adding new answers, comments, and votes is disabled.
What happens if the number of API calls for a SQS fifo queue exceeds the quota?asked 3 months ago
Potential bug enabling you to override AWS usage quotas in AWS API Gateway.asked 25 days ago
Can I get API Keys for a Service Role?asked 6 months ago
http lambda authorizer external api callsasked a month ago
Is the AWS Pinpoint SDK intended to only be used by a mobile app (iOS/Android) or a web client?asked 6 months ago
Create API GW Websocket API that is only accessible from within a VPC.asked 2 months ago
Creating a custom domain name for a stage in API Gateway and attaching the certAccepted Answerasked 4 years ago
Amazon Connect - Outbound calls onlyasked 2 years ago
Can you create AWSBehavior API calls from C++?Accepted Answerasked 4 years ago
Cloud Front distribution managed by API Gatewayasked 2 years ago