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 +4 -4
- data/lib/google/cloud/chronicle/version.rb +1 -1
- data/lib/google/cloud/chronicle.rb +70 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6df8c80c8874514301cfedcb48b307b6980517a982b87c752477d6416f2c7331
|
|
4
|
+
data.tar.gz: f752a71dac0c1bbf82ddbb74e7d08b94217bdb6107f2a57f5bbc213f9c8c5fb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 466c9858d7f7636832d3f49ba0a5e2f6eb533c0091b136240b5bebeef0ab21a370ac0516f73ca90bd36bb43b41003550a6895f2c0e2b2d0ee4f1f6b0a707899b
|
|
7
|
+
data.tar.gz: bdf37da85dc102aa05819b56451ed5545b4bae6af03861b55fee8a6ea715e1577961a40c69485785bf459b547b0c112ddecde8f028aa5acd30046630cc340cb7
|
|
@@ -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
|
#
|