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\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Connectors\CheckReadinessResponse;
|
---|
21 | use Google\Service\Connectors\CheckStatusResponse;
|
---|
22 | use Google\Service\Connectors\ExchangeAuthCodeRequest;
|
---|
23 | use Google\Service\Connectors\ExchangeAuthCodeResponse;
|
---|
24 | use Google\Service\Connectors\ExecuteSqlQueryRequest;
|
---|
25 | use Google\Service\Connectors\ExecuteSqlQueryResponse;
|
---|
26 | use Google\Service\Connectors\RefreshAccessTokenRequest;
|
---|
27 | use Google\Service\Connectors\RefreshAccessTokenResponse;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "connections" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $connectorsService = new Google\Service\Connectors(...);
|
---|
34 | * $connections = $connectorsService->projects_locations_connections;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsLocationsConnections extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Reports readiness status of the connector. Similar logic to GetStatus but
|
---|
41 | * modified for kubernetes health check to understand.
|
---|
42 | * (connections.checkReadiness)
|
---|
43 | *
|
---|
44 | * @param string $name
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return CheckReadinessResponse
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function checkReadiness($name, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['name' => $name];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('checkReadiness', [$params], CheckReadinessResponse::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Reports the status of the connection. Note that when the connection is in a
|
---|
57 | * state that is not ACTIVE, the implementation of this RPC method must return a
|
---|
58 | * Status with the corresponding State instead of returning a gRPC status code
|
---|
59 | * that is not "OK", which indicates that ConnectionStatus itself, not the
|
---|
60 | * connection, failed. (connections.checkStatus)
|
---|
61 | *
|
---|
62 | * @param string $name
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return CheckStatusResponse
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function checkStatus($name, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['name' => $name];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('checkStatus', [$params], CheckStatusResponse::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * ExchangeAuthCode exchanges the OAuth authorization code (and other necessary
|
---|
75 | * data) for an access token (and associated credentials).
|
---|
76 | * (connections.exchangeAuthCode)
|
---|
77 | *
|
---|
78 | * @param string $name
|
---|
79 | * @param ExchangeAuthCodeRequest $postBody
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | * @return ExchangeAuthCodeResponse
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function exchangeAuthCode($name, ExchangeAuthCodeRequest $postBody, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('exchangeAuthCode', [$params], ExchangeAuthCodeResponse::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Executes a SQL statement specified in the body of the request. An example of
|
---|
92 | * this SQL statement in the case of Salesforce connector would be 'select *
|
---|
93 | * from Account a, Order o where a.Id = o.AccountId'.
|
---|
94 | * (connections.executeSqlQuery)
|
---|
95 | *
|
---|
96 | * @param string $connection Required. Resource name of the Connection. Format:
|
---|
97 | * projects/{project}/locations/{location}/connections/{connection}
|
---|
98 | * @param ExecuteSqlQueryRequest $postBody
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return ExecuteSqlQueryResponse
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function executeSqlQuery($connection, ExecuteSqlQueryRequest $postBody, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['connection' => $connection, 'postBody' => $postBody];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('executeSqlQuery', [$params], ExecuteSqlQueryResponse::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * RefreshAccessToken exchanges the OAuth refresh token (and other necessary
|
---|
111 | * data) for a new access token (and new associated credentials).
|
---|
112 | * (connections.refreshAccessToken)
|
---|
113 | *
|
---|
114 | * @param string $name
|
---|
115 | * @param RefreshAccessTokenRequest $postBody
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | * @return RefreshAccessTokenResponse
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function refreshAccessToken($name, RefreshAccessTokenRequest $postBody, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('refreshAccessToken', [$params], RefreshAccessTokenResponse::class);
|
---|
125 | }
|
---|
126 | }
|
---|
127 |
|
---|
128 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
129 | class_alias(ProjectsLocationsConnections::class, 'Google_Service_Connectors_Resource_ProjectsLocationsConnections');
|
---|