Skip to content

list_recommendations async

list_recommendations(
    agent_space_id: AgentSpaceIdentifier,
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    task_id: Optional[ResourceId] = None,
    goal_id: Optional[ResourceId] = None,
    status: Optional[RecommendationStatus] = None,
    priority: Optional[RecommendationPriority] = None,
    limit: Optional[int] = None,
    next_token: Optional[NextToken] = None,
) -> ListRecommendationsResponse

Lists recommendations for the specified agent space

Parameters:

  • agent_space_id (AgentSpaceIdentifier) –

    The unique identifier for the agent space containing the recommendations

  • task_id (Optional[ResourceId], default: None ) –

    Optional task ID to filter recommendations by specific task

  • goal_id (Optional[ResourceId], default: None ) –

    Optional goal ID to filter recommendations by specific goal

  • status (Optional[RecommendationStatus], default: None ) –

    Optional status to filter recommendations by their current status

  • priority (Optional[RecommendationPriority], default: None ) –

    Optional priority to filter recommendations by priority level

  • limit (Optional[int], default: None ) –

    Maximum number of recommendations to return in a single response

  • next_token (Optional[NextToken], default: None ) –

    Token for retrieving the next page of results

Raises:

Source code in docs_src/capo_devops_agent/_services/async_dev_ops_agent.py
async def list_recommendations(
    self,
    agent_space_id: "capo_devops_agent.types.agent_space_identifier.AgentSpaceIdentifier",
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    task_id: Optional["capo_devops_agent.types.resource_id.ResourceId"] = None,
    goal_id: Optional["capo_devops_agent.types.resource_id.ResourceId"] = None,
    status: Optional[
        "capo_devops_agent.types.recommendation_status.RecommendationStatus"
    ] = None,
    priority: Optional[
        "capo_devops_agent.types.recommendation_priority.RecommendationPriority"
    ] = None,
    limit: Optional[int] = None,
    next_token: Optional["capo_devops_agent.types.next_token.NextToken"] = None,
) -> "capo_devops_agent.types.list_recommendations_response.ListRecommendationsResponse":
    """<p>Lists recommendations for the specified agent space</p>

    Args:
        agent_space_id: <p>The unique identifier for the agent space containing the recommendations</p>
        task_id: <p>Optional task ID to filter recommendations by specific task</p>
        goal_id: <p>Optional goal ID to filter recommendations by specific goal</p>
        status: <p>Optional status to filter recommendations by their current status</p>
        priority: <p>Optional priority to filter recommendations by priority level</p>
        limit: <p>Maximum number of recommendations to return in a single response</p>
        next_token: <p>Token for retrieving the next page of results</p>

    Raises:
        capo_devops_agent.errors.access_denied_exception.AccessDeniedException: <p>Access to the requested resource is denied due to insufficient permissions.</p>
        capo_devops_agent.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_devops_agent.errors.content_size_exceeded_exception.ContentSizeExceededException: <p>This exception is thrown when the content size exceeds the allowed limit.</p>
        capo_devops_agent.errors.internal_server_exception.InternalServerException: <p>This exception is thrown when an unexpected error occurs in the processing of a request.</p>
        capo_devops_agent.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters provided in the request are invalid.</p>
        capo_devops_agent.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_devops_agent.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed the service quota limit.</p>
        capo_devops_agent.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Please slow down and try again.</p>
        capo_devops_agent.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_devops_agent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_devops_agent.types.list_recommendations_request.ListRecommendationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_devops_agent.types.list_recommendations_response.ListRecommendationsResponse"
    ]:
        import capo_devops_agent._operations.dev_ops_agent.list_recommendations

        (
            output,
            http_response,
        ) = await capo_devops_agent._operations.dev_ops_agent.list_recommendations.async_list_recommendations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRecommendations")
    )
    input_: capo_devops_agent.types.list_recommendations_request.ListRecommendationsRequest = {
        "agent_space_id": agent_space_id
    }
    if task_id is not None:
        input_["task_id"] = task_id
    if goal_id is not None:
        input_["goal_id"] = goal_id
    if status is not None:
        input_["status"] = status
    if priority is not None:
        input_["priority"] = priority
    if limit is not None:
        input_["limit"] = limit
    if next_token is not None:
        input_["next_token"] = next_token

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