google-cloud-security_center 0.6.0 → 0.7.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: d381b69c5fbbb368fd9b5e2f33a5d70ac5191d6178c7c599460f42c91b7651db
4
- data.tar.gz: 2c4bdf0224df6c5831de578cf9ddd775c528a5b8a2ddde78890d3b09c61643d0
3
+ metadata.gz: c53987a65142ff94fc7bf23fb5d21a65ffa9aa04011ce3547dbfbd800fece172
4
+ data.tar.gz: 2f159336e93dfed91e0c442b6a2c3115d23f8adb71bbf4914ca9cbb49df423ce
5
5
  SHA512:
6
- metadata.gz: ec0518134687aac0c09b9e17381c5419bf58bcf44a9e8e54d6733e8b653958217887ff90bf3e4e137435e51ea3630c0e0dcc49fd5fad5725c200b3af65ca419d
7
- data.tar.gz: 01de529448dc8ffaf90e04b681289232b541f306da2e1150830124b9ddb2a7158e5553390102f1781c51e2a4718519e337636a4e922ba0fa29d6d0a32a3314f8
6
+ metadata.gz: 142ee68972dbed6f5037db53d794f304f44300c94c8e63565e99bc615596c55ea56c746182b71798afbfb31616df6c8b067fa7a1d618af9b26765674d47f3bd2
7
+ data.tar.gz: 2f97d88ecc50ed333d11d16a0273e80ac587c86a73fb1d4ca244707c4cb6303607dc5371f57b0afc9e5a78277481ddee29521ca8a800a82c59180a92b7c0efbc
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Ruby Client for Cloud Security Command Center API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
1
+ # Ruby Client for Cloud Security Command Center API
2
2
 
3
3
  [Cloud Security Command Center API][Product Documentation]:
4
4
  Cloud Security Command Center API provides access to temporal views of
@@ -21,7 +21,7 @@ module Google
21
21
  # rubocop:disable LineLength
22
22
 
23
23
  ##
24
- # # Ruby Client for Cloud Security Command Center API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
24
+ # # Ruby Client for Cloud Security Command Center API
25
25
  #
26
26
  # [Cloud Security Command Center API][Product Documentation]:
27
27
  # Cloud Security Command Center API provides access to temporal views of
@@ -23,7 +23,7 @@ module Google
23
23
  # rubocop:disable LineLength
24
24
 
25
25
  ##
26
- # # Ruby Client for Cloud Security Command Center API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
26
+ # # Ruby Client for Cloud Security Command Center API
27
27
  #
28
28
  # [Cloud Security Command Center API][Product Documentation]:
29
29
  # Cloud Security Command Center API provides access to temporal views of
@@ -18,14 +18,6 @@ module Google
18
18
  module V1
19
19
  class SecurityCenterClient
20
20
 
21
- # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.asset_path.
22
- # @param organization [String]
23
- # @param asset [String]
24
- # @return [String]
25
- def asset_path organization, asset
26
- self.class.asset_path organization, asset
27
- end
28
-
29
21
  # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.asset_security_marks_path.
30
22
  # @param organization [String]
31
23
  # @param asset [String]
@@ -66,13 +58,6 @@ module Google
66
58
  self.class.organization_settings_path organization
67
59
  end
68
60
 
69
- # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.organization_sources_path.
70
- # @param organization [String]
71
- # @return [String]
72
- def organization_sources_path organization
73
- self.class.organization_sources_path organization
74
- end
75
-
76
61
  # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path.
77
62
  # @param organization [String]
78
63
  # @param source [String]
@@ -91,12 +91,6 @@ module Google
91
91
  self::GRPC_INTERCEPTORS = SecurityCenterClient::GRPC_INTERCEPTORS
92
92
  end
93
93
 
94
- ASSET_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
95
- "organizations/{organization}/assets/{asset}"
96
- )
97
-
98
- private_constant :ASSET_PATH_TEMPLATE
99
-
100
94
  ASSET_SECURITY_MARKS_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
101
95
  "organizations/{organization}/assets/{asset}/securityMarks"
102
96
  )
@@ -127,30 +121,15 @@ module Google
127
121
 
128
122
  private_constant :ORGANIZATION_SETTINGS_PATH_TEMPLATE
129
123
 
130
- ORGANIZATION_SOURCES_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
131
- "organizations/{organization}/sources/-"
132
- )
133
-
134
- private_constant :ORGANIZATION_SOURCES_PATH_TEMPLATE
135
-
136
124
  SOURCE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
137
125
  "organizations/{organization}/sources/{source}"
138
126
  )
139
127
 
140
128
  private_constant :SOURCE_PATH_TEMPLATE
141
129
 
142
- # Returns a fully-qualified asset resource name string.
143
- # @param organization [String]
144
- # @param asset [String]
145
- # @return [String]
146
- def self.asset_path organization, asset
147
- ASSET_PATH_TEMPLATE.render(
148
- :"organization" => organization,
149
- :"asset" => asset
150
- )
151
- end
152
-
153
130
  # Returns a fully-qualified asset_security_marks resource name string.
131
+ # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
132
+ # This helper function will be deleted in the next major version.
154
133
  # @param organization [String]
155
134
  # @param asset [String]
156
135
  # @return [String]
@@ -175,6 +154,8 @@ module Google
175
154
  end
176
155
 
177
156
  # Returns a fully-qualified finding_security_marks resource name string.
157
+ # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
158
+ # This helper function will be deleted in the next major version.
178
159
  # @param organization [String]
179
160
  # @param source [String]
180
161
  # @param finding [String]
@@ -205,15 +186,6 @@ module Google
205
186
  )
206
187
  end
207
188
 
208
- # Returns a fully-qualified organization_sources resource name string.
209
- # @param organization [String]
210
- # @return [String]
211
- def self.organization_sources_path organization
212
- ORGANIZATION_SOURCES_PATH_TEMPLATE.render(
213
- :"organization" => organization
214
- )
215
- end
216
-
217
189
  # Returns a fully-qualified source resource name string.
218
190
  # @param organization [String]
219
191
  # @param source [String]
@@ -346,6 +318,38 @@ module Google
346
318
  &Google::Cloud::SecurityCenter::V1::SecurityCenter::Stub.method(:new)
347
319
  )
348
320
 
321
+ @get_iam_policy = Google::Gax.create_api_call(
322
+ @security_center_stub.method(:get_iam_policy),
323
+ defaults["get_iam_policy"],
324
+ exception_transformer: exception_transformer,
325
+ params_extractor: proc do |request|
326
+ {'resource' => request.resource}
327
+ end
328
+ )
329
+ @group_assets = Google::Gax.create_api_call(
330
+ @security_center_stub.method(:group_assets),
331
+ defaults["group_assets"],
332
+ exception_transformer: exception_transformer,
333
+ params_extractor: proc do |request|
334
+ {'parent' => request.parent}
335
+ end
336
+ )
337
+ @group_findings = Google::Gax.create_api_call(
338
+ @security_center_stub.method(:group_findings),
339
+ defaults["group_findings"],
340
+ exception_transformer: exception_transformer,
341
+ params_extractor: proc do |request|
342
+ {'parent' => request.parent}
343
+ end
344
+ )
345
+ @test_iam_permissions = Google::Gax.create_api_call(
346
+ @security_center_stub.method(:test_iam_permissions),
347
+ defaults["test_iam_permissions"],
348
+ exception_transformer: exception_transformer,
349
+ params_extractor: proc do |request|
350
+ {'resource' => request.resource}
351
+ end
352
+ )
349
353
  @create_source = Google::Gax.create_api_call(
350
354
  @security_center_stub.method(:create_source),
351
355
  defaults["create_source"],
@@ -362,14 +366,6 @@ module Google
362
366
  {'parent' => request.parent}
363
367
  end
364
368
  )
365
- @get_iam_policy = Google::Gax.create_api_call(
366
- @security_center_stub.method(:get_iam_policy),
367
- defaults["get_iam_policy"],
368
- exception_transformer: exception_transformer,
369
- params_extractor: proc do |request|
370
- {'resource' => request.resource}
371
- end
372
- )
373
369
  @get_organization_settings = Google::Gax.create_api_call(
374
370
  @security_center_stub.method(:get_organization_settings),
375
371
  defaults["get_organization_settings"],
@@ -386,22 +382,6 @@ module Google
386
382
  {'name' => request.name}
387
383
  end
388
384
  )
389
- @group_assets = Google::Gax.create_api_call(
390
- @security_center_stub.method(:group_assets),
391
- defaults["group_assets"],
392
- exception_transformer: exception_transformer,
393
- params_extractor: proc do |request|
394
- {'parent' => request.parent}
395
- end
396
- )
397
- @group_findings = Google::Gax.create_api_call(
398
- @security_center_stub.method(:group_findings),
399
- defaults["group_findings"],
400
- exception_transformer: exception_transformer,
401
- params_extractor: proc do |request|
402
- {'parent' => request.parent}
403
- end
404
- )
405
385
  @list_assets = Google::Gax.create_api_call(
406
386
  @security_center_stub.method(:list_assets),
407
387
  defaults["list_assets"],
@@ -450,14 +430,6 @@ module Google
450
430
  {'resource' => request.resource}
451
431
  end
452
432
  )
453
- @test_iam_permissions = Google::Gax.create_api_call(
454
- @security_center_stub.method(:test_iam_permissions),
455
- defaults["test_iam_permissions"],
456
- exception_transformer: exception_transformer,
457
- params_extractor: proc do |request|
458
- {'resource' => request.resource}
459
- end
460
- )
461
433
  @update_finding = Google::Gax.create_api_call(
462
434
  @security_center_stub.method(:update_finding),
463
435
  defaults["update_finding"],
@@ -494,98 +466,6 @@ module Google
494
466
 
495
467
  # Service calls
496
468
 
497
- # Creates a source.
498
- #
499
- # @param parent [String]
500
- # Required. Resource name of the new source's parent. Its format should be
501
- # "organizations/[organization_id]".
502
- # @param source [Google::Cloud::SecurityCenter::V1::Source | Hash]
503
- # Required. The Source being created, only the display_name and description will be
504
- # used. All other fields will be ignored.
505
- # A hash of the same form as `Google::Cloud::SecurityCenter::V1::Source`
506
- # can also be provided.
507
- # @param options [Google::Gax::CallOptions]
508
- # Overrides the default settings for this call, e.g, timeout,
509
- # retries, etc.
510
- # @yield [result, operation] Access the result along with the RPC operation
511
- # @yieldparam result [Google::Cloud::SecurityCenter::V1::Source]
512
- # @yieldparam operation [GRPC::ActiveCall::Operation]
513
- # @return [Google::Cloud::SecurityCenter::V1::Source]
514
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
515
- # @example
516
- # require "google/cloud/security_center"
517
- #
518
- # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
519
- # formatted_parent = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.organization_path("[ORGANIZATION]")
520
- #
521
- # # TODO: Initialize `source`:
522
- # source = {}
523
- # response = security_center_client.create_source(formatted_parent, source)
524
-
525
- def create_source \
526
- parent,
527
- source,
528
- options: nil,
529
- &block
530
- req = {
531
- parent: parent,
532
- source: source
533
- }.delete_if { |_, v| v.nil? }
534
- req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::CreateSourceRequest)
535
- @create_source.call(req, options, &block)
536
- end
537
-
538
- # Creates a finding. The corresponding source must exist for finding creation
539
- # to succeed.
540
- #
541
- # @param parent [String]
542
- # Required. Resource name of the new finding's parent. Its format should be
543
- # "organizations/[organization_id]/sources/[source_id]".
544
- # @param finding_id [String]
545
- # Required. Unique identifier provided by the client within the parent scope.
546
- # It must be alphanumeric and less than or equal to 32 characters and
547
- # greater than 0 characters in length.
548
- # @param finding [Google::Cloud::SecurityCenter::V1::Finding | Hash]
549
- # Required. The Finding being created. The name and security_marks will be ignored as
550
- # they are both output only fields on this resource.
551
- # A hash of the same form as `Google::Cloud::SecurityCenter::V1::Finding`
552
- # can also be provided.
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::SecurityCenter::V1::Finding]
558
- # @yieldparam operation [GRPC::ActiveCall::Operation]
559
- # @return [Google::Cloud::SecurityCenter::V1::Finding]
560
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
561
- # @example
562
- # require "google/cloud/security_center"
563
- #
564
- # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
565
- # formatted_parent = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
566
- #
567
- # # TODO: Initialize `finding_id`:
568
- # finding_id = ''
569
- #
570
- # # TODO: Initialize `finding`:
571
- # finding = {}
572
- # response = security_center_client.create_finding(formatted_parent, finding_id, finding)
573
-
574
- def create_finding \
575
- parent,
576
- finding_id,
577
- finding,
578
- options: nil,
579
- &block
580
- req = {
581
- parent: parent,
582
- finding_id: finding_id,
583
- finding: finding
584
- }.delete_if { |_, v| v.nil? }
585
- req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::CreateFindingRequest)
586
- @create_finding.call(req, options, &block)
587
- end
588
-
589
469
  # Gets the access control policy on the specified Source.
590
470
  #
591
471
  # @param resource [String]
@@ -608,8 +488,10 @@ module Google
608
488
  # require "google/cloud/security_center"
609
489
  #
610
490
  # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
611
- # formatted_resource = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
612
- # response = security_center_client.get_iam_policy(formatted_resource)
491
+ #
492
+ # # TODO: Initialize `resource`:
493
+ # resource = ''
494
+ # response = security_center_client.get_iam_policy(resource)
613
495
 
614
496
  def get_iam_policy \
615
497
  resource,
@@ -624,68 +506,6 @@ module Google
624
506
  @get_iam_policy.call(req, options, &block)
625
507
  end
626
508
 
627
- # Gets the settings for an organization.
628
- #
629
- # @param name [String]
630
- # Required. Name of the organization to get organization settings for. Its format is
631
- # "organizations/[organization_id]/organizationSettings".
632
- # @param options [Google::Gax::CallOptions]
633
- # Overrides the default settings for this call, e.g, timeout,
634
- # retries, etc.
635
- # @yield [result, operation] Access the result along with the RPC operation
636
- # @yieldparam result [Google::Cloud::SecurityCenter::V1::OrganizationSettings]
637
- # @yieldparam operation [GRPC::ActiveCall::Operation]
638
- # @return [Google::Cloud::SecurityCenter::V1::OrganizationSettings]
639
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
640
- # @example
641
- # require "google/cloud/security_center"
642
- #
643
- # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
644
- # formatted_name = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.organization_settings_path("[ORGANIZATION]")
645
- # response = security_center_client.get_organization_settings(formatted_name)
646
-
647
- def get_organization_settings \
648
- name,
649
- options: nil,
650
- &block
651
- req = {
652
- name: name
653
- }.delete_if { |_, v| v.nil? }
654
- req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest)
655
- @get_organization_settings.call(req, options, &block)
656
- end
657
-
658
- # Gets a source.
659
- #
660
- # @param name [String]
661
- # Required. Relative resource name of the source. Its format is
662
- # "organizations/[organization_id]/source/[source_id]".
663
- # @param options [Google::Gax::CallOptions]
664
- # Overrides the default settings for this call, e.g, timeout,
665
- # retries, etc.
666
- # @yield [result, operation] Access the result along with the RPC operation
667
- # @yieldparam result [Google::Cloud::SecurityCenter::V1::Source]
668
- # @yieldparam operation [GRPC::ActiveCall::Operation]
669
- # @return [Google::Cloud::SecurityCenter::V1::Source]
670
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
671
- # @example
672
- # require "google/cloud/security_center"
673
- #
674
- # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
675
- # formatted_name = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
676
- # response = security_center_client.get_source(formatted_name)
677
-
678
- def get_source \
679
- name,
680
- options: nil,
681
- &block
682
- req = {
683
- name: name
684
- }.delete_if { |_, v| v.nil? }
685
- req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::GetSourceRequest)
686
- @get_source.call(req, options, &block)
687
- end
688
-
689
509
  # Filters an organization's assets and groups them by their specified
690
510
  # properties.
691
511
  #
@@ -1033,6 +853,203 @@ module Google
1033
853
  @group_findings.call(req, options, &block)
1034
854
  end
1035
855
 
856
+ # Returns the permissions that a caller has on the specified source.
857
+ #
858
+ # @param resource [String]
859
+ # REQUIRED: The resource for which the policy detail is being requested.
860
+ # See the operation documentation for the appropriate value for this field.
861
+ # @param permissions [Array<String>]
862
+ # The set of permissions to check for the `resource`. Permissions with
863
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
864
+ # information see
865
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
866
+ # @param options [Google::Gax::CallOptions]
867
+ # Overrides the default settings for this call, e.g, timeout,
868
+ # retries, etc.
869
+ # @yield [result, operation] Access the result along with the RPC operation
870
+ # @yieldparam result [Google::Iam::V1::TestIamPermissionsResponse]
871
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
872
+ # @return [Google::Iam::V1::TestIamPermissionsResponse]
873
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
874
+ # @example
875
+ # require "google/cloud/security_center"
876
+ #
877
+ # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
878
+ #
879
+ # # TODO: Initialize `resource`:
880
+ # resource = ''
881
+ #
882
+ # # TODO: Initialize `permissions`:
883
+ # permissions = []
884
+ # response = security_center_client.test_iam_permissions(resource, permissions)
885
+
886
+ def test_iam_permissions \
887
+ resource,
888
+ permissions,
889
+ options: nil,
890
+ &block
891
+ req = {
892
+ resource: resource,
893
+ permissions: permissions
894
+ }.delete_if { |_, v| v.nil? }
895
+ req = Google::Gax::to_proto(req, Google::Iam::V1::TestIamPermissionsRequest)
896
+ @test_iam_permissions.call(req, options, &block)
897
+ end
898
+
899
+ # Creates a source.
900
+ #
901
+ # @param parent [String]
902
+ # Required. Resource name of the new source's parent. Its format should be
903
+ # "organizations/[organization_id]".
904
+ # @param source [Google::Cloud::SecurityCenter::V1::Source | Hash]
905
+ # Required. The Source being created, only the display_name and description will be
906
+ # used. All other fields will be ignored.
907
+ # A hash of the same form as `Google::Cloud::SecurityCenter::V1::Source`
908
+ # can also be provided.
909
+ # @param options [Google::Gax::CallOptions]
910
+ # Overrides the default settings for this call, e.g, timeout,
911
+ # retries, etc.
912
+ # @yield [result, operation] Access the result along with the RPC operation
913
+ # @yieldparam result [Google::Cloud::SecurityCenter::V1::Source]
914
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
915
+ # @return [Google::Cloud::SecurityCenter::V1::Source]
916
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
917
+ # @example
918
+ # require "google/cloud/security_center"
919
+ #
920
+ # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
921
+ # formatted_parent = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.organization_path("[ORGANIZATION]")
922
+ #
923
+ # # TODO: Initialize `source`:
924
+ # source = {}
925
+ # response = security_center_client.create_source(formatted_parent, source)
926
+
927
+ def create_source \
928
+ parent,
929
+ source,
930
+ options: nil,
931
+ &block
932
+ req = {
933
+ parent: parent,
934
+ source: source
935
+ }.delete_if { |_, v| v.nil? }
936
+ req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::CreateSourceRequest)
937
+ @create_source.call(req, options, &block)
938
+ end
939
+
940
+ # Creates a finding. The corresponding source must exist for finding creation
941
+ # to succeed.
942
+ #
943
+ # @param parent [String]
944
+ # Required. Resource name of the new finding's parent. Its format should be
945
+ # "organizations/[organization_id]/sources/[source_id]".
946
+ # @param finding_id [String]
947
+ # Required. Unique identifier provided by the client within the parent scope.
948
+ # It must be alphanumeric and less than or equal to 32 characters and
949
+ # greater than 0 characters in length.
950
+ # @param finding [Google::Cloud::SecurityCenter::V1::Finding | Hash]
951
+ # Required. The Finding being created. The name and security_marks will be ignored as
952
+ # they are both output only fields on this resource.
953
+ # A hash of the same form as `Google::Cloud::SecurityCenter::V1::Finding`
954
+ # can also be provided.
955
+ # @param options [Google::Gax::CallOptions]
956
+ # Overrides the default settings for this call, e.g, timeout,
957
+ # retries, etc.
958
+ # @yield [result, operation] Access the result along with the RPC operation
959
+ # @yieldparam result [Google::Cloud::SecurityCenter::V1::Finding]
960
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
961
+ # @return [Google::Cloud::SecurityCenter::V1::Finding]
962
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
963
+ # @example
964
+ # require "google/cloud/security_center"
965
+ #
966
+ # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
967
+ # formatted_parent = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
968
+ #
969
+ # # TODO: Initialize `finding_id`:
970
+ # finding_id = ''
971
+ #
972
+ # # TODO: Initialize `finding`:
973
+ # finding = {}
974
+ # response = security_center_client.create_finding(formatted_parent, finding_id, finding)
975
+
976
+ def create_finding \
977
+ parent,
978
+ finding_id,
979
+ finding,
980
+ options: nil,
981
+ &block
982
+ req = {
983
+ parent: parent,
984
+ finding_id: finding_id,
985
+ finding: finding
986
+ }.delete_if { |_, v| v.nil? }
987
+ req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::CreateFindingRequest)
988
+ @create_finding.call(req, options, &block)
989
+ end
990
+
991
+ # Gets the settings for an organization.
992
+ #
993
+ # @param name [String]
994
+ # Required. Name of the organization to get organization settings for. Its format is
995
+ # "organizations/[organization_id]/organizationSettings".
996
+ # @param options [Google::Gax::CallOptions]
997
+ # Overrides the default settings for this call, e.g, timeout,
998
+ # retries, etc.
999
+ # @yield [result, operation] Access the result along with the RPC operation
1000
+ # @yieldparam result [Google::Cloud::SecurityCenter::V1::OrganizationSettings]
1001
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1002
+ # @return [Google::Cloud::SecurityCenter::V1::OrganizationSettings]
1003
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
1004
+ # @example
1005
+ # require "google/cloud/security_center"
1006
+ #
1007
+ # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
1008
+ # formatted_name = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.organization_settings_path("[ORGANIZATION]")
1009
+ # response = security_center_client.get_organization_settings(formatted_name)
1010
+
1011
+ def get_organization_settings \
1012
+ name,
1013
+ options: nil,
1014
+ &block
1015
+ req = {
1016
+ name: name
1017
+ }.delete_if { |_, v| v.nil? }
1018
+ req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest)
1019
+ @get_organization_settings.call(req, options, &block)
1020
+ end
1021
+
1022
+ # Gets a source.
1023
+ #
1024
+ # @param name [String]
1025
+ # Required. Relative resource name of the source. Its format is
1026
+ # "organizations/[organization_id]/source/[source_id]".
1027
+ # @param options [Google::Gax::CallOptions]
1028
+ # Overrides the default settings for this call, e.g, timeout,
1029
+ # retries, etc.
1030
+ # @yield [result, operation] Access the result along with the RPC operation
1031
+ # @yieldparam result [Google::Cloud::SecurityCenter::V1::Source]
1032
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1033
+ # @return [Google::Cloud::SecurityCenter::V1::Source]
1034
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
1035
+ # @example
1036
+ # require "google/cloud/security_center"
1037
+ #
1038
+ # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
1039
+ # formatted_name = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
1040
+ # response = security_center_client.get_source(formatted_name)
1041
+
1042
+ def get_source \
1043
+ name,
1044
+ options: nil,
1045
+ &block
1046
+ req = {
1047
+ name: name
1048
+ }.delete_if { |_, v| v.nil? }
1049
+ req = Google::Gax::to_proto(req, Google::Cloud::SecurityCenter::V1::GetSourceRequest)
1050
+ @get_source.call(req, options, &block)
1051
+ end
1052
+
1036
1053
  # Lists an organization's assets.
1037
1054
  #
1038
1055
  # @param parent [String]
@@ -1583,11 +1600,13 @@ module Google
1583
1600
  # require "google/cloud/security_center"
1584
1601
  #
1585
1602
  # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
1586
- # formatted_resource = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
1603
+ #
1604
+ # # TODO: Initialize `resource`:
1605
+ # resource = ''
1587
1606
  #
1588
1607
  # # TODO: Initialize `policy`:
1589
1608
  # policy = {}
1590
- # response = security_center_client.set_iam_policy(formatted_resource, policy)
1609
+ # response = security_center_client.set_iam_policy(resource, policy)
1591
1610
 
1592
1611
  def set_iam_policy \
1593
1612
  resource,
@@ -1602,47 +1621,6 @@ module Google
1602
1621
  @set_iam_policy.call(req, options, &block)
1603
1622
  end
1604
1623
 
1605
- # Returns the permissions that a caller has on the specified source.
1606
- #
1607
- # @param resource [String]
1608
- # REQUIRED: The resource for which the policy detail is being requested.
1609
- # See the operation documentation for the appropriate value for this field.
1610
- # @param permissions [Array<String>]
1611
- # The set of permissions to check for the `resource`. Permissions with
1612
- # wildcards (such as '*' or 'storage.*') are not allowed. For more
1613
- # information see
1614
- # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1615
- # @param options [Google::Gax::CallOptions]
1616
- # Overrides the default settings for this call, e.g, timeout,
1617
- # retries, etc.
1618
- # @yield [result, operation] Access the result along with the RPC operation
1619
- # @yieldparam result [Google::Iam::V1::TestIamPermissionsResponse]
1620
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1621
- # @return [Google::Iam::V1::TestIamPermissionsResponse]
1622
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1623
- # @example
1624
- # require "google/cloud/security_center"
1625
- #
1626
- # security_center_client = Google::Cloud::SecurityCenter.new(version: :v1)
1627
- # formatted_resource = Google::Cloud::SecurityCenter::V1::SecurityCenterClient.source_path("[ORGANIZATION]", "[SOURCE]")
1628
- #
1629
- # # TODO: Initialize `permissions`:
1630
- # permissions = []
1631
- # response = security_center_client.test_iam_permissions(formatted_resource, permissions)
1632
-
1633
- def test_iam_permissions \
1634
- resource,
1635
- permissions,
1636
- options: nil,
1637
- &block
1638
- req = {
1639
- resource: resource,
1640
- permissions: permissions
1641
- }.delete_if { |_, v| v.nil? }
1642
- req = Google::Gax::to_proto(req, Google::Iam::V1::TestIamPermissionsRequest)
1643
- @test_iam_permissions.call(req, options, &block)
1644
- end
1645
-
1646
1624
  # Creates or updates a finding. The corresponding source must exist for a
1647
1625
  # finding creation to succeed.
1648
1626
  #
@@ -20,37 +20,42 @@
20
20
  }
21
21
  },
22
22
  "methods": {
23
- "CreateSource": {
23
+ "GetIamPolicy": {
24
24
  "timeout_millis": 60000,
25
- "retry_codes_name": "non_idempotent",
25
+ "retry_codes_name": "idempotent",
26
26
  "retry_params_name": "default"
27
27
  },
28
- "CreateFinding": {
28
+ "GroupAssets": {
29
29
  "timeout_millis": 60000,
30
- "retry_codes_name": "non_idempotent",
30
+ "retry_codes_name": "idempotent",
31
31
  "retry_params_name": "default"
32
32
  },
33
- "GetIamPolicy": {
33
+ "GroupFindings": {
34
34
  "timeout_millis": 60000,
35
35
  "retry_codes_name": "idempotent",
36
36
  "retry_params_name": "default"
37
37
  },
38
- "GetOrganizationSettings": {
38
+ "TestIamPermissions": {
39
39
  "timeout_millis": 60000,
40
40
  "retry_codes_name": "idempotent",
41
41
  "retry_params_name": "default"
42
42
  },
43
- "GetSource": {
43
+ "CreateSource": {
44
44
  "timeout_millis": 60000,
45
- "retry_codes_name": "idempotent",
45
+ "retry_codes_name": "non_idempotent",
46
46
  "retry_params_name": "default"
47
47
  },
48
- "GroupAssets": {
48
+ "CreateFinding": {
49
+ "timeout_millis": 60000,
50
+ "retry_codes_name": "non_idempotent",
51
+ "retry_params_name": "default"
52
+ },
53
+ "GetOrganizationSettings": {
49
54
  "timeout_millis": 60000,
50
55
  "retry_codes_name": "idempotent",
51
56
  "retry_params_name": "default"
52
57
  },
53
- "GroupFindings": {
58
+ "GetSource": {
54
59
  "timeout_millis": 60000,
55
60
  "retry_codes_name": "idempotent",
56
61
  "retry_params_name": "default"
@@ -85,11 +90,6 @@
85
90
  "retry_codes_name": "non_idempotent",
86
91
  "retry_params_name": "default"
87
92
  },
88
- "TestIamPermissions": {
89
- "timeout_millis": 60000,
90
- "retry_codes_name": "idempotent",
91
- "retry_params_name": "default"
92
- },
93
93
  "UpdateFinding": {
94
94
  "timeout_millis": 60000,
95
95
  "retry_codes_name": "non_idempotent",
@@ -24,7 +24,7 @@ module Google
24
24
  # rubocop:disable LineLength
25
25
 
26
26
  ##
27
- # # Ruby Client for Cloud Security Command Center API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
27
+ # # Ruby Client for Cloud Security Command Center API
28
28
  #
29
29
  # [Cloud Security Command Center API][Product Documentation]:
30
30
  # Cloud Security Command Center API provides access to temporal views of
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module SecurityCenter
19
- VERSION = "0.6.0".freeze
19
+ VERSION = "0.7.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-security_center
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.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: 2020-02-10 00:00:00.000000000 Z
11
+ date: 2020-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax