google-cloud-retail 1.7.0 → 1.8.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: 2253df3ce7fd7420f0ab26352e895fc836437bef7fb02bfc0386cc987729c2f8
4
- data.tar.gz: aedb2db1153d3a7b791234ac9ad348a30444486a1292c6581d4698487f2b5fb3
3
+ metadata.gz: 978b4b7de8a2eebc992f5dedb4d1469a90d35c7fec5020f27c61e958e4a2b4b1
4
+ data.tar.gz: 6b0163dbc91e47a2a8ad730ab090220181bc796b9234e7aededc7c32dcf5518c
5
5
  SHA512:
6
- metadata.gz: 26c9d0ce3ac6d1147b0d656f81d4075415fadb8886d8469895071f5d804865b2a3563bfbfe94f0f35cfd95976b2d51fb55c2f706ece136b7df906c4a79f59a8e
7
- data.tar.gz: 9b370125cd13b9d8a560964dab246d078f852704906822dff50be284f75152da7b380fe8a2406aa5537a5a4eba0219ff4ee0978b694fddff52277077e545d7e9
6
+ metadata.gz: 1a58d373b5b100c1defd7eca4d8b1e30b9641dfc1798888536ceac2e4b6571cd876611f7a8d294f3d6dffc3b7155ecb51e2be22257840438152b67dd20545529
7
+ data.tar.gz: 25e8cf609aa3f277e41fa19ee476eb488e0d4e8dc49fb502e0f41e8bbbec49478a1f1d5e20e3cc1f6d055290e3351502d791ca827b589b98eaa34c099d96a93a
data/AUTHENTICATION.md CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
56
56
  ```ruby
57
57
  require "google/cloud/retail"
58
58
 
59
- client = Google::Cloud::Retail.catalog_service do |config|
59
+ client = Google::Cloud::Retail.analytics_service do |config|
60
60
  config.credentials = "path/to/credentialfile.json"
61
61
  end
62
62
  ```
@@ -70,7 +70,7 @@ Google::Cloud::Retail.configure do |config|
70
70
  config.credentials = "path/to/credentialfile.json"
71
71
  end
72
72
 
73
- client = Google::Cloud::Retail.catalog_service
73
+ client = Google::Cloud::Retail.analytics_service
74
74
  ```
75
75
 
76
76
  ### Environment Variables
@@ -100,7 +100,7 @@ require "google/cloud/retail"
100
100
 
101
101
  ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
102
 
103
- client = Google::Cloud::Retail.catalog_service
103
+ client = Google::Cloud::Retail.analytics_service
104
104
  ```
105
105
 
106
106
  ### Local ADC file
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Retail
23
- VERSION = "1.7.0"
23
+ VERSION = "1.8.0"
24
24
  end
25
25
  end
26
26
  end
@@ -45,6 +45,41 @@ end
45
45
  module Google
46
46
  module Cloud
47
47
  module Retail
48
+ ##
49
+ # Create a new client object for AnalyticsService.
50
+ #
51
+ # By default, this returns an instance of
52
+ # [Google::Cloud::Retail::V2::AnalyticsService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AnalyticsService-Client)
53
+ # for a gRPC client for version V2 of the API.
54
+ # However, you can specify a different API version by passing it in the
55
+ # `version` parameter. If the AnalyticsService service is
56
+ # supported by that API version, and the corresponding gem is available, the
57
+ # appropriate versioned client will be returned.
58
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
59
+ # the `transport` parameter.
60
+ #
61
+ # ## About AnalyticsService
62
+ #
63
+ # Service for managing & accessing retail search business metric.
64
+ # Retail recommendation business metric is currently not available.
65
+ #
66
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
67
+ # Defaults to `:v2`.
68
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
69
+ # @return [::Object] A client object for the specified version.
70
+ #
71
+ def self.analytics_service version: :v2, transport: :grpc, &block
72
+ require "google/cloud/retail/#{version.to_s.downcase}"
73
+
74
+ package_name = Google::Cloud::Retail
75
+ .constants
76
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
77
+ .first
78
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:AnalyticsService)
79
+ service_module = service_module.const_get(:Rest) if transport == :rest
80
+ service_module.const_get(:Client).new(&block)
81
+ end
82
+
48
83
  ##
49
84
  # Create a new client object for CatalogService.
50
85
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-retail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.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: 2024-01-15 00:00:00.000000000 Z
11
+ date: 2024-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core