public final SearchAgentsPagedResponse searchAgents(String parent) {
    SearchAgentsRequest request = SearchAgentsRequest.newBuilder().setParent(parent).build();
    return searchAgents(request);
  }
public final SearchAgentsPagedResponse searchAgents ( String parent ) { SearchAgentsRequest request = SearchAgentsRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return searchAgents ( request ) ; }
Returns the list of agents.

<p>Since there is at most one conversational agent per project, this method is useful primarily
for listing all agents across projects the caller has access to. One can achieve that with a
wildcard project collection id "-". Refer to [List
Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).

<p>Sample code:

<pre><code>
try (AgentsClient agentsClient = AgentsClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (Agent element : agentsClient.searchAgents(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
</code></pre>

@param parent Required. The project to list agents from. Format: `projects/&lt;Project ID or
'-'&gt;`.
@throws com.google.api.gax.rpc.ApiException if the remote call fails