getOperation method

Future<GetOperationResult> getOperation({
  1. required String operationId,
})

Returns information about a specific operation. Operations include events such as when you create an instance, allocate a static IP, attach a static IP, and so on.

May throw AccessDeniedException. May throw AccountSetupInProgressException. May throw InvalidInputException. May throw NotFoundException. May throw OperationFailureException. May throw RegionSetupInProgressException. May throw ServiceException. May throw UnauthenticatedException.

Parameter operationId : A GUID used to identify the operation.

Implementation

Future<GetOperationResult> getOperation({
  required String operationId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Lightsail_20161128.GetOperation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'operationId': operationId,
    },
  );

  return GetOperationResult.fromJson(jsonResponse.body);
}