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

posta 5 anni fa482 visualizzazioni
2 Risposte
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.

con risposta 5 anni fa
0

Tedious to figure this out!

con risposta 5 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande