:doc:`DirectoryService <../../ds>` / Client / unshare_directory

*****************
unshare_directory
*****************



.. py:method:: DirectoryService.Client.unshare_directory(**kwargs)

  

  Stops the directory sharing between the directory owner and consumer accounts.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UnshareDirectory>`_  


  **Request Syntax**
  ::

    response = client.unshare_directory(
        DirectoryId='string',
        UnshareTarget={
            'Id': 'string',
            'Type': 'ACCOUNT'
        }
    )
    
  :type DirectoryId: string
  :param DirectoryId: **[REQUIRED]** 

    The identifier of the Managed Microsoft AD directory that you want to stop sharing.

    

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

    Identifier for the directory consumer account with whom the directory has to be unshared.

    

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

      Identifier of the directory consumer account.

      

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

      Type of identifier to be used in the *Id* field.

      

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

    
    ::

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

    

    - *(dict) --* 
      

      - **SharedDirectoryId** *(string) --* 

        Identifier of the directory stored in the directory consumer account that is to be unshared from the specified directory ( ``DirectoryId``).

        
  
  **Exceptions**
  
  *   :py:class:`DirectoryService.Client.exceptions.EntityDoesNotExistException`

  
  *   :py:class:`DirectoryService.Client.exceptions.InvalidTargetException`

  
  *   :py:class:`DirectoryService.Client.exceptions.DirectoryNotSharedException`

  
  *   :py:class:`DirectoryService.Client.exceptions.ClientException`

  
  *   :py:class:`DirectoryService.Client.exceptions.ServiceException`

  