google-cloud-api_hub-v1 0.a → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +144 -8
- data/lib/google/cloud/api_hub/v1/api_hub/client.rb +4514 -0
- data/lib/google/cloud/api_hub/v1/api_hub/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/api_hub/paths.rb +216 -0
- data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +4251 -0
- data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +2147 -0
- data/lib/google/cloud/api_hub/v1/api_hub/rest.rb +53 -0
- data/lib/google/cloud/api_hub/v1/api_hub.rb +55 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies/client.rb +906 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies/paths.rb +88 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/client.rb +853 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/service_stub.rb +366 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest.rb +54 -0
- data/lib/google/cloud/api_hub/v1/api_hub_dependencies.rb +56 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/client.rb +640 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/paths.rb +52 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +601 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +248 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest.rb +53 -0
- data/lib/google/cloud/api_hub/v1/api_hub_plugin.rb +55 -0
- data/lib/google/cloud/api_hub/v1/bindings_override.rb +102 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service/client.rb +689 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service/paths.rb +83 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/client.rb +650 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/service_stub.rb +247 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest.rb +53 -0
- data/lib/google/cloud/api_hub/v1/host_project_registration_service.rb +55 -0
- data/lib/google/cloud/api_hub/v1/linting_service/client.rb +744 -0
- data/lib/google/cloud/api_hub/v1/linting_service/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/linting_service/paths.rb +75 -0
- data/lib/google/cloud/api_hub/v1/linting_service/rest/client.rb +698 -0
- data/lib/google/cloud/api_hub/v1/linting_service/rest/service_stub.rb +307 -0
- data/lib/google/cloud/api_hub/v1/linting_service/rest.rb +53 -0
- data/lib/google/cloud/api_hub/v1/linting_service.rb +55 -0
- data/lib/google/cloud/api_hub/v1/provisioning/client.rb +676 -0
- data/lib/google/cloud/api_hub/v1/provisioning/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/provisioning/operations.rb +809 -0
- data/lib/google/cloud/api_hub/v1/provisioning/paths.rb +69 -0
- data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +637 -0
- data/lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb +902 -0
- data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +247 -0
- data/lib/google/cloud/api_hub/v1/provisioning/rest.rb +54 -0
- data/lib/google/cloud/api_hub/v1/provisioning.rb +56 -0
- data/lib/google/cloud/api_hub/v1/rest.rb +44 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/client.rb +885 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/credentials.rb +47 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/paths.rb +83 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/client.rb +832 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/service_stub.rb +365 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest.rb +53 -0
- data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service.rb +55 -0
- data/lib/google/cloud/api_hub/v1/version.rb +7 -2
- data/lib/google/cloud/api_hub/v1.rb +51 -0
- data/lib/google/cloud/apihub/v1/apihub_service_pb.rb +102 -0
- data/lib/google/cloud/apihub/v1/apihub_service_services_pb.rb +288 -0
- data/lib/google/cloud/apihub/v1/common_fields_pb.rb +92 -0
- data/lib/google/cloud/apihub/v1/host_project_registration_service_pb.rb +53 -0
- data/lib/google/cloud/apihub/v1/host_project_registration_service_services_pb.rb +53 -0
- data/lib/google/cloud/apihub/v1/linting_service_pb.rb +56 -0
- data/lib/google/cloud/apihub/v1/linting_service_services_pb.rb +53 -0
- data/lib/google/cloud/apihub/v1/plugin_service_pb.rb +53 -0
- data/lib/google/cloud/apihub/v1/plugin_service_services_pb.rb +51 -0
- data/lib/google/cloud/apihub/v1/provisioning_service_pb.rb +53 -0
- data/lib/google/cloud/apihub/v1/provisioning_service_services_pb.rb +50 -0
- data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_pb.rb +57 -0
- data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_services_pb.rb +55 -0
- data/lib/google-cloud-api_hub-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +403 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +1317 -0
- data/proto_docs/google/cloud/apihub/v1/common_fields.rb +1296 -0
- data/proto_docs/google/cloud/apihub/v1/host_project_registration_service.rb +146 -0
- data/proto_docs/google/cloud/apihub/v1/linting_service.rb +103 -0
- data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +104 -0
- data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +87 -0
- data/proto_docs/google/cloud/apihub/v1/runtime_project_attachment_service.rb +182 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +155 -10
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module ApiHub
|
23
|
+
module V1
|
24
|
+
module ApiHubPlugin
|
25
|
+
# Path helper methods for the ApiHubPlugin API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Plugin resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}/plugins/{plugin}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
# @param plugin [String]
|
37
|
+
#
|
38
|
+
# @return [::String]
|
39
|
+
def plugin_path project:, location:, plugin:
|
40
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
41
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
42
|
+
|
43
|
+
"projects/#{project}/locations/#{location}/plugins/#{plugin}"
|
44
|
+
end
|
45
|
+
|
46
|
+
extend self
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,601 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/apihub/v1/plugin_service_pb"
|
21
|
+
require "google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module ApiHub
|
27
|
+
module V1
|
28
|
+
module ApiHubPlugin
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the ApiHubPlugin service.
|
32
|
+
#
|
33
|
+
# This service is used for managing plugins inside the API Hub.
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
# @private
|
37
|
+
API_VERSION = ""
|
38
|
+
|
39
|
+
# @private
|
40
|
+
DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
|
41
|
+
|
42
|
+
include Paths
|
43
|
+
|
44
|
+
# @private
|
45
|
+
attr_reader :api_hub_plugin_stub
|
46
|
+
|
47
|
+
##
|
48
|
+
# Configure the ApiHubPlugin Client class.
|
49
|
+
#
|
50
|
+
# See {::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client::Configuration}
|
51
|
+
# for a description of the configuration fields.
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
#
|
55
|
+
# # Modify the configuration for all ApiHubPlugin clients
|
56
|
+
# ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.configure do |config|
|
57
|
+
# config.timeout = 10.0
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# @yield [config] Configure the Client client.
|
61
|
+
# @yieldparam config [Client::Configuration]
|
62
|
+
#
|
63
|
+
# @return [Client::Configuration]
|
64
|
+
#
|
65
|
+
def self.configure
|
66
|
+
@configure ||= begin
|
67
|
+
namespace = ["Google", "Cloud", "ApiHub", "V1"]
|
68
|
+
parent_config = while namespace.any?
|
69
|
+
parent_name = namespace.join "::"
|
70
|
+
parent_const = const_get parent_name
|
71
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
72
|
+
namespace.pop
|
73
|
+
end
|
74
|
+
default_config = Client::Configuration.new parent_config
|
75
|
+
|
76
|
+
default_config.rpcs.get_plugin.timeout = 60.0
|
77
|
+
default_config.rpcs.get_plugin.retry_policy = {
|
78
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
79
|
+
}
|
80
|
+
|
81
|
+
default_config.rpcs.enable_plugin.timeout = 60.0
|
82
|
+
|
83
|
+
default_config.rpcs.disable_plugin.timeout = 60.0
|
84
|
+
|
85
|
+
default_config
|
86
|
+
end
|
87
|
+
yield @configure if block_given?
|
88
|
+
@configure
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Configure the ApiHubPlugin Client instance.
|
93
|
+
#
|
94
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
95
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
96
|
+
# should be made on {Client.configure}.
|
97
|
+
#
|
98
|
+
# See {::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client::Configuration}
|
99
|
+
# for a description of the configuration fields.
|
100
|
+
#
|
101
|
+
# @yield [config] Configure the Client client.
|
102
|
+
# @yieldparam config [Client::Configuration]
|
103
|
+
#
|
104
|
+
# @return [Client::Configuration]
|
105
|
+
#
|
106
|
+
def configure
|
107
|
+
yield @config if block_given?
|
108
|
+
@config
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# The effective universe domain
|
113
|
+
#
|
114
|
+
# @return [String]
|
115
|
+
#
|
116
|
+
def universe_domain
|
117
|
+
@api_hub_plugin_stub.universe_domain
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# Create a new ApiHubPlugin REST client object.
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
#
|
125
|
+
# # Create a client using the default configuration
|
126
|
+
# client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
|
127
|
+
#
|
128
|
+
# # Create a client using a custom configuration
|
129
|
+
# client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new do |config|
|
130
|
+
# config.timeout = 10.0
|
131
|
+
# end
|
132
|
+
#
|
133
|
+
# @yield [config] Configure the ApiHubPlugin client.
|
134
|
+
# @yieldparam config [Client::Configuration]
|
135
|
+
#
|
136
|
+
def initialize
|
137
|
+
# Create the configuration object
|
138
|
+
@config = Configuration.new Client.configure
|
139
|
+
|
140
|
+
# Yield the configuration if needed
|
141
|
+
yield @config if block_given?
|
142
|
+
|
143
|
+
# Create credentials
|
144
|
+
credentials = @config.credentials
|
145
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
146
|
+
# but only if the default endpoint does not have a region prefix.
|
147
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
148
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
149
|
+
!@config.endpoint.split(".").first.include?("-"))
|
150
|
+
credentials ||= Credentials.default scope: @config.scope,
|
151
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
152
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
153
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
154
|
+
end
|
155
|
+
|
156
|
+
@quota_project_id = @config.quota_project
|
157
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
158
|
+
|
159
|
+
@api_hub_plugin_stub = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::ServiceStub.new(
|
160
|
+
endpoint: @config.endpoint,
|
161
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
162
|
+
universe_domain: @config.universe_domain,
|
163
|
+
credentials: credentials
|
164
|
+
)
|
165
|
+
|
166
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
167
|
+
config.credentials = credentials
|
168
|
+
config.quota_project = @quota_project_id
|
169
|
+
config.endpoint = @api_hub_plugin_stub.endpoint
|
170
|
+
config.universe_domain = @api_hub_plugin_stub.universe_domain
|
171
|
+
config.bindings_override = @config.bindings_override
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# Get the associated client for mix-in of the Locations.
|
177
|
+
#
|
178
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
179
|
+
#
|
180
|
+
attr_reader :location_client
|
181
|
+
|
182
|
+
# Service calls
|
183
|
+
|
184
|
+
##
|
185
|
+
# Get details about an API Hub plugin.
|
186
|
+
#
|
187
|
+
# @overload get_plugin(request, options = nil)
|
188
|
+
# Pass arguments to `get_plugin` via a request object, either of type
|
189
|
+
# {::Google::Cloud::ApiHub::V1::GetPluginRequest} or an equivalent Hash.
|
190
|
+
#
|
191
|
+
# @param request [::Google::Cloud::ApiHub::V1::GetPluginRequest, ::Hash]
|
192
|
+
# A request object representing the call parameters. Required. To specify no
|
193
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
194
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
195
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
196
|
+
#
|
197
|
+
# @overload get_plugin(name: nil)
|
198
|
+
# Pass arguments to `get_plugin` via keyword arguments. Note that at
|
199
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
200
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
201
|
+
#
|
202
|
+
# @param name [::String]
|
203
|
+
# Required. The name of the plugin to retrieve.
|
204
|
+
# Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
|
205
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
206
|
+
# @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
|
207
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
208
|
+
#
|
209
|
+
# @return [::Google::Cloud::ApiHub::V1::Plugin]
|
210
|
+
#
|
211
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
212
|
+
#
|
213
|
+
# @example Basic example
|
214
|
+
# require "google/cloud/api_hub/v1"
|
215
|
+
#
|
216
|
+
# # Create a client object. The client can be reused for multiple calls.
|
217
|
+
# client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
|
218
|
+
#
|
219
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
220
|
+
# request = Google::Cloud::ApiHub::V1::GetPluginRequest.new
|
221
|
+
#
|
222
|
+
# # Call the get_plugin method.
|
223
|
+
# result = client.get_plugin request
|
224
|
+
#
|
225
|
+
# # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
|
226
|
+
# p result
|
227
|
+
#
|
228
|
+
def get_plugin request, options = nil
|
229
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
230
|
+
|
231
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginRequest
|
232
|
+
|
233
|
+
# Converts hash and nil to an options object
|
234
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
235
|
+
|
236
|
+
# Customize the options with defaults
|
237
|
+
call_metadata = @config.rpcs.get_plugin.metadata.to_h
|
238
|
+
|
239
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
240
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
241
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
242
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
243
|
+
transports_version_send: [:rest]
|
244
|
+
|
245
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
246
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
247
|
+
|
248
|
+
options.apply_defaults timeout: @config.rpcs.get_plugin.timeout,
|
249
|
+
metadata: call_metadata,
|
250
|
+
retry_policy: @config.rpcs.get_plugin.retry_policy
|
251
|
+
|
252
|
+
options.apply_defaults timeout: @config.timeout,
|
253
|
+
metadata: @config.metadata,
|
254
|
+
retry_policy: @config.retry_policy
|
255
|
+
|
256
|
+
@api_hub_plugin_stub.get_plugin request, options do |result, operation|
|
257
|
+
yield result, operation if block_given?
|
258
|
+
return result
|
259
|
+
end
|
260
|
+
rescue ::Gapic::Rest::Error => e
|
261
|
+
raise ::Google::Cloud::Error.from_error(e)
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# Enables a plugin.
|
266
|
+
# The `state` of the plugin after enabling is `ENABLED`
|
267
|
+
#
|
268
|
+
# @overload enable_plugin(request, options = nil)
|
269
|
+
# Pass arguments to `enable_plugin` via a request object, either of type
|
270
|
+
# {::Google::Cloud::ApiHub::V1::EnablePluginRequest} or an equivalent Hash.
|
271
|
+
#
|
272
|
+
# @param request [::Google::Cloud::ApiHub::V1::EnablePluginRequest, ::Hash]
|
273
|
+
# A request object representing the call parameters. Required. To specify no
|
274
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
275
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
276
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
277
|
+
#
|
278
|
+
# @overload enable_plugin(name: nil)
|
279
|
+
# Pass arguments to `enable_plugin` via keyword arguments. Note that at
|
280
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
281
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
282
|
+
#
|
283
|
+
# @param name [::String]
|
284
|
+
# Required. The name of the plugin to enable.
|
285
|
+
# Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
|
286
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
287
|
+
# @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
|
288
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
289
|
+
#
|
290
|
+
# @return [::Google::Cloud::ApiHub::V1::Plugin]
|
291
|
+
#
|
292
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
293
|
+
#
|
294
|
+
# @example Basic example
|
295
|
+
# require "google/cloud/api_hub/v1"
|
296
|
+
#
|
297
|
+
# # Create a client object. The client can be reused for multiple calls.
|
298
|
+
# client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
|
299
|
+
#
|
300
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
301
|
+
# request = Google::Cloud::ApiHub::V1::EnablePluginRequest.new
|
302
|
+
#
|
303
|
+
# # Call the enable_plugin method.
|
304
|
+
# result = client.enable_plugin request
|
305
|
+
#
|
306
|
+
# # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
|
307
|
+
# p result
|
308
|
+
#
|
309
|
+
def enable_plugin request, options = nil
|
310
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
311
|
+
|
312
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginRequest
|
313
|
+
|
314
|
+
# Converts hash and nil to an options object
|
315
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
316
|
+
|
317
|
+
# Customize the options with defaults
|
318
|
+
call_metadata = @config.rpcs.enable_plugin.metadata.to_h
|
319
|
+
|
320
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
321
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
322
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
323
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
324
|
+
transports_version_send: [:rest]
|
325
|
+
|
326
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
327
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
328
|
+
|
329
|
+
options.apply_defaults timeout: @config.rpcs.enable_plugin.timeout,
|
330
|
+
metadata: call_metadata,
|
331
|
+
retry_policy: @config.rpcs.enable_plugin.retry_policy
|
332
|
+
|
333
|
+
options.apply_defaults timeout: @config.timeout,
|
334
|
+
metadata: @config.metadata,
|
335
|
+
retry_policy: @config.retry_policy
|
336
|
+
|
337
|
+
@api_hub_plugin_stub.enable_plugin request, options do |result, operation|
|
338
|
+
yield result, operation if block_given?
|
339
|
+
return result
|
340
|
+
end
|
341
|
+
rescue ::Gapic::Rest::Error => e
|
342
|
+
raise ::Google::Cloud::Error.from_error(e)
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Disables a plugin.
|
347
|
+
# The `state` of the plugin after disabling is `DISABLED`
|
348
|
+
#
|
349
|
+
# @overload disable_plugin(request, options = nil)
|
350
|
+
# Pass arguments to `disable_plugin` via a request object, either of type
|
351
|
+
# {::Google::Cloud::ApiHub::V1::DisablePluginRequest} or an equivalent Hash.
|
352
|
+
#
|
353
|
+
# @param request [::Google::Cloud::ApiHub::V1::DisablePluginRequest, ::Hash]
|
354
|
+
# A request object representing the call parameters. Required. To specify no
|
355
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
356
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
357
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
358
|
+
#
|
359
|
+
# @overload disable_plugin(name: nil)
|
360
|
+
# Pass arguments to `disable_plugin` via keyword arguments. Note that at
|
361
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
362
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
363
|
+
#
|
364
|
+
# @param name [::String]
|
365
|
+
# Required. The name of the plugin to disable.
|
366
|
+
# Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
|
367
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
368
|
+
# @yieldparam result [::Google::Cloud::ApiHub::V1::Plugin]
|
369
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
370
|
+
#
|
371
|
+
# @return [::Google::Cloud::ApiHub::V1::Plugin]
|
372
|
+
#
|
373
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
374
|
+
#
|
375
|
+
# @example Basic example
|
376
|
+
# require "google/cloud/api_hub/v1"
|
377
|
+
#
|
378
|
+
# # Create a client object. The client can be reused for multiple calls.
|
379
|
+
# client = Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new
|
380
|
+
#
|
381
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
382
|
+
# request = Google::Cloud::ApiHub::V1::DisablePluginRequest.new
|
383
|
+
#
|
384
|
+
# # Call the disable_plugin method.
|
385
|
+
# result = client.disable_plugin request
|
386
|
+
#
|
387
|
+
# # The returned object is of type Google::Cloud::ApiHub::V1::Plugin.
|
388
|
+
# p result
|
389
|
+
#
|
390
|
+
def disable_plugin request, options = nil
|
391
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
392
|
+
|
393
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginRequest
|
394
|
+
|
395
|
+
# Converts hash and nil to an options object
|
396
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
397
|
+
|
398
|
+
# Customize the options with defaults
|
399
|
+
call_metadata = @config.rpcs.disable_plugin.metadata.to_h
|
400
|
+
|
401
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
402
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
403
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
404
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
405
|
+
transports_version_send: [:rest]
|
406
|
+
|
407
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
408
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
409
|
+
|
410
|
+
options.apply_defaults timeout: @config.rpcs.disable_plugin.timeout,
|
411
|
+
metadata: call_metadata,
|
412
|
+
retry_policy: @config.rpcs.disable_plugin.retry_policy
|
413
|
+
|
414
|
+
options.apply_defaults timeout: @config.timeout,
|
415
|
+
metadata: @config.metadata,
|
416
|
+
retry_policy: @config.retry_policy
|
417
|
+
|
418
|
+
@api_hub_plugin_stub.disable_plugin request, options do |result, operation|
|
419
|
+
yield result, operation if block_given?
|
420
|
+
return result
|
421
|
+
end
|
422
|
+
rescue ::Gapic::Rest::Error => e
|
423
|
+
raise ::Google::Cloud::Error.from_error(e)
|
424
|
+
end
|
425
|
+
|
426
|
+
##
|
427
|
+
# Configuration class for the ApiHubPlugin REST API.
|
428
|
+
#
|
429
|
+
# This class represents the configuration for ApiHubPlugin REST,
|
430
|
+
# providing control over timeouts, retry behavior, logging, transport
|
431
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
432
|
+
# applied individually to specific RPCs. See
|
433
|
+
# {::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client::Configuration::Rpcs}
|
434
|
+
# for a list of RPCs that can be configured independently.
|
435
|
+
#
|
436
|
+
# Configuration can be applied globally to all clients, or to a single client
|
437
|
+
# on construction.
|
438
|
+
#
|
439
|
+
# @example
|
440
|
+
#
|
441
|
+
# # Modify the global config, setting the timeout for
|
442
|
+
# # get_plugin to 20 seconds,
|
443
|
+
# # and all remaining timeouts to 10 seconds.
|
444
|
+
# ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.configure do |config|
|
445
|
+
# config.timeout = 10.0
|
446
|
+
# config.rpcs.get_plugin.timeout = 20.0
|
447
|
+
# end
|
448
|
+
#
|
449
|
+
# # Apply the above configuration only to a new client.
|
450
|
+
# client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new do |config|
|
451
|
+
# config.timeout = 10.0
|
452
|
+
# config.rpcs.get_plugin.timeout = 20.0
|
453
|
+
# end
|
454
|
+
#
|
455
|
+
# @!attribute [rw] endpoint
|
456
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
457
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
458
|
+
# @return [::String,nil]
|
459
|
+
# @!attribute [rw] credentials
|
460
|
+
# Credentials to send with calls. You may provide any of the following types:
|
461
|
+
# * (`String`) The path to a service account key file in JSON format
|
462
|
+
# * (`Hash`) A service account key as a Hash
|
463
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
464
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
465
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
466
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
467
|
+
# * (`nil`) indicating no credentials
|
468
|
+
# @return [::Object]
|
469
|
+
# @!attribute [rw] scope
|
470
|
+
# The OAuth scopes
|
471
|
+
# @return [::Array<::String>]
|
472
|
+
# @!attribute [rw] lib_name
|
473
|
+
# The library name as recorded in instrumentation and logging
|
474
|
+
# @return [::String]
|
475
|
+
# @!attribute [rw] lib_version
|
476
|
+
# The library version as recorded in instrumentation and logging
|
477
|
+
# @return [::String]
|
478
|
+
# @!attribute [rw] timeout
|
479
|
+
# The call timeout in seconds.
|
480
|
+
# @return [::Numeric]
|
481
|
+
# @!attribute [rw] metadata
|
482
|
+
# Additional headers to be sent with the call.
|
483
|
+
# @return [::Hash{::Symbol=>::String}]
|
484
|
+
# @!attribute [rw] retry_policy
|
485
|
+
# The retry policy. The value is a hash with the following keys:
|
486
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
487
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
488
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
489
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
490
|
+
# trigger a retry.
|
491
|
+
# @return [::Hash]
|
492
|
+
# @!attribute [rw] quota_project
|
493
|
+
# A separate project against which to charge quota.
|
494
|
+
# @return [::String]
|
495
|
+
# @!attribute [rw] universe_domain
|
496
|
+
# The universe domain within which to make requests. This determines the
|
497
|
+
# default endpoint URL. The default value of nil uses the environment
|
498
|
+
# universe (usually the default "googleapis.com" universe).
|
499
|
+
# @return [::String,nil]
|
500
|
+
#
|
501
|
+
class Configuration
|
502
|
+
extend ::Gapic::Config
|
503
|
+
|
504
|
+
# @private
|
505
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
506
|
+
DEFAULT_ENDPOINT = "apihub.googleapis.com"
|
507
|
+
|
508
|
+
config_attr :endpoint, nil, ::String, nil
|
509
|
+
config_attr :credentials, nil do |value|
|
510
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
511
|
+
allowed.any? { |klass| klass === value }
|
512
|
+
end
|
513
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
514
|
+
config_attr :lib_name, nil, ::String, nil
|
515
|
+
config_attr :lib_version, nil, ::String, nil
|
516
|
+
config_attr :timeout, nil, ::Numeric, nil
|
517
|
+
config_attr :metadata, nil, ::Hash, nil
|
518
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
519
|
+
config_attr :quota_project, nil, ::String, nil
|
520
|
+
config_attr :universe_domain, nil, ::String, nil
|
521
|
+
|
522
|
+
# @private
|
523
|
+
# Overrides for http bindings for the RPCs of this service
|
524
|
+
# are only used when this service is used as mixin, and only
|
525
|
+
# by the host service.
|
526
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
527
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
528
|
+
|
529
|
+
# @private
|
530
|
+
def initialize parent_config = nil
|
531
|
+
@parent_config = parent_config unless parent_config.nil?
|
532
|
+
|
533
|
+
yield self if block_given?
|
534
|
+
end
|
535
|
+
|
536
|
+
##
|
537
|
+
# Configurations for individual RPCs
|
538
|
+
# @return [Rpcs]
|
539
|
+
#
|
540
|
+
def rpcs
|
541
|
+
@rpcs ||= begin
|
542
|
+
parent_rpcs = nil
|
543
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
544
|
+
Rpcs.new parent_rpcs
|
545
|
+
end
|
546
|
+
end
|
547
|
+
|
548
|
+
##
|
549
|
+
# Configuration RPC class for the ApiHubPlugin API.
|
550
|
+
#
|
551
|
+
# Includes fields providing the configuration for each RPC in this service.
|
552
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
553
|
+
# the following configuration fields:
|
554
|
+
#
|
555
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
556
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
557
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
558
|
+
# include the following keys:
|
559
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
560
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
561
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
562
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
563
|
+
# trigger a retry.
|
564
|
+
#
|
565
|
+
class Rpcs
|
566
|
+
##
|
567
|
+
# RPC-specific configuration for `get_plugin`
|
568
|
+
# @return [::Gapic::Config::Method]
|
569
|
+
#
|
570
|
+
attr_reader :get_plugin
|
571
|
+
##
|
572
|
+
# RPC-specific configuration for `enable_plugin`
|
573
|
+
# @return [::Gapic::Config::Method]
|
574
|
+
#
|
575
|
+
attr_reader :enable_plugin
|
576
|
+
##
|
577
|
+
# RPC-specific configuration for `disable_plugin`
|
578
|
+
# @return [::Gapic::Config::Method]
|
579
|
+
#
|
580
|
+
attr_reader :disable_plugin
|
581
|
+
|
582
|
+
# @private
|
583
|
+
def initialize parent_rpcs = nil
|
584
|
+
get_plugin_config = parent_rpcs.get_plugin if parent_rpcs.respond_to? :get_plugin
|
585
|
+
@get_plugin = ::Gapic::Config::Method.new get_plugin_config
|
586
|
+
enable_plugin_config = parent_rpcs.enable_plugin if parent_rpcs.respond_to? :enable_plugin
|
587
|
+
@enable_plugin = ::Gapic::Config::Method.new enable_plugin_config
|
588
|
+
disable_plugin_config = parent_rpcs.disable_plugin if parent_rpcs.respond_to? :disable_plugin
|
589
|
+
@disable_plugin = ::Gapic::Config::Method.new disable_plugin_config
|
590
|
+
|
591
|
+
yield self if block_given?
|
592
|
+
end
|
593
|
+
end
|
594
|
+
end
|
595
|
+
end
|
596
|
+
end
|
597
|
+
end
|
598
|
+
end
|
599
|
+
end
|
600
|
+
end
|
601
|
+
end
|