[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\CloudAsset\Resource;
|
---|
| 19 |
|
---|
| 20 | use 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 | */
|
---|
| 30 | class 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
|
---|
| 40 | * "folders/[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
|
---|
| 54 | * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
|
---|
| 55 | * supported asset types.
|
---|
| 56 | * @opt_param string contentType Asset content type. If not specified, no
|
---|
| 57 | * content but the asset name will be returned.
|
---|
| 58 | * @opt_param int pageSize The maximum number of assets to be returned in a
|
---|
| 59 | * single response. Default is 100, minimum is 1, and maximum is 1000.
|
---|
| 60 | * @opt_param string pageToken The `next_page_token` returned from the previous
|
---|
| 61 | * `ListAssetsResponse`, or unspecified for the first `ListAssetsRequest`. It is
|
---|
| 62 | * a continuation of a prior `ListAssets` call, and the API should return the
|
---|
| 63 | * next page of assets.
|
---|
| 64 | * @opt_param string readTime Timestamp to take an asset snapshot. This can only
|
---|
| 65 | * be set to a timestamp between the current time and the current time minus 35
|
---|
| 66 | * days (inclusive). If not specified, the current time will be used. Due to
|
---|
| 67 | * delays in resource data collection and indexing, there is a volatile window
|
---|
| 68 | * during which running the same query may get different results.
|
---|
| 69 | * @opt_param string relationshipTypes A list of relationship types to output,
|
---|
| 70 | * for example: `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified
|
---|
| 71 | * if content_type=RELATIONSHIP. * If specified: it snapshots specified
|
---|
| 72 | * relationships. It returns an error if any of the [relationship_types] doesn't
|
---|
| 73 | * belong to the supported relationship types of the [asset_types] or if any of
|
---|
| 74 | * the [asset_types] doesn't belong to the source types of the
|
---|
| 75 | * [relationship_types]. * Otherwise: it snapshots the supported relationships
|
---|
| 76 | * for all [asset_types] or returns an error if any of the [asset_types] has no
|
---|
| 77 | * relationship support. An unspecified asset types field means all supported
|
---|
| 78 | * asset_types. See [Introduction to Cloud Asset
|
---|
| 79 | * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
|
---|
| 80 | * supported asset types and relationship types.
|
---|
| 81 | * @return ListAssetsResponse
|
---|
| 82 | * @throws \Google\Service\Exception
|
---|
| 83 | */
|
---|
| 84 | public function listAssets($parent, $optParams = [])
|
---|
| 85 | {
|
---|
| 86 | $params = ['parent' => $parent];
|
---|
| 87 | $params = array_merge($params, $optParams);
|
---|
| 88 | return $this->call('list', [$params], ListAssetsResponse::class);
|
---|
| 89 | }
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 93 | class_alias(Assets::class, 'Google_Service_CloudAsset_Resource_Assets');
|
---|