google-cloud-asset 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/asset.rb +2 -2
  4. data/lib/google/cloud/asset/v1.rb +138 -0
  5. data/lib/google/cloud/asset/v1/asset_service_client.rb +385 -0
  6. data/lib/google/cloud/asset/v1/asset_service_client_config.json +36 -0
  7. data/lib/google/cloud/asset/v1/asset_service_pb.rb +63 -0
  8. data/lib/google/cloud/asset/v1/asset_service_services_pb.rb +58 -0
  9. data/lib/google/cloud/asset/v1/assets_pb.rb +49 -0
  10. data/lib/google/cloud/asset/v1/credentials.rb +41 -0
  11. data/lib/google/cloud/asset/v1/doc/google/cloud/asset/v1/asset_service.rb +129 -0
  12. data/lib/google/cloud/asset/v1/doc/google/cloud/asset/v1/assets.rb +108 -0
  13. data/lib/google/cloud/asset/v1/doc/google/iam/v1/policy.rb +104 -0
  14. data/lib/google/cloud/asset/v1/doc/google/longrunning/operations.rb +51 -0
  15. data/lib/google/cloud/asset/v1/doc/google/protobuf/any.rb +130 -0
  16. data/lib/google/cloud/asset/v1/doc/google/protobuf/struct.rb +74 -0
  17. data/lib/google/cloud/asset/v1/doc/google/protobuf/timestamp.rb +109 -0
  18. data/lib/google/cloud/asset/v1/doc/google/rpc/status.rb +87 -0
  19. data/lib/google/cloud/asset/v1/helpers.rb +29 -0
  20. data/lib/google/cloud/asset/v1beta1.rb +1 -0
  21. data/lib/google/cloud/asset/v1beta1/asset_service_client.rb +9 -7
  22. data/lib/google/cloud/asset/v1beta1/asset_service_services_pb.rb +3 -2
  23. data/lib/google/cloud/asset/v1beta1/doc/google/cloud/asset/v1beta1/asset_service.rb +6 -3
  24. data/lib/google/cloud/asset/v1beta1/doc/google/cloud/asset/v1beta1/assets.rb +10 -6
  25. data/lib/google/cloud/asset/v1beta1/doc/google/longrunning/operations.rb +1 -1
  26. data/lib/google/cloud/asset/v1beta1/doc/google/rpc/status.rb +17 -14
  27. data/lib/google/cloud/asset/v1beta1/helpers.rb +29 -0
  28. metadata +22 -6
@@ -0,0 +1,87 @@
1
+ # Copyright 2019 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
+ module Google
17
+ module Rpc
18
+ # The `Status` type defines a logical error model that is suitable for
19
+ # different programming environments, including REST APIs and RPC APIs. It is
20
+ # used by [gRPC](https://github.com/grpc). The error model is designed to be:
21
+ #
22
+ # * Simple to use and understand for most users
23
+ # * Flexible enough to meet unexpected needs
24
+ #
25
+ # = Overview
26
+ #
27
+ # The `Status` message contains three pieces of data: error code, error
28
+ # message, and error details. The error code should be an enum value of
29
+ # {Google::Rpc::Code}, but it may accept additional error codes
30
+ # if needed. The error message should be a developer-facing English message
31
+ # that helps developers *understand* and *resolve* the error. If a localized
32
+ # user-facing error message is needed, put the localized message in the error
33
+ # details or localize it in the client. The optional error details may contain
34
+ # arbitrary information about the error. There is a predefined set of error
35
+ # detail types in the package `google.rpc` that can be used for common error
36
+ # conditions.
37
+ #
38
+ # = Language mapping
39
+ #
40
+ # The `Status` message is the logical representation of the error model, but it
41
+ # is not necessarily the actual wire format. When the `Status` message is
42
+ # exposed in different client libraries and different wire protocols, it can be
43
+ # mapped differently. For example, it will likely be mapped to some exceptions
44
+ # in Java, but more likely mapped to some error codes in C.
45
+ #
46
+ # = Other uses
47
+ #
48
+ # The error model and the `Status` message can be used in a variety of
49
+ # environments, either with or without APIs, to provide a
50
+ # consistent developer experience across different environments.
51
+ #
52
+ # Example uses of this error model include:
53
+ #
54
+ # * Partial errors. If a service needs to return partial errors to the client,
55
+ # it may embed the `Status` in the normal response to indicate the partial
56
+ # errors.
57
+ #
58
+ # * Workflow errors. A typical workflow has multiple steps. Each step may
59
+ # have a `Status` message for error reporting.
60
+ #
61
+ # * Batch operations. If a client uses batch request and batch response, the
62
+ # `Status` message should be used directly inside batch response, one for
63
+ # each error sub-response.
64
+ #
65
+ # * Asynchronous operations. If an API call embeds asynchronous operation
66
+ # results in its response, the status of those operations should be
67
+ # represented directly using the `Status` message.
68
+ #
69
+ # * Logging. If some API errors are stored in logs, the message `Status` could
70
+ # be used directly after any stripping needed for security/privacy reasons.
71
+ # @!attribute [rw] code
72
+ # @return [Integer]
73
+ # The status code, which should be an enum value of
74
+ # {Google::Rpc::Code}.
75
+ # @!attribute [rw] message
76
+ # @return [String]
77
+ # A developer-facing error message, which should be in English. Any
78
+ # user-facing error message should be localized and sent in the
79
+ # {Google::Rpc::Status#details} field, or localized
80
+ # by the client.
81
+ # @!attribute [rw] details
82
+ # @return [Array<Google::Protobuf::Any>]
83
+ # A list of messages that carry the error details. There is a common set of
84
+ # message types for APIs to use.
85
+ class Status; end
86
+ end
87
+ end
@@ -0,0 +1,29 @@
1
+ # Copyright 2018 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
+ module Google
15
+ module Cloud
16
+ module Asset
17
+ module V1
18
+ class AssetServiceClient
19
+ # Alias for Google::Cloud::Asset::V1::AssetServiceClient.project_path.
20
+ # @param project [String]
21
+ # @return [String]
22
+ def project_path project
23
+ self.class.project_path project
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -14,6 +14,7 @@
14
14
 
15
15
 
16
16
  require "google/cloud/asset/v1beta1/asset_service_client"
17
+ require "google/cloud/asset/v1beta1/helpers"
17
18
 
18
19
  module Google
19
20
  module Cloud
@@ -207,8 +207,9 @@ module Google
207
207
 
208
208
  # Exports assets with time and resource types to a given Cloud Storage
209
209
  # location. The output format is newline-delimited JSON.
210
- # This API implements the {Google::Longrunning::Operation} API allowing you
211
- # to keep track of the export.
210
+ # This API implements the
211
+ # {Google::Longrunning::Operation} API allowing
212
+ # you to keep track of the export.
212
213
  #
213
214
  # @param parent [String]
214
215
  # Required. The relative name of the root asset. This can only be an
@@ -245,14 +246,14 @@ module Google
245
246
  # @example
246
247
  # require "google/cloud/asset"
247
248
  #
248
- # asset_service_client = Google::Cloud::Asset.new(version: :v1beta1)
249
+ # asset_client = Google::Cloud::Asset.new(version: :v1beta1)
249
250
  # formatted_parent = Google::Cloud::Asset::V1beta1::AssetServiceClient.project_path("[PROJECT]")
250
251
  #
251
252
  # # TODO: Initialize `output_config`:
252
253
  # output_config = {}
253
254
  #
254
255
  # # Register a callback during the method call.
255
- # operation = asset_service_client.export_assets(formatted_parent, output_config) do |op|
256
+ # operation = asset_client.export_assets(formatted_parent, output_config) do |op|
256
257
  # raise op.results.message if op.error?
257
258
  # op_results = op.results
258
259
  # # Process the results.
@@ -328,7 +329,8 @@ module Google
328
329
  # @param asset_names [Array<String>]
329
330
  # A list of the full names of the assets. For example:
330
331
  # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
331
- # See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
332
+ # See [Resource
333
+ # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
332
334
  # for more info.
333
335
  #
334
336
  # The request becomes a no-op if the asset name list is empty, and the max
@@ -344,7 +346,7 @@ module Google
344
346
  # @example
345
347
  # require "google/cloud/asset"
346
348
  #
347
- # asset_service_client = Google::Cloud::Asset.new(version: :v1beta1)
349
+ # asset_client = Google::Cloud::Asset.new(version: :v1beta1)
348
350
  # formatted_parent = Google::Cloud::Asset::V1beta1::AssetServiceClient.project_path("[PROJECT]")
349
351
  #
350
352
  # # TODO: Initialize `content_type`:
@@ -352,7 +354,7 @@ module Google
352
354
  #
353
355
  # # TODO: Initialize `read_time_window`:
354
356
  # read_time_window = {}
355
- # response = asset_service_client.batch_get_assets_history(formatted_parent, content_type, read_time_window)
357
+ # response = asset_client.batch_get_assets_history(formatted_parent, content_type, read_time_window)
356
358
 
357
359
  def batch_get_assets_history \
358
360
  parent,
@@ -37,8 +37,9 @@ module Google
37
37
 
38
38
  # Exports assets with time and resource types to a given Cloud Storage
39
39
  # location. The output format is newline-delimited JSON.
40
- # This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you
41
- # to keep track of the export.
40
+ # This API implements the
41
+ # [google.longrunning.Operation][google.longrunning.Operation] API allowing
42
+ # you to keep track of the export.
42
43
  rpc :ExportAssets, ExportAssetsRequest, Google::Longrunning::Operation
43
44
  # Batch gets the update history of assets that overlap a time window.
44
45
  # For RESOURCE content, this API outputs history with asset in both
@@ -49,8 +49,10 @@ module Google
49
49
  class ExportAssetsRequest; end
50
50
 
51
51
  # The export asset response. This message is returned by the
52
- # {Google::Longrunning::Operations::GetOperation} method in the returned
53
- # {Google::Longrunning::Operation#response} field.
52
+ # {Google::Longrunning::Operations::GetOperation}
53
+ # method in the returned
54
+ # {Google::Longrunning::Operation#response}
55
+ # field.
54
56
  # @!attribute [rw] read_time
55
57
  # @return [Google::Protobuf::Timestamp]
56
58
  # Time the snapshot was taken.
@@ -70,7 +72,8 @@ module Google
70
72
  # @return [Array<String>]
71
73
  # A list of the full names of the assets. For example:
72
74
  # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
73
- # See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
75
+ # See [Resource
76
+ # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
74
77
  # for more info.
75
78
  #
76
79
  # The request becomes a no-op if the asset name list is empty, and the max
@@ -44,8 +44,10 @@ module Google
44
44
  # Cloud IAM policies, and other non-GCP assets.
45
45
  # @!attribute [rw] name
46
46
  # @return [String]
47
- # The full name of the asset. For example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
48
- # See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
47
+ # The full name of the asset. For example:
48
+ # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
49
+ # See [Resource
50
+ # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
49
51
  # for more information.
50
52
  # @!attribute [rw] asset_type
51
53
  # @return [String]
@@ -55,8 +57,8 @@ module Google
55
57
  # Representation of the resource.
56
58
  # @!attribute [rw] iam_policy
57
59
  # @return [Google::Iam::V1::Policy]
58
- # Representation of the actual Cloud IAM policy set on a cloud resource. For each
59
- # resource, there must be at most one Cloud IAM policy set on it.
60
+ # Representation of the actual Cloud IAM policy set on a cloud resource. For
61
+ # each resource, there must be at most one Cloud IAM policy set on it.
60
62
  class Asset; end
61
63
 
62
64
  # Representation of a cloud resource.
@@ -85,12 +87,14 @@ module Google
85
87
  # @!attribute [rw] parent
86
88
  # @return [String]
87
89
  # The full name of the immediate parent of this resource. See
88
- # [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
90
+ # [Resource
91
+ # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
89
92
  # for more information.
90
93
  #
91
94
  # For GCP assets, it is the parent resource defined in the [Cloud IAM policy
92
95
  # hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
93
- # For example: `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
96
+ # For example:
97
+ # `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
94
98
  #
95
99
  # For third-party assets, it is up to the users to define.
96
100
  # @!attribute [rw] data
@@ -31,7 +31,7 @@ module Google
31
31
  # @!attribute [rw] done
32
32
  # @return [true, false]
33
33
  # If the value is `false`, it means the operation is still in progress.
34
- # If true, the operation is completed, and either `error` or `response` is
34
+ # If `true`, the operation is completed, and either `error` or `response` is
35
35
  # available.
36
36
  # @!attribute [rw] error
37
37
  # @return [Google::Rpc::Status]
@@ -15,24 +15,25 @@
15
15
 
16
16
  module Google
17
17
  module Rpc
18
- # The `Status` type defines a logical error model that is suitable for different
19
- # programming environments, including REST APIs and RPC APIs. It is used by
20
- # [gRPC](https://github.com/grpc). The error model is designed to be:
18
+ # The `Status` type defines a logical error model that is suitable for
19
+ # different programming environments, including REST APIs and RPC APIs. It is
20
+ # used by [gRPC](https://github.com/grpc). The error model is designed to be:
21
21
  #
22
22
  # * Simple to use and understand for most users
23
23
  # * Flexible enough to meet unexpected needs
24
24
  #
25
25
  # = Overview
26
26
  #
27
- # The `Status` message contains three pieces of data: error code, error message,
28
- # and error details. The error code should be an enum value of
29
- # {Google::Rpc::Code}, but it may accept additional error codes if needed. The
30
- # error message should be a developer-facing English message that helps
31
- # developers *understand* and *resolve* the error. If a localized user-facing
32
- # error message is needed, put the localized message in the error details or
33
- # localize it in the client. The optional error details may contain arbitrary
34
- # information about the error. There is a predefined set of error detail types
35
- # in the package `google.rpc` that can be used for common error conditions.
27
+ # The `Status` message contains three pieces of data: error code, error
28
+ # message, and error details. The error code should be an enum value of
29
+ # {Google::Rpc::Code}, but it may accept additional error codes
30
+ # if needed. The error message should be a developer-facing English message
31
+ # that helps developers *understand* and *resolve* the error. If a localized
32
+ # user-facing error message is needed, put the localized message in the error
33
+ # details or localize it in the client. The optional error details may contain
34
+ # arbitrary information about the error. There is a predefined set of error
35
+ # detail types in the package `google.rpc` that can be used for common error
36
+ # conditions.
36
37
  #
37
38
  # = Language mapping
38
39
  #
@@ -69,12 +70,14 @@ module Google
69
70
  # be used directly after any stripping needed for security/privacy reasons.
70
71
  # @!attribute [rw] code
71
72
  # @return [Integer]
72
- # The status code, which should be an enum value of {Google::Rpc::Code}.
73
+ # The status code, which should be an enum value of
74
+ # {Google::Rpc::Code}.
73
75
  # @!attribute [rw] message
74
76
  # @return [String]
75
77
  # A developer-facing error message, which should be in English. Any
76
78
  # user-facing error message should be localized and sent in the
77
- # {Google::Rpc::Status#details} field, or localized by the client.
79
+ # {Google::Rpc::Status#details} field, or localized
80
+ # by the client.
78
81
  # @!attribute [rw] details
79
82
  # @return [Array<Google::Protobuf::Any>]
80
83
  # A list of messages that carry the error details. There is a common set of
@@ -0,0 +1,29 @@
1
+ # Copyright 2018 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
+ module Google
15
+ module Cloud
16
+ module Asset
17
+ module V1beta1
18
+ class AssetServiceClient
19
+ # Alias for Google::Cloud::Asset::V1beta1::AssetServiceClient.project_path.
20
+ # @param project [String]
21
+ # @return [String]
22
+ def project_path project
23
+ self.class.project_path project
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-asset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-01 00:00:00.000000000 Z
11
+ date: 2019-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.61.0
75
+ version: 0.64.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.61.0
82
+ version: 0.64.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -118,6 +118,22 @@ files:
118
118
  - LICENSE
119
119
  - README.md
120
120
  - lib/google/cloud/asset.rb
121
+ - lib/google/cloud/asset/v1.rb
122
+ - lib/google/cloud/asset/v1/asset_service_client.rb
123
+ - lib/google/cloud/asset/v1/asset_service_client_config.json
124
+ - lib/google/cloud/asset/v1/asset_service_pb.rb
125
+ - lib/google/cloud/asset/v1/asset_service_services_pb.rb
126
+ - lib/google/cloud/asset/v1/assets_pb.rb
127
+ - lib/google/cloud/asset/v1/credentials.rb
128
+ - lib/google/cloud/asset/v1/doc/google/cloud/asset/v1/asset_service.rb
129
+ - lib/google/cloud/asset/v1/doc/google/cloud/asset/v1/assets.rb
130
+ - lib/google/cloud/asset/v1/doc/google/iam/v1/policy.rb
131
+ - lib/google/cloud/asset/v1/doc/google/longrunning/operations.rb
132
+ - lib/google/cloud/asset/v1/doc/google/protobuf/any.rb
133
+ - lib/google/cloud/asset/v1/doc/google/protobuf/struct.rb
134
+ - lib/google/cloud/asset/v1/doc/google/protobuf/timestamp.rb
135
+ - lib/google/cloud/asset/v1/doc/google/rpc/status.rb
136
+ - lib/google/cloud/asset/v1/helpers.rb
121
137
  - lib/google/cloud/asset/v1beta1.rb
122
138
  - lib/google/cloud/asset/v1beta1/asset_service_client.rb
123
139
  - lib/google/cloud/asset/v1beta1/asset_service_client_config.json
@@ -133,6 +149,7 @@ files:
133
149
  - lib/google/cloud/asset/v1beta1/doc/google/protobuf/struct.rb
134
150
  - lib/google/cloud/asset/v1beta1/doc/google/protobuf/timestamp.rb
135
151
  - lib/google/cloud/asset/v1beta1/doc/google/rpc/status.rb
152
+ - lib/google/cloud/asset/v1beta1/helpers.rb
136
153
  homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-asset
137
154
  licenses:
138
155
  - Apache-2.0
@@ -152,8 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
169
  - !ruby/object:Gem::Version
153
170
  version: '0'
154
171
  requirements: []
155
- rubyforge_project:
156
- rubygems_version: 2.7.6
172
+ rubygems_version: 3.0.3
157
173
  signing_key:
158
174
  specification_version: 4
159
175
  summary: API Client library for Cloud Asset API