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