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\CloudAsset\Resource;
19
20use Google\Service\CloudAsset\ListAssetsResponse;
21
22/**
23 * The "assets" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $cloudassetService = new Google\Service\CloudAsset(...);
27 *   $assets = $cloudassetService->assets;
28 *  </code>
29 */
30class Assets extends \Google\Service\Resource
31{
32  /**
33   * Lists assets with time and resource types and returns paged results in
34   * response. (assets.listAssets)
35   *
36   * @param string $parent Required. Name of the organization, folder, or project
37   * the assets belong to. Format: "organizations/[organization-number]" (such as
38   * "organizations/123"), "projects/[project-id]" (such as "projects/my-project-
39   * id"), "projects/[project-number]" (such as "projects/12345"), or "folders
40   * /[folder-number]" (such as "folders/12345").
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string assetTypes A list of asset types to take a snapshot for.
44   * For example: "compute.googleapis.com/Disk". Regular expression is also
45   * supported. For example: * "compute.googleapis.com.*" snapshots resources
46   * whose asset type starts with "compute.googleapis.com". * ".*Instance"
47   * snapshots resources whose asset type ends with "Instance". * ".*Instance.*"
48   * snapshots resources whose asset type contains "Instance". See
49   * [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular
50   * expression syntax. If the regular expression does not match any supported
51   * asset type, an INVALID_ARGUMENT error will be returned. If specified, only
52   * matching assets will be returned, otherwise, it will snapshot all asset
53   * types. See [Introduction to Cloud Asset Inventory](https://cloud.google.com
54   * /asset-inventory/docs/overview) for all supported asset types.
55   * @opt_param string contentType Asset content type. If not specified, no
56   * content but the asset name will be returned.
57   * @opt_param int pageSize The maximum number of assets to be returned in a
58   * single response. Default is 100, minimum is 1, and maximum is 1000.
59   * @opt_param string pageToken The `next_page_token` returned from the previous
60   * `ListAssetsResponse`, or unspecified for the first `ListAssetsRequest`. It is
61   * a continuation of a prior `ListAssets` call, and the API should return the
62   * next page of assets.
63   * @opt_param string readTime Timestamp to take an asset snapshot. This can only
64   * be set to a timestamp between the current time and the current time minus 35
65   * days (inclusive). If not specified, the current time will be used. Due to
66   * delays in resource data collection and indexing, there is a volatile window
67   * during which running the same query may get different results.
68   * @opt_param string relationshipTypes A list of relationship types to output,
69   * for example: `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified
70   * if content_type=RELATIONSHIP. * If specified: it snapshots specified
71   * relationships. It returns an error if any of the [relationship_types] doesn't
72   * belong to the supported relationship types of the [asset_types] or if any of
73   * the [asset_types] doesn't belong to the source types of the
74   * [relationship_types]. * Otherwise: it snapshots the supported relationships
75   * for all [asset_types] or returns an error if any of the [asset_types] has no
76   * relationship support. An unspecified asset types field means all supported
77   * asset_types. See [Introduction to Cloud Asset
78   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
79   * supported asset types and relationship types.
80   * @return ListAssetsResponse
81   */
82  public function listAssets($parent, $optParams = [])
83  {
84    $params = ['parent' => $parent];
85    $params = array_merge($params, $optParams);
86    return $this->call('list', [$params], ListAssetsResponse::class);
87  }
88}
89
90// Adding a class alias for backwards compatibility with the previous class name.
91class_alias(Assets::class, 'Google_Service_CloudAsset_Resource_Assets');
92