<?php
/*
 * Copyright 2014 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

namespace Google\Service\CloudKMS\Resource;

use Google\Service\CloudKMS\ListRetiredResourcesResponse;
use Google\Service\CloudKMS\RetiredResource;

/**
 * The "retiredResources" collection of methods.
 * Typical usage is:
 *  <code>
 *   $cloudkmsService = new Google\Service\CloudKMS(...);
 *   $retiredResources = $cloudkmsService->projects_locations_retiredResources;
 *  </code>
 */
class ProjectsLocationsRetiredResources extends \Google\Service\Resource
{
  /**
   * Retrieves a specific RetiredResource resource, which represents the record of
   * a deleted CryptoKey. (retiredResources.get)
   *
   * @param string $name Required. The name of the RetiredResource to get.
   * @param array $optParams Optional parameters.
   * @return RetiredResource
   * @throws \Google\Service\Exception
   */
  public function get($name, $optParams = [])
  {
    $params = ['name' => $name];
    $params = array_merge($params, $optParams);
    return $this->call('get', [$params], RetiredResource::class);
  }
  /**
   * Lists the RetiredResources which are the records of deleted CryptoKeys.
   * RetiredResources prevent the reuse of these resource names after deletion.
   * (retiredResources.listProjectsLocationsRetiredResources)
   *
   * @param string $parent Required. The project-specific location holding the
   * RetiredResources, in the format `projects/locations`.
   * @param array $optParams Optional parameters.
   *
   * @opt_param int pageSize Optional. Optional limit on the number of
   * RetiredResources to be included in the response. Further RetiredResources can
   * subsequently be obtained by including the
   * ListRetiredResourcesResponse.next_page_token in a subsequent request. If
   * unspecified, the server will pick an appropriate default.
   * @opt_param string pageToken Optional. Optional pagination token, returned
   * earlier via ListRetiredResourcesResponse.next_page_token.
   * @return ListRetiredResourcesResponse
   * @throws \Google\Service\Exception
   */
  public function listProjectsLocationsRetiredResources($parent, $optParams = [])
  {
    $params = ['parent' => $parent];
    $params = array_merge($params, $optParams);
    return $this->call('list', [$params], ListRetiredResourcesResponse::class);
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsRetiredResources::class, 'Google_Service_CloudKMS_Resource_ProjectsLocationsRetiredResources');
