google-cloud-asset 0.8.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +272 -0
- data/README.md +36 -24
- data/lib/{google/cloud/asset/v1/doc/google/protobuf/empty.rb → google-cloud-asset.rb} +4 -14
- data/lib/google/cloud/asset.rb +76 -116
- data/lib/google/cloud/asset/version.rb +1 -1
- metadata +73 -78
- data/LICENSE +0 -201
- data/lib/google/cloud/asset/v1.rb +0 -146
- data/lib/google/cloud/asset/v1/asset_service_client.rb +0 -669
- data/lib/google/cloud/asset/v1/asset_service_client_config.json +0 -61
- data/lib/google/cloud/asset/v1/asset_service_pb.rb +0 -123
- data/lib/google/cloud/asset/v1/asset_service_services_pb.rb +0 -69
- data/lib/google/cloud/asset/v1/assets_pb.rb +0 -51
- data/lib/google/cloud/asset/v1/credentials.rb +0 -41
- data/lib/google/cloud/asset/v1/doc/google/cloud/asset/v1/asset_service.rb +0 -295
- data/lib/google/cloud/asset/v1/doc/google/cloud/asset/v1/assets.rb +0 -116
- data/lib/google/cloud/asset/v1/doc/google/iam/v1/policy.rb +0 -151
- data/lib/google/cloud/asset/v1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/asset/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/asset/v1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/asset/v1/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/asset/v1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/asset/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/asset/v1/doc/google/type/expr.rb +0 -45
- data/lib/google/cloud/asset/v1/helpers.rb +0 -39
- data/lib/google/cloud/asset/v1beta1.rb +0 -146
- data/lib/google/cloud/asset/v1beta1/asset_service_client.rb +0 -400
- data/lib/google/cloud/asset/v1beta1/asset_service_client_config.json +0 -36
- data/lib/google/cloud/asset/v1beta1/asset_service_pb.rb +0 -67
- data/lib/google/cloud/asset/v1beta1/asset_service_services_pb.rb +0 -59
- data/lib/google/cloud/asset/v1beta1/assets_pb.rb +0 -50
- data/lib/google/cloud/asset/v1beta1/credentials.rb +0 -41
- data/lib/google/cloud/asset/v1beta1/doc/google/cloud/asset/v1beta1/asset_service.rb +0 -140
- data/lib/google/cloud/asset/v1beta1/doc/google/cloud/asset/v1beta1/assets.rb +0 -108
- data/lib/google/cloud/asset/v1beta1/doc/google/iam/v1/policy.rb +0 -151
- data/lib/google/cloud/asset/v1beta1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/asset/v1beta1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/asset/v1beta1/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/asset/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/asset/v1beta1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/asset/v1beta1/doc/google/type/expr.rb +0 -45
- data/lib/google/cloud/asset/v1beta1/helpers.rb +0 -31
- data/lib/google/cloud/orgpolicy/v1/doc/google/cloud/orgpolicy/v1/orgpolicy.rb +0 -308
- data/lib/google/cloud/orgpolicy/v1/orgpolicy_pb.rb +0 -55
data/LICENSE
DELETED
@@ -1,201 +0,0 @@
|
|
1
|
-
Apache License
|
2
|
-
Version 2.0, January 2004
|
3
|
-
https://www.apache.org/licenses/
|
4
|
-
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
-
|
7
|
-
1. Definitions.
|
8
|
-
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
-
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
-
the copyright owner that is granting the License.
|
14
|
-
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
-
other entities that control, are controlled by, or are under common
|
17
|
-
control with that entity. For the purposes of this definition,
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
19
|
-
direction or management of such entity, whether by contract or
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
-
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
-
exercising permissions granted by this License.
|
25
|
-
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
27
|
-
including but not limited to software source code, documentation
|
28
|
-
source, and configuration files.
|
29
|
-
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
31
|
-
transformation or translation of a Source form, including but
|
32
|
-
not limited to compiled object code, generated documentation,
|
33
|
-
and conversions to other media types.
|
34
|
-
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
36
|
-
Object form, made available under the License, as indicated by a
|
37
|
-
copyright notice that is included in or attached to the work
|
38
|
-
(an example is provided in the Appendix below).
|
39
|
-
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
-
the Work and Derivative Works thereof.
|
47
|
-
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
49
|
-
the original version of the Work and any modifications or additions
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
-
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
64
|
-
subsequently incorporated within the Work.
|
65
|
-
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
72
|
-
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
-
where such license applies only to those patent claims licensable
|
79
|
-
by such Contributor that are necessarily infringed by their
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
82
|
-
institute patent litigation against any entity (including a
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
85
|
-
or contributory patent infringement, then any patent licenses
|
86
|
-
granted to You under this License for that Work shall terminate
|
87
|
-
as of the date such litigation is filed.
|
88
|
-
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
91
|
-
modifications, and in Source or Object form, provided that You
|
92
|
-
meet the following conditions:
|
93
|
-
|
94
|
-
(a) You must give any other recipients of the Work or
|
95
|
-
Derivative Works a copy of this License; and
|
96
|
-
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
98
|
-
stating that You changed the files; and
|
99
|
-
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
102
|
-
attribution notices from the Source form of the Work,
|
103
|
-
excluding those notices that do not pertain to any part of
|
104
|
-
the Derivative Works; and
|
105
|
-
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
108
|
-
include a readable copy of the attribution notices contained
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
111
|
-
of the following places: within a NOTICE text file distributed
|
112
|
-
as part of the Derivative Works; within the Source form or
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
114
|
-
within a display generated by the Derivative Works, if and
|
115
|
-
wherever such third-party notices normally appear. The contents
|
116
|
-
of the NOTICE file are for informational purposes only and
|
117
|
-
do not modify the License. You may add Your own attribution
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
120
|
-
that such additional attribution notices cannot be construed
|
121
|
-
as modifying the License.
|
122
|
-
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
124
|
-
may provide additional or different license terms and conditions
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
128
|
-
the conditions stated in this License.
|
129
|
-
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
133
|
-
this License, without any additional terms or conditions.
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
-
the terms of any separate license agreement you may have executed
|
136
|
-
with Licensor regarding such Contributions.
|
137
|
-
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
140
|
-
except as required for reasonable and customary use in describing the
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
-
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
152
|
-
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
158
|
-
incidental, or consequential damages of any character arising as a
|
159
|
-
result of this License or out of the use or inability to use the
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
162
|
-
other commercial damages or losses), even if such Contributor
|
163
|
-
has been advised of the possibility of such damages.
|
164
|
-
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
-
or other liability obligations and/or rights consistent with this
|
169
|
-
License. However, in accepting such obligations, You may act only
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
174
|
-
of your accepting any such warranty or additional liability.
|
175
|
-
|
176
|
-
END OF TERMS AND CONDITIONS
|
177
|
-
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
179
|
-
|
180
|
-
To apply the Apache License to your work, attach the following
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
-
replaced with your own identifying information. (Don't include
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
184
|
-
comment syntax for the file format. We also recommend that a
|
185
|
-
file or class name and description of purpose be included on the
|
186
|
-
same "printed page" as the copyright notice for easier
|
187
|
-
identification within third-party archives.
|
188
|
-
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
190
|
-
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
-
you may not use this file except in compliance with the License.
|
193
|
-
You may obtain a copy of the License at
|
194
|
-
|
195
|
-
https://www.apache.org/licenses/LICENSE-2.0
|
196
|
-
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
-
See the License for the specific language governing permissions and
|
201
|
-
limitations under the License.
|
@@ -1,146 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
require "google/cloud/asset/v1/asset_service_client"
|
17
|
-
require "google/cloud/asset/v1/helpers"
|
18
|
-
|
19
|
-
module Google
|
20
|
-
module Cloud
|
21
|
-
module Asset
|
22
|
-
# rubocop:disable LineLength
|
23
|
-
|
24
|
-
##
|
25
|
-
# # Ruby Client for Cloud Asset API
|
26
|
-
#
|
27
|
-
# [Cloud Asset API][Product Documentation]:
|
28
|
-
# The cloud asset API manages the history and inventory of cloud resources.
|
29
|
-
# - [Product Documentation][]
|
30
|
-
#
|
31
|
-
# ## Quick Start
|
32
|
-
# In order to use this library, you first need to go through the following
|
33
|
-
# steps:
|
34
|
-
#
|
35
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
36
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
37
|
-
# 3. [Enable the Cloud Asset API.](https://console.cloud.google.com/apis/library/asset.googleapis.com)
|
38
|
-
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-asset/latest/file.AUTHENTICATION.html)
|
39
|
-
#
|
40
|
-
# ### Installation
|
41
|
-
# ```
|
42
|
-
# $ gem install google-cloud-asset
|
43
|
-
# ```
|
44
|
-
#
|
45
|
-
# ### Next Steps
|
46
|
-
# - Read the [Cloud Asset API Product documentation][Product Documentation]
|
47
|
-
# to learn more about the product and see How-to Guides.
|
48
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
49
|
-
# to see the full list of Cloud APIs that we cover.
|
50
|
-
#
|
51
|
-
# [Product Documentation]: https://cloud.google.com/resource-manager
|
52
|
-
#
|
53
|
-
# ## Enabling Logging
|
54
|
-
#
|
55
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
56
|
-
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
57
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
58
|
-
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
59
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
60
|
-
#
|
61
|
-
# Configuring a Ruby stdlib logger:
|
62
|
-
#
|
63
|
-
# ```ruby
|
64
|
-
# require "logger"
|
65
|
-
#
|
66
|
-
# module MyLogger
|
67
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
68
|
-
# def logger
|
69
|
-
# LOGGER
|
70
|
-
# end
|
71
|
-
# end
|
72
|
-
#
|
73
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
74
|
-
# module GRPC
|
75
|
-
# extend MyLogger
|
76
|
-
# end
|
77
|
-
# ```
|
78
|
-
#
|
79
|
-
module V1
|
80
|
-
# rubocop:enable LineLength
|
81
|
-
|
82
|
-
##
|
83
|
-
# Asset service definition.
|
84
|
-
#
|
85
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
86
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
87
|
-
# be many types.
|
88
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
89
|
-
# authenticating requests made by this client.
|
90
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
91
|
-
# credentials for this client.
|
92
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
93
|
-
# credentials for this client.
|
94
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
95
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
96
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
97
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
98
|
-
# metadata for requests, generally, to give OAuth credentials.
|
99
|
-
# @param scopes [Array<String>]
|
100
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
101
|
-
# an updater_proc is supplied.
|
102
|
-
# @param client_config [Hash]
|
103
|
-
# A Hash for call options for each method. See
|
104
|
-
# Google::Gax#construct_settings for the structure of
|
105
|
-
# this data. Falls back to the default config if not specified
|
106
|
-
# or the specified config is missing data points.
|
107
|
-
# @param timeout [Numeric]
|
108
|
-
# The default timeout, in seconds, for calls made through this client.
|
109
|
-
# @param metadata [Hash]
|
110
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
111
|
-
# @param service_address [String]
|
112
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
113
|
-
# @param service_port [Integer]
|
114
|
-
# Override for the service port, or `nil` to leave as the default.
|
115
|
-
# @param exception_transformer [Proc]
|
116
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
117
|
-
# custom error handling.
|
118
|
-
def self.new \
|
119
|
-
credentials: nil,
|
120
|
-
scopes: nil,
|
121
|
-
client_config: nil,
|
122
|
-
timeout: nil,
|
123
|
-
metadata: nil,
|
124
|
-
service_address: nil,
|
125
|
-
service_port: nil,
|
126
|
-
exception_transformer: nil,
|
127
|
-
lib_name: nil,
|
128
|
-
lib_version: nil
|
129
|
-
kwargs = {
|
130
|
-
credentials: credentials,
|
131
|
-
scopes: scopes,
|
132
|
-
client_config: client_config,
|
133
|
-
timeout: timeout,
|
134
|
-
metadata: metadata,
|
135
|
-
exception_transformer: exception_transformer,
|
136
|
-
lib_name: lib_name,
|
137
|
-
service_address: service_address,
|
138
|
-
service_port: service_port,
|
139
|
-
lib_version: lib_version
|
140
|
-
}.select { |_, v| v != nil }
|
141
|
-
Google::Cloud::Asset::V1::AssetServiceClient.new(**kwargs)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
@@ -1,669 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#
|
15
|
-
# EDITING INSTRUCTIONS
|
16
|
-
# This file was generated from the file
|
17
|
-
# https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto,
|
18
|
-
# and updates to that file get reflected here through a refresh process.
|
19
|
-
# For the short term, the refresh process will only be runnable by Google
|
20
|
-
# engineers.
|
21
|
-
|
22
|
-
|
23
|
-
require "json"
|
24
|
-
require "pathname"
|
25
|
-
|
26
|
-
require "google/gax"
|
27
|
-
require "google/gax/operation"
|
28
|
-
require "google/longrunning/operations_client"
|
29
|
-
|
30
|
-
require "google/cloud/asset/v1/asset_service_pb"
|
31
|
-
require "google/cloud/asset/v1/credentials"
|
32
|
-
require "google/cloud/asset/version"
|
33
|
-
|
34
|
-
module Google
|
35
|
-
module Cloud
|
36
|
-
module Asset
|
37
|
-
module V1
|
38
|
-
# Asset service definition.
|
39
|
-
#
|
40
|
-
# @!attribute [r] asset_service_stub
|
41
|
-
# @return [Google::Cloud::Asset::V1::AssetService::Stub]
|
42
|
-
class AssetServiceClient
|
43
|
-
# @private
|
44
|
-
attr_reader :asset_service_stub
|
45
|
-
|
46
|
-
# The default address of the service.
|
47
|
-
SERVICE_ADDRESS = "cloudasset.googleapis.com".freeze
|
48
|
-
|
49
|
-
# The default port of the service.
|
50
|
-
DEFAULT_SERVICE_PORT = 443
|
51
|
-
|
52
|
-
# The default set of gRPC interceptors.
|
53
|
-
GRPC_INTERCEPTORS = []
|
54
|
-
|
55
|
-
DEFAULT_TIMEOUT = 30
|
56
|
-
|
57
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
58
|
-
# this service.
|
59
|
-
ALL_SCOPES = [
|
60
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
61
|
-
].freeze
|
62
|
-
|
63
|
-
# @private
|
64
|
-
class OperationsClient < Google::Longrunning::OperationsClient
|
65
|
-
self::SERVICE_ADDRESS = AssetServiceClient::SERVICE_ADDRESS
|
66
|
-
self::GRPC_INTERCEPTORS = AssetServiceClient::GRPC_INTERCEPTORS
|
67
|
-
end
|
68
|
-
|
69
|
-
FEED_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
70
|
-
"projects/{project}/feeds/{feed}"
|
71
|
-
)
|
72
|
-
|
73
|
-
private_constant :FEED_PATH_TEMPLATE
|
74
|
-
|
75
|
-
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
76
|
-
"projects/{project}"
|
77
|
-
)
|
78
|
-
|
79
|
-
private_constant :PROJECT_PATH_TEMPLATE
|
80
|
-
|
81
|
-
# Returns a fully-qualified feed resource name string.
|
82
|
-
# @param project [String]
|
83
|
-
# @param feed [String]
|
84
|
-
# @return [String]
|
85
|
-
def self.feed_path project, feed
|
86
|
-
FEED_PATH_TEMPLATE.render(
|
87
|
-
:"project" => project,
|
88
|
-
:"feed" => feed
|
89
|
-
)
|
90
|
-
end
|
91
|
-
|
92
|
-
# Returns a fully-qualified project resource name string.
|
93
|
-
# @param project [String]
|
94
|
-
# @return [String]
|
95
|
-
def self.project_path project
|
96
|
-
PROJECT_PATH_TEMPLATE.render(
|
97
|
-
:"project" => project
|
98
|
-
)
|
99
|
-
end
|
100
|
-
|
101
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
102
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
103
|
-
# be many types.
|
104
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
105
|
-
# authenticating requests made by this client.
|
106
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
107
|
-
# credentials for this client.
|
108
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
109
|
-
# credentials for this client.
|
110
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
111
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
112
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
113
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
114
|
-
# metadata for requests, generally, to give OAuth credentials.
|
115
|
-
# @param scopes [Array<String>]
|
116
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
117
|
-
# an updater_proc is supplied.
|
118
|
-
# @param client_config [Hash]
|
119
|
-
# A Hash for call options for each method. See
|
120
|
-
# Google::Gax#construct_settings for the structure of
|
121
|
-
# this data. Falls back to the default config if not specified
|
122
|
-
# or the specified config is missing data points.
|
123
|
-
# @param timeout [Numeric]
|
124
|
-
# The default timeout, in seconds, for calls made through this client.
|
125
|
-
# @param metadata [Hash]
|
126
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
127
|
-
# @param service_address [String]
|
128
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
129
|
-
# @param service_port [Integer]
|
130
|
-
# Override for the service port, or `nil` to leave as the default.
|
131
|
-
# @param exception_transformer [Proc]
|
132
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
133
|
-
# custom error handling.
|
134
|
-
def initialize \
|
135
|
-
credentials: nil,
|
136
|
-
scopes: ALL_SCOPES,
|
137
|
-
client_config: {},
|
138
|
-
timeout: DEFAULT_TIMEOUT,
|
139
|
-
metadata: nil,
|
140
|
-
service_address: nil,
|
141
|
-
service_port: nil,
|
142
|
-
exception_transformer: nil,
|
143
|
-
lib_name: nil,
|
144
|
-
lib_version: ""
|
145
|
-
# These require statements are intentionally placed here to initialize
|
146
|
-
# the gRPC module only when it's required.
|
147
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
148
|
-
require "google/gax/grpc"
|
149
|
-
require "google/cloud/asset/v1/asset_service_services_pb"
|
150
|
-
|
151
|
-
credentials ||= Google::Cloud::Asset::V1::Credentials.default
|
152
|
-
|
153
|
-
@operations_client = OperationsClient.new(
|
154
|
-
credentials: credentials,
|
155
|
-
scopes: scopes,
|
156
|
-
client_config: client_config,
|
157
|
-
timeout: timeout,
|
158
|
-
lib_name: lib_name,
|
159
|
-
service_address: service_address,
|
160
|
-
service_port: service_port,
|
161
|
-
lib_version: lib_version,
|
162
|
-
metadata: metadata,
|
163
|
-
)
|
164
|
-
|
165
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
166
|
-
updater_proc = Google::Cloud::Asset::V1::Credentials.new(credentials).updater_proc
|
167
|
-
end
|
168
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
169
|
-
channel = credentials
|
170
|
-
end
|
171
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
172
|
-
chan_creds = credentials
|
173
|
-
end
|
174
|
-
if credentials.is_a?(Proc)
|
175
|
-
updater_proc = credentials
|
176
|
-
end
|
177
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
178
|
-
updater_proc = credentials.updater_proc
|
179
|
-
end
|
180
|
-
|
181
|
-
package_version = Google::Cloud::Asset::VERSION
|
182
|
-
|
183
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
184
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
185
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
186
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
187
|
-
google_api_client.freeze
|
188
|
-
|
189
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
190
|
-
if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
|
191
|
-
headers[:"x-goog-user-project"] = credentials.quota_project_id
|
192
|
-
end
|
193
|
-
headers.merge!(metadata) unless metadata.nil?
|
194
|
-
client_config_file = Pathname.new(__dir__).join(
|
195
|
-
"asset_service_client_config.json"
|
196
|
-
)
|
197
|
-
defaults = client_config_file.open do |f|
|
198
|
-
Google::Gax.construct_settings(
|
199
|
-
"google.cloud.asset.v1.AssetService",
|
200
|
-
JSON.parse(f.read),
|
201
|
-
client_config,
|
202
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
203
|
-
timeout,
|
204
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
205
|
-
metadata: headers
|
206
|
-
)
|
207
|
-
end
|
208
|
-
|
209
|
-
# Allow overriding the service path/port in subclasses.
|
210
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
211
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
212
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
213
|
-
@asset_service_stub = Google::Gax::Grpc.create_stub(
|
214
|
-
service_path,
|
215
|
-
port,
|
216
|
-
chan_creds: chan_creds,
|
217
|
-
channel: channel,
|
218
|
-
updater_proc: updater_proc,
|
219
|
-
scopes: scopes,
|
220
|
-
interceptors: interceptors,
|
221
|
-
&Google::Cloud::Asset::V1::AssetService::Stub.method(:new)
|
222
|
-
)
|
223
|
-
|
224
|
-
@export_assets = Google::Gax.create_api_call(
|
225
|
-
@asset_service_stub.method(:export_assets),
|
226
|
-
defaults["export_assets"],
|
227
|
-
exception_transformer: exception_transformer,
|
228
|
-
params_extractor: proc do |request|
|
229
|
-
{'parent' => request.parent}
|
230
|
-
end
|
231
|
-
)
|
232
|
-
@batch_get_assets_history = Google::Gax.create_api_call(
|
233
|
-
@asset_service_stub.method(:batch_get_assets_history),
|
234
|
-
defaults["batch_get_assets_history"],
|
235
|
-
exception_transformer: exception_transformer,
|
236
|
-
params_extractor: proc do |request|
|
237
|
-
{'parent' => request.parent}
|
238
|
-
end
|
239
|
-
)
|
240
|
-
@create_feed = Google::Gax.create_api_call(
|
241
|
-
@asset_service_stub.method(:create_feed),
|
242
|
-
defaults["create_feed"],
|
243
|
-
exception_transformer: exception_transformer,
|
244
|
-
params_extractor: proc do |request|
|
245
|
-
{'parent' => request.parent}
|
246
|
-
end
|
247
|
-
)
|
248
|
-
@get_feed = Google::Gax.create_api_call(
|
249
|
-
@asset_service_stub.method(:get_feed),
|
250
|
-
defaults["get_feed"],
|
251
|
-
exception_transformer: exception_transformer,
|
252
|
-
params_extractor: proc do |request|
|
253
|
-
{'name' => request.name}
|
254
|
-
end
|
255
|
-
)
|
256
|
-
@list_feeds = Google::Gax.create_api_call(
|
257
|
-
@asset_service_stub.method(:list_feeds),
|
258
|
-
defaults["list_feeds"],
|
259
|
-
exception_transformer: exception_transformer,
|
260
|
-
params_extractor: proc do |request|
|
261
|
-
{'parent' => request.parent}
|
262
|
-
end
|
263
|
-
)
|
264
|
-
@update_feed = Google::Gax.create_api_call(
|
265
|
-
@asset_service_stub.method(:update_feed),
|
266
|
-
defaults["update_feed"],
|
267
|
-
exception_transformer: exception_transformer,
|
268
|
-
params_extractor: proc do |request|
|
269
|
-
{'feed.name' => request.feed.name}
|
270
|
-
end
|
271
|
-
)
|
272
|
-
@delete_feed = Google::Gax.create_api_call(
|
273
|
-
@asset_service_stub.method(:delete_feed),
|
274
|
-
defaults["delete_feed"],
|
275
|
-
exception_transformer: exception_transformer,
|
276
|
-
params_extractor: proc do |request|
|
277
|
-
{'name' => request.name}
|
278
|
-
end
|
279
|
-
)
|
280
|
-
end
|
281
|
-
|
282
|
-
# Service calls
|
283
|
-
|
284
|
-
# Exports assets with time and resource types to a given Cloud Storage
|
285
|
-
# location. The output format is newline-delimited JSON.
|
286
|
-
# This API implements the {Google::Longrunning::Operation} API allowing you
|
287
|
-
# to keep track of the export.
|
288
|
-
#
|
289
|
-
# @param parent [String]
|
290
|
-
# Required. The relative name of the root asset. This can only be an
|
291
|
-
# organization number (such as "organizations/123"), a project ID (such as
|
292
|
-
# "projects/my-project-id"), or a project number (such as "projects/12345"),
|
293
|
-
# or a folder number (such as "folders/123").
|
294
|
-
# @param output_config [Google::Cloud::Asset::V1::OutputConfig | Hash]
|
295
|
-
# Required. Output configuration indicating where the results will be output
|
296
|
-
# to. All results will be in newline delimited JSON format.
|
297
|
-
# A hash of the same form as `Google::Cloud::Asset::V1::OutputConfig`
|
298
|
-
# can also be provided.
|
299
|
-
# @param read_time [Google::Protobuf::Timestamp | Hash]
|
300
|
-
# Timestamp to take an asset snapshot. This can only be set to a timestamp
|
301
|
-
# between 2018-10-02 UTC (inclusive) and the current time. If not specified,
|
302
|
-
# the current time will be used. Due to delays in resource data collection
|
303
|
-
# and indexing, there is a volatile window during which running the same
|
304
|
-
# query may get different results.
|
305
|
-
# A hash of the same form as `Google::Protobuf::Timestamp`
|
306
|
-
# can also be provided.
|
307
|
-
# @param asset_types [Array<String>]
|
308
|
-
# A list of asset types of which to take a snapshot for. For example:
|
309
|
-
# "compute.googleapis.com/Disk". If specified, only matching assets will be
|
310
|
-
# returned. See [Introduction to Cloud Asset
|
311
|
-
# Inventory](https://cloud.google.com/resource-manager-inventory/docs/overview)
|
312
|
-
# for all supported asset types.
|
313
|
-
# @param content_type [Google::Cloud::Asset::V1::ContentType]
|
314
|
-
# Asset content type. If not specified, no content but the asset name will be
|
315
|
-
# returned.
|
316
|
-
# @param options [Google::Gax::CallOptions]
|
317
|
-
# Overrides the default settings for this call, e.g, timeout,
|
318
|
-
# retries, etc.
|
319
|
-
# @return [Google::Gax::Operation]
|
320
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
321
|
-
# @example
|
322
|
-
# require "google/cloud/asset"
|
323
|
-
#
|
324
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
325
|
-
#
|
326
|
-
# # TODO: Initialize `parent`:
|
327
|
-
# parent = ''
|
328
|
-
#
|
329
|
-
# # TODO: Initialize `output_config`:
|
330
|
-
# output_config = {}
|
331
|
-
#
|
332
|
-
# # Register a callback during the method call.
|
333
|
-
# operation = asset_client.export_assets(parent, output_config) do |op|
|
334
|
-
# raise op.results.message if op.error?
|
335
|
-
# op_results = op.results
|
336
|
-
# # Process the results.
|
337
|
-
#
|
338
|
-
# metadata = op.metadata
|
339
|
-
# # Process the metadata.
|
340
|
-
# end
|
341
|
-
#
|
342
|
-
# # Or use the return value to register a callback.
|
343
|
-
# operation.on_done do |op|
|
344
|
-
# raise op.results.message if op.error?
|
345
|
-
# op_results = op.results
|
346
|
-
# # Process the results.
|
347
|
-
#
|
348
|
-
# metadata = op.metadata
|
349
|
-
# # Process the metadata.
|
350
|
-
# end
|
351
|
-
#
|
352
|
-
# # Manually reload the operation.
|
353
|
-
# operation.reload!
|
354
|
-
#
|
355
|
-
# # Or block until the operation completes, triggering callbacks on
|
356
|
-
# # completion.
|
357
|
-
# operation.wait_until_done!
|
358
|
-
|
359
|
-
def export_assets \
|
360
|
-
parent,
|
361
|
-
output_config,
|
362
|
-
read_time: nil,
|
363
|
-
asset_types: nil,
|
364
|
-
content_type: nil,
|
365
|
-
options: nil
|
366
|
-
req = {
|
367
|
-
parent: parent,
|
368
|
-
output_config: output_config,
|
369
|
-
read_time: read_time,
|
370
|
-
asset_types: asset_types,
|
371
|
-
content_type: content_type
|
372
|
-
}.delete_if { |_, v| v.nil? }
|
373
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::ExportAssetsRequest)
|
374
|
-
operation = Google::Gax::Operation.new(
|
375
|
-
@export_assets.call(req, options),
|
376
|
-
@operations_client,
|
377
|
-
Google::Cloud::Asset::V1::ExportAssetsResponse,
|
378
|
-
Google::Cloud::Asset::V1::ExportAssetsRequest,
|
379
|
-
call_options: options
|
380
|
-
)
|
381
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
382
|
-
operation
|
383
|
-
end
|
384
|
-
|
385
|
-
# Batch gets the update history of assets that overlap a time window.
|
386
|
-
# For RESOURCE content, this API outputs history with asset in both
|
387
|
-
# non-delete or deleted status.
|
388
|
-
# For IAM_POLICY content, this API outputs history when the asset and its
|
389
|
-
# attached IAM POLICY both exist. This can create gaps in the output history.
|
390
|
-
# If a specified asset does not exist, this API returns an INVALID_ARGUMENT
|
391
|
-
# error.
|
392
|
-
#
|
393
|
-
# @param parent [String]
|
394
|
-
# Required. The relative name of the root asset. It can only be an
|
395
|
-
# organization number (such as "organizations/123"), a project ID (such as
|
396
|
-
# "projects/my-project-id")", or a project number (such as "projects/12345").
|
397
|
-
# @param content_type [Google::Cloud::Asset::V1::ContentType]
|
398
|
-
# Optional. The content type.
|
399
|
-
# @param read_time_window [Google::Cloud::Asset::V1::TimeWindow | Hash]
|
400
|
-
# Optional. The time window for the asset history. Both start_time and
|
401
|
-
# end_time are optional and if set, it must be after 2018-10-02 UTC. If
|
402
|
-
# end_time is not set, it is default to current timestamp. If start_time is
|
403
|
-
# not set, the snapshot of the assets at end_time will be returned. The
|
404
|
-
# returned results contain all temporal assets whose time window overlap with
|
405
|
-
# read_time_window.
|
406
|
-
# A hash of the same form as `Google::Cloud::Asset::V1::TimeWindow`
|
407
|
-
# can also be provided.
|
408
|
-
# @param asset_names [Array<String>]
|
409
|
-
# A list of the full names of the assets. For example:
|
410
|
-
# `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
|
411
|
-
# See [Resource
|
412
|
-
# Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
|
413
|
-
# and [Resource Name
|
414
|
-
# Format](https://cloud.google.com/resource-manager-inventory/docs/resource-name-format)
|
415
|
-
# for more info.
|
416
|
-
#
|
417
|
-
# The request becomes a no-op if the asset name list is empty, and the max
|
418
|
-
# size of the asset name list is 100 in one request.
|
419
|
-
# @param options [Google::Gax::CallOptions]
|
420
|
-
# Overrides the default settings for this call, e.g, timeout,
|
421
|
-
# retries, etc.
|
422
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
423
|
-
# @yieldparam result [Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
|
424
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
425
|
-
# @return [Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
|
426
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
427
|
-
# @example
|
428
|
-
# require "google/cloud/asset"
|
429
|
-
#
|
430
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
431
|
-
#
|
432
|
-
# # TODO: Initialize `parent`:
|
433
|
-
# parent = ''
|
434
|
-
#
|
435
|
-
# # TODO: Initialize `content_type`:
|
436
|
-
# content_type = :CONTENT_TYPE_UNSPECIFIED
|
437
|
-
#
|
438
|
-
# # TODO: Initialize `read_time_window`:
|
439
|
-
# read_time_window = {}
|
440
|
-
# response = asset_client.batch_get_assets_history(parent, content_type, read_time_window)
|
441
|
-
|
442
|
-
def batch_get_assets_history \
|
443
|
-
parent,
|
444
|
-
content_type,
|
445
|
-
read_time_window,
|
446
|
-
asset_names: nil,
|
447
|
-
options: nil,
|
448
|
-
&block
|
449
|
-
req = {
|
450
|
-
parent: parent,
|
451
|
-
content_type: content_type,
|
452
|
-
read_time_window: read_time_window,
|
453
|
-
asset_names: asset_names
|
454
|
-
}.delete_if { |_, v| v.nil? }
|
455
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest)
|
456
|
-
@batch_get_assets_history.call(req, options, &block)
|
457
|
-
end
|
458
|
-
|
459
|
-
# Creates a feed in a parent project/folder/organization to listen to its
|
460
|
-
# asset updates.
|
461
|
-
#
|
462
|
-
# @param parent [String]
|
463
|
-
# Required. The name of the project/folder/organization where this feed
|
464
|
-
# should be created in. It can only be an organization number (such as
|
465
|
-
# "organizations/123"), a folder number (such as "folders/123"), a project ID
|
466
|
-
# (such as "projects/my-project-id")", or a project number (such as
|
467
|
-
# "projects/12345").
|
468
|
-
# @param feed_id [String]
|
469
|
-
# Required. This is the client-assigned asset feed identifier and it needs to
|
470
|
-
# be unique under a specific parent project/folder/organization.
|
471
|
-
# @param feed [Google::Cloud::Asset::V1::Feed | Hash]
|
472
|
-
# Required. The feed details. The field `name` must be empty and it will be generated
|
473
|
-
# in the format of:
|
474
|
-
# projects/project_number/feeds/feed_id
|
475
|
-
# folders/folder_number/feeds/feed_id
|
476
|
-
# organizations/organization_number/feeds/feed_id
|
477
|
-
# A hash of the same form as `Google::Cloud::Asset::V1::Feed`
|
478
|
-
# can also be provided.
|
479
|
-
# @param options [Google::Gax::CallOptions]
|
480
|
-
# Overrides the default settings for this call, e.g, timeout,
|
481
|
-
# retries, etc.
|
482
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
483
|
-
# @yieldparam result [Google::Cloud::Asset::V1::Feed]
|
484
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
485
|
-
# @return [Google::Cloud::Asset::V1::Feed]
|
486
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
487
|
-
# @example
|
488
|
-
# require "google/cloud/asset"
|
489
|
-
#
|
490
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
491
|
-
#
|
492
|
-
# # TODO: Initialize `parent`:
|
493
|
-
# parent = ''
|
494
|
-
#
|
495
|
-
# # TODO: Initialize `feed_id`:
|
496
|
-
# feed_id = ''
|
497
|
-
#
|
498
|
-
# # TODO: Initialize `feed`:
|
499
|
-
# feed = {}
|
500
|
-
# response = asset_client.create_feed(parent, feed_id, feed)
|
501
|
-
|
502
|
-
def create_feed \
|
503
|
-
parent,
|
504
|
-
feed_id,
|
505
|
-
feed,
|
506
|
-
options: nil,
|
507
|
-
&block
|
508
|
-
req = {
|
509
|
-
parent: parent,
|
510
|
-
feed_id: feed_id,
|
511
|
-
feed: feed
|
512
|
-
}.delete_if { |_, v| v.nil? }
|
513
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::CreateFeedRequest)
|
514
|
-
@create_feed.call(req, options, &block)
|
515
|
-
end
|
516
|
-
|
517
|
-
# Gets details about an asset feed.
|
518
|
-
#
|
519
|
-
# @param name [String]
|
520
|
-
# Required. The name of the Feed and it must be in the format of:
|
521
|
-
# projects/project_number/feeds/feed_id
|
522
|
-
# folders/folder_number/feeds/feed_id
|
523
|
-
# organizations/organization_number/feeds/feed_id
|
524
|
-
# @param options [Google::Gax::CallOptions]
|
525
|
-
# Overrides the default settings for this call, e.g, timeout,
|
526
|
-
# retries, etc.
|
527
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
528
|
-
# @yieldparam result [Google::Cloud::Asset::V1::Feed]
|
529
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
530
|
-
# @return [Google::Cloud::Asset::V1::Feed]
|
531
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
532
|
-
# @example
|
533
|
-
# require "google/cloud/asset"
|
534
|
-
#
|
535
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
536
|
-
# formatted_name = Google::Cloud::Asset::V1::AssetServiceClient.feed_path("[PROJECT]", "[FEED]")
|
537
|
-
# response = asset_client.get_feed(formatted_name)
|
538
|
-
|
539
|
-
def get_feed \
|
540
|
-
name,
|
541
|
-
options: nil,
|
542
|
-
&block
|
543
|
-
req = {
|
544
|
-
name: name
|
545
|
-
}.delete_if { |_, v| v.nil? }
|
546
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::GetFeedRequest)
|
547
|
-
@get_feed.call(req, options, &block)
|
548
|
-
end
|
549
|
-
|
550
|
-
# Lists all asset feeds in a parent project/folder/organization.
|
551
|
-
#
|
552
|
-
# @param parent [String]
|
553
|
-
# Required. The parent project/folder/organization whose feeds are to be
|
554
|
-
# listed. It can only be using project/folder/organization number (such as
|
555
|
-
# "folders/12345")", or a project ID (such as "projects/my-project-id").
|
556
|
-
# @param options [Google::Gax::CallOptions]
|
557
|
-
# Overrides the default settings for this call, e.g, timeout,
|
558
|
-
# retries, etc.
|
559
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
560
|
-
# @yieldparam result [Google::Cloud::Asset::V1::ListFeedsResponse]
|
561
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
562
|
-
# @return [Google::Cloud::Asset::V1::ListFeedsResponse]
|
563
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
564
|
-
# @example
|
565
|
-
# require "google/cloud/asset"
|
566
|
-
#
|
567
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
568
|
-
#
|
569
|
-
# # TODO: Initialize `parent`:
|
570
|
-
# parent = ''
|
571
|
-
# response = asset_client.list_feeds(parent)
|
572
|
-
|
573
|
-
def list_feeds \
|
574
|
-
parent,
|
575
|
-
options: nil,
|
576
|
-
&block
|
577
|
-
req = {
|
578
|
-
parent: parent
|
579
|
-
}.delete_if { |_, v| v.nil? }
|
580
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::ListFeedsRequest)
|
581
|
-
@list_feeds.call(req, options, &block)
|
582
|
-
end
|
583
|
-
|
584
|
-
# Updates an asset feed configuration.
|
585
|
-
#
|
586
|
-
# @param feed [Google::Cloud::Asset::V1::Feed | Hash]
|
587
|
-
# Required. The new values of feed details. It must match an existing feed and the
|
588
|
-
# field `name` must be in the format of:
|
589
|
-
# projects/project_number/feeds/feed_id or
|
590
|
-
# folders/folder_number/feeds/feed_id or
|
591
|
-
# organizations/organization_number/feeds/feed_id.
|
592
|
-
# A hash of the same form as `Google::Cloud::Asset::V1::Feed`
|
593
|
-
# can also be provided.
|
594
|
-
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
595
|
-
# Required. Only updates the `feed` fields indicated by this mask.
|
596
|
-
# The field mask must not be empty, and it must not contain fields that
|
597
|
-
# are immutable or only set by the server.
|
598
|
-
# A hash of the same form as `Google::Protobuf::FieldMask`
|
599
|
-
# can also be provided.
|
600
|
-
# @param options [Google::Gax::CallOptions]
|
601
|
-
# Overrides the default settings for this call, e.g, timeout,
|
602
|
-
# retries, etc.
|
603
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
604
|
-
# @yieldparam result [Google::Cloud::Asset::V1::Feed]
|
605
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
606
|
-
# @return [Google::Cloud::Asset::V1::Feed]
|
607
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
608
|
-
# @example
|
609
|
-
# require "google/cloud/asset"
|
610
|
-
#
|
611
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
612
|
-
#
|
613
|
-
# # TODO: Initialize `feed`:
|
614
|
-
# feed = {}
|
615
|
-
#
|
616
|
-
# # TODO: Initialize `update_mask`:
|
617
|
-
# update_mask = {}
|
618
|
-
# response = asset_client.update_feed(feed, update_mask)
|
619
|
-
|
620
|
-
def update_feed \
|
621
|
-
feed,
|
622
|
-
update_mask,
|
623
|
-
options: nil,
|
624
|
-
&block
|
625
|
-
req = {
|
626
|
-
feed: feed,
|
627
|
-
update_mask: update_mask
|
628
|
-
}.delete_if { |_, v| v.nil? }
|
629
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::UpdateFeedRequest)
|
630
|
-
@update_feed.call(req, options, &block)
|
631
|
-
end
|
632
|
-
|
633
|
-
# Deletes an asset feed.
|
634
|
-
#
|
635
|
-
# @param name [String]
|
636
|
-
# Required. The name of the feed and it must be in the format of:
|
637
|
-
# projects/project_number/feeds/feed_id
|
638
|
-
# folders/folder_number/feeds/feed_id
|
639
|
-
# organizations/organization_number/feeds/feed_id
|
640
|
-
# @param options [Google::Gax::CallOptions]
|
641
|
-
# Overrides the default settings for this call, e.g, timeout,
|
642
|
-
# retries, etc.
|
643
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
644
|
-
# @yieldparam result []
|
645
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
646
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
647
|
-
# @example
|
648
|
-
# require "google/cloud/asset"
|
649
|
-
#
|
650
|
-
# asset_client = Google::Cloud::Asset.new(version: :v1)
|
651
|
-
# formatted_name = Google::Cloud::Asset::V1::AssetServiceClient.feed_path("[PROJECT]", "[FEED]")
|
652
|
-
# asset_client.delete_feed(formatted_name)
|
653
|
-
|
654
|
-
def delete_feed \
|
655
|
-
name,
|
656
|
-
options: nil,
|
657
|
-
&block
|
658
|
-
req = {
|
659
|
-
name: name
|
660
|
-
}.delete_if { |_, v| v.nil? }
|
661
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::DeleteFeedRequest)
|
662
|
-
@delete_feed.call(req, options, &block)
|
663
|
-
nil
|
664
|
-
end
|
665
|
-
end
|
666
|
-
end
|
667
|
-
end
|
668
|
-
end
|
669
|
-
end
|