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\DLP\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DLP\GooglePrivacyDlpV2Connection;
|
---|
21 | use Google\Service\DLP\GooglePrivacyDlpV2CreateConnectionRequest;
|
---|
22 | use Google\Service\DLP\GooglePrivacyDlpV2ListConnectionsResponse;
|
---|
23 | use Google\Service\DLP\GooglePrivacyDlpV2SearchConnectionsResponse;
|
---|
24 | use Google\Service\DLP\GooglePrivacyDlpV2UpdateConnectionRequest;
|
---|
25 | use Google\Service\DLP\GoogleProtobufEmpty;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "connections" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $dlpService = new Google\Service\DLP(...);
|
---|
32 | * $connections = $dlpService->organizations_locations_connections;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class OrganizationsLocationsConnections extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Create a Connection to an external data source. (connections.create)
|
---|
39 | *
|
---|
40 | * @param string $parent Required. Parent resource name. The format of this
|
---|
41 | * value varies depending on the scope of the request (project or organization):
|
---|
42 | * + Projects scope: `projects/{project_id}/locations/{location_id}` +
|
---|
43 | * Organizations scope: `organizations/{org_id}/locations/{location_id}`
|
---|
44 | * @param GooglePrivacyDlpV2CreateConnectionRequest $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return GooglePrivacyDlpV2Connection
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, GooglePrivacyDlpV2CreateConnectionRequest $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], GooglePrivacyDlpV2Connection::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Delete a Connection. (connections.delete)
|
---|
57 | *
|
---|
58 | * @param string $name Required. Resource name of the Connection to be deleted,
|
---|
59 | * in the format:
|
---|
60 | * `projects/{project}/locations/{location}/connections/{connection}`.
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return GoogleProtobufEmpty
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function delete($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Get a Connection by name. (connections.get)
|
---|
73 | *
|
---|
74 | * @param string $name Required. Resource name in the format:
|
---|
75 | * `projects/{project}/locations/{location}/connections/{connection}`.
|
---|
76 | * @param array $optParams Optional parameters.
|
---|
77 | * @return GooglePrivacyDlpV2Connection
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function get($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('get', [$params], GooglePrivacyDlpV2Connection::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Lists Connections in a parent. Use SearchConnections to see all connections
|
---|
88 | * within an organization. (connections.listOrganizationsLocationsConnections)
|
---|
89 | *
|
---|
90 | * @param string $parent Required. Resource name of the organization or project,
|
---|
91 | * for example, `organizations/433245324/locations/europe` or `projects/project-
|
---|
92 | * id/locations/asia`.
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | *
|
---|
95 | * @opt_param string filter Optional. Supported field/value: `state` -
|
---|
96 | * MISSING|AVAILABLE|ERROR
|
---|
97 | * @opt_param int pageSize Optional. Number of results per page, max 1000.
|
---|
98 | * @opt_param string pageToken Optional. Page token from a previous page to
|
---|
99 | * return the next set of results. If set, all other request fields must match
|
---|
100 | * the original request.
|
---|
101 | * @return GooglePrivacyDlpV2ListConnectionsResponse
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function listOrganizationsLocationsConnections($parent, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['parent' => $parent];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('list', [$params], GooglePrivacyDlpV2ListConnectionsResponse::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Update a Connection. (connections.patch)
|
---|
112 | *
|
---|
113 | * @param string $name Required. Resource name in the format:
|
---|
114 | * `projects/{project}/locations/{location}/connections/{connection}`.
|
---|
115 | * @param GooglePrivacyDlpV2UpdateConnectionRequest $postBody
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | * @return GooglePrivacyDlpV2Connection
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function patch($name, GooglePrivacyDlpV2UpdateConnectionRequest $postBody, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('patch', [$params], GooglePrivacyDlpV2Connection::class);
|
---|
125 | }
|
---|
126 | /**
|
---|
127 | * Searches for Connections in a parent. (connections.search)
|
---|
128 | *
|
---|
129 | * @param string $parent Required. Resource name of the organization or project
|
---|
130 | * with a wildcard location, for example, `organizations/433245324/locations/-`
|
---|
131 | * or `projects/project-id/locations/-`.
|
---|
132 | * @param array $optParams Optional parameters.
|
---|
133 | *
|
---|
134 | * @opt_param string filter Optional. Supported field/value: - `state` -
|
---|
135 | * MISSING|AVAILABLE|ERROR
|
---|
136 | * @opt_param int pageSize Optional. Number of results per page, max 1000.
|
---|
137 | * @opt_param string pageToken Optional. Page token from a previous page to
|
---|
138 | * return the next set of results. If set, all other request fields must match
|
---|
139 | * the original request.
|
---|
140 | * @return GooglePrivacyDlpV2SearchConnectionsResponse
|
---|
141 | * @throws \Google\Service\Exception
|
---|
142 | */
|
---|
143 | public function search($parent, $optParams = [])
|
---|
144 | {
|
---|
145 | $params = ['parent' => $parent];
|
---|
146 | $params = array_merge($params, $optParams);
|
---|
147 | return $this->call('search', [$params], GooglePrivacyDlpV2SearchConnectionsResponse::class);
|
---|
148 | }
|
---|
149 | }
|
---|
150 |
|
---|
151 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
152 | class_alias(OrganizationsLocationsConnections::class, 'Google_Service_DLP_Resource_OrganizationsLocationsConnections');
|
---|