:doc:`CodeStarNotifications <../../codestar-notifications>` / Client / subscribe

*********
subscribe
*********



.. py:method:: CodeStarNotifications.Client.subscribe(**kwargs)

  

  Creates an association between a notification rule and an Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client so that the associated target can receive notifications when the events described in the rule are triggered.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Subscribe>`_  


  **Request Syntax**
  ::

    response = client.subscribe(
        Arn='string',
        Target={
            'TargetType': 'string',
            'TargetAddress': 'string'
        },
        ClientRequestToken='string'
    )
    
  :type Arn: string
  :param Arn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.

    

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

    Information about the Amazon Q Developer in chat applications topics or Amazon Q Developer in chat applications clients associated with a notification rule.

    

  
    - **TargetType** *(string) --* 

      The target type. Can be an Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client.

       

      
      * Amazon Q Developer in chat applications topics are specified as ``SNS``.
       
      * Amazon Q Developer in chat applications clients are specified as ``AWSChatbotSlack``.
      

      

    
    - **TargetAddress** *(string) --* 

      The Amazon Resource Name (ARN) of the Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client.

      

    
  
  :type ClientRequestToken: string
  :param ClientRequestToken: 

    An enumeration token that, when provided in a request, returns the next batch of the results.

    

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

    
    ::

      {
          'Arn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Arn** *(string) --* 

        The Amazon Resource Name (ARN) of the notification rule for which you have created assocations.

        
  
  **Exceptions**
  
  *   :py:class:`CodeStarNotifications.Client.exceptions.ValidationException`

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

  
  *   :py:class:`CodeStarNotifications.Client.exceptions.ConfigurationException`

  