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\OSConfig\Resource;
19
20use Google\Service\OSConfig\Inventory;
21use Google\Service\OSConfig\ListInventoriesResponse;
22
23/**
24 * The "inventories" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $osconfigService = new Google\Service\OSConfig(...);
28 *   $inventories = $osconfigService->inventories;
29 *  </code>
30 */
31class ProjectsLocationsInstancesInventories extends \Google\Service\Resource
32{
33  /**
34   * Get inventory data for the specified VM instance. If the VM has no associated
35   * inventory, the message `NOT_FOUND` is returned. (inventories.get)
36   *
37   * @param string $name Required. API resource name for inventory resource.
38   * Format:
39   * `projects/{project}/locations/{location}/instances/{instance}/inventory` For
40   * `{project}`, either `project-number` or `project-id` can be provided. For
41   * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be
42   * provided.
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string view Inventory view indicating what information should be
46   * included in the inventory resource. If unspecified, the default view is
47   * BASIC.
48   * @return Inventory
49   */
50  public function get($name, $optParams = [])
51  {
52    $params = ['name' => $name];
53    $params = array_merge($params, $optParams);
54    return $this->call('get', [$params], Inventory::class);
55  }
56  /**
57   * List inventory data for all VM instances in the specified zone.
58   * (inventories.listProjectsLocationsInstancesInventories)
59   *
60   * @param string $parent Required. The parent resource name. Format:
61   * `projects/{project}/locations/{location}/instances/-` For `{project}`, either
62   * `project-number` or `project-id` can be provided.
63   * @param array $optParams Optional parameters.
64   *
65   * @opt_param string filter If provided, this field specifies the criteria that
66   * must be met by a `Inventory` API resource to be included in the response.
67   * @opt_param int pageSize The maximum number of results to return.
68   * @opt_param string pageToken A pagination token returned from a previous call
69   * to `ListInventories` that indicates where this listing should continue from.
70   * @opt_param string view Inventory view indicating what information should be
71   * included in the inventory resource. If unspecified, the default view is
72   * BASIC.
73   * @return ListInventoriesResponse
74   */
75  public function listProjectsLocationsInstancesInventories($parent, $optParams = [])
76  {
77    $params = ['parent' => $parent];
78    $params = array_merge($params, $optParams);
79    return $this->call('list', [$params], ListInventoriesResponse::class);
80  }
81}
82
83// Adding a class alias for backwards compatibility with the previous class name.
84class_alias(ProjectsLocationsInstancesInventories::class, 'Google_Service_OSConfig_Resource_ProjectsLocationsInstancesInventories');
85