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

asked 5 years ago450 views
2 Answers
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.

answered 5 years ago
0

Tedious to figure this out!

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions