google-cloud-ai_platform 2.1.1 → 2.2.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: 8491f828f548df60ef027f22571fb97ff495f6544a14f1a59adc5798fcd93ce3
4
- data.tar.gz: 3f8a32a9c41399de659985c444979cb99b1b5d0ed5cd79ed6c1f5dabc438b94e
3
+ metadata.gz: 1ea7b07cbcfc3b228609c9128e215ab61cb718b4bc93939572769d78915ce027
4
+ data.tar.gz: 7c645bde1c67fdaf8d06f0f7848862c4695178cf725a8a87aa461aa40f508633
5
5
  SHA512:
6
- metadata.gz: 506b4ede74e729be011f4d7c9547c1ee75c4a309f7c7fd45ff43a329ba1f7532cd6f2f66b12188ffdd0386c7ed824a486a0fd3737ce6c4a5b6cc2b79e5f261e2
7
- data.tar.gz: 5f08ca2dbe87192dc5b7bb8d0388b151bb9e93ea15cd22f431a03a36a02be4b63aefd0c2bbf18bfd71d40f987da5b45d414d95bd25ad36a019629016e1433445
6
+ metadata.gz: 690cfdfaee10207774ab6a65e6c15983811ae1194a5512748ede0701ea5b87517878e645ea9f3920ebbd1ef1e79d0322dcbda444adcc8ef890b33da953eda6cb
7
+ data.tar.gz: 441891560c50ed9c07910066cd8f73b6440cc22dde66a5dabcf08f509b25f95b4d771a2ee70aa4a2b164a945022ec46962a58efbc7a7ecdc4968242b691b79af
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module AIPlatform
23
- VERSION = "2.1.1"
23
+ VERSION = "2.2.0"
24
24
  end
25
25
  end
26
26
  end
@@ -2012,6 +2012,76 @@ module Google
2012
2012
  false
2013
2013
  end
2014
2014
 
2015
+ ##
2016
+ # Create a new client object for SessionService.
2017
+ #
2018
+ # By default, this returns an instance of
2019
+ # [Google::Cloud::AIPlatform::V1::SessionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SessionService-Client)
2020
+ # for a gRPC client for version V1 of the API.
2021
+ # However, you can specify a different API version by passing it in the
2022
+ # `version` parameter. If the SessionService service is
2023
+ # supported by that API version, and the corresponding gem is available, the
2024
+ # appropriate versioned client will be returned.
2025
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
2026
+ # the `transport` parameter.
2027
+ #
2028
+ # Raises an exception if the currently installed versioned client gem for the
2029
+ # given API version does not support the given transport of the SessionService service.
2030
+ # You can determine whether the method will succeed by calling
2031
+ # {Google::Cloud::AIPlatform.session_service_available?}.
2032
+ #
2033
+ # ## About SessionService
2034
+ #
2035
+ # The service that manages Vertex Session related resources.
2036
+ #
2037
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
2038
+ # Defaults to `:v1`.
2039
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
2040
+ # @return [::Object] A client object for the specified version.
2041
+ #
2042
+ def self.session_service version: :v1, transport: :grpc, &block
2043
+ require "google/cloud/ai_platform/#{version.to_s.downcase}"
2044
+
2045
+ package_name = Google::Cloud::AIPlatform
2046
+ .constants
2047
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
2048
+ .first
2049
+ service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:SessionService)
2050
+ service_module = service_module.const_get(:Rest) if transport == :rest
2051
+ service_module.const_get(:Client).new(&block)
2052
+ end
2053
+
2054
+ ##
2055
+ # Determines whether the SessionService service is supported by the current client.
2056
+ # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.session_service}.
2057
+ # If false, that method will raise an exception. This could happen if the given
2058
+ # API version does not exist or does not support the SessionService service,
2059
+ # or if the versioned client gem needs an update to support the SessionService service.
2060
+ #
2061
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
2062
+ # Defaults to `:v1`.
2063
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
2064
+ # @return [boolean] Whether the service is available.
2065
+ #
2066
+ def self.session_service_available? version: :v1, transport: :grpc
2067
+ require "google/cloud/ai_platform/#{version.to_s.downcase}"
2068
+ package_name = Google::Cloud::AIPlatform
2069
+ .constants
2070
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
2071
+ .first
2072
+ return false unless package_name
2073
+ service_module = Google::Cloud::AIPlatform.const_get package_name
2074
+ return false unless service_module.const_defined? :SessionService
2075
+ service_module = service_module.const_get :SessionService
2076
+ if transport == :rest
2077
+ return false unless service_module.const_defined? :Rest
2078
+ service_module = service_module.const_get :Rest
2079
+ end
2080
+ service_module.const_defined? :Client
2081
+ rescue ::LoadError
2082
+ false
2083
+ end
2084
+
2015
2085
  ##
2016
2086
  # Create a new client object for SpecialistPoolService.
2017
2087
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-ai_platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC