Skip to content

get_data_lake_principal

get_data_lake_principal(
    *, config_overrides: Optional[LakeFormationClientConfig] = None
) -> GetDataLakePrincipalResponse

Returns the identity of the invoking principal.

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def get_data_lake_principal(
    self, *, config_overrides: Optional[LakeFormationClientConfig] = None
) -> "capo_lakeformation.types.get_data_lake_principal_response.GetDataLakePrincipalResponse":
    """<p>Returns the identity of the invoking principal.</p>

    Raises:
        capo_lakeformation.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lakeformation.types.get_data_lake_principal_request.GetDataLakePrincipalRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.get_data_lake_principal_response.GetDataLakePrincipalResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.get_data_lake_principal

        output, http_response = (
            capo_lakeformation._operations.aws_lake_formation.get_data_lake_principal.get_data_lake_principal(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDataLakePrincipal")
    )
    input_: capo_lakeformation.types.get_data_lake_principal_request.GetDataLakePrincipalRequest = {}

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output