Skip to content

Commit 637e560

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
fix(proto): update the asset service proto and comments (#90)
1 parent b05ea42 commit 637e560

14 files changed

Lines changed: 100 additions & 68 deletions

File tree

packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ service AssetService {
4040
option (google.api.http) = {
4141
post: "/v1beta1/{parent=projects/*}:exportAssets"
4242
body: "*"
43+
additional_bindings {
44+
post: "/v1beta1/{parent=folders/*}:exportAssets"
45+
body: "*"
46+
}
4347
additional_bindings {
4448
post: "/v1beta1/{parent=organizations/*}:exportAssets"
4549
body: "*"
@@ -64,20 +68,24 @@ service AssetService {
6468

6569
// Export asset request.
6670
message ExportAssetsRequest {
67-
// Required. The relative name of the root asset. This can only be an organization
68-
// number (such as "organizations/123"), a project ID (such as
69-
// "projects/my-project-id"), or a project number (such as "projects/12345").
71+
// Required. The relative name of the root asset. This can only be an
72+
// organization number (such as "organizations/123"), a project ID (such as
73+
// "projects/my-project-id"), a project number (such as "projects/12345"), or
74+
// a folder number (such as "folders/123").
7075
string parent = 1;
7176

72-
// Timestamp to take an asset snapshot. This can only be set to a timestamp in
73-
// the past or of the current time. If not specified, the current time will be
74-
// used. Due to delays in resource data collection and indexing, there is a
75-
// volatile window during which running the same query may get different
76-
// results.
77+
// Timestamp to take an asset snapshot. This can only be set to a timestamp
78+
// between 2018-10-02 UTC (inclusive) and the current time. If not specified,
79+
// the current time will be used. Due to delays in resource data collection
80+
// and indexing, there is a volatile window during which running the same
81+
// query may get different results.
7782
google.protobuf.Timestamp read_time = 2;
7883

7984
// A list of asset types of which to take a snapshot for. For example:
80-
// "google.compute.disk". If specified, only matching assets will be returned.
85+
// "google.compute.Disk". If specified, only matching assets will be returned.
86+
// See [Introduction to Cloud Asset
87+
// Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
88+
// for all supported asset types.
8189
repeated string asset_types = 3;
8290

8391
// Asset content type. If not specified, no content but the asset name will be
@@ -120,9 +128,12 @@ message BatchGetAssetsHistoryRequest {
120128
// Required. The content type.
121129
ContentType content_type = 3;
122130

123-
// Required. The time window for the asset history. The start time is
124-
// required. The returned results contain all temporal assets whose time
125-
// window overlap with read_time_window.
131+
// Optional. The time window for the asset history. Both start_time and
132+
// end_time are optional and if set, it must be after 2018-10-02 UTC. If
133+
// end_time is not set, it is default to current timestamp. If start_time is
134+
// not set, the snapshot of the assets at end_time will be returned. The
135+
// returned results contain all temporal assets whose time window overlap with
136+
// read_time_window.
126137
TimeWindow read_time_window = 4;
127138
}
128139

@@ -143,10 +154,15 @@ message OutputConfig {
143154

144155
// A Cloud Storage location.
145156
message GcsDestination {
146-
// The path of the Cloud Storage objects. It's the same path that is used by
147-
// gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
148-
// for more information.
149-
string uri = 1;
157+
// Required.
158+
oneof object_uri {
159+
// The uri of the Cloud Storage object. It's the same uri that is used by
160+
// gsutil. For example: "gs://bucket_name/object_name". See [Viewing and
161+
// Editing Object
162+
// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
163+
// for more information.
164+
string uri = 1;
165+
}
150166
}
151167

152168
// Asset content type.

packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ message TemporalAsset {
4444
Asset asset = 3;
4545
}
4646

47-
// A time window of [start_time, end_time).
47+
// A time window of (start_time, end_time].
4848
message TimeWindow {
49-
// Start time of the time window (inclusive).
49+
// Start time of the time window (exclusive).
5050
google.protobuf.Timestamp start_time = 1;
5151

52-
// End time of the time window (exclusive).
52+
// End time of the time window (inclusive).
5353
// Current timestamp if not specified.
5454
google.protobuf.Timestamp end_time = 2;
5555
}
@@ -62,7 +62,7 @@ message Asset {
6262
// for more information.
6363
string name = 1;
6464

65-
// Type of the asset. Example: "google.compute.disk".
65+
// Type of the asset. Example: "google.compute.Disk".
6666
string asset_type = 2;
6767

6868
// Representation of the resource.

packages/google-cloud-asset/src/v1beta1/asset_service_client.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -220,25 +220,29 @@ class AssetServiceClient {
220220
* @param {Object} request
221221
* The request object that will be sent.
222222
* @param {string} request.parent
223-
* Required. The relative name of the root asset. This can only be an organization
224-
* number (such as "organizations/123"), a project ID (such as
225-
* "projects/my-project-id"), or a project number (such as "projects/12345").
223+
* Required. The relative name of the root asset. This can only be an
224+
* organization number (such as "organizations/123"), a project ID (such as
225+
* "projects/my-project-id"), a project number (such as "projects/12345"), or
226+
* a folder number (such as "folders/123").
226227
* @param {Object} request.outputConfig
227228
* Required. Output configuration indicating where the results will be output
228229
* to. All results will be in newline delimited JSON format.
229230
*
230231
* This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig}
231232
* @param {Object} [request.readTime]
232-
* Timestamp to take an asset snapshot. This can only be set to a timestamp in
233-
* the past or of the current time. If not specified, the current time will be
234-
* used. Due to delays in resource data collection and indexing, there is a
235-
* volatile window during which running the same query may get different
236-
* results.
233+
* Timestamp to take an asset snapshot. This can only be set to a timestamp
234+
* between 2018-10-02 UTC (inclusive) and the current time. If not specified,
235+
* the current time will be used. Due to delays in resource data collection
236+
* and indexing, there is a volatile window during which running the same
237+
* query may get different results.
237238
*
238239
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
239240
* @param {string[]} [request.assetTypes]
240241
* A list of asset types of which to take a snapshot for. For example:
241-
* "google.compute.disk". If specified, only matching assets will be returned.
242+
* "google.compute.Disk". If specified, only matching assets will be returned.
243+
* See [Introduction to Cloud Asset
244+
* Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
245+
* for all supported asset types.
242246
* @param {number} [request.contentType]
243247
* Asset content type. If not specified, no content but the asset name will be
244248
* returned.
@@ -355,9 +359,12 @@ class AssetServiceClient {
355359
*
356360
* The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType}
357361
* @param {Object} request.readTimeWindow
358-
* Required. The time window for the asset history. The start time is
359-
* required. The returned results contain all temporal assets whose time
360-
* window overlap with read_time_window.
362+
* Optional. The time window for the asset history. Both start_time and
363+
* end_time are optional and if set, it must be after 2018-10-02 UTC. If
364+
* end_time is not set, it is default to current timestamp. If start_time is
365+
* not set, the snapshot of the assets at end_time will be returned. The
366+
* returned results contain all temporal assets whose time window overlap with
367+
* read_time_window.
361368
*
362369
* This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow}
363370
* @param {string[]} [request.assetNames]

packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,22 +19,26 @@
1919
* Export asset request.
2020
*
2121
* @property {string} parent
22-
* Required. The relative name of the root asset. This can only be an organization
23-
* number (such as "organizations/123"), a project ID (such as
24-
* "projects/my-project-id"), or a project number (such as "projects/12345").
22+
* Required. The relative name of the root asset. This can only be an
23+
* organization number (such as "organizations/123"), a project ID (such as
24+
* "projects/my-project-id"), a project number (such as "projects/12345"), or
25+
* a folder number (such as "folders/123").
2526
*
2627
* @property {Object} readTime
27-
* Timestamp to take an asset snapshot. This can only be set to a timestamp in
28-
* the past or of the current time. If not specified, the current time will be
29-
* used. Due to delays in resource data collection and indexing, there is a
30-
* volatile window during which running the same query may get different
31-
* results.
28+
* Timestamp to take an asset snapshot. This can only be set to a timestamp
29+
* between 2018-10-02 UTC (inclusive) and the current time. If not specified,
30+
* the current time will be used. Due to delays in resource data collection
31+
* and indexing, there is a volatile window during which running the same
32+
* query may get different results.
3233
*
3334
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
3435
*
3536
* @property {string[]} assetTypes
3637
* A list of asset types of which to take a snapshot for. For example:
37-
* "google.compute.disk". If specified, only matching assets will be returned.
38+
* "google.compute.Disk". If specified, only matching assets will be returned.
39+
* See [Introduction to Cloud Asset
40+
* Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
41+
* for all supported asset types.
3842
*
3943
* @property {number} contentType
4044
* Asset content type. If not specified, no content but the asset name will be
@@ -103,9 +107,12 @@ const ExportAssetsResponse = {
103107
* The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType}
104108
*
105109
* @property {Object} readTimeWindow
106-
* Required. The time window for the asset history. The start time is
107-
* required. The returned results contain all temporal assets whose time
108-
* window overlap with read_time_window.
110+
* Optional. The time window for the asset history. Both start_time and
111+
* end_time are optional and if set, it must be after 2018-10-02 UTC. If
112+
* end_time is not set, it is default to current timestamp. If start_time is
113+
* not set, the snapshot of the assets at end_time will be returned. The
114+
* returned results contain all temporal assets whose time window overlap with
115+
* read_time_window.
109116
*
110117
* This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow}
111118
*
@@ -153,8 +160,10 @@ const OutputConfig = {
153160
* A Cloud Storage location.
154161
*
155162
* @property {string} uri
156-
* The path of the Cloud Storage objects. It's the same path that is used by
157-
* gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
163+
* The uri of the Cloud Storage object. It's the same uri that is used by
164+
* gsutil. For example: "gs://bucket_name/object_name". See [Viewing and
165+
* Editing Object
166+
* Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
158167
* for more information.
159168
*
160169
* @typedef GcsDestination

packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -41,15 +41,15 @@ const TemporalAsset = {
4141
};
4242

4343
/**
44-
* A time window of [start_time, end_time).
44+
* A time window of (start_time, end_time].
4545
*
4646
* @property {Object} startTime
47-
* Start time of the time window (inclusive).
47+
* Start time of the time window (exclusive).
4848
*
4949
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
5050
*
5151
* @property {Object} endTime
52-
* End time of the time window (exclusive).
52+
* End time of the time window (inclusive).
5353
* Current timestamp if not specified.
5454
*
5555
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
@@ -72,7 +72,7 @@ const TimeWindow = {
7272
* for more information.
7373
*
7474
* @property {string} assetType
75-
* Type of the asset. Example: "google.compute.disk".
75+
* Type of the asset. Example: "google.compute.Disk".
7676
*
7777
* @property {Object} resource
7878
* Representation of the resource.
@@ -141,4 +141,4 @@ const Asset = {
141141
*/
142142
const Resource = {
143143
// This is for documentation. Actual contents will be loaded by gRPC.
144-
};
144+
};

packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)