Skip to content

Commit 972760f

Browse files
1 parent ed5cf07 commit 972760f

6 files changed

Lines changed: 308 additions & 0 deletions

src/Connectors.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
114114
'required' => true,
115115
],
116116
],
117+
],'generateConnectionToolspecOverride' => [
118+
'path' => 'v2/{+name}:generateConnectionToolspecOverride',
119+
'httpMethod' => 'POST',
120+
'parameters' => [
121+
'name' => [
122+
'location' => 'path',
123+
'type' => 'string',
124+
'required' => true,
125+
],
126+
],
127+
],'listCustomToolNames' => [
128+
'path' => 'v2/{+name}:listCustomToolNames',
129+
'httpMethod' => 'GET',
130+
'parameters' => [
131+
'name' => [
132+
'location' => 'path',
133+
'type' => 'string',
134+
'required' => true,
135+
],
136+
],
117137
],'refreshAccessToken' => [
118138
'path' => 'v2/{+name}:refreshAccessToken',
119139
'httpMethod' => 'POST',
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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\Connectors;
19+
20+
class GenerateCustomToolspecRequest extends \Google\Collection
21+
{
22+
protected $collection_key = 'toolNames';
23+
protected $toolNamesType = ToolName::class;
24+
protected $toolNamesDataType = 'array';
25+
26+
/**
27+
* list of tools to be generated.
28+
*
29+
* @param ToolName[] $toolNames
30+
*/
31+
public function setToolNames($toolNames)
32+
{
33+
$this->toolNames = $toolNames;
34+
}
35+
/**
36+
* @return ToolName[]
37+
*/
38+
public function getToolNames()
39+
{
40+
return $this->toolNames;
41+
}
42+
}
43+
44+
// Adding a class alias for backwards compatibility with the previous class name.
45+
class_alias(GenerateCustomToolspecRequest::class, 'Google_Service_Connectors_GenerateCustomToolspecRequest');
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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\Connectors;
19+
20+
class GenerateCustomToolspecResponse extends \Google\Model
21+
{
22+
protected $toolSpecType = ToolSpec::class;
23+
protected $toolSpecDataType = '';
24+
25+
/**
26+
* tool spec that has tool_defitions array containing the tools for all sted
27+
* tool_names.
28+
*
29+
* @param ToolSpec $toolSpec
30+
*/
31+
public function setToolSpec(ToolSpec $toolSpec)
32+
{
33+
$this->toolSpec = $toolSpec;
34+
}
35+
/**
36+
* @return ToolSpec
37+
*/
38+
public function getToolSpec()
39+
{
40+
return $this->toolSpec;
41+
}
42+
}
43+
44+
// Adding a class alias for backwards compatibility with the previous class name.
45+
class_alias(GenerateCustomToolspecResponse::class, 'Google_Service_Connectors_GenerateCustomToolspecResponse');
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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\Connectors;
19+
20+
class ListCustomToolNamesResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'toolNames';
23+
protected $toolNamesType = ToolName::class;
24+
protected $toolNamesDataType = 'array';
25+
26+
/**
27+
* List of custom tools.
28+
*
29+
* @param ToolName[] $toolNames
30+
*/
31+
public function setToolNames($toolNames)
32+
{
33+
$this->toolNames = $toolNames;
34+
}
35+
/**
36+
* @return ToolName[]
37+
*/
38+
public function getToolNames()
39+
{
40+
return $this->toolNames;
41+
}
42+
}
43+
44+
// Adding a class alias for backwards compatibility with the previous class name.
45+
class_alias(ListCustomToolNamesResponse::class, 'Google_Service_Connectors_ListCustomToolNamesResponse');

src/Connectors/Resource/ProjectsLocationsConnections.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
use Google\Service\Connectors\ExchangeAuthCodeResponse;
2424
use Google\Service\Connectors\ExecuteSqlQueryRequest;
2525
use Google\Service\Connectors\ExecuteSqlQueryResponse;
26+
use Google\Service\Connectors\GenerateCustomToolspecRequest;
27+
use Google\Service\Connectors\GenerateCustomToolspecResponse;
28+
use Google\Service\Connectors\ListCustomToolNamesResponse;
2629
use Google\Service\Connectors\ListToolsPostRequest;
2730
use Google\Service\Connectors\ListToolsResponse;
2831
use Google\Service\Connectors\RefreshAccessTokenRequest;
@@ -112,6 +115,38 @@ public function executeSqlQuery($connection, ExecuteSqlQueryRequest $postBody, $
112115
$params = array_merge($params, $optParams);
113116
return $this->call('executeSqlQuery', [$params], ExecuteSqlQueryResponse::class);
114117
}
118+
/**
119+
* Generate toolspec override for the given list of toolNames.
120+
* (connections.generateConnectionToolspecOverride)
121+
*
122+
* @param string $name Required. Resource name of the Connection. Format:
123+
* projects/{project}/locations/{location}/connections/{connection}
124+
* @param GenerateCustomToolspecRequest $postBody
125+
* @param array $optParams Optional parameters.
126+
* @return GenerateCustomToolspecResponse
127+
* @throws \Google\Service\Exception
128+
*/
129+
public function generateConnectionToolspecOverride($name, GenerateCustomToolspecRequest $postBody, $optParams = [])
130+
{
131+
$params = ['name' => $name, 'postBody' => $postBody];
132+
$params = array_merge($params, $optParams);
133+
return $this->call('generateConnectionToolspecOverride', [$params], GenerateCustomToolspecResponse::class);
134+
}
135+
/**
136+
* Lists custom tool names. (connections.listCustomToolNames)
137+
*
138+
* @param string $name Required. Resource name of the Connection. Format:
139+
* projects/{project}/locations/{location}/connections/{connection}
140+
* @param array $optParams Optional parameters.
141+
* @return ListCustomToolNamesResponse
142+
* @throws \Google\Service\Exception
143+
*/
144+
public function listCustomToolNames($name, $optParams = [])
145+
{
146+
$params = ['name' => $name];
147+
$params = array_merge($params, $optParams);
148+
return $this->call('listCustomToolNames', [$params], ListCustomToolNamesResponse::class);
149+
}
115150
/**
116151
* RefreshAccessToken exchanges the OAuth refresh token (and other necessary
117152
* data) for a new access token (and new associated credentials).

src/Connectors/ToolName.php

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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\Connectors;
19+
20+
class ToolName extends \Google\Model
21+
{
22+
/**
23+
* Operation unspecified.
24+
*/
25+
public const OPERATION_OPERATION_UNSPECIFIED = 'OPERATION_UNSPECIFIED';
26+
/**
27+
* LIST entities.
28+
*/
29+
public const OPERATION_LIST = 'LIST';
30+
/**
31+
* GET entity.
32+
*/
33+
public const OPERATION_GET = 'GET';
34+
/**
35+
* CREATE entity.
36+
*/
37+
public const OPERATION_CREATE = 'CREATE';
38+
/**
39+
* UPDATE entity.
40+
*/
41+
public const OPERATION_UPDATE = 'UPDATE';
42+
/**
43+
* DELETE entity.
44+
*/
45+
public const OPERATION_DELETE = 'DELETE';
46+
/**
47+
* Entity name for which the tool was generated.
48+
*
49+
* @var string
50+
*/
51+
public $entityName;
52+
/**
53+
* Tool name that was generated in the list tools call.
54+
*
55+
* @var string
56+
*/
57+
public $name;
58+
/**
59+
* Operation for which the tool was generated.
60+
*
61+
* @var string
62+
*/
63+
public $operation;
64+
65+
/**
66+
* Entity name for which the tool was generated.
67+
*
68+
* @param string $entityName
69+
*/
70+
public function setEntityName($entityName)
71+
{
72+
$this->entityName = $entityName;
73+
}
74+
/**
75+
* @return string
76+
*/
77+
public function getEntityName()
78+
{
79+
return $this->entityName;
80+
}
81+
/**
82+
* Tool name that was generated in the list tools call.
83+
*
84+
* @param string $name
85+
*/
86+
public function setName($name)
87+
{
88+
$this->name = $name;
89+
}
90+
/**
91+
* @return string
92+
*/
93+
public function getName()
94+
{
95+
return $this->name;
96+
}
97+
/**
98+
* Operation for which the tool was generated.
99+
*
100+
* Accepted values: OPERATION_UNSPECIFIED, LIST, GET, CREATE, UPDATE, DELETE
101+
*
102+
* @param self::OPERATION_* $operation
103+
*/
104+
public function setOperation($operation)
105+
{
106+
$this->operation = $operation;
107+
}
108+
/**
109+
* @return self::OPERATION_*
110+
*/
111+
public function getOperation()
112+
{
113+
return $this->operation;
114+
}
115+
}
116+
117+
// Adding a class alias for backwards compatibility with the previous class name.
118+
class_alias(ToolName::class, 'Google_Service_Connectors_ToolName');

0 commit comments

Comments
 (0)