Skip to content

Commit 867ae2c

Browse files
1 parent 1cb49a9 commit 867ae2c

7 files changed

Lines changed: 488 additions & 0 deletions

src/AgentRegistry.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
163163
'type' => 'string',
164164
],
165165
],
166+
],'search' => [
167+
'path' => 'v1alpha/{+parent}/agents:search',
168+
'httpMethod' => 'POST',
169+
'parameters' => [
170+
'parent' => [
171+
'location' => 'path',
172+
'type' => 'string',
173+
'required' => true,
174+
],
175+
],
166176
],
167177
]
168178
]
@@ -251,6 +261,16 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
251261
'type' => 'string',
252262
],
253263
],
264+
],'search' => [
265+
'path' => 'v1alpha/{+parent}/mcpServers:search',
266+
'httpMethod' => 'POST',
267+
'parameters' => [
268+
'parent' => [
269+
'location' => 'path',
270+
'type' => 'string',
271+
'required' => true,
272+
],
273+
],
254274
],
255275
]
256276
]

src/AgentRegistry/Resource/ProjectsLocationsAgents.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
use Google\Service\AgentRegistry\Agent;
2121
use Google\Service\AgentRegistry\ListAgentsResponse;
22+
use Google\Service\AgentRegistry\SearchAgentsRequest;
23+
use Google\Service\AgentRegistry\SearchAgentsResponse;
2224

2325
/**
2426
* The "agents" collection of methods.
@@ -67,6 +69,22 @@ public function listProjectsLocationsAgents($parent, $optParams = [])
6769
$params = array_merge($params, $optParams);
6870
return $this->call('list', [$params], ListAgentsResponse::class);
6971
}
72+
/**
73+
* Searches Agents in a given project and location. (agents.search)
74+
*
75+
* @param string $parent Required. Parent value for SearchAgentsRequest. Format:
76+
* `projects/{project}/locations/{location}`.
77+
* @param SearchAgentsRequest $postBody
78+
* @param array $optParams Optional parameters.
79+
* @return SearchAgentsResponse
80+
* @throws \Google\Service\Exception
81+
*/
82+
public function search($parent, SearchAgentsRequest $postBody, $optParams = [])
83+
{
84+
$params = ['parent' => $parent, 'postBody' => $postBody];
85+
$params = array_merge($params, $optParams);
86+
return $this->call('search', [$params], SearchAgentsResponse::class);
87+
}
7088
}
7189

7290
// Adding a class alias for backwards compatibility with the previous class name.

src/AgentRegistry/Resource/ProjectsLocationsMcpServers.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
use Google\Service\AgentRegistry\ListMcpServersResponse;
2121
use Google\Service\AgentRegistry\McpServer;
22+
use Google\Service\AgentRegistry\SearchMcpServersRequest;
23+
use Google\Service\AgentRegistry\SearchMcpServersResponse;
2224

2325
/**
2426
* The "mcpServers" collection of methods.
@@ -68,6 +70,22 @@ public function listProjectsLocationsMcpServers($parent, $optParams = [])
6870
$params = array_merge($params, $optParams);
6971
return $this->call('list', [$params], ListMcpServersResponse::class);
7072
}
73+
/**
74+
* Searches McpServers in a given project and location. (mcpServers.search)
75+
*
76+
* @param string $parent Required. Parent value for SearchMcpServersRequest.
77+
* Format: `projects/{project}/locations/{location}`.
78+
* @param SearchMcpServersRequest $postBody
79+
* @param array $optParams Optional parameters.
80+
* @return SearchMcpServersResponse
81+
* @throws \Google\Service\Exception
82+
*/
83+
public function search($parent, SearchMcpServersRequest $postBody, $optParams = [])
84+
{
85+
$params = ['parent' => $parent, 'postBody' => $postBody];
86+
$params = array_merge($params, $optParams);
87+
return $this->call('search', [$params], SearchMcpServersResponse::class);
88+
}
7189
}
7290

7391
// Adding a class alias for backwards compatibility with the previous class name.
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\AgentRegistry;
19+
20+
class SearchAgentsRequest extends \Google\Model
21+
{
22+
/**
23+
* Optional. The maximum number of search results to return per page. The page
24+
* size is capped at `100`, even if a larger value is specified. A negative
25+
* value will result in an `INVALID_ARGUMENT` error. If unspecified or set to
26+
* `0`, a default value of `20` will be used. The server may return fewer
27+
* results than requested.
28+
*
29+
* @var int
30+
*/
31+
public $pageSize;
32+
/**
33+
* Optional. If present, retrieve the next batch of results from the preceding
34+
* call to this method. `page_token` must be the value of `next_page_token`
35+
* from the previous response. The values of all other method parameters, must
36+
* be identical to those in the previous call.
37+
*
38+
* @var string
39+
*/
40+
public $pageToken;
41+
/**
42+
* Optional. Search criteria used to select the Agents to return. If no search
43+
* criteria is specified then all accessible Agents will be returned. Search
44+
* expressions can be used to restrict results based upon searchable fields,
45+
* where the operators can be used along with the suffix wildcard symbol `*`.
46+
* See [instructions](https://docs.cloud.google.com/agent-registry/search-
47+
* agents-and-tools) for more details. Allowed operators: `=`, `:`, `NOT`,
48+
* `AND`, `OR`, and `()`. Searchable fields: | Field | `=` | `:` | `*` |
49+
* Keyword Search | |--------------------|-----|-----|-----|----------------|
50+
* | agentId | Yes | Yes | Yes | Included | | name | No | Yes | Yes | Included
51+
* | | displayName | No | Yes | Yes | Included | | description | No | Yes | No
52+
* | Included | | skills | No | Yes | No | Included | | skills.id | No | Yes |
53+
* No | Included | | skills.name | No | Yes | No | Included | |
54+
* skills.description | No | Yes | No | Included | | skills.tags | No | Yes |
55+
* No | Included | | skills.examples | No | Yes | No | Included | Examples: *
56+
* `agentId=urn:agent:projects-123:projects:123:locations:us-
57+
* central1:reasoningEngines:1234` to find the agent with the specified agent
58+
* ID. * `name:important` to find agents whose name contains `important` as a
59+
* word. * `displayName:works*` to find agents whose display name contains
60+
* words that start with `works`. * `skills.tags:test` to find agents whose
61+
* skills tags contain `test`. * `planner OR booking` to find agents whose
62+
* metadata contains the words `planner` or `booking`.
63+
*
64+
* @var string
65+
*/
66+
public $searchString;
67+
68+
/**
69+
* Optional. The maximum number of search results to return per page. The page
70+
* size is capped at `100`, even if a larger value is specified. A negative
71+
* value will result in an `INVALID_ARGUMENT` error. If unspecified or set to
72+
* `0`, a default value of `20` will be used. The server may return fewer
73+
* results than requested.
74+
*
75+
* @param int $pageSize
76+
*/
77+
public function setPageSize($pageSize)
78+
{
79+
$this->pageSize = $pageSize;
80+
}
81+
/**
82+
* @return int
83+
*/
84+
public function getPageSize()
85+
{
86+
return $this->pageSize;
87+
}
88+
/**
89+
* Optional. If present, retrieve the next batch of results from the preceding
90+
* call to this method. `page_token` must be the value of `next_page_token`
91+
* from the previous response. The values of all other method parameters, must
92+
* be identical to those in the previous call.
93+
*
94+
* @param string $pageToken
95+
*/
96+
public function setPageToken($pageToken)
97+
{
98+
$this->pageToken = $pageToken;
99+
}
100+
/**
101+
* @return string
102+
*/
103+
public function getPageToken()
104+
{
105+
return $this->pageToken;
106+
}
107+
/**
108+
* Optional. Search criteria used to select the Agents to return. If no search
109+
* criteria is specified then all accessible Agents will be returned. Search
110+
* expressions can be used to restrict results based upon searchable fields,
111+
* where the operators can be used along with the suffix wildcard symbol `*`.
112+
* See [instructions](https://docs.cloud.google.com/agent-registry/search-
113+
* agents-and-tools) for more details. Allowed operators: `=`, `:`, `NOT`,
114+
* `AND`, `OR`, and `()`. Searchable fields: | Field | `=` | `:` | `*` |
115+
* Keyword Search | |--------------------|-----|-----|-----|----------------|
116+
* | agentId | Yes | Yes | Yes | Included | | name | No | Yes | Yes | Included
117+
* | | displayName | No | Yes | Yes | Included | | description | No | Yes | No
118+
* | Included | | skills | No | Yes | No | Included | | skills.id | No | Yes |
119+
* No | Included | | skills.name | No | Yes | No | Included | |
120+
* skills.description | No | Yes | No | Included | | skills.tags | No | Yes |
121+
* No | Included | | skills.examples | No | Yes | No | Included | Examples: *
122+
* `agentId=urn:agent:projects-123:projects:123:locations:us-
123+
* central1:reasoningEngines:1234` to find the agent with the specified agent
124+
* ID. * `name:important` to find agents whose name contains `important` as a
125+
* word. * `displayName:works*` to find agents whose display name contains
126+
* words that start with `works`. * `skills.tags:test` to find agents whose
127+
* skills tags contain `test`. * `planner OR booking` to find agents whose
128+
* metadata contains the words `planner` or `booking`.
129+
*
130+
* @param string $searchString
131+
*/
132+
public function setSearchString($searchString)
133+
{
134+
$this->searchString = $searchString;
135+
}
136+
/**
137+
* @return string
138+
*/
139+
public function getSearchString()
140+
{
141+
return $this->searchString;
142+
}
143+
}
144+
145+
// Adding a class alias for backwards compatibility with the previous class name.
146+
class_alias(SearchAgentsRequest::class, 'Google_Service_AgentRegistry_SearchAgentsRequest');
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\AgentRegistry;
19+
20+
class SearchAgentsResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'agents';
23+
protected $agentsType = Agent::class;
24+
protected $agentsDataType = 'array';
25+
/**
26+
* If there are more results than those appearing in this response, then
27+
* `next_page_token` is included. To get the next set of results, call this
28+
* method again using the value of `next_page_token` as `page_token`.
29+
*
30+
* @var string
31+
*/
32+
public $nextPageToken;
33+
34+
/**
35+
* A list of Agents that match the `search_string`.
36+
*
37+
* @param Agent[] $agents
38+
*/
39+
public function setAgents($agents)
40+
{
41+
$this->agents = $agents;
42+
}
43+
/**
44+
* @return Agent[]
45+
*/
46+
public function getAgents()
47+
{
48+
return $this->agents;
49+
}
50+
/**
51+
* If there are more results than those appearing in this response, then
52+
* `next_page_token` is included. To get the next set of results, call this
53+
* method again using the value of `next_page_token` as `page_token`.
54+
*
55+
* @param string $nextPageToken
56+
*/
57+
public function setNextPageToken($nextPageToken)
58+
{
59+
$this->nextPageToken = $nextPageToken;
60+
}
61+
/**
62+
* @return string
63+
*/
64+
public function getNextPageToken()
65+
{
66+
return $this->nextPageToken;
67+
}
68+
}
69+
70+
// Adding a class alias for backwards compatibility with the previous class name.
71+
class_alias(SearchAgentsResponse::class, 'Google_Service_AgentRegistry_SearchAgentsResponse');

0 commit comments

Comments
 (0)