google-cloud-chronicle 1.2.0 → 1.3.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: de78013dbb9ae92834994255210000de3a8f27dac9852093e6558b42abc3326e
4
- data.tar.gz: 5b5b0f4d912471439d08f1bd731a673816c45b338b4377182b10aeeaad2f3d29
3
+ metadata.gz: 6df8c80c8874514301cfedcb48b307b6980517a982b87c752477d6416f2c7331
4
+ data.tar.gz: f752a71dac0c1bbf82ddbb74e7d08b94217bdb6107f2a57f5bbc213f9c8c5fb0
5
5
  SHA512:
6
- metadata.gz: '08f34698049c76c02f2986b6807b513ac1e31855ade46f20e1d5da919c8bce5a6be867d21bc9f077ea8ccc6f3ce536621b833178febe6e47b44605ba722cdaa5'
7
- data.tar.gz: 99b8ee31de8ce2e0bd653498bba370e147e5fb515fb1355239b2940d63d3172e0e7741923c46a1e095d4d1473139321a02300762f110c5810376dde5634011d7
6
+ metadata.gz: 466c9858d7f7636832d3f49ba0a5e2f6eb533c0091b136240b5bebeef0ab21a370ac0516f73ca90bd36bb43b41003550a6895f2c0e2b2d0ee4f1f6b0a707899b
7
+ data.tar.gz: bdf37da85dc102aa05819b56451ed5545b4bae6af03861b55fee8a6ea715e1577961a40c69485785bf459b547b0c112ddecde8f028aa5acd30046630cc340cb7
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Chronicle
23
- VERSION = "1.2.0"
23
+ VERSION = "1.3.0"
24
24
  end
25
25
  end
26
26
  end
@@ -1030,6 +1030,76 @@ module Google
1030
1030
  false
1031
1031
  end
1032
1032
 
1033
+ ##
1034
+ # Create a new client object for SearchService.
1035
+ #
1036
+ # By default, this returns an instance of
1037
+ # [Google::Cloud::Chronicle::V1::SearchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-chronicle-v1/latest/Google-Cloud-Chronicle-V1-SearchService-Client)
1038
+ # for a gRPC client for version V1 of the API.
1039
+ # However, you can specify a different API version by passing it in the
1040
+ # `version` parameter. If the SearchService service is
1041
+ # supported by that API version, and the corresponding gem is available, the
1042
+ # appropriate versioned client will be returned.
1043
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
1044
+ # the `transport` parameter.
1045
+ #
1046
+ # Raises an exception if the currently installed versioned client gem for the
1047
+ # given API version does not support the given transport of the SearchService service.
1048
+ # You can determine whether the method will succeed by calling
1049
+ # {Google::Cloud::Chronicle.search_service_available?}.
1050
+ #
1051
+ # ## About SearchService
1052
+ #
1053
+ # SearchService provides methods for searching data in Chronicle.
1054
+ #
1055
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
1056
+ # Defaults to `:v1`.
1057
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
1058
+ # @return [::Object] A client object for the specified version.
1059
+ #
1060
+ def self.search_service version: :v1, transport: :grpc, &block
1061
+ require "google/cloud/chronicle/#{version.to_s.downcase}"
1062
+
1063
+ package_name = Google::Cloud::Chronicle
1064
+ .constants
1065
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
1066
+ .first
1067
+ service_module = Google::Cloud::Chronicle.const_get(package_name).const_get(:SearchService)
1068
+ service_module = service_module.const_get(:Rest) if transport == :rest
1069
+ service_module.const_get(:Client).new(&block)
1070
+ end
1071
+
1072
+ ##
1073
+ # Determines whether the SearchService service is supported by the current client.
1074
+ # If true, you can retrieve a client object by calling {Google::Cloud::Chronicle.search_service}.
1075
+ # If false, that method will raise an exception. This could happen if the given
1076
+ # API version does not exist or does not support the SearchService service,
1077
+ # or if the versioned client gem needs an update to support the SearchService service.
1078
+ #
1079
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
1080
+ # Defaults to `:v1`.
1081
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
1082
+ # @return [boolean] Whether the service is available.
1083
+ #
1084
+ def self.search_service_available? version: :v1, transport: :grpc
1085
+ require "google/cloud/chronicle/#{version.to_s.downcase}"
1086
+ package_name = Google::Cloud::Chronicle
1087
+ .constants
1088
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
1089
+ .first
1090
+ return false unless package_name
1091
+ service_module = Google::Cloud::Chronicle.const_get package_name
1092
+ return false unless service_module.const_defined? :SearchService
1093
+ service_module = service_module.const_get :SearchService
1094
+ if transport == :rest
1095
+ return false unless service_module.const_defined? :Rest
1096
+ service_module = service_module.const_get :Rest
1097
+ end
1098
+ service_module.const_defined? :Client
1099
+ rescue ::LoadError
1100
+ false
1101
+ end
1102
+
1033
1103
  ##
1034
1104
  # Configure the google-cloud-chronicle library.
1035
1105
  #
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: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC