google-cloud-asset 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a689a784987f7d4f4cc741ee9d1a396bb2c3bbbb14a7436a5f36ee5b2de6017
4
- data.tar.gz: f5bebf6b421e022dafa870ac2eb9de5d18eda7552a9516c9ea92c3c15236d7f4
3
+ metadata.gz: 2bb0c0ca81e8a3f8d29eda8b5449d10743216c46491ae8c16e576e4e818e4974
4
+ data.tar.gz: 207ecd01a72c4dd44ce7701f4c5e37b97e38606c1aef635e328c3aa8d6d2f6fb
5
5
  SHA512:
6
- metadata.gz: d1b4e77354e19012322fb52d18a9ef9d13d0e3ae4a97f88d643f32b777bff0f209c342aca4d4b3fd4cd4b6a5b07b32fcbf70b9e0cd57b7379b1d014f50932202
7
- data.tar.gz: ea83b7cc3e02d3931c7d5e8fabf49be1486840fe655742571b51a326d02949315a82ab6ab6e52638c43bff904a53aa0499e25a0dfddf88e268e02b87aad42e15
6
+ metadata.gz: adf65e8955cda487fe03574b37b93e49f655d1e1fdb84164ade3b60796dd746d465c61abdbf8db0eddb7a89d3f0629df73de2a07937a64fef728aaf0b6764470
7
+ data.tar.gz: 2b25d32de17712e24f729295375255e9b81e300dc0a22511e3b2feb2b22e976a66511798dc2f3e466f5f63849eb4257562b6631ee4cde6f1b094f50a8905ec74
@@ -66,12 +66,29 @@ module Google
66
66
  self::GRPC_INTERCEPTORS = AssetServiceClient::GRPC_INTERCEPTORS
67
67
  end
68
68
 
69
+ FEED_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
70
+ "projects/{project}/feeds/{feed}"
71
+ )
72
+
73
+ private_constant :FEED_PATH_TEMPLATE
74
+
69
75
  PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
70
76
  "projects/{project}"
71
77
  )
72
78
 
73
79
  private_constant :PROJECT_PATH_TEMPLATE
74
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
+
75
92
  # Returns a fully-qualified project resource name string.
76
93
  # @param project [String]
77
94
  # @return [String]
@@ -217,6 +234,46 @@ module Google
217
234
  {'parent' => request.parent}
218
235
  end
219
236
  )
237
+ @create_feed = Google::Gax.create_api_call(
238
+ @asset_service_stub.method(:create_feed),
239
+ defaults["create_feed"],
240
+ exception_transformer: exception_transformer,
241
+ params_extractor: proc do |request|
242
+ {'parent' => request.parent}
243
+ end
244
+ )
245
+ @get_feed = Google::Gax.create_api_call(
246
+ @asset_service_stub.method(:get_feed),
247
+ defaults["get_feed"],
248
+ exception_transformer: exception_transformer,
249
+ params_extractor: proc do |request|
250
+ {'name' => request.name}
251
+ end
252
+ )
253
+ @list_feeds = Google::Gax.create_api_call(
254
+ @asset_service_stub.method(:list_feeds),
255
+ defaults["list_feeds"],
256
+ exception_transformer: exception_transformer,
257
+ params_extractor: proc do |request|
258
+ {'parent' => request.parent}
259
+ end
260
+ )
261
+ @update_feed = Google::Gax.create_api_call(
262
+ @asset_service_stub.method(:update_feed),
263
+ defaults["update_feed"],
264
+ exception_transformer: exception_transformer,
265
+ params_extractor: proc do |request|
266
+ {'feed.name' => request.feed.name}
267
+ end
268
+ )
269
+ @delete_feed = Google::Gax.create_api_call(
270
+ @asset_service_stub.method(:delete_feed),
271
+ defaults["delete_feed"],
272
+ exception_transformer: exception_transformer,
273
+ params_extractor: proc do |request|
274
+ {'name' => request.name}
275
+ end
276
+ )
220
277
  end
221
278
 
222
279
  # Service calls
@@ -395,6 +452,213 @@ module Google
395
452
  req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest)
396
453
  @batch_get_assets_history.call(req, options, &block)
397
454
  end
455
+
456
+ # Creates a feed in a parent project/folder/organization to listen to its
457
+ # asset updates.
458
+ #
459
+ # @param parent [String]
460
+ # Required. The name of the project/folder/organization where this feed
461
+ # should be created in. It can only be an organization number (such as
462
+ # "organizations/123"), a folder number (such as "folders/123"), a project ID
463
+ # (such as "projects/my-project-id")", or a project number (such as
464
+ # "projects/12345").
465
+ # @param feed_id [String]
466
+ # Required. This is the client-assigned asset feed identifier and it needs to
467
+ # be unique under a specific parent project/folder/organization.
468
+ # @param feed [Google::Cloud::Asset::V1::Feed | Hash]
469
+ # Required. The feed details. The field `name` must be empty and it will be generated
470
+ # in the format of:
471
+ # projects/project_number/feeds/feed_id
472
+ # folders/folder_number/feeds/feed_id
473
+ # organizations/organization_number/feeds/feed_id
474
+ # A hash of the same form as `Google::Cloud::Asset::V1::Feed`
475
+ # can also be provided.
476
+ # @param options [Google::Gax::CallOptions]
477
+ # Overrides the default settings for this call, e.g, timeout,
478
+ # retries, etc.
479
+ # @yield [result, operation] Access the result along with the RPC operation
480
+ # @yieldparam result [Google::Cloud::Asset::V1::Feed]
481
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
482
+ # @return [Google::Cloud::Asset::V1::Feed]
483
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
484
+ # @example
485
+ # require "google/cloud/asset"
486
+ #
487
+ # asset_client = Google::Cloud::Asset.new(version: :v1)
488
+ #
489
+ # # TODO: Initialize `parent`:
490
+ # parent = ''
491
+ #
492
+ # # TODO: Initialize `feed_id`:
493
+ # feed_id = ''
494
+ #
495
+ # # TODO: Initialize `feed`:
496
+ # feed = {}
497
+ # response = asset_client.create_feed(parent, feed_id, feed)
498
+
499
+ def create_feed \
500
+ parent,
501
+ feed_id,
502
+ feed,
503
+ options: nil,
504
+ &block
505
+ req = {
506
+ parent: parent,
507
+ feed_id: feed_id,
508
+ feed: feed
509
+ }.delete_if { |_, v| v.nil? }
510
+ req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::CreateFeedRequest)
511
+ @create_feed.call(req, options, &block)
512
+ end
513
+
514
+ # Gets details about an asset feed.
515
+ #
516
+ # @param name [String]
517
+ # Required. The name of the Feed and it must be in the format of:
518
+ # projects/project_number/feeds/feed_id
519
+ # folders/folder_number/feeds/feed_id
520
+ # organizations/organization_number/feeds/feed_id
521
+ # @param options [Google::Gax::CallOptions]
522
+ # Overrides the default settings for this call, e.g, timeout,
523
+ # retries, etc.
524
+ # @yield [result, operation] Access the result along with the RPC operation
525
+ # @yieldparam result [Google::Cloud::Asset::V1::Feed]
526
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
527
+ # @return [Google::Cloud::Asset::V1::Feed]
528
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
529
+ # @example
530
+ # require "google/cloud/asset"
531
+ #
532
+ # asset_client = Google::Cloud::Asset.new(version: :v1)
533
+ # formatted_name = Google::Cloud::Asset::V1::AssetServiceClient.feed_path("[PROJECT]", "[FEED]")
534
+ # response = asset_client.get_feed(formatted_name)
535
+
536
+ def get_feed \
537
+ name,
538
+ options: nil,
539
+ &block
540
+ req = {
541
+ name: name
542
+ }.delete_if { |_, v| v.nil? }
543
+ req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::GetFeedRequest)
544
+ @get_feed.call(req, options, &block)
545
+ end
546
+
547
+ # Lists all asset feeds in a parent project/folder/organization.
548
+ #
549
+ # @param parent [String]
550
+ # Required. The parent project/folder/organization whose feeds are to be
551
+ # listed. It can only be using project/folder/organization number (such as
552
+ # "folders/12345")", or a project ID (such as "projects/my-project-id").
553
+ # @param options [Google::Gax::CallOptions]
554
+ # Overrides the default settings for this call, e.g, timeout,
555
+ # retries, etc.
556
+ # @yield [result, operation] Access the result along with the RPC operation
557
+ # @yieldparam result [Google::Cloud::Asset::V1::ListFeedsResponse]
558
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
559
+ # @return [Google::Cloud::Asset::V1::ListFeedsResponse]
560
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
561
+ # @example
562
+ # require "google/cloud/asset"
563
+ #
564
+ # asset_client = Google::Cloud::Asset.new(version: :v1)
565
+ #
566
+ # # TODO: Initialize `parent`:
567
+ # parent = ''
568
+ # response = asset_client.list_feeds(parent)
569
+
570
+ def list_feeds \
571
+ parent,
572
+ options: nil,
573
+ &block
574
+ req = {
575
+ parent: parent
576
+ }.delete_if { |_, v| v.nil? }
577
+ req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::ListFeedsRequest)
578
+ @list_feeds.call(req, options, &block)
579
+ end
580
+
581
+ # Updates an asset feed configuration.
582
+ #
583
+ # @param feed [Google::Cloud::Asset::V1::Feed | Hash]
584
+ # Required. The new values of feed details. It must match an existing feed and the
585
+ # field `name` must be in the format of:
586
+ # projects/project_number/feeds/feed_id or
587
+ # folders/folder_number/feeds/feed_id or
588
+ # organizations/organization_number/feeds/feed_id.
589
+ # A hash of the same form as `Google::Cloud::Asset::V1::Feed`
590
+ # can also be provided.
591
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
592
+ # Required. Only updates the `feed` fields indicated by this mask.
593
+ # The field mask must not be empty, and it must not contain fields that
594
+ # are immutable or only set by the server.
595
+ # A hash of the same form as `Google::Protobuf::FieldMask`
596
+ # can also be provided.
597
+ # @param options [Google::Gax::CallOptions]
598
+ # Overrides the default settings for this call, e.g, timeout,
599
+ # retries, etc.
600
+ # @yield [result, operation] Access the result along with the RPC operation
601
+ # @yieldparam result [Google::Cloud::Asset::V1::Feed]
602
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
603
+ # @return [Google::Cloud::Asset::V1::Feed]
604
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
605
+ # @example
606
+ # require "google/cloud/asset"
607
+ #
608
+ # asset_client = Google::Cloud::Asset.new(version: :v1)
609
+ #
610
+ # # TODO: Initialize `feed`:
611
+ # feed = {}
612
+ #
613
+ # # TODO: Initialize `update_mask`:
614
+ # update_mask = {}
615
+ # response = asset_client.update_feed(feed, update_mask)
616
+
617
+ def update_feed \
618
+ feed,
619
+ update_mask,
620
+ options: nil,
621
+ &block
622
+ req = {
623
+ feed: feed,
624
+ update_mask: update_mask
625
+ }.delete_if { |_, v| v.nil? }
626
+ req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::UpdateFeedRequest)
627
+ @update_feed.call(req, options, &block)
628
+ end
629
+
630
+ # Deletes an asset feed.
631
+ #
632
+ # @param name [String]
633
+ # Required. The name of the feed and it must be in the format of:
634
+ # projects/project_number/feeds/feed_id
635
+ # folders/folder_number/feeds/feed_id
636
+ # organizations/organization_number/feeds/feed_id
637
+ # @param options [Google::Gax::CallOptions]
638
+ # Overrides the default settings for this call, e.g, timeout,
639
+ # retries, etc.
640
+ # @yield [result, operation] Access the result along with the RPC operation
641
+ # @yieldparam result []
642
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
643
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
644
+ # @example
645
+ # require "google/cloud/asset"
646
+ #
647
+ # asset_client = Google::Cloud::Asset.new(version: :v1)
648
+ # formatted_name = Google::Cloud::Asset::V1::AssetServiceClient.feed_path("[PROJECT]", "[FEED]")
649
+ # asset_client.delete_feed(formatted_name)
650
+
651
+ def delete_feed \
652
+ name,
653
+ options: nil,
654
+ &block
655
+ req = {
656
+ name: name
657
+ }.delete_if { |_, v| v.nil? }
658
+ req = Google::Gax::to_proto(req, Google::Cloud::Asset::V1::DeleteFeedRequest)
659
+ @delete_feed.call(req, options, &block)
660
+ nil
661
+ end
398
662
  end
399
663
  end
400
664
  end
@@ -29,6 +29,31 @@
29
29
  "timeout_millis": 600000,
30
30
  "retry_codes_name": "idempotent",
31
31
  "retry_params_name": "default"
32
+ },
33
+ "CreateFeed": {
34
+ "timeout_millis": 30000,
35
+ "retry_codes_name": "non_idempotent",
36
+ "retry_params_name": "default"
37
+ },
38
+ "GetFeed": {
39
+ "timeout_millis": 10000,
40
+ "retry_codes_name": "idempotent",
41
+ "retry_params_name": "default"
42
+ },
43
+ "ListFeeds": {
44
+ "timeout_millis": 10000,
45
+ "retry_codes_name": "idempotent",
46
+ "retry_params_name": "default"
47
+ },
48
+ "UpdateFeed": {
49
+ "timeout_millis": 30000,
50
+ "retry_codes_name": "non_idempotent",
51
+ "retry_params_name": "default"
52
+ },
53
+ "DeleteFeed": {
54
+ "timeout_millis": 30000,
55
+ "retry_codes_name": "idempotent",
56
+ "retry_params_name": "default"
32
57
  }
33
58
  }
34
59
  }
@@ -34,6 +34,27 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
34
34
  add_message "google.cloud.asset.v1.BatchGetAssetsHistoryResponse" do
35
35
  repeated :assets, :message, 1, "google.cloud.asset.v1.TemporalAsset"
36
36
  end
37
+ add_message "google.cloud.asset.v1.CreateFeedRequest" do
38
+ optional :parent, :string, 1
39
+ optional :feed_id, :string, 2
40
+ optional :feed, :message, 3, "google.cloud.asset.v1.Feed"
41
+ end
42
+ add_message "google.cloud.asset.v1.GetFeedRequest" do
43
+ optional :name, :string, 1
44
+ end
45
+ add_message "google.cloud.asset.v1.ListFeedsRequest" do
46
+ optional :parent, :string, 1
47
+ end
48
+ add_message "google.cloud.asset.v1.ListFeedsResponse" do
49
+ repeated :feeds, :message, 1, "google.cloud.asset.v1.Feed"
50
+ end
51
+ add_message "google.cloud.asset.v1.UpdateFeedRequest" do
52
+ optional :feed, :message, 1, "google.cloud.asset.v1.Feed"
53
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
54
+ end
55
+ add_message "google.cloud.asset.v1.DeleteFeedRequest" do
56
+ optional :name, :string, 1
57
+ end
37
58
  add_message "google.cloud.asset.v1.OutputConfig" do
38
59
  oneof :destination do
39
60
  optional :gcs_destination, :message, 1, "google.cloud.asset.v1.GcsDestination"
@@ -51,6 +72,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
51
72
  optional :table, :string, 2
52
73
  optional :force, :bool, 3
53
74
  end
75
+ add_message "google.cloud.asset.v1.PubsubDestination" do
76
+ optional :topic, :string, 1
77
+ end
78
+ add_message "google.cloud.asset.v1.FeedOutputConfig" do
79
+ oneof :destination do
80
+ optional :pubsub_destination, :message, 1, "google.cloud.asset.v1.PubsubDestination"
81
+ end
82
+ end
83
+ add_message "google.cloud.asset.v1.Feed" do
84
+ optional :name, :string, 1
85
+ repeated :asset_names, :string, 2
86
+ repeated :asset_types, :string, 3
87
+ optional :content_type, :enum, 4, "google.cloud.asset.v1.ContentType"
88
+ optional :feed_output_config, :message, 5, "google.cloud.asset.v1.FeedOutputConfig"
89
+ end
54
90
  add_enum "google.cloud.asset.v1.ContentType" do
55
91
  value :CONTENT_TYPE_UNSPECIFIED, 0
56
92
  value :RESOURCE, 1
@@ -68,9 +104,18 @@ module Google
68
104
  ExportAssetsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ExportAssetsResponse").msgclass
69
105
  BatchGetAssetsHistoryRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.BatchGetAssetsHistoryRequest").msgclass
70
106
  BatchGetAssetsHistoryResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.BatchGetAssetsHistoryResponse").msgclass
107
+ CreateFeedRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.CreateFeedRequest").msgclass
108
+ GetFeedRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.GetFeedRequest").msgclass
109
+ ListFeedsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ListFeedsRequest").msgclass
110
+ ListFeedsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ListFeedsResponse").msgclass
111
+ UpdateFeedRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.UpdateFeedRequest").msgclass
112
+ DeleteFeedRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.DeleteFeedRequest").msgclass
71
113
  OutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.OutputConfig").msgclass
72
114
  GcsDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.GcsDestination").msgclass
73
115
  BigQueryDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.BigQueryDestination").msgclass
116
+ PubsubDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.PubsubDestination").msgclass
117
+ FeedOutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.FeedOutputConfig").msgclass
118
+ Feed = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.Feed").msgclass
74
119
  ContentType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ContentType").enummodule
75
120
  end
76
121
  end
@@ -48,6 +48,17 @@ module Google
48
48
  # If a specified asset does not exist, this API returns an INVALID_ARGUMENT
49
49
  # error.
50
50
  rpc :BatchGetAssetsHistory, BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse
51
+ # Creates a feed in a parent project/folder/organization to listen to its
52
+ # asset updates.
53
+ rpc :CreateFeed, CreateFeedRequest, Feed
54
+ # Gets details about an asset feed.
55
+ rpc :GetFeed, GetFeedRequest, Feed
56
+ # Lists all asset feeds in a parent project/folder/organization.
57
+ rpc :ListFeeds, ListFeedsRequest, ListFeedsResponse
58
+ # Updates an asset feed configuration.
59
+ rpc :UpdateFeed, UpdateFeedRequest, Feed
60
+ # Deletes an asset feed.
61
+ rpc :DeleteFeed, DeleteFeedRequest, Google::Protobuf::Empty
51
62
  end
52
63
 
53
64
  Stub = Service.rpc_stub_class
@@ -4,12 +4,12 @@
4
4
 
5
5
  require 'google/protobuf'
6
6
 
7
- require 'google/api/annotations_pb'
8
7
  require 'google/api/resource_pb'
9
8
  require 'google/iam/v1/policy_pb'
10
9
  require 'google/protobuf/any_pb'
11
10
  require 'google/protobuf/struct_pb'
12
11
  require 'google/protobuf/timestamp_pb'
12
+ require 'google/api/annotations_pb'
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_message "google.cloud.asset.v1.TemporalAsset" do
15
15
  optional :window, :message, 1, "google.cloud.asset.v1.TimeWindow"
@@ -25,6 +25,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
25
25
  optional :asset_type, :string, 2
26
26
  optional :resource, :message, 3, "google.cloud.asset.v1.Resource"
27
27
  optional :iam_policy, :message, 4, "google.iam.v1.Policy"
28
+ repeated :ancestors, :string, 10
28
29
  end
29
30
  add_message "google.cloud.asset.v1.Resource" do
30
31
  optional :version, :string, 1
@@ -97,6 +97,72 @@ module Google
97
97
  # A list of assets with valid time windows.
98
98
  class BatchGetAssetsHistoryResponse; end
99
99
 
100
+ # Create asset feed request.
101
+ # @!attribute [rw] parent
102
+ # @return [String]
103
+ # Required. The name of the project/folder/organization where this feed
104
+ # should be created in. It can only be an organization number (such as
105
+ # "organizations/123"), a folder number (such as "folders/123"), a project ID
106
+ # (such as "projects/my-project-id")", or a project number (such as
107
+ # "projects/12345").
108
+ # @!attribute [rw] feed_id
109
+ # @return [String]
110
+ # Required. This is the client-assigned asset feed identifier and it needs to
111
+ # be unique under a specific parent project/folder/organization.
112
+ # @!attribute [rw] feed
113
+ # @return [Google::Cloud::Asset::V1::Feed]
114
+ # Required. The feed details. The field `name` must be empty and it will be generated
115
+ # in the format of:
116
+ # projects/project_number/feeds/feed_id
117
+ # folders/folder_number/feeds/feed_id
118
+ # organizations/organization_number/feeds/feed_id
119
+ class CreateFeedRequest; end
120
+
121
+ # Get asset feed request.
122
+ # @!attribute [rw] name
123
+ # @return [String]
124
+ # Required. The name of the Feed and it must be in the format of:
125
+ # projects/project_number/feeds/feed_id
126
+ # folders/folder_number/feeds/feed_id
127
+ # organizations/organization_number/feeds/feed_id
128
+ class GetFeedRequest; end
129
+
130
+ # List asset feeds request.
131
+ # @!attribute [rw] parent
132
+ # @return [String]
133
+ # Required. The parent project/folder/organization whose feeds are to be
134
+ # listed. It can only be using project/folder/organization number (such as
135
+ # "folders/12345")", or a project ID (such as "projects/my-project-id").
136
+ class ListFeedsRequest; end
137
+
138
+ # @!attribute [rw] feeds
139
+ # @return [Array<Google::Cloud::Asset::V1::Feed>]
140
+ # A list of feeds.
141
+ class ListFeedsResponse; end
142
+
143
+ # Update asset feed request.
144
+ # @!attribute [rw] feed
145
+ # @return [Google::Cloud::Asset::V1::Feed]
146
+ # Required. The new values of feed details. It must match an existing feed and the
147
+ # field `name` must be in the format of:
148
+ # projects/project_number/feeds/feed_id or
149
+ # folders/folder_number/feeds/feed_id or
150
+ # organizations/organization_number/feeds/feed_id.
151
+ # @!attribute [rw] update_mask
152
+ # @return [Google::Protobuf::FieldMask]
153
+ # Required. Only updates the `feed` fields indicated by this mask.
154
+ # The field mask must not be empty, and it must not contain fields that
155
+ # are immutable or only set by the server.
156
+ class UpdateFeedRequest; end
157
+
158
+ # @!attribute [rw] name
159
+ # @return [String]
160
+ # Required. The name of the feed and it must be in the format of:
161
+ # projects/project_number/feeds/feed_id
162
+ # folders/folder_number/feeds/feed_id
163
+ # organizations/organization_number/feeds/feed_id
164
+ class DeleteFeedRequest; end
165
+
100
166
  # Output configuration for export assets destination.
101
167
  # @!attribute [rw] gcs_destination
102
168
  # @return [Google::Cloud::Asset::V1::GcsDestination]
@@ -150,6 +216,62 @@ module Google
150
216
  # returns an error.
151
217
  class BigQueryDestination; end
152
218
 
219
+ # A Cloud Pubsub destination.
220
+ # @!attribute [rw] topic
221
+ # @return [String]
222
+ # The name of the Cloud Pub/Sub topic to publish to.
223
+ # For example: `projects/PROJECT_ID/topics/TOPIC_ID`.
224
+ class PubsubDestination; end
225
+
226
+ # Output configuration for asset feed destination.
227
+ # @!attribute [rw] pubsub_destination
228
+ # @return [Google::Cloud::Asset::V1::PubsubDestination]
229
+ # Destination on Cloud Pubsub.
230
+ class FeedOutputConfig; end
231
+
232
+ # An asset feed used to export asset updates to a destinations.
233
+ # An asset feed filter controls what updates are exported.
234
+ # The asset feed must be created within a project, organization, or
235
+ # folder. Supported destinations are:
236
+ # Cloud Pub/Sub topics.
237
+ # @!attribute [rw] name
238
+ # @return [String]
239
+ # Required. The format will be
240
+ # projects/\\{project_number}/feeds/{client-assigned_feed_identifier} or
241
+ # folders/\\{folder_number}/feeds/{client-assigned_feed_identifier} or
242
+ # organizations/\\{organization_number}/feeds/{client-assigned_feed_identifier}
243
+ #
244
+ # The client-assigned feed identifier must be unique within the parent
245
+ # project/folder/organization.
246
+ # @!attribute [rw] asset_names
247
+ # @return [Array<String>]
248
+ # A list of the full names of the assets to receive updates. You must specify
249
+ # either or both of asset_names and asset_types. Only asset updates matching
250
+ # specified asset_names and asset_types are exported to the feed. For
251
+ # example:
252
+ # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
253
+ # See [Resource
254
+ # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
255
+ # for more info.
256
+ # @!attribute [rw] asset_types
257
+ # @return [Array<String>]
258
+ # A list of types of the assets to receive updates. You must specify either
259
+ # or both of asset_names and asset_types. Only asset updates matching
260
+ # specified asset_names and asset_types are exported to the feed.
261
+ # For example:
262
+ # "compute.googleapis.com/Disk" See [Introduction to Cloud Asset
263
+ # Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
264
+ # for all supported asset types.
265
+ # @!attribute [rw] content_type
266
+ # @return [Google::Cloud::Asset::V1::ContentType]
267
+ # Asset content type. If not specified, no content but the asset name and
268
+ # type will be returned.
269
+ # @!attribute [rw] feed_output_config
270
+ # @return [Google::Cloud::Asset::V1::FeedOutputConfig]
271
+ # Required. Feed output configuration defining where the asset updates are
272
+ # published to.
273
+ class Feed; end
274
+
153
275
  # Asset content type.
154
276
  module ContentType
155
277
  # Unspecified content type.
@@ -59,6 +59,14 @@ module Google
59
59
  # @return [Google::Iam::V1::Policy]
60
60
  # Representation of the actual Cloud IAM policy set on a cloud resource. For
61
61
  # each resource, there must be at most one Cloud IAM policy set on it.
62
+ # @!attribute [rw] ancestors
63
+ # @return [Array<String>]
64
+ # Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
65
+ # represented as a list of relative resource names. Ancestry path starts with
66
+ # the closest CRM ancestor and ends at root. If the asset is a CRM
67
+ # project/folder/organization, this starts from the asset itself.
68
+ #
69
+ # Example: ["projects/123456789", "folders/5432", "organizations/1234"]
62
70
  class Asset; end
63
71
 
64
72
  # Representation of a cloud resource.
@@ -0,0 +1,29 @@
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 Protobuf
18
+ # A generic empty message that you can re-use to avoid defining duplicated
19
+ # empty messages in your APIs. A typical example is to use it as the request
20
+ # or the response type of an API method. For instance:
21
+ #
22
+ # service Foo {
23
+ # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
24
+ # }
25
+ #
26
+ # The JSON representation for `Empty` is empty JSON object `{}`.
27
+ class Empty; end
28
+ end
29
+ end
@@ -0,0 +1,222 @@
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 Protobuf
18
+ # `FieldMask` represents a set of symbolic field paths, for example:
19
+ #
20
+ # paths: "f.a"
21
+ # paths: "f.b.d"
22
+ #
23
+ # Here `f` represents a field in some root message, `a` and `b`
24
+ # fields in the message found in `f`, and `d` a field found in the
25
+ # message in `f.b`.
26
+ #
27
+ # Field masks are used to specify a subset of fields that should be
28
+ # returned by a get operation or modified by an update operation.
29
+ # Field masks also have a custom JSON encoding (see below).
30
+ #
31
+ # = Field Masks in Projections
32
+ #
33
+ # When used in the context of a projection, a response message or
34
+ # sub-message is filtered by the API to only contain those fields as
35
+ # specified in the mask. For example, if the mask in the previous
36
+ # example is applied to a response message as follows:
37
+ #
38
+ # f {
39
+ # a : 22
40
+ # b {
41
+ # d : 1
42
+ # x : 2
43
+ # }
44
+ # y : 13
45
+ # }
46
+ # z: 8
47
+ #
48
+ # The result will not contain specific values for fields x,y and z
49
+ # (their value will be set to the default, and omitted in proto text
50
+ # output):
51
+ #
52
+ #
53
+ # f {
54
+ # a : 22
55
+ # b {
56
+ # d : 1
57
+ # }
58
+ # }
59
+ #
60
+ # A repeated field is not allowed except at the last position of a
61
+ # paths string.
62
+ #
63
+ # If a FieldMask object is not present in a get operation, the
64
+ # operation applies to all fields (as if a FieldMask of all fields
65
+ # had been specified).
66
+ #
67
+ # Note that a field mask does not necessarily apply to the
68
+ # top-level response message. In case of a REST get operation, the
69
+ # field mask applies directly to the response, but in case of a REST
70
+ # list operation, the mask instead applies to each individual message
71
+ # in the returned resource list. In case of a REST custom method,
72
+ # other definitions may be used. Where the mask applies will be
73
+ # clearly documented together with its declaration in the API. In
74
+ # any case, the effect on the returned resource/resources is required
75
+ # behavior for APIs.
76
+ #
77
+ # = Field Masks in Update Operations
78
+ #
79
+ # A field mask in update operations specifies which fields of the
80
+ # targeted resource are going to be updated. The API is required
81
+ # to only change the values of the fields as specified in the mask
82
+ # and leave the others untouched. If a resource is passed in to
83
+ # describe the updated values, the API ignores the values of all
84
+ # fields not covered by the mask.
85
+ #
86
+ # If a repeated field is specified for an update operation, new values will
87
+ # be appended to the existing repeated field in the target resource. Note that
88
+ # a repeated field is only allowed in the last position of a `paths` string.
89
+ #
90
+ # If a sub-message is specified in the last position of the field mask for an
91
+ # update operation, then new value will be merged into the existing sub-message
92
+ # in the target resource.
93
+ #
94
+ # For example, given the target message:
95
+ #
96
+ # f {
97
+ # b {
98
+ # d: 1
99
+ # x: 2
100
+ # }
101
+ # c: [1]
102
+ # }
103
+ #
104
+ # And an update message:
105
+ #
106
+ # f {
107
+ # b {
108
+ # d: 10
109
+ # }
110
+ # c: [2]
111
+ # }
112
+ #
113
+ # then if the field mask is:
114
+ #
115
+ # paths: ["f.b", "f.c"]
116
+ #
117
+ # then the result will be:
118
+ #
119
+ # f {
120
+ # b {
121
+ # d: 10
122
+ # x: 2
123
+ # }
124
+ # c: [1, 2]
125
+ # }
126
+ #
127
+ # An implementation may provide options to override this default behavior for
128
+ # repeated and message fields.
129
+ #
130
+ # In order to reset a field's value to the default, the field must
131
+ # be in the mask and set to the default value in the provided resource.
132
+ # Hence, in order to reset all fields of a resource, provide a default
133
+ # instance of the resource and set all fields in the mask, or do
134
+ # not provide a mask as described below.
135
+ #
136
+ # If a field mask is not present on update, the operation applies to
137
+ # all fields (as if a field mask of all fields has been specified).
138
+ # Note that in the presence of schema evolution, this may mean that
139
+ # fields the client does not know and has therefore not filled into
140
+ # the request will be reset to their default. If this is unwanted
141
+ # behavior, a specific service may require a client to always specify
142
+ # a field mask, producing an error if not.
143
+ #
144
+ # As with get operations, the location of the resource which
145
+ # describes the updated values in the request message depends on the
146
+ # operation kind. In any case, the effect of the field mask is
147
+ # required to be honored by the API.
148
+ #
149
+ # == Considerations for HTTP REST
150
+ #
151
+ # The HTTP kind of an update operation which uses a field mask must
152
+ # be set to PATCH instead of PUT in order to satisfy HTTP semantics
153
+ # (PUT must only be used for full updates).
154
+ #
155
+ # = JSON Encoding of Field Masks
156
+ #
157
+ # In JSON, a field mask is encoded as a single string where paths are
158
+ # separated by a comma. Fields name in each path are converted
159
+ # to/from lower-camel naming conventions.
160
+ #
161
+ # As an example, consider the following message declarations:
162
+ #
163
+ # message Profile {
164
+ # User user = 1;
165
+ # Photo photo = 2;
166
+ # }
167
+ # message User {
168
+ # string display_name = 1;
169
+ # string address = 2;
170
+ # }
171
+ #
172
+ # In proto a field mask for `Profile` may look as such:
173
+ #
174
+ # mask {
175
+ # paths: "user.display_name"
176
+ # paths: "photo"
177
+ # }
178
+ #
179
+ # In JSON, the same mask is represented as below:
180
+ #
181
+ # {
182
+ # mask: "user.displayName,photo"
183
+ # }
184
+ #
185
+ # = Field Masks and Oneof Fields
186
+ #
187
+ # Field masks treat fields in oneofs just as regular fields. Consider the
188
+ # following message:
189
+ #
190
+ # message SampleMessage {
191
+ # oneof test_oneof {
192
+ # string name = 4;
193
+ # SubMessage sub_message = 9;
194
+ # }
195
+ # }
196
+ #
197
+ # The field mask can be:
198
+ #
199
+ # mask {
200
+ # paths: "name"
201
+ # }
202
+ #
203
+ # Or:
204
+ #
205
+ # mask {
206
+ # paths: "sub_message"
207
+ # }
208
+ #
209
+ # Note that oneof type names ("test_oneof" in this case) cannot be used in
210
+ # paths.
211
+ #
212
+ # == Field Mask Verification
213
+ #
214
+ # The implementation of any API method which has a FieldMask type field in the
215
+ # request should verify the included field paths, and return an
216
+ # `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
217
+ # @!attribute [rw] paths
218
+ # @return [Array<String>]
219
+ # The set of field mask paths.
220
+ class FieldMask; end
221
+ end
222
+ end
@@ -18,6 +18,14 @@ module Google
18
18
  module V1
19
19
  class AssetServiceClient
20
20
 
21
+ # Alias for Google::Cloud::Asset::V1::AssetServiceClient.feed_path.
22
+ # @param project [String]
23
+ # @param feed [String]
24
+ # @return [String]
25
+ def feed_path project, feed
26
+ self.class.feed_path project, feed
27
+ end
28
+
21
29
  # Alias for Google::Cloud::Asset::V1::AssetServiceClient.project_path.
22
30
  # @param project [String]
23
31
  # @return [String]
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Asset
19
- VERSION = "0.5.2".freeze
19
+ VERSION = "0.6.0".freeze
20
20
  end
21
21
  end
22
22
  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.5.2
4
+ version: 0.6.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-11-20 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -171,6 +171,8 @@ files:
171
171
  - lib/google/cloud/asset/v1/doc/google/iam/v1/policy.rb
172
172
  - lib/google/cloud/asset/v1/doc/google/longrunning/operations.rb
173
173
  - lib/google/cloud/asset/v1/doc/google/protobuf/any.rb
174
+ - lib/google/cloud/asset/v1/doc/google/protobuf/empty.rb
175
+ - lib/google/cloud/asset/v1/doc/google/protobuf/field_mask.rb
174
176
  - lib/google/cloud/asset/v1/doc/google/protobuf/struct.rb
175
177
  - lib/google/cloud/asset/v1/doc/google/protobuf/timestamp.rb
176
178
  - lib/google/cloud/asset/v1/doc/google/rpc/status.rb