:doc:`SSMIncidents <../../ssm-incidents>` / Client / update_related_items

********************
update_related_items
********************



.. py:method:: SSMIncidents.Client.update_related_items(**kwargs)

  

  Add or remove related items from the related items tab of an incident record.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-incidents-2018-05-10/UpdateRelatedItems>`_  


  **Request Syntax**
  ::

    response = client.update_related_items(
        clientToken='string',
        incidentRecordArn='string',
        relatedItemsUpdate={
            'itemToAdd': {
                'generatedId': 'string',
                'identifier': {
                    'type': 'ANALYSIS'|'INCIDENT'|'METRIC'|'PARENT'|'ATTACHMENT'|'OTHER'|'AUTOMATION'|'INVOLVED_RESOURCE'|'TASK',
                    'value': {
                        'arn': 'string',
                        'metricDefinition': 'string',
                        'pagerDutyIncidentDetail': {
                            'autoResolve': True|False,
                            'id': 'string',
                            'secretId': 'string'
                        },
                        'url': 'string'
                    }
                },
                'title': 'string'
            },
            'itemToRemove': {
                'type': 'ANALYSIS'|'INCIDENT'|'METRIC'|'PARENT'|'ATTACHMENT'|'OTHER'|'AUTOMATION'|'INVOLVED_RESOURCE'|'TASK',
                'value': {
                    'arn': 'string',
                    'metricDefinition': 'string',
                    'pagerDutyIncidentDetail': {
                        'autoResolve': True|False,
                        'id': 'string',
                        'secretId': 'string'
                    },
                    'url': 'string'
                }
            }
        }
    )
    
  :type clientToken: string
  :param clientToken: 

    A token that ensures that a client calls the operation only once with the specified details.

    This field is autopopulated if not provided.

  
  :type incidentRecordArn: string
  :param incidentRecordArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the incident record that contains the related items that you update.

    

  
  :type relatedItemsUpdate: dict
  :param relatedItemsUpdate: **[REQUIRED]** 

    Details about the item that you are add to, or delete from, an incident.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``itemToAdd``, ``itemToRemove``. 

  
    - **itemToAdd** *(dict) --* 

      Details about the related item you're adding.

      

    
      - **generatedId** *(string) --* 

        A unique ID for a ``RelatedItem``.

         

        .. warning::

           

          Don't specify this parameter when you add a ``RelatedItem`` by using the  UpdateRelatedItems API action.

          

        

      
      - **identifier** *(dict) --* **[REQUIRED]** 

        Details about the related item.

        

      
        - **type** *(string) --* **[REQUIRED]** 

          The type of related item.

          

        
        - **value** *(dict) --* **[REQUIRED]** 

          Details about the related item.

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``arn``, ``metricDefinition``, ``pagerDutyIncidentDetail``, ``url``. 

        
          - **arn** *(string) --* 

            The Amazon Resource Name (ARN) of the related item, if the related item is an Amazon resource.

            

          
          - **metricDefinition** *(string) --* 

            The metric definition, if the related item is a metric in Amazon CloudWatch.

            

          
          - **pagerDutyIncidentDetail** *(dict) --* 

            Details about an incident that is associated with a PagerDuty incident.

            

          
            - **autoResolve** *(boolean) --* 

              Indicates whether to resolve the PagerDuty incident when you resolve the associated Incident Manager incident.

              

            
            - **id** *(string) --* **[REQUIRED]** 

              The ID of the incident associated with the PagerDuty service for the response plan.

              

            
            - **secretId** *(string) --* 

              The ID of the Amazon Web Services Secrets Manager secret that stores your PagerDuty key, either a General Access REST API Key or User Token REST API Key, and other user credentials.

              

            
          
          - **url** *(string) --* 

            The URL, if the related item is a non-Amazon Web Services resource.

            

          
        
      
      - **title** *(string) --* 

        The title of the related item.

        

      
    
    - **itemToRemove** *(dict) --* 

      Details about the related item you're deleting.

      

    
      - **type** *(string) --* **[REQUIRED]** 

        The type of related item.

        

      
      - **value** *(dict) --* **[REQUIRED]** 

        Details about the related item.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``arn``, ``metricDefinition``, ``pagerDutyIncidentDetail``, ``url``. 

      
        - **arn** *(string) --* 

          The Amazon Resource Name (ARN) of the related item, if the related item is an Amazon resource.

          

        
        - **metricDefinition** *(string) --* 

          The metric definition, if the related item is a metric in Amazon CloudWatch.

          

        
        - **pagerDutyIncidentDetail** *(dict) --* 

          Details about an incident that is associated with a PagerDuty incident.

          

        
          - **autoResolve** *(boolean) --* 

            Indicates whether to resolve the PagerDuty incident when you resolve the associated Incident Manager incident.

            

          
          - **id** *(string) --* **[REQUIRED]** 

            The ID of the incident associated with the PagerDuty service for the response plan.

            

          
          - **secretId** *(string) --* 

            The ID of the Amazon Web Services Secrets Manager secret that stores your PagerDuty key, either a General Access REST API Key or User Token REST API Key, and other user credentials.

            

          
        
        - **url** *(string) --* 

          The URL, if the related item is a non-Amazon Web Services resource.

          

        
      
    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`SSMIncidents.Client.exceptions.ThrottlingException`

  
  *   :py:class:`SSMIncidents.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`SSMIncidents.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`SSMIncidents.Client.exceptions.ValidationException`

  
  *   :py:class:`SSMIncidents.Client.exceptions.ConflictException`

  
  *   :py:class:`SSMIncidents.Client.exceptions.InternalServerException`

  