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\Dns\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Dns\GoogleIamV1GetIamPolicyRequest;
|
---|
21 | use Google\Service\Dns\GoogleIamV1Policy;
|
---|
22 | use Google\Service\Dns\GoogleIamV1SetIamPolicyRequest;
|
---|
23 | use Google\Service\Dns\GoogleIamV1TestIamPermissionsRequest;
|
---|
24 | use Google\Service\Dns\GoogleIamV1TestIamPermissionsResponse;
|
---|
25 | use Google\Service\Dns\ManagedZone;
|
---|
26 | use Google\Service\Dns\ManagedZonesListResponse;
|
---|
27 | use Google\Service\Dns\Operation;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "managedZones" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $dnsService = new Google\Service\Dns(...);
|
---|
34 | * $managedZones = $dnsService->managedZones;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ManagedZones extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates a new ManagedZone. (managedZones.create)
|
---|
41 | *
|
---|
42 | * @param string $project Identifies the project addressed by this request.
|
---|
43 | * @param ManagedZone $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param string clientOperationId For mutating operation requests only. An
|
---|
47 | * optional identifier specified by the client. Must be unique for operation
|
---|
48 | * resources in the Operations collection.
|
---|
49 | * @return ManagedZone
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function create($project, ManagedZone $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['project' => $project, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('create', [$params], ManagedZone::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Deletes a previously created ManagedZone. (managedZones.delete)
|
---|
60 | *
|
---|
61 | * @param string $project Identifies the project addressed by this request.
|
---|
62 | * @param string $managedZone Identifies the managed zone addressed by this
|
---|
63 | * request. Can be the managed zone name or ID.
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | *
|
---|
66 | * @opt_param string clientOperationId For mutating operation requests only. An
|
---|
67 | * optional identifier specified by the client. Must be unique for operation
|
---|
68 | * resources in the Operations collection.
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function delete($project, $managedZone, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['project' => $project, 'managedZone' => $managedZone];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('delete', [$params]);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Fetches the representation of an existing ManagedZone. (managedZones.get)
|
---|
79 | *
|
---|
80 | * @param string $project Identifies the project addressed by this request.
|
---|
81 | * @param string $managedZone Identifies the managed zone addressed by this
|
---|
82 | * request. Can be the managed zone name or ID.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | *
|
---|
85 | * @opt_param string clientOperationId For mutating operation requests only. An
|
---|
86 | * optional identifier specified by the client. Must be unique for operation
|
---|
87 | * resources in the Operations collection.
|
---|
88 | * @return ManagedZone
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function get($project, $managedZone, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['project' => $project, 'managedZone' => $managedZone];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('get', [$params], ManagedZone::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
99 | * resource exists and does not have a policy set. (managedZones.getIamPolicy)
|
---|
100 | *
|
---|
101 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
102 | * requested. See [Resource
|
---|
103 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
104 | * appropriate value for this field.
|
---|
105 | * @param GoogleIamV1GetIamPolicyRequest $postBody
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | * @return GoogleIamV1Policy
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function getIamPolicy($resource, GoogleIamV1GetIamPolicyRequest $postBody, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
115 | }
|
---|
116 | /**
|
---|
117 | * Enumerates ManagedZones that have been created but not yet deleted.
|
---|
118 | * (managedZones.listManagedZones)
|
---|
119 | *
|
---|
120 | * @param string $project Identifies the project addressed by this request.
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | *
|
---|
123 | * @opt_param string dnsName Restricts the list to return only zones with this
|
---|
124 | * domain name.
|
---|
125 | * @opt_param int maxResults Optional. Maximum number of results to be returned.
|
---|
126 | * If unspecified, the server decides how many results to return.
|
---|
127 | * @opt_param string pageToken Optional. A tag returned by a previous list
|
---|
128 | * request that was truncated. Use this parameter to continue a previous list
|
---|
129 | * request.
|
---|
130 | * @return ManagedZonesListResponse
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function listManagedZones($project, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['project' => $project];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('list', [$params], ManagedZonesListResponse::class);
|
---|
138 | }
|
---|
139 | /**
|
---|
140 | * Applies a partial update to an existing ManagedZone. (managedZones.patch)
|
---|
141 | *
|
---|
142 | * @param string $project Identifies the project addressed by this request.
|
---|
143 | * @param string $managedZone Identifies the managed zone addressed by this
|
---|
144 | * request. Can be the managed zone name or ID.
|
---|
145 | * @param ManagedZone $postBody
|
---|
146 | * @param array $optParams Optional parameters.
|
---|
147 | *
|
---|
148 | * @opt_param string clientOperationId For mutating operation requests only. An
|
---|
149 | * optional identifier specified by the client. Must be unique for operation
|
---|
150 | * resources in the Operations collection.
|
---|
151 | * @return Operation
|
---|
152 | * @throws \Google\Service\Exception
|
---|
153 | */
|
---|
154 | public function patch($project, $managedZone, ManagedZone $postBody, $optParams = [])
|
---|
155 | {
|
---|
156 | $params = ['project' => $project, 'managedZone' => $managedZone, 'postBody' => $postBody];
|
---|
157 | $params = array_merge($params, $optParams);
|
---|
158 | return $this->call('patch', [$params], Operation::class);
|
---|
159 | }
|
---|
160 | /**
|
---|
161 | * Sets the access control policy on the specified resource. Replaces any
|
---|
162 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
163 | * `PERMISSION_DENIED` errors. (managedZones.setIamPolicy)
|
---|
164 | *
|
---|
165 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
166 | * specified. See [Resource
|
---|
167 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
168 | * appropriate value for this field.
|
---|
169 | * @param GoogleIamV1SetIamPolicyRequest $postBody
|
---|
170 | * @param array $optParams Optional parameters.
|
---|
171 | * @return GoogleIamV1Policy
|
---|
172 | * @throws \Google\Service\Exception
|
---|
173 | */
|
---|
174 | public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
|
---|
175 | {
|
---|
176 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
177 | $params = array_merge($params, $optParams);
|
---|
178 | return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
179 | }
|
---|
180 | /**
|
---|
181 | * Returns permissions that a caller has on the specified resource. If the
|
---|
182 | * resource does not exist, this returns an empty set of permissions, not a
|
---|
183 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
184 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
185 | * This operation may "fail open" without warning.
|
---|
186 | * (managedZones.testIamPermissions)
|
---|
187 | *
|
---|
188 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
189 | * being requested. See [Resource
|
---|
190 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
191 | * appropriate value for this field.
|
---|
192 | * @param GoogleIamV1TestIamPermissionsRequest $postBody
|
---|
193 | * @param array $optParams Optional parameters.
|
---|
194 | * @return GoogleIamV1TestIamPermissionsResponse
|
---|
195 | * @throws \Google\Service\Exception
|
---|
196 | */
|
---|
197 | public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
198 | {
|
---|
199 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
200 | $params = array_merge($params, $optParams);
|
---|
201 | return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
|
---|
202 | }
|
---|
203 | /**
|
---|
204 | * Updates an existing ManagedZone. (managedZones.update)
|
---|
205 | *
|
---|
206 | * @param string $project Identifies the project addressed by this request.
|
---|
207 | * @param string $managedZone Identifies the managed zone addressed by this
|
---|
208 | * request. Can be the managed zone name or ID.
|
---|
209 | * @param ManagedZone $postBody
|
---|
210 | * @param array $optParams Optional parameters.
|
---|
211 | *
|
---|
212 | * @opt_param string clientOperationId For mutating operation requests only. An
|
---|
213 | * optional identifier specified by the client. Must be unique for operation
|
---|
214 | * resources in the Operations collection.
|
---|
215 | * @return Operation
|
---|
216 | * @throws \Google\Service\Exception
|
---|
217 | */
|
---|
218 | public function update($project, $managedZone, ManagedZone $postBody, $optParams = [])
|
---|
219 | {
|
---|
220 | $params = ['project' => $project, 'managedZone' => $managedZone, 'postBody' => $postBody];
|
---|
221 | $params = array_merge($params, $optParams);
|
---|
222 | return $this->call('update', [$params], Operation::class);
|
---|
223 | }
|
---|
224 | }
|
---|
225 |
|
---|
226 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
227 | class_alias(ManagedZones::class, 'Google_Service_Dns_Resource_ManagedZones');
|
---|