:doc:`ChimeSDKMessaging <../../chime-sdk-messaging>` / Client / put_channel_membership_preferences

**********************************
put_channel_membership_preferences
**********************************



.. py:method:: ChimeSDKMessaging.Client.put_channel_membership_preferences(**kwargs)

  

  Sets the membership preferences of an ``AppInstanceUser`` or ``AppInstanceBot`` for the specified channel. The user or bot must be a member of the channel. Only the user or bot who owns the membership can set preferences. Users or bots in the ``AppInstanceAdmin`` and channel moderator roles can't set preferences for other users. Banned users or bots can't set membership preferences for the channel from which they are banned.

   

  .. note::

    

    The x-amz-chime-bearer request header is mandatory. Use the ARN of an ``AppInstanceUser`` or ``AppInstanceBot`` that makes the API call as the value in the header.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-messaging-2021-05-15/PutChannelMembershipPreferences>`_  


  **Request Syntax**
  ::

    response = client.put_channel_membership_preferences(
        ChannelArn='string',
        MemberArn='string',
        ChimeBearer='string',
        Preferences={
            'PushNotifications': {
                'AllowNotifications': 'ALL'|'NONE'|'FILTERED',
                'FilterRule': 'string'
            }
        }
    )
    
  :type ChannelArn: string
  :param ChannelArn: **[REQUIRED]** 

    The ARN of the channel.

    

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

    The ARN of the member setting the preferences.

    

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

    The ARN of the ``AppInstanceUser`` or ``AppInstanceBot`` that makes the API call.

    

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

    The channel membership preferences of an ``AppInstanceUser`` .

    

  
    - **PushNotifications** *(dict) --* 

      The push notification configuration of a message.

      

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

        Enum value that indicates which push notifications to send to the requested member of a channel. ``ALL`` sends all push notifications, ``NONE`` sends no push notifications, ``FILTERED`` sends only filtered push notifications.

        

      
      - **FilterRule** *(string) --* 

        The simple JSON object used to send a subset of a push notification to the requested member.

        

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

    
    ::

      {
          'ChannelArn': 'string',
          'Member': {
              'Arn': 'string',
              'Name': 'string'
          },
          'Preferences': {
              'PushNotifications': {
                  'AllowNotifications': 'ALL'|'NONE'|'FILTERED',
                  'FilterRule': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ChannelArn** *(string) --* 

        The ARN of the channel.

        
      

      - **Member** *(dict) --* 

        The details of a user.

        
        

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

          The ARN in an Identity.

          
        

        - **Name** *(string) --* 

          The name in an Identity.

          
    
      

      - **Preferences** *(dict) --* 

        The ARN and metadata of the member being added.

        
        

        - **PushNotifications** *(dict) --* 

          The push notification configuration of a message.

          
          

          - **AllowNotifications** *(string) --* 

            Enum value that indicates which push notifications to send to the requested member of a channel. ``ALL`` sends all push notifications, ``NONE`` sends no push notifications, ``FILTERED`` sends only filtered push notifications.

            
          

          - **FilterRule** *(string) --* 

            The simple JSON object used to send a subset of a push notification to the requested member.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.BadRequestException`

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

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.UnauthorizedClientException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ThrottledClientException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ServiceFailureException`

  