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