getOpportunity method
Fetches the Opportunity record from Partner Central by a
given Identifier.
Use the ListOpportunities action or the event notification
(from Amazon EventBridge) to obtain this identifier.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter catalog :
Specifies the catalog associated with the request. This field takes a
string value from a predefined list: AWS or
Sandbox. The catalog determines which environment the
opportunity is fetched from. Use AWS to retrieve
opportunities in the Amazon Web Services catalog, and Sandbox
to retrieve opportunities in a secure, isolated testing environment.
Parameter identifier :
Read-only, system generated Opportunity unique identifier.
Implementation
Future<GetOpportunityResponse> getOpportunity({
required String catalog,
required String identifier,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AWSPartnerCentralSelling.GetOpportunity'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Catalog': catalog,
'Identifier': identifier,
},
);
return GetOpportunityResponse.fromJson(jsonResponse.body);
}