Skip to content

Commit

Permalink
fix(proto): update the asset service proto and comments (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Jan 22, 2019
1 parent b05ea42 commit 637e560
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ service AssetService {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*}:exportAssets"
body: "*"
additional_bindings {
post: "/v1beta1/{parent=folders/*}:exportAssets"
body: "*"
}
additional_bindings {
post: "/v1beta1/{parent=organizations/*}:exportAssets"
body: "*"
Expand All @@ -64,20 +68,24 @@ service AssetService {

// Export asset request.
message ExportAssetsRequest {
// Required. The relative name of the root asset. This can only be an organization
// number (such as "organizations/123"), a project ID (such as
// "projects/my-project-id"), or a project number (such as "projects/12345").
// Required. The relative name of the root asset. This can only be an
// organization number (such as "organizations/123"), a project ID (such as
// "projects/my-project-id"), a project number (such as "projects/12345"), or
// a folder number (such as "folders/123").
string parent = 1;

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

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

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

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

Expand All @@ -143,10 +154,15 @@ message OutputConfig {

// A Cloud Storage location.
message GcsDestination {
// The path of the Cloud Storage objects. It's the same path that is used by
// gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
// for more information.
string uri = 1;
// Required.
oneof object_uri {
// The uri of the Cloud Storage object. It's the same uri that is used by
// gsutil. For example: "gs://bucket_name/object_name". See [Viewing and
// Editing Object
// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
// for more information.
string uri = 1;
}
}

// Asset content type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ message TemporalAsset {
Asset asset = 3;
}

// A time window of [start_time, end_time).
// A time window of (start_time, end_time].
message TimeWindow {
// Start time of the time window (inclusive).
// Start time of the time window (exclusive).
google.protobuf.Timestamp start_time = 1;

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

// Type of the asset. Example: "google.compute.disk".
// Type of the asset. Example: "google.compute.Disk".
string asset_type = 2;

// Representation of the resource.
Expand Down
33 changes: 20 additions & 13 deletions packages/google-cloud-asset/src/v1beta1/asset_service_client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -220,25 +220,29 @@ class AssetServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The relative name of the root asset. This can only be an organization
* number (such as "organizations/123"), a project ID (such as
* "projects/my-project-id"), or a project number (such as "projects/12345").
* Required. The relative name of the root asset. This can only be an
* organization number (such as "organizations/123"), a project ID (such as
* "projects/my-project-id"), a project number (such as "projects/12345"), or
* a folder number (such as "folders/123").
* @param {Object} request.outputConfig
* Required. Output configuration indicating where the results will be output
* to. All results will be in newline delimited JSON format.
*
* This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig}
* @param {Object} [request.readTime]
* Timestamp to take an asset snapshot. This can only be set to a timestamp in
* the past or of the current time. If not specified, the current time will be
* used. Due to delays in resource data collection and indexing, there is a
* volatile window during which running the same query may get different
* results.
* Timestamp to take an asset snapshot. This can only be set to a timestamp
* between 2018-10-02 UTC (inclusive) and the current time. If not specified,
* the current time will be used. Due to delays in resource data collection
* and indexing, there is a volatile window during which running the same
* query may get different results.
*
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
* @param {string[]} [request.assetTypes]
* A list of asset types of which to take a snapshot for. For example:
* "google.compute.disk". If specified, only matching assets will be returned.
* "google.compute.Disk". If specified, only matching assets will be returned.
* See [Introduction to Cloud Asset
* Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
* for all supported asset types.
* @param {number} [request.contentType]
* Asset content type. If not specified, no content but the asset name will be
* returned.
Expand Down Expand Up @@ -355,9 +359,12 @@ class AssetServiceClient {
*
* The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType}
* @param {Object} request.readTimeWindow
* Required. The time window for the asset history. The start time is
* required. The returned results contain all temporal assets whose time
* window overlap with read_time_window.
* Optional. The time window for the asset history. Both start_time and
* end_time are optional and if set, it must be after 2018-10-02 UTC. If
* end_time is not set, it is default to current timestamp. If start_time is
* not set, the snapshot of the assets at end_time will be returned. The
* returned results contain all temporal assets whose time window overlap with
* read_time_window.
*
* This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow}
* @param {string[]} [request.assetNames]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,22 +19,26 @@
* Export asset request.
*
* @property {string} parent
* Required. The relative name of the root asset. This can only be an organization
* number (such as "organizations/123"), a project ID (such as
* "projects/my-project-id"), or a project number (such as "projects/12345").
* Required. The relative name of the root asset. This can only be an
* organization number (such as "organizations/123"), a project ID (such as
* "projects/my-project-id"), a project number (such as "projects/12345"), or
* a folder number (such as "folders/123").
*
* @property {Object} readTime
* Timestamp to take an asset snapshot. This can only be set to a timestamp in
* the past or of the current time. If not specified, the current time will be
* used. Due to delays in resource data collection and indexing, there is a
* volatile window during which running the same query may get different
* results.
* Timestamp to take an asset snapshot. This can only be set to a timestamp
* between 2018-10-02 UTC (inclusive) and the current time. If not specified,
* the current time will be used. Due to delays in resource data collection
* and indexing, there is a volatile window during which running the same
* query may get different results.
*
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
*
* @property {string[]} assetTypes
* A list of asset types of which to take a snapshot for. For example:
* "google.compute.disk". If specified, only matching assets will be returned.
* "google.compute.Disk". If specified, only matching assets will be returned.
* See [Introduction to Cloud Asset
* Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
* for all supported asset types.
*
* @property {number} contentType
* Asset content type. If not specified, no content but the asset name will be
Expand Down Expand Up @@ -103,9 +107,12 @@ const ExportAssetsResponse = {
* The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType}
*
* @property {Object} readTimeWindow
* Required. The time window for the asset history. The start time is
* required. The returned results contain all temporal assets whose time
* window overlap with read_time_window.
* Optional. The time window for the asset history. Both start_time and
* end_time are optional and if set, it must be after 2018-10-02 UTC. If
* end_time is not set, it is default to current timestamp. If start_time is
* not set, the snapshot of the assets at end_time will be returned. The
* returned results contain all temporal assets whose time window overlap with
* read_time_window.
*
* This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow}
*
Expand Down Expand Up @@ -153,8 +160,10 @@ const OutputConfig = {
* A Cloud Storage location.
*
* @property {string} uri
* The path of the Cloud Storage objects. It's the same path that is used by
* gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
* The uri of the Cloud Storage object. It's the same uri that is used by
* gsutil. For example: "gs://bucket_name/object_name". See [Viewing and
* Editing Object
* Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
* for more information.
*
* @typedef GcsDestination
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,15 +41,15 @@ const TemporalAsset = {
};

/**
* A time window of [start_time, end_time).
* A time window of (start_time, end_time].
*
* @property {Object} startTime
* Start time of the time window (inclusive).
* Start time of the time window (exclusive).
*
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
*
* @property {Object} endTime
* End time of the time window (exclusive).
* End time of the time window (inclusive).
* Current timestamp if not specified.
*
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
Expand All @@ -72,7 +72,7 @@ const TimeWindow = {
* for more information.
*
* @property {string} assetType
* Type of the asset. Example: "google.compute.disk".
* Type of the asset. Example: "google.compute.Disk".
*
* @property {Object} resource
* Representation of the resource.
Expand Down Expand Up @@ -141,4 +141,4 @@ const Asset = {
*/
const Resource = {
// This is for documentation. Actual contents will be loaded by gRPC.
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-asset/src/v1beta1/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
12 changes: 6 additions & 6 deletions packages/google-cloud-asset/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"updateTime": "2019-01-16T12:23:48.319165Z",
"updateTime": "2019-01-22T12:19:14.185087Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.5",
"dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c"
"version": "0.16.7",
"dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "7a81902f287a4ac2ac130994889c80f87f91d035",
"internalRef": "229452079"
"sha": "96adaf6de4fa2cabbdd5de560a367bb488e0639b",
"internalRef": "229998977"
}
},
{
"template": {
"name": "node_library",
"origin": "synthtool.gcp",
"version": "2018.12.6"
"version": "2019.1.16"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-asset/test/gapic-v1beta1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 637e560

Please sign in to comment.