Skip to content

delete_profile async

delete_profile(
    profile_id: ProfileIdentifier,
    *,
    config_overrides: Optional[AsyncRolesAnywhereClientConfig] = None,
) -> ProfileDetailResponse

Deletes a profile.

Required permissions: rolesanywhere:DeleteProfile.

Parameters:

  • profile_id (ProfileIdentifier) –

    The profile to act on. You can specify one of the following:

    • The profile ID.

    • The profile ARN.

    • The alias ARN of the profile.

    An ARN must be for a profile in your account and Region.

Raises:

Source code in docs_src/capo_rolesanywhere/_services/async_roles_anywhere.py
async def delete_profile(
    self,
    profile_id: "capo_rolesanywhere.types.profile_identifier.ProfileIdentifier",
    *,
    config_overrides: Optional[AsyncRolesAnywhereClientConfig] = None,
) -> "capo_rolesanywhere.types.profile_detail_response.ProfileDetailResponse":
    """<p>Deletes a profile.</p> <p> <b>Required permissions: </b> <code>rolesanywhere:DeleteProfile</code>. </p>

    Args:
        profile_id: <p>The profile to act on. You can specify one of the following:</p> <ul> <li> <p>The profile ID.</p> </li> <li> <p>The profile ARN.</p> </li> <li> <p>The alias ARN of the profile.</p> </li> </ul> <p>An ARN must be for a profile in your account and Region.</p>

    Raises:
        capo_rolesanywhere.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_rolesanywhere.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_rolesanywhere.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed due to a temporary failure of the service.</p>
        capo_rolesanywhere.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rolesanywhere.types.scalar_profile_request.ScalarProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_rolesanywhere.types.profile_detail_response.ProfileDetailResponse"
    ]:
        import capo_rolesanywhere._operations.roles_anywhere.delete_profile

        (
            output,
            http_response,
        ) = await capo_rolesanywhere._operations.roles_anywhere.delete_profile.async_delete_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteProfile")
    )
    input_: capo_rolesanywhere.types.scalar_profile_request.ScalarProfileRequest = {
        "profile_id": profile_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output