google-cloud-chronicle 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 998b580e320b3b698b1c3bad6612e3ac26a1c083205c0977c0ce33776f8c8e06
4
- data.tar.gz: 365e572da95c64a6385e3e5ac9f65c0171bcdf77163e09cf53250c06945b23af
3
+ metadata.gz: 79f37ec6f64f24130575ddf6a1299b04ca14286e29f2000c64257d3a4fbbcaed
4
+ data.tar.gz: 9968856552da7e5fda968bc00ffd5574823c57e98c172c60a621112dbd3ce2bc
5
5
  SHA512:
6
- metadata.gz: f0c5ed0f81771ea79e01fb1dd4fb99145dd8bf16cfd4a9d8808d17ae16638e0d46b303816a2dccced2b0bca7ebfc709cbd1ce133b51266538848b564d8a36df8
7
- data.tar.gz: b77ffe76d9441eb8761717c84b6bb487070fcd1bd5bf6fe572d043ca8cb8c03d7eaae2be6458a219abce390f41b18e1b7103badaf1dc4dfdef41a541d10e080e
6
+ metadata.gz: 25ae3d03ae56a379c9fd08fc1c49ebca10e3cb75fd51e73a202a729a5e708c5a6f99b04f171988f3710bb3f00d7daac6324a64abd98a8f42c51af89d448806a0
7
+ data.tar.gz: 71b478f027ad27878ed33834f323d556532afa75dd2797fbf47ea2d8fe815ac8950d27cd5090cf14ecfba72ddd675b44f67cbbc75078ab2e6ca34f6664681b25
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Chronicle
23
- VERSION = "0.6.0"
23
+ VERSION = "0.7.0"
24
24
  end
25
25
  end
26
26
  end
@@ -607,6 +607,78 @@ module Google
607
607
  false
608
608
  end
609
609
 
610
+ ##
611
+ # Create a new client object for FindingsRefinementService.
612
+ #
613
+ # By default, this returns an instance of
614
+ # [Google::Cloud::Chronicle::V1::FindingsRefinementService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-chronicle-v1/latest/Google-Cloud-Chronicle-V1-FindingsRefinementService-Client)
615
+ # for a gRPC client for version V1 of the API.
616
+ # However, you can specify a different API version by passing it in the
617
+ # `version` parameter. If the FindingsRefinementService service is
618
+ # supported by that API version, and the corresponding gem is available, the
619
+ # appropriate versioned client will be returned.
620
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
621
+ # the `transport` parameter.
622
+ #
623
+ # Raises an exception if the currently installed versioned client gem for the
624
+ # given API version does not support the given transport of the FindingsRefinementService service.
625
+ # You can determine whether the method will succeed by calling
626
+ # {Google::Cloud::Chronicle.findings_refinement_service_available?}.
627
+ #
628
+ # ## About FindingsRefinementService
629
+ #
630
+ # FindingsRefinementService provides an interface for filtering out
631
+ # findings that are unlikely to be real threats to prevent them
632
+ # from triggering alerts or notifications.
633
+ #
634
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
635
+ # Defaults to `:v1`.
636
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
637
+ # @return [::Object] A client object for the specified version.
638
+ #
639
+ def self.findings_refinement_service version: :v1, transport: :grpc, &block
640
+ require "google/cloud/chronicle/#{version.to_s.downcase}"
641
+
642
+ package_name = Google::Cloud::Chronicle
643
+ .constants
644
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
645
+ .first
646
+ service_module = Google::Cloud::Chronicle.const_get(package_name).const_get(:FindingsRefinementService)
647
+ service_module = service_module.const_get(:Rest) if transport == :rest
648
+ service_module.const_get(:Client).new(&block)
649
+ end
650
+
651
+ ##
652
+ # Determines whether the FindingsRefinementService service is supported by the current client.
653
+ # If true, you can retrieve a client object by calling {Google::Cloud::Chronicle.findings_refinement_service}.
654
+ # If false, that method will raise an exception. This could happen if the given
655
+ # API version does not exist or does not support the FindingsRefinementService service,
656
+ # or if the versioned client gem needs an update to support the FindingsRefinementService service.
657
+ #
658
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
659
+ # Defaults to `:v1`.
660
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
661
+ # @return [boolean] Whether the service is available.
662
+ #
663
+ def self.findings_refinement_service_available? version: :v1, transport: :grpc
664
+ require "google/cloud/chronicle/#{version.to_s.downcase}"
665
+ package_name = Google::Cloud::Chronicle
666
+ .constants
667
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
668
+ .first
669
+ return false unless package_name
670
+ service_module = Google::Cloud::Chronicle.const_get package_name
671
+ return false unless service_module.const_defined? :FindingsRefinementService
672
+ service_module = service_module.const_get :FindingsRefinementService
673
+ if transport == :rest
674
+ return false unless service_module.const_defined? :Rest
675
+ service_module = service_module.const_get :Rest
676
+ end
677
+ service_module.const_defined? :Client
678
+ rescue ::LoadError
679
+ false
680
+ end
681
+
610
682
  ##
611
683
  # Create a new client object for InstanceService.
612
684
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-chronicle
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