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

gefragt vor 5 Jahren482 Aufrufe
2 Antworten
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.

beantwortet vor 5 Jahren
0

Tedious to figure this out!

beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen