AwsAbstractRequest Class

(QtAws::Core::AwsAbstractRequest)

The AwsAbstractRequest class provides an interface for AWS requests. More...

Header: #include <AwsAbstractRequest>
Inherited By:

QtAws::ACM::AcmRequest, QtAws::ACMPCA::AcmpcaRequest, QtAws::AlexaForBusiness::AlexaForBusinessRequest, QtAws::APIGateway::APIGatewayRequest, QtAws::ApplicationAutoScaling::ApplicationAutoScalingRequest, QtAws::ApplicationDiscoveryService::ApplicationDiscoveryServiceRequest, QtAws::AppStream::AppStreamRequest, QtAws::AppSync::AppSyncRequest, QtAws::Athena::AthenaRequest, QtAws::AutoScaling::AutoScalingRequest, QtAws::AutoScalingPlans::AutoScalingPlansRequest, QtAws::Batch::BatchRequest, QtAws::Budgets::BudgetsRequest, QtAws::Cloud9::Cloud9Request, QtAws::CloudDirectory::CloudDirectoryRequest, QtAws::CloudFormation::CloudFormationRequest, QtAws::CloudFront::CloudFrontRequest, QtAws::CloudHSM::CloudHSMRequest, QtAws::CloudHSMV2::CloudHSMV2Request, QtAws::CloudSearch::CloudSearchRequest, QtAws::CloudSearchDomain::CloudSearchDomainRequest, QtAws::CloudTrail::CloudTrailRequest, QtAws::CloudWatch::CloudWatchRequest, QtAws::CloudWatchEvents::CloudWatchEventsRequest, QtAws::CloudWatchLogs::CloudWatchLogsRequest, QtAws::CodeBuild::CodeBuildRequest, QtAws::CodeCommit::CodeCommitRequest, QtAws::CodeDeploy::CodeDeployRequest, QtAws::CodePipeline::CodePipelineRequest, QtAws::CodeStar::CodeStarRequest, QtAws::CognitoIdentity::CognitoIdentityRequest, QtAws::CognitoIdentityProvider::CognitoIdentityProviderRequest, QtAws::CognitoSync::CognitoSyncRequest, QtAws::Comprehend::ComprehendRequest, QtAws::ConfigService::ConfigServiceRequest, QtAws::Connect::ConnectRequest, QtAws::CostandUsageReportService::CostandUsageReportServiceRequest, QtAws::CostExplorer::CostExplorerRequest, QtAws::DatabaseMigrationService::DatabaseMigrationServiceRequest, QtAws::DataPipeline::DataPipelineRequest, QtAws::DAX::DaxRequest, QtAws::DeviceFarm::DeviceFarmRequest, QtAws::DirectConnect::DirectConnectRequest, QtAws::DirectoryService::DirectoryServiceRequest, QtAws::DynamoDB::DynamoDBRequest, QtAws::DynamoDBStreams::DynamoDBStreamsRequest, QtAws::EC2::Ec2Request, QtAws::ECR::EcrRequest, QtAws::ECS::EcsRequest, QtAws::EFS::EfsRequest, QtAws::ElastiCache::ElastiCacheRequest, QtAws::ElasticBeanstalk::ElasticBeanstalkRequest, QtAws::ElasticLoadBalancing::ElasticLoadBalancingRequest, QtAws::ElasticLoadBalancingv2::ElasticLoadBalancingv2Request, QtAws::ElasticsearchService::ElasticsearchServiceRequest, QtAws::ElasticTranscoder::ElasticTranscoderRequest, QtAws::EMR::EmrRequest, QtAws::Firehose::FirehoseRequest, QtAws::FMS::FmsRequest, QtAws::GameLift::GameLiftRequest, QtAws::Glacier::GlacierRequest, QtAws::Glue::GlueRequest, QtAws::Greengrass::GreengrassRequest, QtAws::GuardDuty::GuardDutyRequest, QtAws::Health::HealthRequest, QtAws::IAM::IamRequest, QtAws::ImportExport::ImportExportRequest, QtAws::Inspector::InspectorRequest, QtAws::IoT1ClickDevicesService::IoT1ClickDevicesServiceRequest, QtAws::IoT1ClickProjects::IoT1ClickProjectsRequest, QtAws::IoT::IoTRequest, QtAws::IoTAnalytics::IoTAnalyticsRequest, QtAws::IoTDataPlane::IoTDataPlaneRequest, QtAws::IoTJobsDataPlane::IoTJobsDataPlaneRequest, QtAws::Kinesis::KinesisRequest, QtAws::KinesisAnalytics::KinesisAnalyticsRequest, QtAws::KinesisVideo::KinesisVideoRequest, QtAws::KinesisVideoArchivedMedia::KinesisVideoArchivedMediaRequest, QtAws::KinesisVideoMedia::KinesisVideoMediaRequest, QtAws::KMS::KmsRequest, QtAws::Lambda::LambdaRequest, QtAws::LexModelBuildingService::LexModelBuildingServiceRequest, QtAws::LexRuntimeService::LexRuntimeServiceRequest, QtAws::Lightsail::LightsailRequest, QtAws::MachineLearning::MachineLearningRequest, QtAws::MarketplaceCommerceAnalytics::MarketplaceCommerceAnalyticsRequest, QtAws::MarketplaceEntitlementService::MarketplaceEntitlementServiceRequest, QtAws::MarketplaceMetering::MarketplaceMeteringRequest, QtAws::MediaConvert::MediaConvertRequest, QtAws::MediaLive::MediaLiveRequest, QtAws::MediaPackage::MediaPackageRequest, QtAws::MediaStore::MediaStoreRequest, QtAws::MediaStoreData::MediaStoreDataRequest, QtAws::MigrationHub::MigrationHubRequest, QtAws::Mobile::MobileRequest, QtAws::MobileAnalytics::MobileAnalyticsRequest, QtAws::MQ::MqRequest, QtAws::MTurk::MTurkRequest, QtAws::OpsWorks::OpsWorksRequest, QtAws::OpsWorksCM::OpsWorksCMRequest, QtAws::Organizations::OrganizationsRequest, QtAws::Pinpoint::PinpointRequest, QtAws::Polly::PollyRequest, QtAws::Pricing::PricingRequest, QtAws::RDS::RdsRequest, QtAws::Redshift::RedshiftRequest, QtAws::Rekognition::RekognitionRequest, QtAws::ResourceGroups::ResourceGroupsRequest, QtAws::ResourceGroupsTaggingAPI::ResourceGroupsTaggingAPIRequest, QtAws::Route53::Route53Request, QtAws::Route53Domains::Route53DomainsRequest, QtAws::S3::S3Request, QtAws::SageMaker::SageMakerRequest, QtAws::SageMakerRuntime::SageMakerRuntimeRequest, QtAws::SecretsManager::SecretsManagerRequest, QtAws::ServerlessApplicationRepository::ServerlessApplicationRepositoryRequest, QtAws::ServiceCatalog::ServiceCatalogRequest, QtAws::ServiceDiscovery::ServiceDiscoveryRequest, QtAws::SES::SesRequest, QtAws::SFN::SfnRequest, QtAws::Shield::ShieldRequest, QtAws::SimpleDB::SimpleDBRequest, QtAws::SMS::SmsRequest, QtAws::Snowball::SnowballRequest, QtAws::SNS::SnsRequest, QtAws::SQS::SqsRequest, QtAws::SSM::SsmRequest, QtAws::StorageGateway::StorageGatewayRequest, QtAws::STS::StsRequest, QtAws::Support::SupportRequest, QtAws::SWF::SwfRequest, QtAws::TranscribeService::TranscribeServiceRequest, QtAws::Translate::TranslateRequest, QtAws::WAF::WafRequest, QtAws::WAFRegional::WAFRegionalRequest, QtAws::WorkDocs::WorkDocsRequest, QtAws::WorkMail::WorkMailRequest, QtAws::WorkSpaces::WorkSpacesRequest, and QtAws::XRay::XRayRequest

Public Functions

AwsAbstractRequest()
AwsAbstractRequest(const AwsAbstractRequest &other)
virtual ~AwsAbstractRequest()
virtual QByteArray data() const
virtual bool isValid() const = 0
virtual QNetworkRequest networkRequest(const QUrl &endpoint, const AwsAbstractSignature &signature, const AwsAbstractCredentials &credentials) const
virtual QNetworkAccessManager::Operation operation() const
virtual AwsAbstractResponse *send(QNetworkAccessManager &manager, const QUrl &endpoint, const AwsAbstractSignature &signature, const AwsAbstractCredentials &credentials) const
AwsAbstractRequest &operator=(const AwsAbstractRequest &other)
virtual bool operator==(const AwsAbstractRequest &other) const

Protected Functions

virtual AwsAbstractResponse *response(QNetworkReply * const reply) const = 0
void setData(const QByteArray &data)
void setOperation(const QNetworkAccessManager::Operation operation)
virtual QNetworkRequest unsignedRequest(const QUrl &endpoint) const = 0

Detailed Description

The AwsAbstractRequest class provides an interface for AWS requests.

Typically, a user would pass a derived class (such as SqsCreateQueueRequest) to an AwsAbstractClient-derived class (such as SqsClient) to send a request to an AWS service.

Note, by design, requests based on this class are endpoint-agnostic. That is, you may instantiate a request (such as an SqsCreateQueueRequest), and pass it to multiple clients (such as a US instance of SqsClient as well as an AU instance of SqsClient). Thus it is the caller (typically an AwsAbstractClient-derived class) that is responsible for for setting the region / endpoint information, allowing requests to be reused unmodified multiple times, and/or in multiple regions.

Member Function Documentation

AwsAbstractRequest::AwsAbstractRequest()

Constructs an AwsAbstractRequest object.

AwsAbstractRequest::AwsAbstractRequest(const AwsAbstractRequest &other)

Constructs a copy of other.

[virtual] AwsAbstractRequest::~AwsAbstractRequest()

Destroys the AWS request.

[virtual] QByteArray AwsAbstractRequest::data() const

Returns data to be included with PUT and/or POST operations.

See also setData().

[pure virtual] bool AwsAbstractRequest::isValid() const

Returns true if this request is valid; false otherwise.

Derived classes must implement this function to provide a level of request validation relevant to the type of request being implemented.

In this context, "valid" means that with valid credentials, the request's networkRequest method should return a request that the caller can reasonably expect AWS to accept (ignoring server side access restrictions and the like).

[virtual] QNetworkRequest AwsAbstractRequest::networkRequest(const QUrl &endpoint, const AwsAbstractSignature &signature, const AwsAbstractCredentials &credentials) const

Returns a QNetwokrRequest object that can be used to send this AWS request to Amazon.

This base implementation fetches the basic request for endpoint via unsignedRequest, then uses signature and credentials to sign the request before returning to the caller.

Derived classes may override this if their specific AWS service required more advanced logic (or disallow signing, for example).

[virtual] QNetworkAccessManager::Operation AwsAbstractRequest::operation() const

Returns the network operation to use when sending this request.

This defaults to QNetworkAccessManager::GetOperation unless overridden or changed via setOperation.

See also setOperation().

[pure virtual protected] AwsAbstractResponse *AwsAbstractRequest::response(QNetworkReply * const reply) const

Return an AWS response object for reply.

Derived classes must implement this pure virtual function to return the relevant AwsAbstractResponse-derived object for their request type.

For example, the SqsCreateQueueRequest::response implementation returns an instance of the related SqsCreateQueueResponse class. Typically an AwsAbstractClient-derived class will cast this the returned pointer to the relevant known type in its send method.

[virtual] AwsAbstractResponse *AwsAbstractRequest::send(QNetworkAccessManager &manager, const QUrl &endpoint, const AwsAbstractSignature &signature, const AwsAbstractCredentials &credentials) const

Sends this request to the Amazon endpoint via network access manager.

If appropriate, signature and credentials will be used to sign the request.

Returns an AwsAbstractResponse-derived object representing the AWS service's response.

[protected] void AwsAbstractRequest::setData(const QByteArray &data)

Sets the data to be used with POST and/or PUT operations.

See also data().

[protected] void AwsAbstractRequest::setOperation(const QNetworkAccessManager::Operation operation)

Sets the network operation to use when submitting this request.

See also operation().

[pure virtual protected] QNetworkRequest AwsAbstractRequest::unsignedRequest(const QUrl &endpoint) const

Returns a network request for this AWS request for the given AWS endpoint.

Derived classes must implement this pure virtual function to build network requests that the networkRequest function can sign, before being subitted to Amazon.

AwsAbstractRequest &AwsAbstractRequest::operator=(const AwsAbstractRequest &other)

Sets the AwsAbstractRequest object to be equal to other.

[virtual] bool AwsAbstractRequest::operator==(const AwsAbstractRequest &other) const

Returns true if this request is equal to other; false otherwise.

© 2018 Paul Colby Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.