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\Sheets\Resource;
19
20use Google\Service\Sheets\DeveloperMetadata;
21use Google\Service\Sheets\SearchDeveloperMetadataRequest;
22use Google\Service\Sheets\SearchDeveloperMetadataResponse;
23
24/**
25 * The "developerMetadata" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $sheetsService = new Google\Service\Sheets(...);
29 *   $developerMetadata = $sheetsService->developerMetadata;
30 *  </code>
31 */
32class SpreadsheetsDeveloperMetadata extends \Google\Service\Resource
33{
34  /**
35   * Returns the developer metadata with the specified ID. The caller must specify
36   * the spreadsheet ID and the developer metadata's unique metadataId.
37   * (developerMetadata.get)
38   *
39   * @param string $spreadsheetId The ID of the spreadsheet to retrieve metadata
40   * from.
41   * @param int $metadataId The ID of the developer metadata to retrieve.
42   * @param array $optParams Optional parameters.
43   * @return DeveloperMetadata
44   */
45  public function get($spreadsheetId, $metadataId, $optParams = [])
46  {
47    $params = ['spreadsheetId' => $spreadsheetId, 'metadataId' => $metadataId];
48    $params = array_merge($params, $optParams);
49    return $this->call('get', [$params], DeveloperMetadata::class);
50  }
51  /**
52   * Returns all developer metadata matching the specified DataFilter. If the
53   * provided DataFilter represents a DeveloperMetadataLookup object, this will
54   * return all DeveloperMetadata entries selected by it. If the DataFilter
55   * represents a location in a spreadsheet, this will return all developer
56   * metadata associated with locations intersecting that region.
57   * (developerMetadata.search)
58   *
59   * @param string $spreadsheetId The ID of the spreadsheet to retrieve metadata
60   * from.
61   * @param SearchDeveloperMetadataRequest $postBody
62   * @param array $optParams Optional parameters.
63   * @return SearchDeveloperMetadataResponse
64   */
65  public function search($spreadsheetId, SearchDeveloperMetadataRequest $postBody, $optParams = [])
66  {
67    $params = ['spreadsheetId' => $spreadsheetId, 'postBody' => $postBody];
68    $params = array_merge($params, $optParams);
69    return $this->call('search', [$params], SearchDeveloperMetadataResponse::class);
70  }
71}
72
73// Adding a class alias for backwards compatibility with the previous class name.
74class_alias(SpreadsheetsDeveloperMetadata::class, 'Google_Service_Sheets_Resource_SpreadsheetsDeveloperMetadata');
75