google-cloud-recommendation_engine-v1beta1 0.1.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 +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-recommendation_engine-v1beta1.rb +21 -0
- data/lib/google/cloud/recommendation_engine/v1beta1.rb +38 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb +50 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +831 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb +51 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +570 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb +73 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb +53 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +554 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb +51 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb +77 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb +49 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +468 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb +51 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb +56 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb +50 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +820 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb +51 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +570 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb +54 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +28 -0
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +77 -0
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +59 -0
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb +61 -0
- data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +32 -0
- data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +91 -0
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +48 -0
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb +53 -0
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +49 -0
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb +48 -0
- data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +19 -0
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +84 -0
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +68 -0
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb +66 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/httpbody.rb +75 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb +214 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb +110 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb +89 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb +206 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb +88 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb +212 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb +367 -0
- data/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb +191 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/date.rb +50 -0
- metadata +242 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2020 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
# This gem does not autoload during Bundler.require. To load this gem,
|
|
20
|
+
# issue explicit require statements for the packages desired, e.g.:
|
|
21
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2020 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
require "google/cloud/recommendation_engine/v1beta1/catalog_service"
|
|
20
|
+
require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry"
|
|
21
|
+
require "google/cloud/recommendation_engine/v1beta1/prediction_service"
|
|
22
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service"
|
|
23
|
+
require "google/cloud/recommendation_engine/v1beta1/version"
|
|
24
|
+
|
|
25
|
+
module Google
|
|
26
|
+
module Cloud
|
|
27
|
+
module RecommendationEngine
|
|
28
|
+
##
|
|
29
|
+
# To load this package, including all its services, and instantiate a client:
|
|
30
|
+
#
|
|
31
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
|
32
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
|
33
|
+
#
|
|
34
|
+
module V1beta1
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2020 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
require "gapic/common"
|
|
20
|
+
require "gapic/config"
|
|
21
|
+
require "gapic/config/method"
|
|
22
|
+
|
|
23
|
+
require "google/cloud/recommendation_engine/v1beta1/version"
|
|
24
|
+
|
|
25
|
+
require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials"
|
|
26
|
+
require "google/cloud/recommendation_engine/v1beta1/catalog_service/paths"
|
|
27
|
+
require "google/cloud/recommendation_engine/v1beta1/catalog_service/operations"
|
|
28
|
+
require "google/cloud/recommendation_engine/v1beta1/catalog_service/client"
|
|
29
|
+
|
|
30
|
+
module Google
|
|
31
|
+
module Cloud
|
|
32
|
+
module RecommendationEngine
|
|
33
|
+
module V1beta1
|
|
34
|
+
##
|
|
35
|
+
# Service for ingesting catalog information of the customer's website.
|
|
36
|
+
#
|
|
37
|
+
# To load this service and instantiate a client:
|
|
38
|
+
#
|
|
39
|
+
# require "google/cloud/recommendation_engine/v1beta1/catalog_service"
|
|
40
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
|
41
|
+
#
|
|
42
|
+
module CatalogService
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
helper_path = ::File.join __dir__, "catalog_service", "helpers.rb"
|
|
50
|
+
require "google/cloud/recommendation_engine/v1beta1/catalog_service/helpers" if ::File.file? helper_path
|
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2020 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
require "google/cloud/errors"
|
|
20
|
+
require "google/cloud/recommendationengine/v1beta1/catalog_service_pb"
|
|
21
|
+
|
|
22
|
+
module Google
|
|
23
|
+
module Cloud
|
|
24
|
+
module RecommendationEngine
|
|
25
|
+
module V1beta1
|
|
26
|
+
module CatalogService
|
|
27
|
+
##
|
|
28
|
+
# Client for the CatalogService service.
|
|
29
|
+
#
|
|
30
|
+
# Service for ingesting catalog information of the customer's website.
|
|
31
|
+
#
|
|
32
|
+
class Client
|
|
33
|
+
include Paths
|
|
34
|
+
|
|
35
|
+
# @private
|
|
36
|
+
attr_reader :catalog_service_stub
|
|
37
|
+
|
|
38
|
+
##
|
|
39
|
+
# Configure the CatalogService Client class.
|
|
40
|
+
#
|
|
41
|
+
# See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client::Configuration}
|
|
42
|
+
# for a description of the configuration fields.
|
|
43
|
+
#
|
|
44
|
+
# ## Example
|
|
45
|
+
#
|
|
46
|
+
# To modify the configuration for all CatalogService clients:
|
|
47
|
+
#
|
|
48
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config|
|
|
49
|
+
# config.timeout = 10.0
|
|
50
|
+
# end
|
|
51
|
+
#
|
|
52
|
+
# @yield [config] Configure the Client client.
|
|
53
|
+
# @yieldparam config [Client::Configuration]
|
|
54
|
+
#
|
|
55
|
+
# @return [Client::Configuration]
|
|
56
|
+
#
|
|
57
|
+
def self.configure
|
|
58
|
+
@configure ||= begin
|
|
59
|
+
namespace = ["Google", "Cloud", "RecommendationEngine", "V1beta1"]
|
|
60
|
+
parent_config = while namespace.any?
|
|
61
|
+
parent_name = namespace.join "::"
|
|
62
|
+
parent_const = const_get parent_name
|
|
63
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
|
64
|
+
namespace.pop
|
|
65
|
+
end
|
|
66
|
+
default_config = Client::Configuration.new parent_config
|
|
67
|
+
|
|
68
|
+
default_config.rpcs.create_catalog_item.timeout = 600.0
|
|
69
|
+
default_config.rpcs.create_catalog_item.retry_policy = {
|
|
70
|
+
initial_delay: 0.1,
|
|
71
|
+
max_delay: 60.0,
|
|
72
|
+
multiplier: 1.3,
|
|
73
|
+
retry_codes: [14, 4]
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
default_config.rpcs.get_catalog_item.timeout = 600.0
|
|
77
|
+
default_config.rpcs.get_catalog_item.retry_policy = {
|
|
78
|
+
initial_delay: 0.1,
|
|
79
|
+
max_delay: 60.0,
|
|
80
|
+
multiplier: 1.3,
|
|
81
|
+
retry_codes: [14, 4]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
default_config.rpcs.list_catalog_items.timeout = 600.0
|
|
85
|
+
default_config.rpcs.list_catalog_items.retry_policy = {
|
|
86
|
+
initial_delay: 0.1,
|
|
87
|
+
max_delay: 60.0,
|
|
88
|
+
multiplier: 1.3,
|
|
89
|
+
retry_codes: [14, 4]
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
default_config.rpcs.update_catalog_item.timeout = 600.0
|
|
93
|
+
default_config.rpcs.update_catalog_item.retry_policy = {
|
|
94
|
+
initial_delay: 0.1,
|
|
95
|
+
max_delay: 60.0,
|
|
96
|
+
multiplier: 1.3,
|
|
97
|
+
retry_codes: [14, 4]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
default_config.rpcs.delete_catalog_item.timeout = 600.0
|
|
101
|
+
default_config.rpcs.delete_catalog_item.retry_policy = {
|
|
102
|
+
initial_delay: 0.1,
|
|
103
|
+
max_delay: 60.0,
|
|
104
|
+
multiplier: 1.3,
|
|
105
|
+
retry_codes: [14, 4]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
default_config.rpcs.import_catalog_items.timeout = 600.0
|
|
109
|
+
default_config.rpcs.import_catalog_items.retry_policy = {
|
|
110
|
+
initial_delay: 0.1,
|
|
111
|
+
max_delay: 60.0,
|
|
112
|
+
multiplier: 1.3,
|
|
113
|
+
retry_codes: [14, 4]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
default_config
|
|
117
|
+
end
|
|
118
|
+
yield @configure if block_given?
|
|
119
|
+
@configure
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
##
|
|
123
|
+
# Configure the CatalogService Client instance.
|
|
124
|
+
#
|
|
125
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
|
126
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
|
127
|
+
# should be made on {Client.configure}.
|
|
128
|
+
#
|
|
129
|
+
# See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client::Configuration}
|
|
130
|
+
# for a description of the configuration fields.
|
|
131
|
+
#
|
|
132
|
+
# @yield [config] Configure the Client client.
|
|
133
|
+
# @yieldparam config [Client::Configuration]
|
|
134
|
+
#
|
|
135
|
+
# @return [Client::Configuration]
|
|
136
|
+
#
|
|
137
|
+
def configure
|
|
138
|
+
yield @config if block_given?
|
|
139
|
+
@config
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
##
|
|
143
|
+
# Create a new CatalogService client object.
|
|
144
|
+
#
|
|
145
|
+
# ## Examples
|
|
146
|
+
#
|
|
147
|
+
# To create a new CatalogService client with the default
|
|
148
|
+
# configuration:
|
|
149
|
+
#
|
|
150
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
|
151
|
+
#
|
|
152
|
+
# To create a new CatalogService client with a custom
|
|
153
|
+
# configuration:
|
|
154
|
+
#
|
|
155
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
|
|
156
|
+
# config.timeout = 10.0
|
|
157
|
+
# end
|
|
158
|
+
#
|
|
159
|
+
# @yield [config] Configure the CatalogService client.
|
|
160
|
+
# @yieldparam config [Client::Configuration]
|
|
161
|
+
#
|
|
162
|
+
def initialize
|
|
163
|
+
# These require statements are intentionally placed here to initialize
|
|
164
|
+
# the gRPC module only when it's required.
|
|
165
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
|
166
|
+
require "gapic/grpc"
|
|
167
|
+
require "google/cloud/recommendationengine/v1beta1/catalog_service_services_pb"
|
|
168
|
+
|
|
169
|
+
# Create the configuration object
|
|
170
|
+
@config = Configuration.new Client.configure
|
|
171
|
+
|
|
172
|
+
# Yield the configuration if needed
|
|
173
|
+
yield @config if block_given?
|
|
174
|
+
|
|
175
|
+
# Create credentials
|
|
176
|
+
credentials = @config.credentials
|
|
177
|
+
credentials ||= Credentials.default scope: @config.scope
|
|
178
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
|
179
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
|
180
|
+
end
|
|
181
|
+
@quota_project_id = @config.quota_project
|
|
182
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
183
|
+
|
|
184
|
+
@operations_client = Operations.new do |config|
|
|
185
|
+
config.credentials = credentials
|
|
186
|
+
config.endpoint = @config.endpoint
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@catalog_service_stub = ::Gapic::ServiceStub.new(
|
|
190
|
+
::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Stub,
|
|
191
|
+
credentials: credentials,
|
|
192
|
+
endpoint: @config.endpoint,
|
|
193
|
+
channel_args: @config.channel_args,
|
|
194
|
+
interceptors: @config.interceptors
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
##
|
|
199
|
+
# Get the associated client for long-running operations.
|
|
200
|
+
#
|
|
201
|
+
# @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Operations]
|
|
202
|
+
#
|
|
203
|
+
attr_reader :operations_client
|
|
204
|
+
|
|
205
|
+
# Service calls
|
|
206
|
+
|
|
207
|
+
##
|
|
208
|
+
# Creates a catalog item.
|
|
209
|
+
#
|
|
210
|
+
# @overload create_catalog_item(request, options = nil)
|
|
211
|
+
# Pass arguments to `create_catalog_item` via a request object, either of type
|
|
212
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest} or an equivalent Hash.
|
|
213
|
+
#
|
|
214
|
+
# @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Hash]
|
|
215
|
+
# A request object representing the call parameters. Required. To specify no
|
|
216
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
217
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
218
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
219
|
+
#
|
|
220
|
+
# @overload create_catalog_item(parent: nil, catalog_item: nil)
|
|
221
|
+
# Pass arguments to `create_catalog_item` via keyword arguments. Note that at
|
|
222
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
223
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
224
|
+
#
|
|
225
|
+
# @param parent [::String]
|
|
226
|
+
# Required. The parent catalog resource name, such as
|
|
227
|
+
# "projects/*/locations/global/catalogs/default_catalog".
|
|
228
|
+
# @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash]
|
|
229
|
+
# Required. The catalog item to create.
|
|
230
|
+
#
|
|
231
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
232
|
+
# @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
|
233
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
234
|
+
#
|
|
235
|
+
# @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
|
236
|
+
#
|
|
237
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
238
|
+
#
|
|
239
|
+
def create_catalog_item request, options = nil
|
|
240
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
241
|
+
|
|
242
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest
|
|
243
|
+
|
|
244
|
+
# Converts hash and nil to an options object
|
|
245
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
246
|
+
|
|
247
|
+
# Customize the options with defaults
|
|
248
|
+
metadata = @config.rpcs.create_catalog_item.metadata.to_h
|
|
249
|
+
|
|
250
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
251
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
252
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
253
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
|
254
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
255
|
+
|
|
256
|
+
header_params = {
|
|
257
|
+
"parent" => request.parent
|
|
258
|
+
}
|
|
259
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
260
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
261
|
+
|
|
262
|
+
options.apply_defaults timeout: @config.rpcs.create_catalog_item.timeout,
|
|
263
|
+
metadata: metadata,
|
|
264
|
+
retry_policy: @config.rpcs.create_catalog_item.retry_policy
|
|
265
|
+
options.apply_defaults metadata: @config.metadata,
|
|
266
|
+
retry_policy: @config.retry_policy
|
|
267
|
+
|
|
268
|
+
@catalog_service_stub.call_rpc :create_catalog_item, request, options: options do |response, operation|
|
|
269
|
+
yield response, operation if block_given?
|
|
270
|
+
return response
|
|
271
|
+
end
|
|
272
|
+
rescue ::GRPC::BadStatus => e
|
|
273
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
##
|
|
277
|
+
# Gets a specific catalog item.
|
|
278
|
+
#
|
|
279
|
+
# @overload get_catalog_item(request, options = nil)
|
|
280
|
+
# Pass arguments to `get_catalog_item` via a request object, either of type
|
|
281
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest} or an equivalent Hash.
|
|
282
|
+
#
|
|
283
|
+
# @param request [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Hash]
|
|
284
|
+
# A request object representing the call parameters. Required. To specify no
|
|
285
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
286
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
287
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
288
|
+
#
|
|
289
|
+
# @overload get_catalog_item(name: nil)
|
|
290
|
+
# Pass arguments to `get_catalog_item` via keyword arguments. Note that at
|
|
291
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
292
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
293
|
+
#
|
|
294
|
+
# @param name [::String]
|
|
295
|
+
# Required. Full resource name of catalog item, such as
|
|
296
|
+
# "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
|
|
297
|
+
#
|
|
298
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
299
|
+
# @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
|
300
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
301
|
+
#
|
|
302
|
+
# @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
|
303
|
+
#
|
|
304
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
305
|
+
#
|
|
306
|
+
def get_catalog_item request, options = nil
|
|
307
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
308
|
+
|
|
309
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest
|
|
310
|
+
|
|
311
|
+
# Converts hash and nil to an options object
|
|
312
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
313
|
+
|
|
314
|
+
# Customize the options with defaults
|
|
315
|
+
metadata = @config.rpcs.get_catalog_item.metadata.to_h
|
|
316
|
+
|
|
317
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
318
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
319
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
320
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
|
321
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
322
|
+
|
|
323
|
+
header_params = {
|
|
324
|
+
"name" => request.name
|
|
325
|
+
}
|
|
326
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
327
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
328
|
+
|
|
329
|
+
options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout,
|
|
330
|
+
metadata: metadata,
|
|
331
|
+
retry_policy: @config.rpcs.get_catalog_item.retry_policy
|
|
332
|
+
options.apply_defaults metadata: @config.metadata,
|
|
333
|
+
retry_policy: @config.retry_policy
|
|
334
|
+
|
|
335
|
+
@catalog_service_stub.call_rpc :get_catalog_item, request, options: options do |response, operation|
|
|
336
|
+
yield response, operation if block_given?
|
|
337
|
+
return response
|
|
338
|
+
end
|
|
339
|
+
rescue ::GRPC::BadStatus => e
|
|
340
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
##
|
|
344
|
+
# Gets a list of catalog items.
|
|
345
|
+
#
|
|
346
|
+
# @overload list_catalog_items(request, options = nil)
|
|
347
|
+
# Pass arguments to `list_catalog_items` via a request object, either of type
|
|
348
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest} or an equivalent Hash.
|
|
349
|
+
#
|
|
350
|
+
# @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Hash]
|
|
351
|
+
# A request object representing the call parameters. Required. To specify no
|
|
352
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
353
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
354
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
355
|
+
#
|
|
356
|
+
# @overload list_catalog_items(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
|
357
|
+
# Pass arguments to `list_catalog_items` via keyword arguments. Note that at
|
|
358
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
359
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
360
|
+
#
|
|
361
|
+
# @param parent [::String]
|
|
362
|
+
# Required. The parent catalog resource name, such as
|
|
363
|
+
# "projects/*/locations/global/catalogs/default_catalog".
|
|
364
|
+
# @param page_size [::Integer]
|
|
365
|
+
# Optional. Maximum number of results to return per page. If zero, the
|
|
366
|
+
# service will choose a reasonable default.
|
|
367
|
+
# @param page_token [::String]
|
|
368
|
+
# Optional. The previous ListCatalogItemsResponse.next_page_token.
|
|
369
|
+
# @param filter [::String]
|
|
370
|
+
# Optional. A filter to apply on the list results.
|
|
371
|
+
#
|
|
372
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
373
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>]
|
|
374
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
375
|
+
#
|
|
376
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>]
|
|
377
|
+
#
|
|
378
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
379
|
+
#
|
|
380
|
+
def list_catalog_items request, options = nil
|
|
381
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
382
|
+
|
|
383
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest
|
|
384
|
+
|
|
385
|
+
# Converts hash and nil to an options object
|
|
386
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
387
|
+
|
|
388
|
+
# Customize the options with defaults
|
|
389
|
+
metadata = @config.rpcs.list_catalog_items.metadata.to_h
|
|
390
|
+
|
|
391
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
392
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
393
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
394
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
|
395
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
396
|
+
|
|
397
|
+
header_params = {
|
|
398
|
+
"parent" => request.parent
|
|
399
|
+
}
|
|
400
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
401
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
402
|
+
|
|
403
|
+
options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout,
|
|
404
|
+
metadata: metadata,
|
|
405
|
+
retry_policy: @config.rpcs.list_catalog_items.retry_policy
|
|
406
|
+
options.apply_defaults metadata: @config.metadata,
|
|
407
|
+
retry_policy: @config.retry_policy
|
|
408
|
+
|
|
409
|
+
@catalog_service_stub.call_rpc :list_catalog_items, request, options: options do |response, operation|
|
|
410
|
+
response = ::Gapic::PagedEnumerable.new @catalog_service_stub, :list_catalog_items, request, response, operation, options
|
|
411
|
+
yield response, operation if block_given?
|
|
412
|
+
return response
|
|
413
|
+
end
|
|
414
|
+
rescue ::GRPC::BadStatus => e
|
|
415
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
##
|
|
419
|
+
# Updates a catalog item. Partial updating is supported. Non-existing
|
|
420
|
+
# items will be created.
|
|
421
|
+
#
|
|
422
|
+
# @overload update_catalog_item(request, options = nil)
|
|
423
|
+
# Pass arguments to `update_catalog_item` via a request object, either of type
|
|
424
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest} or an equivalent Hash.
|
|
425
|
+
#
|
|
426
|
+
# @param request [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Hash]
|
|
427
|
+
# A request object representing the call parameters. Required. To specify no
|
|
428
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
429
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
430
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
431
|
+
#
|
|
432
|
+
# @overload update_catalog_item(name: nil, catalog_item: nil, update_mask: nil)
|
|
433
|
+
# Pass arguments to `update_catalog_item` via keyword arguments. Note that at
|
|
434
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
435
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
436
|
+
#
|
|
437
|
+
# @param name [::String]
|
|
438
|
+
# Required. Full resource name of catalog item, such as
|
|
439
|
+
# "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
|
|
440
|
+
# @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash]
|
|
441
|
+
# Required. The catalog item to update/create. The 'catalog_item_id' field
|
|
442
|
+
# has to match that in the 'name'.
|
|
443
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
444
|
+
# Optional. Indicates which fields in the provided 'item' to update. If not
|
|
445
|
+
# set, will by default update all fields.
|
|
446
|
+
#
|
|
447
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
448
|
+
# @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
|
449
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
450
|
+
#
|
|
451
|
+
# @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem]
|
|
452
|
+
#
|
|
453
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
454
|
+
#
|
|
455
|
+
def update_catalog_item request, options = nil
|
|
456
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
457
|
+
|
|
458
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest
|
|
459
|
+
|
|
460
|
+
# Converts hash and nil to an options object
|
|
461
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
462
|
+
|
|
463
|
+
# Customize the options with defaults
|
|
464
|
+
metadata = @config.rpcs.update_catalog_item.metadata.to_h
|
|
465
|
+
|
|
466
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
467
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
468
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
469
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
|
470
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
471
|
+
|
|
472
|
+
header_params = {
|
|
473
|
+
"name" => request.name
|
|
474
|
+
}
|
|
475
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
476
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
477
|
+
|
|
478
|
+
options.apply_defaults timeout: @config.rpcs.update_catalog_item.timeout,
|
|
479
|
+
metadata: metadata,
|
|
480
|
+
retry_policy: @config.rpcs.update_catalog_item.retry_policy
|
|
481
|
+
options.apply_defaults metadata: @config.metadata,
|
|
482
|
+
retry_policy: @config.retry_policy
|
|
483
|
+
|
|
484
|
+
@catalog_service_stub.call_rpc :update_catalog_item, request, options: options do |response, operation|
|
|
485
|
+
yield response, operation if block_given?
|
|
486
|
+
return response
|
|
487
|
+
end
|
|
488
|
+
rescue ::GRPC::BadStatus => e
|
|
489
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
##
|
|
493
|
+
# Deletes a catalog item.
|
|
494
|
+
#
|
|
495
|
+
# @overload delete_catalog_item(request, options = nil)
|
|
496
|
+
# Pass arguments to `delete_catalog_item` via a request object, either of type
|
|
497
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest} or an equivalent Hash.
|
|
498
|
+
#
|
|
499
|
+
# @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Hash]
|
|
500
|
+
# A request object representing the call parameters. Required. To specify no
|
|
501
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
502
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
503
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
504
|
+
#
|
|
505
|
+
# @overload delete_catalog_item(name: nil)
|
|
506
|
+
# Pass arguments to `delete_catalog_item` via keyword arguments. Note that at
|
|
507
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
508
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
509
|
+
#
|
|
510
|
+
# @param name [::String]
|
|
511
|
+
# Required. Full resource name of catalog item, such as
|
|
512
|
+
# "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
|
|
513
|
+
#
|
|
514
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
515
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
|
516
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
517
|
+
#
|
|
518
|
+
# @return [::Google::Protobuf::Empty]
|
|
519
|
+
#
|
|
520
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
521
|
+
#
|
|
522
|
+
def delete_catalog_item request, options = nil
|
|
523
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
524
|
+
|
|
525
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest
|
|
526
|
+
|
|
527
|
+
# Converts hash and nil to an options object
|
|
528
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
529
|
+
|
|
530
|
+
# Customize the options with defaults
|
|
531
|
+
metadata = @config.rpcs.delete_catalog_item.metadata.to_h
|
|
532
|
+
|
|
533
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
534
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
535
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
536
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
|
537
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
538
|
+
|
|
539
|
+
header_params = {
|
|
540
|
+
"name" => request.name
|
|
541
|
+
}
|
|
542
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
543
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
544
|
+
|
|
545
|
+
options.apply_defaults timeout: @config.rpcs.delete_catalog_item.timeout,
|
|
546
|
+
metadata: metadata,
|
|
547
|
+
retry_policy: @config.rpcs.delete_catalog_item.retry_policy
|
|
548
|
+
options.apply_defaults metadata: @config.metadata,
|
|
549
|
+
retry_policy: @config.retry_policy
|
|
550
|
+
|
|
551
|
+
@catalog_service_stub.call_rpc :delete_catalog_item, request, options: options do |response, operation|
|
|
552
|
+
yield response, operation if block_given?
|
|
553
|
+
return response
|
|
554
|
+
end
|
|
555
|
+
rescue ::GRPC::BadStatus => e
|
|
556
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
##
|
|
560
|
+
# Bulk import of multiple catalog items. Request processing may be
|
|
561
|
+
# synchronous. No partial updating supported. Non-existing items will be
|
|
562
|
+
# created.
|
|
563
|
+
#
|
|
564
|
+
# Operation.response is of type ImportResponse. Note that it is
|
|
565
|
+
# possible for a subset of the items to be successfully updated.
|
|
566
|
+
#
|
|
567
|
+
# @overload import_catalog_items(request, options = nil)
|
|
568
|
+
# Pass arguments to `import_catalog_items` via a request object, either of type
|
|
569
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest} or an equivalent Hash.
|
|
570
|
+
#
|
|
571
|
+
# @param request [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Hash]
|
|
572
|
+
# A request object representing the call parameters. Required. To specify no
|
|
573
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
574
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
575
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
576
|
+
#
|
|
577
|
+
# @overload import_catalog_items(parent: nil, request_id: nil, input_config: nil, errors_config: nil)
|
|
578
|
+
# Pass arguments to `import_catalog_items` via keyword arguments. Note that at
|
|
579
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
580
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
581
|
+
#
|
|
582
|
+
# @param parent [::String]
|
|
583
|
+
# Required. "projects/1234/locations/global/catalogs/default_catalog"
|
|
584
|
+
# @param request_id [::String]
|
|
585
|
+
# Optional. Unique identifier provided by client, within the ancestor
|
|
586
|
+
# dataset scope. Ensures idempotency and used for request deduplication.
|
|
587
|
+
# Server-generated if unspecified. Up to 128 characters long. This is
|
|
588
|
+
# returned as google.longrunning.Operation.name in the response.
|
|
589
|
+
# @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash]
|
|
590
|
+
# Required. The desired input location of the data.
|
|
591
|
+
# @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash]
|
|
592
|
+
# Optional. The desired location of errors incurred during the Import.
|
|
593
|
+
#
|
|
594
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
595
|
+
# @yieldparam response [::Gapic::Operation]
|
|
596
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
597
|
+
#
|
|
598
|
+
# @return [::Gapic::Operation]
|
|
599
|
+
#
|
|
600
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
601
|
+
#
|
|
602
|
+
def import_catalog_items request, options = nil
|
|
603
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
604
|
+
|
|
605
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest
|
|
606
|
+
|
|
607
|
+
# Converts hash and nil to an options object
|
|
608
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
609
|
+
|
|
610
|
+
# Customize the options with defaults
|
|
611
|
+
metadata = @config.rpcs.import_catalog_items.metadata.to_h
|
|
612
|
+
|
|
613
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
614
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
615
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
616
|
+
gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
|
|
617
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
618
|
+
|
|
619
|
+
header_params = {
|
|
620
|
+
"parent" => request.parent
|
|
621
|
+
}
|
|
622
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
623
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
624
|
+
|
|
625
|
+
options.apply_defaults timeout: @config.rpcs.import_catalog_items.timeout,
|
|
626
|
+
metadata: metadata,
|
|
627
|
+
retry_policy: @config.rpcs.import_catalog_items.retry_policy
|
|
628
|
+
options.apply_defaults metadata: @config.metadata,
|
|
629
|
+
retry_policy: @config.retry_policy
|
|
630
|
+
|
|
631
|
+
@catalog_service_stub.call_rpc :import_catalog_items, request, options: options do |response, operation|
|
|
632
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
633
|
+
yield response, operation if block_given?
|
|
634
|
+
return response
|
|
635
|
+
end
|
|
636
|
+
rescue ::GRPC::BadStatus => e
|
|
637
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
638
|
+
end
|
|
639
|
+
|
|
640
|
+
##
|
|
641
|
+
# Configuration class for the CatalogService API.
|
|
642
|
+
#
|
|
643
|
+
# This class represents the configuration for CatalogService,
|
|
644
|
+
# providing control over timeouts, retry behavior, logging, transport
|
|
645
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
|
646
|
+
# applied individually to specific RPCs. See
|
|
647
|
+
# {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client::Configuration::Rpcs}
|
|
648
|
+
# for a list of RPCs that can be configured independently.
|
|
649
|
+
#
|
|
650
|
+
# Configuration can be applied globally to all clients, or to a single client
|
|
651
|
+
# on construction.
|
|
652
|
+
#
|
|
653
|
+
# # Examples
|
|
654
|
+
#
|
|
655
|
+
# To modify the global config, setting the timeout for create_catalog_item
|
|
656
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
|
657
|
+
#
|
|
658
|
+
# ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config|
|
|
659
|
+
# config.timeout = 10.0
|
|
660
|
+
# config.rpcs.create_catalog_item.timeout = 20.0
|
|
661
|
+
# end
|
|
662
|
+
#
|
|
663
|
+
# To apply the above configuration only to a new client:
|
|
664
|
+
#
|
|
665
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config|
|
|
666
|
+
# config.timeout = 10.0
|
|
667
|
+
# config.rpcs.create_catalog_item.timeout = 20.0
|
|
668
|
+
# end
|
|
669
|
+
#
|
|
670
|
+
# @!attribute [rw] endpoint
|
|
671
|
+
# The hostname or hostname:port of the service endpoint.
|
|
672
|
+
# Defaults to `"recommendationengine.googleapis.com"`.
|
|
673
|
+
# @return [::String]
|
|
674
|
+
# @!attribute [rw] credentials
|
|
675
|
+
# Credentials to send with calls. You may provide any of the following types:
|
|
676
|
+
# * (`String`) The path to a service account key file in JSON format
|
|
677
|
+
# * (`Hash`) A service account key as a Hash
|
|
678
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
679
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
|
680
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
681
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
|
682
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
683
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
684
|
+
# * (`nil`) indicating no credentials
|
|
685
|
+
# @return [::Object]
|
|
686
|
+
# @!attribute [rw] scope
|
|
687
|
+
# The OAuth scopes
|
|
688
|
+
# @return [::Array<::String>]
|
|
689
|
+
# @!attribute [rw] lib_name
|
|
690
|
+
# The library name as recorded in instrumentation and logging
|
|
691
|
+
# @return [::String]
|
|
692
|
+
# @!attribute [rw] lib_version
|
|
693
|
+
# The library version as recorded in instrumentation and logging
|
|
694
|
+
# @return [::String]
|
|
695
|
+
# @!attribute [rw] channel_args
|
|
696
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
|
697
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
|
698
|
+
# @return [::Hash]
|
|
699
|
+
# @!attribute [rw] interceptors
|
|
700
|
+
# An array of interceptors that are run before calls are executed.
|
|
701
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
|
702
|
+
# @!attribute [rw] timeout
|
|
703
|
+
# The call timeout in seconds.
|
|
704
|
+
# @return [::Numeric]
|
|
705
|
+
# @!attribute [rw] metadata
|
|
706
|
+
# Additional gRPC headers to be sent with the call.
|
|
707
|
+
# @return [::Hash{::Symbol=>::String}]
|
|
708
|
+
# @!attribute [rw] retry_policy
|
|
709
|
+
# The retry policy. The value is a hash with the following keys:
|
|
710
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
711
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
712
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
713
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
714
|
+
# trigger a retry.
|
|
715
|
+
# @return [::Hash]
|
|
716
|
+
# @!attribute [rw] quota_project
|
|
717
|
+
# A separate project against which to charge quota.
|
|
718
|
+
# @return [::String]
|
|
719
|
+
#
|
|
720
|
+
class Configuration
|
|
721
|
+
extend ::Gapic::Config
|
|
722
|
+
|
|
723
|
+
config_attr :endpoint, "recommendationengine.googleapis.com", ::String
|
|
724
|
+
config_attr :credentials, nil do |value|
|
|
725
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
|
726
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
|
727
|
+
allowed.any? { |klass| klass === value }
|
|
728
|
+
end
|
|
729
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
|
730
|
+
config_attr :lib_name, nil, ::String, nil
|
|
731
|
+
config_attr :lib_version, nil, ::String, nil
|
|
732
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
|
733
|
+
config_attr :interceptors, nil, ::Array, nil
|
|
734
|
+
config_attr :timeout, nil, ::Numeric, nil
|
|
735
|
+
config_attr :metadata, nil, ::Hash, nil
|
|
736
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
737
|
+
config_attr :quota_project, nil, ::String, nil
|
|
738
|
+
|
|
739
|
+
# @private
|
|
740
|
+
def initialize parent_config = nil
|
|
741
|
+
@parent_config = parent_config unless parent_config.nil?
|
|
742
|
+
|
|
743
|
+
yield self if block_given?
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
##
|
|
747
|
+
# Configurations for individual RPCs
|
|
748
|
+
# @return [Rpcs]
|
|
749
|
+
#
|
|
750
|
+
def rpcs
|
|
751
|
+
@rpcs ||= begin
|
|
752
|
+
parent_rpcs = nil
|
|
753
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
|
754
|
+
Rpcs.new parent_rpcs
|
|
755
|
+
end
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
##
|
|
759
|
+
# Configuration RPC class for the CatalogService API.
|
|
760
|
+
#
|
|
761
|
+
# Includes fields providing the configuration for each RPC in this service.
|
|
762
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
|
763
|
+
# the following configuration fields:
|
|
764
|
+
#
|
|
765
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
|
766
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
|
767
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
|
768
|
+
# include the following keys:
|
|
769
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
770
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
771
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
772
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
773
|
+
# trigger a retry.
|
|
774
|
+
#
|
|
775
|
+
class Rpcs
|
|
776
|
+
##
|
|
777
|
+
# RPC-specific configuration for `create_catalog_item`
|
|
778
|
+
# @return [::Gapic::Config::Method]
|
|
779
|
+
#
|
|
780
|
+
attr_reader :create_catalog_item
|
|
781
|
+
##
|
|
782
|
+
# RPC-specific configuration for `get_catalog_item`
|
|
783
|
+
# @return [::Gapic::Config::Method]
|
|
784
|
+
#
|
|
785
|
+
attr_reader :get_catalog_item
|
|
786
|
+
##
|
|
787
|
+
# RPC-specific configuration for `list_catalog_items`
|
|
788
|
+
# @return [::Gapic::Config::Method]
|
|
789
|
+
#
|
|
790
|
+
attr_reader :list_catalog_items
|
|
791
|
+
##
|
|
792
|
+
# RPC-specific configuration for `update_catalog_item`
|
|
793
|
+
# @return [::Gapic::Config::Method]
|
|
794
|
+
#
|
|
795
|
+
attr_reader :update_catalog_item
|
|
796
|
+
##
|
|
797
|
+
# RPC-specific configuration for `delete_catalog_item`
|
|
798
|
+
# @return [::Gapic::Config::Method]
|
|
799
|
+
#
|
|
800
|
+
attr_reader :delete_catalog_item
|
|
801
|
+
##
|
|
802
|
+
# RPC-specific configuration for `import_catalog_items`
|
|
803
|
+
# @return [::Gapic::Config::Method]
|
|
804
|
+
#
|
|
805
|
+
attr_reader :import_catalog_items
|
|
806
|
+
|
|
807
|
+
# @private
|
|
808
|
+
def initialize parent_rpcs = nil
|
|
809
|
+
create_catalog_item_config = parent_rpcs&.create_catalog_item if parent_rpcs&.respond_to? :create_catalog_item
|
|
810
|
+
@create_catalog_item = ::Gapic::Config::Method.new create_catalog_item_config
|
|
811
|
+
get_catalog_item_config = parent_rpcs&.get_catalog_item if parent_rpcs&.respond_to? :get_catalog_item
|
|
812
|
+
@get_catalog_item = ::Gapic::Config::Method.new get_catalog_item_config
|
|
813
|
+
list_catalog_items_config = parent_rpcs&.list_catalog_items if parent_rpcs&.respond_to? :list_catalog_items
|
|
814
|
+
@list_catalog_items = ::Gapic::Config::Method.new list_catalog_items_config
|
|
815
|
+
update_catalog_item_config = parent_rpcs&.update_catalog_item if parent_rpcs&.respond_to? :update_catalog_item
|
|
816
|
+
@update_catalog_item = ::Gapic::Config::Method.new update_catalog_item_config
|
|
817
|
+
delete_catalog_item_config = parent_rpcs&.delete_catalog_item if parent_rpcs&.respond_to? :delete_catalog_item
|
|
818
|
+
@delete_catalog_item = ::Gapic::Config::Method.new delete_catalog_item_config
|
|
819
|
+
import_catalog_items_config = parent_rpcs&.import_catalog_items if parent_rpcs&.respond_to? :import_catalog_items
|
|
820
|
+
@import_catalog_items = ::Gapic::Config::Method.new import_catalog_items_config
|
|
821
|
+
|
|
822
|
+
yield self if block_given?
|
|
823
|
+
end
|
|
824
|
+
end
|
|
825
|
+
end
|
|
826
|
+
end
|
|
827
|
+
end
|
|
828
|
+
end
|
|
829
|
+
end
|
|
830
|
+
end
|
|
831
|
+
end
|