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\AnalyticsHub\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AnalyticsHub\AnalyticshubEmpty;
|
---|
21 | use Google\Service\AnalyticsHub\DataExchange;
|
---|
22 | use Google\Service\AnalyticsHub\GetIamPolicyRequest;
|
---|
23 | use Google\Service\AnalyticsHub\ListDataExchangesResponse;
|
---|
24 | use Google\Service\AnalyticsHub\ListSharedResourceSubscriptionsResponse;
|
---|
25 | use Google\Service\AnalyticsHub\Operation;
|
---|
26 | use Google\Service\AnalyticsHub\Policy;
|
---|
27 | use Google\Service\AnalyticsHub\SetIamPolicyRequest;
|
---|
28 | use Google\Service\AnalyticsHub\SubscribeDataExchangeRequest;
|
---|
29 | use Google\Service\AnalyticsHub\TestIamPermissionsRequest;
|
---|
30 | use Google\Service\AnalyticsHub\TestIamPermissionsResponse;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "dataExchanges" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $analyticshubService = new Google\Service\AnalyticsHub(...);
|
---|
37 | * $dataExchanges = $analyticshubService->projects_locations_dataExchanges;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class ProjectsLocationsDataExchanges extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Creates a new data exchange. (dataExchanges.create)
|
---|
44 | *
|
---|
45 | * @param string $parent Required. The parent resource path of the data
|
---|
46 | * exchange. e.g. `projects/myproject/locations/US`.
|
---|
47 | * @param DataExchange $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | *
|
---|
50 | * @opt_param string dataExchangeId Required. The ID of the data exchange. Must
|
---|
51 | * contain only Unicode letters, numbers (0-9), underscores (_). Should not use
|
---|
52 | * characters that require URL-escaping, or characters outside of ASCII, spaces.
|
---|
53 | * Max length: 100 bytes.
|
---|
54 | * @return DataExchange
|
---|
55 | * @throws \Google\Service\Exception
|
---|
56 | */
|
---|
57 | public function create($parent, DataExchange $postBody, $optParams = [])
|
---|
58 | {
|
---|
59 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
60 | $params = array_merge($params, $optParams);
|
---|
61 | return $this->call('create', [$params], DataExchange::class);
|
---|
62 | }
|
---|
63 | /**
|
---|
64 | * Deletes an existing data exchange. (dataExchanges.delete)
|
---|
65 | *
|
---|
66 | * @param string $name Required. The full name of the data exchange resource
|
---|
67 | * that you want to delete. For example,
|
---|
68 | * `projects/myproject/locations/US/dataExchanges/123`.
|
---|
69 | * @param array $optParams Optional parameters.
|
---|
70 | * @return AnalyticshubEmpty
|
---|
71 | * @throws \Google\Service\Exception
|
---|
72 | */
|
---|
73 | public function delete($name, $optParams = [])
|
---|
74 | {
|
---|
75 | $params = ['name' => $name];
|
---|
76 | $params = array_merge($params, $optParams);
|
---|
77 | return $this->call('delete', [$params], AnalyticshubEmpty::class);
|
---|
78 | }
|
---|
79 | /**
|
---|
80 | * Gets the details of a data exchange. (dataExchanges.get)
|
---|
81 | *
|
---|
82 | * @param string $name Required. The resource name of the data exchange. e.g.
|
---|
83 | * `projects/myproject/locations/US/dataExchanges/123`.
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return DataExchange
|
---|
86 | * @throws \Google\Service\Exception
|
---|
87 | */
|
---|
88 | public function get($name, $optParams = [])
|
---|
89 | {
|
---|
90 | $params = ['name' => $name];
|
---|
91 | $params = array_merge($params, $optParams);
|
---|
92 | return $this->call('get', [$params], DataExchange::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Gets the IAM policy. (dataExchanges.getIamPolicy)
|
---|
96 | *
|
---|
97 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
98 | * requested. See [Resource
|
---|
99 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
100 | * appropriate value for this field.
|
---|
101 | * @param GetIamPolicyRequest $postBody
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return Policy
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Lists all data exchanges in a given project and location.
|
---|
114 | * (dataExchanges.listProjectsLocationsDataExchanges)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. The parent resource path of the data
|
---|
117 | * exchanges. e.g. `projects/myproject/locations/US`.
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
121 | * response page. Leverage the page tokens to iterate through the entire
|
---|
122 | * collection.
|
---|
123 | * @opt_param string pageToken Page token, returned by a previous call, to
|
---|
124 | * request the next page of results.
|
---|
125 | * @return ListDataExchangesResponse
|
---|
126 | * @throws \Google\Service\Exception
|
---|
127 | */
|
---|
128 | public function listProjectsLocationsDataExchanges($parent, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['parent' => $parent];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('list', [$params], ListDataExchangesResponse::class);
|
---|
133 | }
|
---|
134 | /**
|
---|
135 | * Lists all subscriptions on a given Data Exchange or Listing.
|
---|
136 | * (dataExchanges.listSubscriptions)
|
---|
137 | *
|
---|
138 | * @param string $resource Required. Resource name of the requested target. This
|
---|
139 | * resource may be either a Listing or a DataExchange. e.g.
|
---|
140 | * projects/123/locations/US/dataExchanges/456 OR e.g.
|
---|
141 | * projects/123/locations/US/dataExchanges/456/listings/789
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | *
|
---|
144 | * @opt_param bool includeDeletedSubscriptions If selected, includes deleted
|
---|
145 | * subscriptions in the response (up to 63 days after deletion).
|
---|
146 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
147 | * response page.
|
---|
148 | * @opt_param string pageToken Page token, returned by a previous call.
|
---|
149 | * @return ListSharedResourceSubscriptionsResponse
|
---|
150 | * @throws \Google\Service\Exception
|
---|
151 | */
|
---|
152 | public function listSubscriptions($resource, $optParams = [])
|
---|
153 | {
|
---|
154 | $params = ['resource' => $resource];
|
---|
155 | $params = array_merge($params, $optParams);
|
---|
156 | return $this->call('listSubscriptions', [$params], ListSharedResourceSubscriptionsResponse::class);
|
---|
157 | }
|
---|
158 | /**
|
---|
159 | * Updates an existing data exchange. (dataExchanges.patch)
|
---|
160 | *
|
---|
161 | * @param string $name Output only. The resource name of the data exchange. e.g.
|
---|
162 | * `projects/myproject/locations/US/dataExchanges/123`.
|
---|
163 | * @param DataExchange $postBody
|
---|
164 | * @param array $optParams Optional parameters.
|
---|
165 | *
|
---|
166 | * @opt_param string updateMask Required. Field mask specifies the fields to
|
---|
167 | * update in the data exchange resource. The fields specified in the
|
---|
168 | * `updateMask` are relative to the resource and are not a full request.
|
---|
169 | * @return DataExchange
|
---|
170 | * @throws \Google\Service\Exception
|
---|
171 | */
|
---|
172 | public function patch($name, DataExchange $postBody, $optParams = [])
|
---|
173 | {
|
---|
174 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
175 | $params = array_merge($params, $optParams);
|
---|
176 | return $this->call('patch', [$params], DataExchange::class);
|
---|
177 | }
|
---|
178 | /**
|
---|
179 | * Sets the IAM policy. (dataExchanges.setIamPolicy)
|
---|
180 | *
|
---|
181 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
182 | * specified. See [Resource
|
---|
183 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
184 | * appropriate value for this field.
|
---|
185 | * @param SetIamPolicyRequest $postBody
|
---|
186 | * @param array $optParams Optional parameters.
|
---|
187 | * @return Policy
|
---|
188 | * @throws \Google\Service\Exception
|
---|
189 | */
|
---|
190 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
191 | {
|
---|
192 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
193 | $params = array_merge($params, $optParams);
|
---|
194 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
195 | }
|
---|
196 | /**
|
---|
197 | * Creates a Subscription to a Data Clean Room. This is a long-running operation
|
---|
198 | * as it will create one or more linked datasets. (dataExchanges.subscribe)
|
---|
199 | *
|
---|
200 | * @param string $name Required. Resource name of the Data Exchange. e.g.
|
---|
201 | * `projects/publisherproject/locations/US/dataExchanges/123`
|
---|
202 | * @param SubscribeDataExchangeRequest $postBody
|
---|
203 | * @param array $optParams Optional parameters.
|
---|
204 | * @return Operation
|
---|
205 | * @throws \Google\Service\Exception
|
---|
206 | */
|
---|
207 | public function subscribe($name, SubscribeDataExchangeRequest $postBody, $optParams = [])
|
---|
208 | {
|
---|
209 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
210 | $params = array_merge($params, $optParams);
|
---|
211 | return $this->call('subscribe', [$params], Operation::class);
|
---|
212 | }
|
---|
213 | /**
|
---|
214 | * Returns the permissions that a caller has. (dataExchanges.testIamPermissions)
|
---|
215 | *
|
---|
216 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
217 | * being requested. See [Resource
|
---|
218 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
219 | * appropriate value for this field.
|
---|
220 | * @param TestIamPermissionsRequest $postBody
|
---|
221 | * @param array $optParams Optional parameters.
|
---|
222 | * @return TestIamPermissionsResponse
|
---|
223 | * @throws \Google\Service\Exception
|
---|
224 | */
|
---|
225 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
226 | {
|
---|
227 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
228 | $params = array_merge($params, $optParams);
|
---|
229 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
230 | }
|
---|
231 | }
|
---|
232 |
|
---|
233 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
234 | class_alias(ProjectsLocationsDataExchanges::class, 'Google_Service_AnalyticsHub_Resource_ProjectsLocationsDataExchanges');
|
---|