Examples of the Pricing and Cost Explorer API

0

Are there any examples for the Pricing and Cost Explorer API's? I've searched the documentation (including for Python) and looked at the source code https://github.com/aws/aws-sdk-cpp for any tests, but came up empty.

My specific error is that I'm getting incomplete type when declaring a variable of type Aws::Pricing::Model::DescribeServicesOutcome .

Here is the error message

main.c: In function ‘int main(int, char**)’:
main.c:39:33: error: invalid use of incomplete type ‘Aws::Pricing::Model::DescribeServicesOutcome {aka class Aws::Utils::Outcome<Aws::Pricing::Model::DescribeServicesResult, Aws::Client::AWSError<Aws::Pricing::PricingErrors> >}’
     pricing.DescribeServices(req);
                                 ^
In file included from /path/to/include/aws/core/utils/crypto/Hash.h:19:0,
                 from /path/to/include/aws/core/client/AWSClient.h:23,
                 from /path/to/include/aws/core/monitoring/MonitoringManager.h:21,
                 from /path/to/include/aws/core/Aws.h:22,
                 from main.c:3:
/path/to/include/aws/core/utils/crypto/HashResult.h:26:50: note: declaration of ‘Aws::Pricing::Model::DescribeServicesOutcome {aka class Aws::Utils::Outcome<Aws::Pricing::Model::DescribeServicesResult, Aws::Client::AWSError<Aws::Pricing::PricingErrors> >}’
         template< typename R, typename E > class Outcome;

It seems that DescribeServicesOutcome , which should be defined in typedef Aws::Utils::Outcome<DescribeServicesResult, Aws::Client::AWSError<PricingErrors>> DescribeServicesOutcome; in <aws/pricing/PricingClient.h> is instead referring to Outcome in /path/to/include/aws/core/utils/crypto/HashResult.h .

I've tried re-ordering the header files but that doesn't work.

Edited by: dtsmith20010101 on Aug 29, 2019 11:11 AM

已提問 5 年前檢視次數 482 次
2 個答案
0

Have to include

#include <aws/core/utils/Outcome.h>
#include <aws/core/Aws.h>
#include <aws/pricing/PricingClient.h>
#include <aws/pricing/model/DescribeServicesRequest.h>

with Outcome.h before the others.

已回答 5 年前
0

Tedious to figure this out!

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南