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\Change;
21use Google\Service\Dns\ChangesListResponse;
22
23/**
24 * The "changes" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $dnsService = new Google\Service\Dns(...);
28 *   $changes = $dnsService->changes;
29 *  </code>
30 */
31class Changes extends \Google\Service\Resource
32{
33  /**
34   * Atomically updates the ResourceRecordSet collection. (changes.create)
35   *
36   * @param string $project Identifies the project addressed by this request.
37   * @param string $location
38   * @param string $managedZone Identifies the managed zone addressed by this
39   * request. Can be the managed zone name or ID.
40   * @param Change $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 Change
47   */
48  public function create($project, $location, $managedZone, Change $postBody, $optParams = [])
49  {
50    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone, 'postBody' => $postBody];
51    $params = array_merge($params, $optParams);
52    return $this->call('create', [$params], Change::class);
53  }
54  /**
55   * Fetches the representation of an existing Change. (changes.get)
56   *
57   * @param string $project Identifies the project addressed by this request.
58   * @param string $location
59   * @param string $managedZone Identifies the managed zone addressed by this
60   * request. Can be the managed zone name or ID.
61   * @param string $changeId The identifier of the requested change, from a
62   * previous ResourceRecordSetsChangeResponse.
63   * @param array $optParams Optional parameters.
64   *
65   * @opt_param string clientOperationId For mutating operation requests only. An
66   * optional identifier specified by the client. Must be unique for operation
67   * resources in the Operations collection.
68   * @return Change
69   */
70  public function get($project, $location, $managedZone, $changeId, $optParams = [])
71  {
72    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone, 'changeId' => $changeId];
73    $params = array_merge($params, $optParams);
74    return $this->call('get', [$params], Change::class);
75  }
76  /**
77   * Enumerates Changes to a ResourceRecordSet collection. (changes.listChanges)
78   *
79   * @param string $project Identifies the project addressed by this request.
80   * @param string $location
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 int maxResults Optional. Maximum number of results to be returned.
86   * If unspecified, the server decides how many results to return.
87   * @opt_param string pageToken Optional. A tag returned by a previous list
88   * request that was truncated. Use this parameter to continue a previous list
89   * request.
90   * @opt_param string sortBy Sorting criterion. The only supported value is
91   * change sequence.
92   * @opt_param string sortOrder Sorting order direction: 'ascending' or
93   * 'descending'.
94   * @return ChangesListResponse
95   */
96  public function listChanges($project, $location, $managedZone, $optParams = [])
97  {
98    $params = ['project' => $project, 'location' => $location, 'managedZone' => $managedZone];
99    $params = array_merge($params, $optParams);
100    return $this->call('list', [$params], ChangesListResponse::class);
101  }
102}
103
104// Adding a class alias for backwards compatibility with the previous class name.
105class_alias(Changes::class, 'Google_Service_Dns_Resource_Changes');
106