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\FirebaseManagement\Resource;
19
20use Google\Service\FirebaseManagement\FirebaseEmpty;
21use Google\Service\FirebaseManagement\ListShaCertificatesResponse;
22use Google\Service\FirebaseManagement\ShaCertificate;
23
24/**
25 * The "sha" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $firebaseService = new Google\Service\FirebaseManagement(...);
29 *   $sha = $firebaseService->sha;
30 *  </code>
31 */
32class ProjectsAndroidAppsSha extends \Google\Service\Resource
33{
34  /**
35   * Adds a ShaCertificate to the specified AndroidApp. (sha.create)
36   *
37   * @param string $parent The resource name of the parent AndroidApp to which to
38   * add a ShaCertificate, in the format: projects/PROJECT_IDENTIFIER/androidApps/
39   * APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-
40   * Collection access pattern may be used here, in the format:
41   * projects/-/androidApps/APP_ID Refer to the `AndroidApp`
42   * [`name`](../projects.androidApps#AndroidApp.FIELDS.name) field for details
43   * about PROJECT_IDENTIFIER and APP_ID values.
44   * @param ShaCertificate $postBody
45   * @param array $optParams Optional parameters.
46   * @return ShaCertificate
47   */
48  public function create($parent, ShaCertificate $postBody, $optParams = [])
49  {
50    $params = ['parent' => $parent, 'postBody' => $postBody];
51    $params = array_merge($params, $optParams);
52    return $this->call('create', [$params], ShaCertificate::class);
53  }
54  /**
55   * Removes a ShaCertificate from the specified AndroidApp. (sha.delete)
56   *
57   * @param string $name The resource name of the ShaCertificate to remove from
58   * the parent AndroidApp, in the format:
59   * projects/PROJECT_IDENTIFIER/androidApps/APP_ID /sha/SHA_HASH Refer to the
60   * `ShaCertificate`
61   * [`name`](../projects.androidApps.sha#ShaCertificate.FIELDS.name) field for
62   * details about PROJECT_IDENTIFIER, APP_ID, and SHA_HASH values. You can obtain
63   * the full resource name of the `ShaCertificate` from the response of
64   * [`ListShaCertificates`](../projects.androidApps.sha/list) or the original
65   * [`CreateShaCertificate`](../projects.androidApps.sha/create).
66   * @param array $optParams Optional parameters.
67   * @return FirebaseEmpty
68   */
69  public function delete($name, $optParams = [])
70  {
71    $params = ['name' => $name];
72    $params = array_merge($params, $optParams);
73    return $this->call('delete', [$params], FirebaseEmpty::class);
74  }
75  /**
76   * Lists the SHA-1 and SHA-256 certificates for the specified AndroidApp.
77   * (sha.listProjectsAndroidAppsSha)
78   *
79   * @param string $parent The resource name of the parent AndroidApp for which to
80   * list each associated ShaCertificate, in the format:
81   * projects/PROJECT_IDENTIFIER /androidApps/APP_ID Since an APP_ID is a unique
82   * identifier, the Unique Resource from Sub-Collection access pattern may be
83   * used here, in the format: projects/-/androidApps/APP_ID Refer to the
84   * `AndroidApp` [`name`](../projects.androidApps#AndroidApp.FIELDS.name) field
85   * for details about PROJECT_IDENTIFIER and APP_ID values.
86   * @param array $optParams Optional parameters.
87   * @return ListShaCertificatesResponse
88   */
89  public function listProjectsAndroidAppsSha($parent, $optParams = [])
90  {
91    $params = ['parent' => $parent];
92    $params = array_merge($params, $optParams);
93    return $this->call('list', [$params], ListShaCertificatesResponse::class);
94  }
95}
96
97// Adding a class alias for backwards compatibility with the previous class name.
98class_alias(ProjectsAndroidAppsSha::class, 'Google_Service_FirebaseManagement_Resource_ProjectsAndroidAppsSha');
99