google-cloud-api_hub-v1 0.a → 0.1.1
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 +420 -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,698 @@
|
|
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/linting_service_pb"
|
21
|
+
require "google/cloud/api_hub/v1/linting_service/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module ApiHub
|
27
|
+
module V1
|
28
|
+
module LintingService
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the LintingService service.
|
32
|
+
#
|
33
|
+
# This service provides all methods related to the 1p Linter.
|
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 :linting_service_stub
|
46
|
+
|
47
|
+
##
|
48
|
+
# Configure the LintingService Client class.
|
49
|
+
#
|
50
|
+
# See {::Google::Cloud::ApiHub::V1::LintingService::Rest::Client::Configuration}
|
51
|
+
# for a description of the configuration fields.
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
#
|
55
|
+
# # Modify the configuration for all LintingService clients
|
56
|
+
# ::Google::Cloud::ApiHub::V1::LintingService::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_style_guide.timeout = 60.0
|
77
|
+
default_config.rpcs.get_style_guide.retry_policy = {
|
78
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
79
|
+
}
|
80
|
+
|
81
|
+
default_config.rpcs.update_style_guide.timeout = 60.0
|
82
|
+
|
83
|
+
default_config.rpcs.get_style_guide_contents.timeout = 60.0
|
84
|
+
default_config.rpcs.get_style_guide_contents.retry_policy = {
|
85
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
86
|
+
}
|
87
|
+
|
88
|
+
default_config.rpcs.lint_spec.timeout = 60.0
|
89
|
+
|
90
|
+
default_config
|
91
|
+
end
|
92
|
+
yield @configure if block_given?
|
93
|
+
@configure
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Configure the LintingService Client instance.
|
98
|
+
#
|
99
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
100
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
101
|
+
# should be made on {Client.configure}.
|
102
|
+
#
|
103
|
+
# See {::Google::Cloud::ApiHub::V1::LintingService::Rest::Client::Configuration}
|
104
|
+
# for a description of the configuration fields.
|
105
|
+
#
|
106
|
+
# @yield [config] Configure the Client client.
|
107
|
+
# @yieldparam config [Client::Configuration]
|
108
|
+
#
|
109
|
+
# @return [Client::Configuration]
|
110
|
+
#
|
111
|
+
def configure
|
112
|
+
yield @config if block_given?
|
113
|
+
@config
|
114
|
+
end
|
115
|
+
|
116
|
+
##
|
117
|
+
# The effective universe domain
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
#
|
121
|
+
def universe_domain
|
122
|
+
@linting_service_stub.universe_domain
|
123
|
+
end
|
124
|
+
|
125
|
+
##
|
126
|
+
# Create a new LintingService REST client object.
|
127
|
+
#
|
128
|
+
# @example
|
129
|
+
#
|
130
|
+
# # Create a client using the default configuration
|
131
|
+
# client = ::Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new
|
132
|
+
#
|
133
|
+
# # Create a client using a custom configuration
|
134
|
+
# client = ::Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new do |config|
|
135
|
+
# config.timeout = 10.0
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# @yield [config] Configure the LintingService client.
|
139
|
+
# @yieldparam config [Client::Configuration]
|
140
|
+
#
|
141
|
+
def initialize
|
142
|
+
# Create the configuration object
|
143
|
+
@config = Configuration.new Client.configure
|
144
|
+
|
145
|
+
# Yield the configuration if needed
|
146
|
+
yield @config if block_given?
|
147
|
+
|
148
|
+
# Create credentials
|
149
|
+
credentials = @config.credentials
|
150
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
151
|
+
# but only if the default endpoint does not have a region prefix.
|
152
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
153
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
154
|
+
!@config.endpoint.split(".").first.include?("-"))
|
155
|
+
credentials ||= Credentials.default scope: @config.scope,
|
156
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
157
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
158
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
159
|
+
end
|
160
|
+
|
161
|
+
@quota_project_id = @config.quota_project
|
162
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
163
|
+
|
164
|
+
@linting_service_stub = ::Google::Cloud::ApiHub::V1::LintingService::Rest::ServiceStub.new(
|
165
|
+
endpoint: @config.endpoint,
|
166
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
167
|
+
universe_domain: @config.universe_domain,
|
168
|
+
credentials: credentials
|
169
|
+
)
|
170
|
+
|
171
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
172
|
+
config.credentials = credentials
|
173
|
+
config.quota_project = @quota_project_id
|
174
|
+
config.endpoint = @linting_service_stub.endpoint
|
175
|
+
config.universe_domain = @linting_service_stub.universe_domain
|
176
|
+
config.bindings_override = @config.bindings_override
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# Get the associated client for mix-in of the Locations.
|
182
|
+
#
|
183
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
184
|
+
#
|
185
|
+
attr_reader :location_client
|
186
|
+
|
187
|
+
# Service calls
|
188
|
+
|
189
|
+
##
|
190
|
+
# Get the style guide being used for linting.
|
191
|
+
#
|
192
|
+
# @overload get_style_guide(request, options = nil)
|
193
|
+
# Pass arguments to `get_style_guide` via a request object, either of type
|
194
|
+
# {::Google::Cloud::ApiHub::V1::GetStyleGuideRequest} or an equivalent Hash.
|
195
|
+
#
|
196
|
+
# @param request [::Google::Cloud::ApiHub::V1::GetStyleGuideRequest, ::Hash]
|
197
|
+
# A request object representing the call parameters. Required. To specify no
|
198
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
199
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
200
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
201
|
+
#
|
202
|
+
# @overload get_style_guide(name: nil)
|
203
|
+
# Pass arguments to `get_style_guide` via keyword arguments. Note that at
|
204
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
205
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
206
|
+
#
|
207
|
+
# @param name [::String]
|
208
|
+
# Required. The name of the spec to retrieve.
|
209
|
+
# Format:
|
210
|
+
# `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
|
211
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
212
|
+
# @yieldparam result [::Google::Cloud::ApiHub::V1::StyleGuide]
|
213
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
214
|
+
#
|
215
|
+
# @return [::Google::Cloud::ApiHub::V1::StyleGuide]
|
216
|
+
#
|
217
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
218
|
+
#
|
219
|
+
# @example Basic example
|
220
|
+
# require "google/cloud/api_hub/v1"
|
221
|
+
#
|
222
|
+
# # Create a client object. The client can be reused for multiple calls.
|
223
|
+
# client = Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new
|
224
|
+
#
|
225
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
226
|
+
# request = Google::Cloud::ApiHub::V1::GetStyleGuideRequest.new
|
227
|
+
#
|
228
|
+
# # Call the get_style_guide method.
|
229
|
+
# result = client.get_style_guide request
|
230
|
+
#
|
231
|
+
# # The returned object is of type Google::Cloud::ApiHub::V1::StyleGuide.
|
232
|
+
# p result
|
233
|
+
#
|
234
|
+
def get_style_guide request, options = nil
|
235
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
236
|
+
|
237
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetStyleGuideRequest
|
238
|
+
|
239
|
+
# Converts hash and nil to an options object
|
240
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
241
|
+
|
242
|
+
# Customize the options with defaults
|
243
|
+
call_metadata = @config.rpcs.get_style_guide.metadata.to_h
|
244
|
+
|
245
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
246
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
247
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
248
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
249
|
+
transports_version_send: [:rest]
|
250
|
+
|
251
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
252
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
253
|
+
|
254
|
+
options.apply_defaults timeout: @config.rpcs.get_style_guide.timeout,
|
255
|
+
metadata: call_metadata,
|
256
|
+
retry_policy: @config.rpcs.get_style_guide.retry_policy
|
257
|
+
|
258
|
+
options.apply_defaults timeout: @config.timeout,
|
259
|
+
metadata: @config.metadata,
|
260
|
+
retry_policy: @config.retry_policy
|
261
|
+
|
262
|
+
@linting_service_stub.get_style_guide request, options do |result, operation|
|
263
|
+
yield result, operation if block_given?
|
264
|
+
return result
|
265
|
+
end
|
266
|
+
rescue ::Gapic::Rest::Error => e
|
267
|
+
raise ::Google::Cloud::Error.from_error(e)
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# Update the styleGuide to be used for liniting in by API hub.
|
272
|
+
#
|
273
|
+
# @overload update_style_guide(request, options = nil)
|
274
|
+
# Pass arguments to `update_style_guide` via a request object, either of type
|
275
|
+
# {::Google::Cloud::ApiHub::V1::UpdateStyleGuideRequest} or an equivalent Hash.
|
276
|
+
#
|
277
|
+
# @param request [::Google::Cloud::ApiHub::V1::UpdateStyleGuideRequest, ::Hash]
|
278
|
+
# A request object representing the call parameters. Required. To specify no
|
279
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
280
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
281
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
282
|
+
#
|
283
|
+
# @overload update_style_guide(style_guide: nil, update_mask: nil)
|
284
|
+
# Pass arguments to `update_style_guide` via keyword arguments. Note that at
|
285
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
286
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
287
|
+
#
|
288
|
+
# @param style_guide [::Google::Cloud::ApiHub::V1::StyleGuide, ::Hash]
|
289
|
+
# Required. The Style guide resource to update.
|
290
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
291
|
+
# Optional. The list of fields to update.
|
292
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
293
|
+
# @yieldparam result [::Google::Cloud::ApiHub::V1::StyleGuide]
|
294
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
295
|
+
#
|
296
|
+
# @return [::Google::Cloud::ApiHub::V1::StyleGuide]
|
297
|
+
#
|
298
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
299
|
+
#
|
300
|
+
# @example Basic example
|
301
|
+
# require "google/cloud/api_hub/v1"
|
302
|
+
#
|
303
|
+
# # Create a client object. The client can be reused for multiple calls.
|
304
|
+
# client = Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new
|
305
|
+
#
|
306
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
307
|
+
# request = Google::Cloud::ApiHub::V1::UpdateStyleGuideRequest.new
|
308
|
+
#
|
309
|
+
# # Call the update_style_guide method.
|
310
|
+
# result = client.update_style_guide request
|
311
|
+
#
|
312
|
+
# # The returned object is of type Google::Cloud::ApiHub::V1::StyleGuide.
|
313
|
+
# p result
|
314
|
+
#
|
315
|
+
def update_style_guide request, options = nil
|
316
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
317
|
+
|
318
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateStyleGuideRequest
|
319
|
+
|
320
|
+
# Converts hash and nil to an options object
|
321
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
322
|
+
|
323
|
+
# Customize the options with defaults
|
324
|
+
call_metadata = @config.rpcs.update_style_guide.metadata.to_h
|
325
|
+
|
326
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
327
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
328
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
329
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
330
|
+
transports_version_send: [:rest]
|
331
|
+
|
332
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
333
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
334
|
+
|
335
|
+
options.apply_defaults timeout: @config.rpcs.update_style_guide.timeout,
|
336
|
+
metadata: call_metadata,
|
337
|
+
retry_policy: @config.rpcs.update_style_guide.retry_policy
|
338
|
+
|
339
|
+
options.apply_defaults timeout: @config.timeout,
|
340
|
+
metadata: @config.metadata,
|
341
|
+
retry_policy: @config.retry_policy
|
342
|
+
|
343
|
+
@linting_service_stub.update_style_guide request, options do |result, operation|
|
344
|
+
yield result, operation if block_given?
|
345
|
+
return result
|
346
|
+
end
|
347
|
+
rescue ::Gapic::Rest::Error => e
|
348
|
+
raise ::Google::Cloud::Error.from_error(e)
|
349
|
+
end
|
350
|
+
|
351
|
+
##
|
352
|
+
# Get the contents of the style guide.
|
353
|
+
#
|
354
|
+
# @overload get_style_guide_contents(request, options = nil)
|
355
|
+
# Pass arguments to `get_style_guide_contents` via a request object, either of type
|
356
|
+
# {::Google::Cloud::ApiHub::V1::GetStyleGuideContentsRequest} or an equivalent Hash.
|
357
|
+
#
|
358
|
+
# @param request [::Google::Cloud::ApiHub::V1::GetStyleGuideContentsRequest, ::Hash]
|
359
|
+
# A request object representing the call parameters. Required. To specify no
|
360
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
361
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
362
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
363
|
+
#
|
364
|
+
# @overload get_style_guide_contents(name: nil)
|
365
|
+
# Pass arguments to `get_style_guide_contents` via keyword arguments. Note that at
|
366
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
367
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
368
|
+
#
|
369
|
+
# @param name [::String]
|
370
|
+
# Required. The name of the StyleGuide whose contents need to be retrieved.
|
371
|
+
# There is exactly one style guide resource per project per location.
|
372
|
+
# The expected format is
|
373
|
+
# `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
|
374
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
375
|
+
# @yieldparam result [::Google::Cloud::ApiHub::V1::StyleGuideContents]
|
376
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
377
|
+
#
|
378
|
+
# @return [::Google::Cloud::ApiHub::V1::StyleGuideContents]
|
379
|
+
#
|
380
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
381
|
+
#
|
382
|
+
# @example Basic example
|
383
|
+
# require "google/cloud/api_hub/v1"
|
384
|
+
#
|
385
|
+
# # Create a client object. The client can be reused for multiple calls.
|
386
|
+
# client = Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new
|
387
|
+
#
|
388
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
389
|
+
# request = Google::Cloud::ApiHub::V1::GetStyleGuideContentsRequest.new
|
390
|
+
#
|
391
|
+
# # Call the get_style_guide_contents method.
|
392
|
+
# result = client.get_style_guide_contents request
|
393
|
+
#
|
394
|
+
# # The returned object is of type Google::Cloud::ApiHub::V1::StyleGuideContents.
|
395
|
+
# p result
|
396
|
+
#
|
397
|
+
def get_style_guide_contents request, options = nil
|
398
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
399
|
+
|
400
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetStyleGuideContentsRequest
|
401
|
+
|
402
|
+
# Converts hash and nil to an options object
|
403
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
404
|
+
|
405
|
+
# Customize the options with defaults
|
406
|
+
call_metadata = @config.rpcs.get_style_guide_contents.metadata.to_h
|
407
|
+
|
408
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
409
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
410
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
411
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
412
|
+
transports_version_send: [:rest]
|
413
|
+
|
414
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
415
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
416
|
+
|
417
|
+
options.apply_defaults timeout: @config.rpcs.get_style_guide_contents.timeout,
|
418
|
+
metadata: call_metadata,
|
419
|
+
retry_policy: @config.rpcs.get_style_guide_contents.retry_policy
|
420
|
+
|
421
|
+
options.apply_defaults timeout: @config.timeout,
|
422
|
+
metadata: @config.metadata,
|
423
|
+
retry_policy: @config.retry_policy
|
424
|
+
|
425
|
+
@linting_service_stub.get_style_guide_contents request, options do |result, operation|
|
426
|
+
yield result, operation if block_given?
|
427
|
+
return result
|
428
|
+
end
|
429
|
+
rescue ::Gapic::Rest::Error => e
|
430
|
+
raise ::Google::Cloud::Error.from_error(e)
|
431
|
+
end
|
432
|
+
|
433
|
+
##
|
434
|
+
# Lints the requested spec and updates the corresponding API Spec with the
|
435
|
+
# lint response. This lint response will be available in all subsequent
|
436
|
+
# Get and List Spec calls to Core service.
|
437
|
+
#
|
438
|
+
# @overload lint_spec(request, options = nil)
|
439
|
+
# Pass arguments to `lint_spec` via a request object, either of type
|
440
|
+
# {::Google::Cloud::ApiHub::V1::LintSpecRequest} or an equivalent Hash.
|
441
|
+
#
|
442
|
+
# @param request [::Google::Cloud::ApiHub::V1::LintSpecRequest, ::Hash]
|
443
|
+
# A request object representing the call parameters. Required. To specify no
|
444
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
445
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
446
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
447
|
+
#
|
448
|
+
# @overload lint_spec(name: nil)
|
449
|
+
# Pass arguments to `lint_spec` via keyword arguments. Note that at
|
450
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
451
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
452
|
+
#
|
453
|
+
# @param name [::String]
|
454
|
+
# Required. The name of the spec to be linted.
|
455
|
+
# Format:
|
456
|
+
# `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
|
457
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
458
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
459
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
460
|
+
#
|
461
|
+
# @return [::Google::Protobuf::Empty]
|
462
|
+
#
|
463
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
464
|
+
#
|
465
|
+
# @example Basic example
|
466
|
+
# require "google/cloud/api_hub/v1"
|
467
|
+
#
|
468
|
+
# # Create a client object. The client can be reused for multiple calls.
|
469
|
+
# client = Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new
|
470
|
+
#
|
471
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
472
|
+
# request = Google::Cloud::ApiHub::V1::LintSpecRequest.new
|
473
|
+
#
|
474
|
+
# # Call the lint_spec method.
|
475
|
+
# result = client.lint_spec request
|
476
|
+
#
|
477
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
478
|
+
# p result
|
479
|
+
#
|
480
|
+
def lint_spec request, options = nil
|
481
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
482
|
+
|
483
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::LintSpecRequest
|
484
|
+
|
485
|
+
# Converts hash and nil to an options object
|
486
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
487
|
+
|
488
|
+
# Customize the options with defaults
|
489
|
+
call_metadata = @config.rpcs.lint_spec.metadata.to_h
|
490
|
+
|
491
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
492
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
493
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
494
|
+
gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
|
495
|
+
transports_version_send: [:rest]
|
496
|
+
|
497
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
498
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
499
|
+
|
500
|
+
options.apply_defaults timeout: @config.rpcs.lint_spec.timeout,
|
501
|
+
metadata: call_metadata,
|
502
|
+
retry_policy: @config.rpcs.lint_spec.retry_policy
|
503
|
+
|
504
|
+
options.apply_defaults timeout: @config.timeout,
|
505
|
+
metadata: @config.metadata,
|
506
|
+
retry_policy: @config.retry_policy
|
507
|
+
|
508
|
+
@linting_service_stub.lint_spec request, options do |result, operation|
|
509
|
+
yield result, operation if block_given?
|
510
|
+
return result
|
511
|
+
end
|
512
|
+
rescue ::Gapic::Rest::Error => e
|
513
|
+
raise ::Google::Cloud::Error.from_error(e)
|
514
|
+
end
|
515
|
+
|
516
|
+
##
|
517
|
+
# Configuration class for the LintingService REST API.
|
518
|
+
#
|
519
|
+
# This class represents the configuration for LintingService REST,
|
520
|
+
# providing control over timeouts, retry behavior, logging, transport
|
521
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
522
|
+
# applied individually to specific RPCs. See
|
523
|
+
# {::Google::Cloud::ApiHub::V1::LintingService::Rest::Client::Configuration::Rpcs}
|
524
|
+
# for a list of RPCs that can be configured independently.
|
525
|
+
#
|
526
|
+
# Configuration can be applied globally to all clients, or to a single client
|
527
|
+
# on construction.
|
528
|
+
#
|
529
|
+
# @example
|
530
|
+
#
|
531
|
+
# # Modify the global config, setting the timeout for
|
532
|
+
# # get_style_guide to 20 seconds,
|
533
|
+
# # and all remaining timeouts to 10 seconds.
|
534
|
+
# ::Google::Cloud::ApiHub::V1::LintingService::Rest::Client.configure do |config|
|
535
|
+
# config.timeout = 10.0
|
536
|
+
# config.rpcs.get_style_guide.timeout = 20.0
|
537
|
+
# end
|
538
|
+
#
|
539
|
+
# # Apply the above configuration only to a new client.
|
540
|
+
# client = ::Google::Cloud::ApiHub::V1::LintingService::Rest::Client.new do |config|
|
541
|
+
# config.timeout = 10.0
|
542
|
+
# config.rpcs.get_style_guide.timeout = 20.0
|
543
|
+
# end
|
544
|
+
#
|
545
|
+
# @!attribute [rw] endpoint
|
546
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
547
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
548
|
+
# @return [::String,nil]
|
549
|
+
# @!attribute [rw] credentials
|
550
|
+
# Credentials to send with calls. You may provide any of the following types:
|
551
|
+
# * (`String`) The path to a service account key file in JSON format
|
552
|
+
# * (`Hash`) A service account key as a Hash
|
553
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
554
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
555
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
556
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
557
|
+
# * (`nil`) indicating no credentials
|
558
|
+
# @return [::Object]
|
559
|
+
# @!attribute [rw] scope
|
560
|
+
# The OAuth scopes
|
561
|
+
# @return [::Array<::String>]
|
562
|
+
# @!attribute [rw] lib_name
|
563
|
+
# The library name as recorded in instrumentation and logging
|
564
|
+
# @return [::String]
|
565
|
+
# @!attribute [rw] lib_version
|
566
|
+
# The library version as recorded in instrumentation and logging
|
567
|
+
# @return [::String]
|
568
|
+
# @!attribute [rw] timeout
|
569
|
+
# The call timeout in seconds.
|
570
|
+
# @return [::Numeric]
|
571
|
+
# @!attribute [rw] metadata
|
572
|
+
# Additional headers to be sent with the call.
|
573
|
+
# @return [::Hash{::Symbol=>::String}]
|
574
|
+
# @!attribute [rw] retry_policy
|
575
|
+
# The retry policy. The value is a hash with the following keys:
|
576
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
577
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
578
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
579
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
580
|
+
# trigger a retry.
|
581
|
+
# @return [::Hash]
|
582
|
+
# @!attribute [rw] quota_project
|
583
|
+
# A separate project against which to charge quota.
|
584
|
+
# @return [::String]
|
585
|
+
# @!attribute [rw] universe_domain
|
586
|
+
# The universe domain within which to make requests. This determines the
|
587
|
+
# default endpoint URL. The default value of nil uses the environment
|
588
|
+
# universe (usually the default "googleapis.com" universe).
|
589
|
+
# @return [::String,nil]
|
590
|
+
#
|
591
|
+
class Configuration
|
592
|
+
extend ::Gapic::Config
|
593
|
+
|
594
|
+
# @private
|
595
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
596
|
+
DEFAULT_ENDPOINT = "apihub.googleapis.com"
|
597
|
+
|
598
|
+
config_attr :endpoint, nil, ::String, nil
|
599
|
+
config_attr :credentials, nil do |value|
|
600
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
601
|
+
allowed.any? { |klass| klass === value }
|
602
|
+
end
|
603
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
604
|
+
config_attr :lib_name, nil, ::String, nil
|
605
|
+
config_attr :lib_version, nil, ::String, nil
|
606
|
+
config_attr :timeout, nil, ::Numeric, nil
|
607
|
+
config_attr :metadata, nil, ::Hash, nil
|
608
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
609
|
+
config_attr :quota_project, nil, ::String, nil
|
610
|
+
config_attr :universe_domain, nil, ::String, nil
|
611
|
+
|
612
|
+
# @private
|
613
|
+
# Overrides for http bindings for the RPCs of this service
|
614
|
+
# are only used when this service is used as mixin, and only
|
615
|
+
# by the host service.
|
616
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
617
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
618
|
+
|
619
|
+
# @private
|
620
|
+
def initialize parent_config = nil
|
621
|
+
@parent_config = parent_config unless parent_config.nil?
|
622
|
+
|
623
|
+
yield self if block_given?
|
624
|
+
end
|
625
|
+
|
626
|
+
##
|
627
|
+
# Configurations for individual RPCs
|
628
|
+
# @return [Rpcs]
|
629
|
+
#
|
630
|
+
def rpcs
|
631
|
+
@rpcs ||= begin
|
632
|
+
parent_rpcs = nil
|
633
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
634
|
+
Rpcs.new parent_rpcs
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
##
|
639
|
+
# Configuration RPC class for the LintingService API.
|
640
|
+
#
|
641
|
+
# Includes fields providing the configuration for each RPC in this service.
|
642
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
643
|
+
# the following configuration fields:
|
644
|
+
#
|
645
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
646
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
647
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
648
|
+
# include the following keys:
|
649
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
650
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
651
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
652
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
653
|
+
# trigger a retry.
|
654
|
+
#
|
655
|
+
class Rpcs
|
656
|
+
##
|
657
|
+
# RPC-specific configuration for `get_style_guide`
|
658
|
+
# @return [::Gapic::Config::Method]
|
659
|
+
#
|
660
|
+
attr_reader :get_style_guide
|
661
|
+
##
|
662
|
+
# RPC-specific configuration for `update_style_guide`
|
663
|
+
# @return [::Gapic::Config::Method]
|
664
|
+
#
|
665
|
+
attr_reader :update_style_guide
|
666
|
+
##
|
667
|
+
# RPC-specific configuration for `get_style_guide_contents`
|
668
|
+
# @return [::Gapic::Config::Method]
|
669
|
+
#
|
670
|
+
attr_reader :get_style_guide_contents
|
671
|
+
##
|
672
|
+
# RPC-specific configuration for `lint_spec`
|
673
|
+
# @return [::Gapic::Config::Method]
|
674
|
+
#
|
675
|
+
attr_reader :lint_spec
|
676
|
+
|
677
|
+
# @private
|
678
|
+
def initialize parent_rpcs = nil
|
679
|
+
get_style_guide_config = parent_rpcs.get_style_guide if parent_rpcs.respond_to? :get_style_guide
|
680
|
+
@get_style_guide = ::Gapic::Config::Method.new get_style_guide_config
|
681
|
+
update_style_guide_config = parent_rpcs.update_style_guide if parent_rpcs.respond_to? :update_style_guide
|
682
|
+
@update_style_guide = ::Gapic::Config::Method.new update_style_guide_config
|
683
|
+
get_style_guide_contents_config = parent_rpcs.get_style_guide_contents if parent_rpcs.respond_to? :get_style_guide_contents
|
684
|
+
@get_style_guide_contents = ::Gapic::Config::Method.new get_style_guide_contents_config
|
685
|
+
lint_spec_config = parent_rpcs.lint_spec if parent_rpcs.respond_to? :lint_spec
|
686
|
+
@lint_spec = ::Gapic::Config::Method.new lint_spec_config
|
687
|
+
|
688
|
+
yield self if block_given?
|
689
|
+
end
|
690
|
+
end
|
691
|
+
end
|
692
|
+
end
|
693
|
+
end
|
694
|
+
end
|
695
|
+
end
|
696
|
+
end
|
697
|
+
end
|
698
|
+
end
|