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
18namespace Google\Service\Dns\Resource;
19
20use Google\Service\Dns\ManagedZone;
21use Google\Service\Dns\ManagedZonesListResponse;
22use Google\Service\Dns\Operation;
23
24/**
25 * The "managedZones" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $dnsService = new Google\Service\Dns(...);
29 *   $managedZones = $dnsService->managedZones;
30 *  </code>
31 */
32class ManagedZones extends \Google\Service\Resource
33{
34  /**
35   * Creates a new ManagedZone. (managedZones.create)
36   *
37   * @param string $project Identifies the project addressed by this request.
38   * @param string $location Specifies the location of the resource. This
39   * information will be used for routing and will be part of the resource name.
40   * @param ManagedZone $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string clientOperationId For mutating operation requests only. An
44   * optional identifier specified by the client. Must be unique for operation
45   * resources in the Operations collection.
46   * @return ManagedZone
47   */
48  public function create($project, $location, ManagedZone $postBody, $optParams = [])
49  {
50    $params = ['project' => $project, 'location' => $location, 'postBody' => $postBody];
51    $params = array_merge($params, $optParams);
52    return $this->call('create', [$params], ManagedZone::class);
53  }
54  /**
55   * Deletes a previously created ManagedZone. (managedZones.delete)
56   *
57   * @param string $project Identifies the project addressed by this request.
58   * @param string $location Specifies the location of the resource. This
59   * information will be used for routing and will be part of the resource name.
60   * @param string $managedZone Identifies the managed zone addressed by this
61   * request. Can be the managed zone name or ID.
62   * @param array $optParams Optional parameters.
63   *
64   * @opt_param string clientOperationId For mutating operation requests only. An
65   * optional identifier specified by the client. Must be unique for operation
66   * resources in the Operations collection.
67   */
68  public function delete($project, $location, $managedZone, $optParams = [])
69  {
70    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone];
71    $params = array_merge($params, $optParams);
72    return $this->call('delete', [$params]);
73  }
74  /**
75   * Fetches the representation of an existing ManagedZone. (managedZones.get)
76   *
77   * @param string $project Identifies the project addressed by this request.
78   * @param string $location Specifies the location of the resource. This
79   * information will be used for routing and will be part of the resource name.
80   * @param string $managedZone Identifies the managed zone addressed by this
81   * request. Can be the managed zone name or ID.
82   * @param array $optParams Optional parameters.
83   *
84   * @opt_param string clientOperationId For mutating operation requests only. An
85   * optional identifier specified by the client. Must be unique for operation
86   * resources in the Operations collection.
87   * @return ManagedZone
88   */
89  public function get($project, $location, $managedZone, $optParams = [])
90  {
91    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone];
92    $params = array_merge($params, $optParams);
93    return $this->call('get', [$params], ManagedZone::class);
94  }
95  /**
96   * Enumerates ManagedZones that have been created but not yet deleted.
97   * (managedZones.listManagedZones)
98   *
99   * @param string $project Identifies the project addressed by this request.
100   * @param string $location Specifies the location of the resource. This
101   * information will be used for routing and will be part of the resource name.
102   * @param array $optParams Optional parameters.
103   *
104   * @opt_param string dnsName Restricts the list to return only zones with this
105   * domain name.
106   * @opt_param int maxResults Optional. Maximum number of results to be returned.
107   * If unspecified, the server decides how many results to return.
108   * @opt_param string pageToken Optional. A tag returned by a previous list
109   * request that was truncated. Use this parameter to continue a previous list
110   * request.
111   * @return ManagedZonesListResponse
112   */
113  public function listManagedZones($project, $location, $optParams = [])
114  {
115    $params = ['project' => $project, 'location' => $location];
116    $params = array_merge($params, $optParams);
117    return $this->call('list', [$params], ManagedZonesListResponse::class);
118  }
119  /**
120   * Applies a partial update to an existing ManagedZone. (managedZones.patch)
121   *
122   * @param string $project Identifies the project addressed by this request.
123   * @param string $location Specifies the location of the resource. This
124   * information will be used for routing and will be part of the resource name.
125   * @param string $managedZone Identifies the managed zone addressed by this
126   * request. Can be the managed zone name or ID.
127   * @param ManagedZone $postBody
128   * @param array $optParams Optional parameters.
129   *
130   * @opt_param string clientOperationId For mutating operation requests only. An
131   * optional identifier specified by the client. Must be unique for operation
132   * resources in the Operations collection.
133   * @return Operation
134   */
135  public function patch($project, $location, $managedZone, ManagedZone $postBody, $optParams = [])
136  {
137    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone, 'postBody' => $postBody];
138    $params = array_merge($params, $optParams);
139    return $this->call('patch', [$params], Operation::class);
140  }
141  /**
142   * Updates an existing ManagedZone. (managedZones.update)
143   *
144   * @param string $project Identifies the project addressed by this request.
145   * @param string $location Specifies the location of the resource. This
146   * information will be used for routing and will be part of the resource name.
147   * @param string $managedZone Identifies the managed zone addressed by this
148   * request. Can be the managed zone name or ID.
149   * @param ManagedZone $postBody
150   * @param array $optParams Optional parameters.
151   *
152   * @opt_param string clientOperationId For mutating operation requests only. An
153   * optional identifier specified by the client. Must be unique for operation
154   * resources in the Operations collection.
155   * @return Operation
156   */
157  public function update($project, $location, $managedZone, ManagedZone $postBody, $optParams = [])
158  {
159    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone, 'postBody' => $postBody];
160    $params = array_merge($params, $optParams);
161    return $this->call('update', [$params], Operation::class);
162  }
163}
164
165// Adding a class alias for backwards compatibility with the previous class name.
166class_alias(ManagedZones::class, 'Google_Service_Dns_Resource_ManagedZones');
167