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\GetIamPolicyRequest;
|
---|
21 | use Google\Service\AnalyticsHub\ListSubscriptionsResponse;
|
---|
22 | use Google\Service\AnalyticsHub\Operation;
|
---|
23 | use Google\Service\AnalyticsHub\Policy;
|
---|
24 | use Google\Service\AnalyticsHub\RefreshSubscriptionRequest;
|
---|
25 | use Google\Service\AnalyticsHub\RevokeSubscriptionRequest;
|
---|
26 | use Google\Service\AnalyticsHub\RevokeSubscriptionResponse;
|
---|
27 | use Google\Service\AnalyticsHub\SetIamPolicyRequest;
|
---|
28 | use Google\Service\AnalyticsHub\Subscription;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The "subscriptions" collection of methods.
|
---|
32 | * Typical usage is:
|
---|
33 | * <code>
|
---|
34 | * $analyticshubService = new Google\Service\AnalyticsHub(...);
|
---|
35 | * $subscriptions = $analyticshubService->projects_locations_subscriptions;
|
---|
36 | * </code>
|
---|
37 | */
|
---|
38 | class ProjectsLocationsSubscriptions extends \Google\Service\Resource
|
---|
39 | {
|
---|
40 | /**
|
---|
41 | * Deletes a subscription. (subscriptions.delete)
|
---|
42 | *
|
---|
43 | * @param string $name Required. Resource name of the subscription to delete.
|
---|
44 | * e.g. projects/123/locations/US/subscriptions/456
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return Operation
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function delete($name, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['name' => $name];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('delete', [$params], Operation::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Gets the details of a Subscription. (subscriptions.get)
|
---|
57 | *
|
---|
58 | * @param string $name Required. Resource name of the subscription. e.g.
|
---|
59 | * projects/123/locations/US/subscriptions/456
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return Subscription
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function get($name, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['name' => $name];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('get', [$params], Subscription::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Gets the IAM policy. (subscriptions.getIamPolicy)
|
---|
72 | *
|
---|
73 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
74 | * requested. See [Resource
|
---|
75 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
76 | * appropriate value for this field.
|
---|
77 | * @param GetIamPolicyRequest $postBody
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | * @return Policy
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Lists all subscriptions in a given project and location.
|
---|
90 | * (subscriptions.listProjectsLocationsSubscriptions)
|
---|
91 | *
|
---|
92 | * @param string $parent Required. The parent resource path of the subscription.
|
---|
93 | * e.g. projects/myproject/locations/US
|
---|
94 | * @param array $optParams Optional parameters.
|
---|
95 | *
|
---|
96 | * @opt_param string filter An expression for filtering the results of the
|
---|
97 | * request. Eligible fields for filtering are: + `listing` + `data_exchange`
|
---|
98 | * Alternatively, a literal wrapped in double quotes may be provided. This will
|
---|
99 | * be checked for an exact match against both fields above. In all cases, the
|
---|
100 | * full Data Exchange or Listing resource name must be provided. Some example of
|
---|
101 | * using filters: +
|
---|
102 | * data_exchange="projects/myproject/locations/us/dataExchanges/123" +
|
---|
103 | * listing="projects/123/locations/us/dataExchanges/456/listings/789" +
|
---|
104 | * "projects/myproject/locations/us/dataExchanges/123"
|
---|
105 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
106 | * response page.
|
---|
107 | * @opt_param string pageToken Page token, returned by a previous call.
|
---|
108 | * @return ListSubscriptionsResponse
|
---|
109 | * @throws \Google\Service\Exception
|
---|
110 | */
|
---|
111 | public function listProjectsLocationsSubscriptions($parent, $optParams = [])
|
---|
112 | {
|
---|
113 | $params = ['parent' => $parent];
|
---|
114 | $params = array_merge($params, $optParams);
|
---|
115 | return $this->call('list', [$params], ListSubscriptionsResponse::class);
|
---|
116 | }
|
---|
117 | /**
|
---|
118 | * Refreshes a Subscription to a Data Exchange. A Data Exchange can become stale
|
---|
119 | * when a publisher adds or removes data. This is a long-running operation as it
|
---|
120 | * may create many linked datasets. (subscriptions.refresh)
|
---|
121 | *
|
---|
122 | * @param string $name Required. Resource name of the Subscription to refresh.
|
---|
123 | * e.g. `projects/subscriberproject/locations/US/subscriptions/123`
|
---|
124 | * @param RefreshSubscriptionRequest $postBody
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | * @return Operation
|
---|
127 | * @throws \Google\Service\Exception
|
---|
128 | */
|
---|
129 | public function refresh($name, RefreshSubscriptionRequest $postBody, $optParams = [])
|
---|
130 | {
|
---|
131 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
132 | $params = array_merge($params, $optParams);
|
---|
133 | return $this->call('refresh', [$params], Operation::class);
|
---|
134 | }
|
---|
135 | /**
|
---|
136 | * Revokes a given subscription. (subscriptions.revoke)
|
---|
137 | *
|
---|
138 | * @param string $name Required. Resource name of the subscription to revoke.
|
---|
139 | * e.g. projects/123/locations/US/subscriptions/456
|
---|
140 | * @param RevokeSubscriptionRequest $postBody
|
---|
141 | * @param array $optParams Optional parameters.
|
---|
142 | * @return RevokeSubscriptionResponse
|
---|
143 | * @throws \Google\Service\Exception
|
---|
144 | */
|
---|
145 | public function revoke($name, RevokeSubscriptionRequest $postBody, $optParams = [])
|
---|
146 | {
|
---|
147 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
148 | $params = array_merge($params, $optParams);
|
---|
149 | return $this->call('revoke', [$params], RevokeSubscriptionResponse::class);
|
---|
150 | }
|
---|
151 | /**
|
---|
152 | * Sets the IAM policy. (subscriptions.setIamPolicy)
|
---|
153 | *
|
---|
154 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
155 | * specified. See [Resource
|
---|
156 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
157 | * appropriate value for this field.
|
---|
158 | * @param SetIamPolicyRequest $postBody
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | * @return Policy
|
---|
161 | * @throws \Google\Service\Exception
|
---|
162 | */
|
---|
163 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
164 | {
|
---|
165 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
166 | $params = array_merge($params, $optParams);
|
---|
167 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
168 | }
|
---|
169 | }
|
---|
170 |
|
---|
171 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
172 | class_alias(ProjectsLocationsSubscriptions::class, 'Google_Service_AnalyticsHub_Resource_ProjectsLocationsSubscriptions');
|
---|