associateOpsItemRelatedItem method

Future<AssociateOpsItemRelatedItemResponse> associateOpsItemRelatedItem({
  1. required String associationType,
  2. required String opsItemId,
  3. required String resourceType,
  4. required String resourceUri,
})

Associates a related item to a Systems Manager OpsCenter OpsItem. For example, you can associate an Incident Manager incident or analysis with an OpsItem. Incident Manager and OpsCenter are tools in Amazon Web Services Systems Manager.

May throw InternalServerError. May throw OpsItemConflictException. May throw OpsItemInvalidParameterException. May throw OpsItemLimitExceededException. May throw OpsItemNotFoundException. May throw OpsItemRelatedItemAlreadyExistsException.

Parameter associationType : The type of association that you want to create between an OpsItem and a resource. OpsCenter supports IsParentOf and RelatesTo association types.

Parameter opsItemId : The ID of the OpsItem to which you want to associate a resource as a related item.

Parameter resourceType : The type of resource that you want to associate with an OpsItem. OpsCenter supports the following types:

AWS::SSMIncidents::IncidentRecord: an Incident Manager incident.

AWS::SSM::Document: a Systems Manager (SSM) document.

Parameter resourceUri : The Amazon Resource Name (ARN) of the Amazon Web Services resource that you want to associate with the OpsItem.

Implementation

Future<AssociateOpsItemRelatedItemResponse> associateOpsItemRelatedItem({
  required String associationType,
  required String opsItemId,
  required String resourceType,
  required String resourceUri,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.AssociateOpsItemRelatedItem'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AssociationType': associationType,
      'OpsItemId': opsItemId,
      'ResourceType': resourceType,
      'ResourceUri': resourceUri,
    },
  );

  return AssociateOpsItemRelatedItemResponse.fromJson(jsonResponse.body);
}