Stops the directory sharing between the directory owner and consumer accounts.
Parameters:
-
directory_id
(DirectoryId)
–
The identifier of the Managed Microsoft AD directory that you want to stop sharing.
-
unshare_target
(UnshareTarget)
–
Identifier for the directory consumer account with whom the directory has to be unshared.
Raises:
Source code in docs_src/capo_directory_service/_services/directory_service.py
| def unshare_directory(
self,
directory_id: "capo_directory_service.types.directory_id.DirectoryId",
unshare_target: "capo_directory_service.types.unshare_target.UnshareTarget",
*,
config_overrides: Optional[DirectoryServiceClientConfig] = None,
) -> "capo_directory_service.types.unshare_directory_result.UnshareDirectoryResult":
"""<p>Stops the directory sharing between the directory owner and consumer accounts. </p>
Args:
directory_id: <p>The identifier of the Managed Microsoft AD directory that you want to stop sharing.</p>
unshare_target: <p>Identifier for the directory consumer account with whom the directory has to be unshared.</p>
Raises:
capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
capo_directory_service.errors.directory_not_shared_exception.DirectoryNotSharedException: <p>The specified directory has not been shared with this Amazon Web Services account.</p>
capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
capo_directory_service.errors.invalid_target_exception.InvalidTargetException: <p>The specified shared target is not valid.</p>
capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_directory_service.types.unshare_directory_request.UnshareDirectoryRequest]",
) -> OperationResponse[
"capo_directory_service.types.unshare_directory_result.UnshareDirectoryResult"
]:
import capo_directory_service._operations.directory_service_20150416.unshare_directory
output, http_response = (
capo_directory_service._operations.directory_service_20150416.unshare_directory.unshare_directory(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UnshareDirectory")
)
input_: capo_directory_service.types.unshare_directory_request.UnshareDirectoryRequest = {
"directory_id": directory_id,
"unshare_target": unshare_target,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|