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\CertificateManager\Resource;
19
20use Google\Service\CertificateManager\DnsAuthorization;
21use Google\Service\CertificateManager\ListDnsAuthorizationsResponse;
22use Google\Service\CertificateManager\Operation;
23
24/**
25 * The "dnsAuthorizations" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $certificatemanagerService = new Google\Service\CertificateManager(...);
29 *   $dnsAuthorizations = $certificatemanagerService->dnsAuthorizations;
30 *  </code>
31 */
32class ProjectsLocationsDnsAuthorizations extends \Google\Service\Resource
33{
34  /**
35   * Creates a new DnsAuthorization in a given project and location.
36   * (dnsAuthorizations.create)
37   *
38   * @param string $parent Required. The parent resource of the dns authorization.
39   * Must be in the format `projects/locations`.
40   * @param DnsAuthorization $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string dnsAuthorizationId Required. A user-provided name of the
44   * dns authorization.
45   * @return Operation
46   */
47  public function create($parent, DnsAuthorization $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('create', [$params], Operation::class);
52  }
53  /**
54   * Deletes a single DnsAuthorization. (dnsAuthorizations.delete)
55   *
56   * @param string $name Required. A name of the dns authorization to delete. Must
57   * be in the format `projects/locations/dnsAuthorizations`.
58   * @param array $optParams Optional parameters.
59   * @return Operation
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], Operation::class);
66  }
67  /**
68   * Gets details of a single DnsAuthorization. (dnsAuthorizations.get)
69   *
70   * @param string $name Required. A name of the dns authorization to describe.
71   * Must be in the format `projects/locations/dnsAuthorizations`.
72   * @param array $optParams Optional parameters.
73   * @return DnsAuthorization
74   */
75  public function get($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], DnsAuthorization::class);
80  }
81  /**
82   * Lists DnsAuthorizations in a given project and location.
83   * (dnsAuthorizations.listProjectsLocationsDnsAuthorizations)
84   *
85   * @param string $parent Required. The project and location from which the dns
86   * authorizations should be listed, specified in the format
87   * `projects/locations`.
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param string filter Filter expression to restrict the Dns Authorizations
91   * returned.
92   * @opt_param string orderBy A list of Dns Authorization field names used to
93   * specify the order of the returned results. The default sorting order is
94   * ascending. To specify descending order for a field, add a suffix " desc".
95   * @opt_param int pageSize Maximum number of dns authorizations to return per
96   * call.
97   * @opt_param string pageToken The value returned by the last
98   * `ListDnsAuthorizationsResponse`. Indicates that this is a continuation of a
99   * prior `ListDnsAuthorizations` call, and that the system should return the
100   * next page of data.
101   * @return ListDnsAuthorizationsResponse
102   */
103  public function listProjectsLocationsDnsAuthorizations($parent, $optParams = [])
104  {
105    $params = ['parent' => $parent];
106    $params = array_merge($params, $optParams);
107    return $this->call('list', [$params], ListDnsAuthorizationsResponse::class);
108  }
109  /**
110   * Updates a DnsAuthorization. (dnsAuthorizations.patch)
111   *
112   * @param string $name A user-defined name of the dns authorization.
113   * DnsAuthorization names must be unique globally and match pattern
114   * `projects/locations/dnsAuthorizations`.
115   * @param DnsAuthorization $postBody
116   * @param array $optParams Optional parameters.
117   *
118   * @opt_param string updateMask Required. The update mask applies to the
119   * resource. For the `FieldMask` definition, see https://developers.google.com
120   * /protocol-buffers/docs/reference/google.protobuf#fieldmask.
121   * @return Operation
122   */
123  public function patch($name, DnsAuthorization $postBody, $optParams = [])
124  {
125    $params = ['name' => $name, 'postBody' => $postBody];
126    $params = array_merge($params, $optParams);
127    return $this->call('patch', [$params], Operation::class);
128  }
129}
130
131// Adding a class alias for backwards compatibility with the previous class name.
132class_alias(ProjectsLocationsDnsAuthorizations::class, 'Google_Service_CertificateManager_Resource_ProjectsLocationsDnsAuthorizations');
133