google-developers-developer_knowledge-v1 0.a → 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 +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +153 -8
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/client.rb +758 -0
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/credentials.rb +47 -0
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/paths.rb +47 -0
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/rest/client.rb +710 -0
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/rest/service_stub.rb +260 -0
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/rest.rb +67 -0
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge.rb +70 -0
- data/lib/google/developers/developer_knowledge/v1/rest.rb +37 -0
- data/lib/google/developers/developer_knowledge/v1/version.rb +7 -2
- data/lib/google/developers/developer_knowledge/v1.rb +45 -0
- data/lib/google/developers/knowledge/v1/developerknowledge_pb.rb +34 -0
- data/lib/google/developers/knowledge/v1/developerknowledge_services_pb.rb +75 -0
- data/lib/google-developers-developer_knowledge-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +593 -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/developers/knowledge/v1/developerknowledge.rb +277 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- metadata +58 -9
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/developers/knowledge/v1/developerknowledge_pb"
|
|
20
|
+
|
|
21
|
+
module Google
|
|
22
|
+
module Developers
|
|
23
|
+
module DeveloperKnowledge
|
|
24
|
+
module V1
|
|
25
|
+
module DeveloperKnowledge
|
|
26
|
+
module Rest
|
|
27
|
+
##
|
|
28
|
+
# REST service stub for the DeveloperKnowledge service.
|
|
29
|
+
# Service stub contains baseline method implementations
|
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
|
31
|
+
#
|
|
32
|
+
class ServiceStub
|
|
33
|
+
# @private
|
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
|
35
|
+
# These require statements are intentionally placed here to initialize
|
|
36
|
+
# the REST modules only when it's required.
|
|
37
|
+
require "gapic/rest"
|
|
38
|
+
|
|
39
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
40
|
+
endpoint_template: endpoint_template,
|
|
41
|
+
universe_domain: universe_domain,
|
|
42
|
+
credentials: credentials,
|
|
43
|
+
numeric_enums: true,
|
|
44
|
+
service_name: self.class,
|
|
45
|
+
raise_faraday_errors: false,
|
|
46
|
+
logger: logger
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
##
|
|
50
|
+
# The effective universe domain
|
|
51
|
+
#
|
|
52
|
+
# @return [String]
|
|
53
|
+
#
|
|
54
|
+
def universe_domain
|
|
55
|
+
@client_stub.universe_domain
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
##
|
|
59
|
+
# The effective endpoint
|
|
60
|
+
#
|
|
61
|
+
# @return [String]
|
|
62
|
+
#
|
|
63
|
+
def endpoint
|
|
64
|
+
@client_stub.endpoint
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
##
|
|
68
|
+
# The logger used for request/response debug logging.
|
|
69
|
+
#
|
|
70
|
+
# @return [Logger]
|
|
71
|
+
#
|
|
72
|
+
def logger stub: false
|
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
##
|
|
77
|
+
# Baseline implementation for the search_document_chunks REST call
|
|
78
|
+
#
|
|
79
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksRequest]
|
|
80
|
+
# A request object representing the call parameters. Required.
|
|
81
|
+
# @param options [::Gapic::CallOptions]
|
|
82
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
83
|
+
#
|
|
84
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
85
|
+
# @yieldparam result [::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksResponse]
|
|
86
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
87
|
+
#
|
|
88
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksResponse]
|
|
89
|
+
# A result object deserialized from the server's reply
|
|
90
|
+
def search_document_chunks request_pb, options = nil
|
|
91
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
92
|
+
|
|
93
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_search_document_chunks_request request_pb
|
|
94
|
+
query_string_params = if query_string_params.any?
|
|
95
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
96
|
+
else
|
|
97
|
+
{}
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
response = @client_stub.make_http_request(
|
|
101
|
+
verb,
|
|
102
|
+
uri: uri,
|
|
103
|
+
body: body || "",
|
|
104
|
+
params: query_string_params,
|
|
105
|
+
method_name: "search_document_chunks",
|
|
106
|
+
options: options
|
|
107
|
+
)
|
|
108
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
109
|
+
result = ::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksResponse.decode_json response.body, ignore_unknown_fields: true
|
|
110
|
+
catch :response do
|
|
111
|
+
yield result, operation if block_given?
|
|
112
|
+
result
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
##
|
|
117
|
+
# Baseline implementation for the get_document REST call
|
|
118
|
+
#
|
|
119
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::GetDocumentRequest]
|
|
120
|
+
# A request object representing the call parameters. Required.
|
|
121
|
+
# @param options [::Gapic::CallOptions]
|
|
122
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
123
|
+
#
|
|
124
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
125
|
+
# @yieldparam result [::Google::Developers::DeveloperKnowledge::V1::Document]
|
|
126
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
127
|
+
#
|
|
128
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::Document]
|
|
129
|
+
# A result object deserialized from the server's reply
|
|
130
|
+
def get_document request_pb, options = nil
|
|
131
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
132
|
+
|
|
133
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb
|
|
134
|
+
query_string_params = if query_string_params.any?
|
|
135
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
136
|
+
else
|
|
137
|
+
{}
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
response = @client_stub.make_http_request(
|
|
141
|
+
verb,
|
|
142
|
+
uri: uri,
|
|
143
|
+
body: body || "",
|
|
144
|
+
params: query_string_params,
|
|
145
|
+
method_name: "get_document",
|
|
146
|
+
options: options
|
|
147
|
+
)
|
|
148
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
149
|
+
result = ::Google::Developers::DeveloperKnowledge::V1::Document.decode_json response.body, ignore_unknown_fields: true
|
|
150
|
+
catch :response do
|
|
151
|
+
yield result, operation if block_given?
|
|
152
|
+
result
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
##
|
|
157
|
+
# Baseline implementation for the batch_get_documents REST call
|
|
158
|
+
#
|
|
159
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsRequest]
|
|
160
|
+
# A request object representing the call parameters. Required.
|
|
161
|
+
# @param options [::Gapic::CallOptions]
|
|
162
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
163
|
+
#
|
|
164
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
165
|
+
# @yieldparam result [::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsResponse]
|
|
166
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
167
|
+
#
|
|
168
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsResponse]
|
|
169
|
+
# A result object deserialized from the server's reply
|
|
170
|
+
def batch_get_documents request_pb, options = nil
|
|
171
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
172
|
+
|
|
173
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_documents_request request_pb
|
|
174
|
+
query_string_params = if query_string_params.any?
|
|
175
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
176
|
+
else
|
|
177
|
+
{}
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
response = @client_stub.make_http_request(
|
|
181
|
+
verb,
|
|
182
|
+
uri: uri,
|
|
183
|
+
body: body || "",
|
|
184
|
+
params: query_string_params,
|
|
185
|
+
method_name: "batch_get_documents",
|
|
186
|
+
options: options
|
|
187
|
+
)
|
|
188
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
189
|
+
result = ::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsResponse.decode_json response.body, ignore_unknown_fields: true
|
|
190
|
+
catch :response do
|
|
191
|
+
yield result, operation if block_given?
|
|
192
|
+
result
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
##
|
|
197
|
+
# @private
|
|
198
|
+
#
|
|
199
|
+
# GRPC transcoding helper method for the search_document_chunks REST call
|
|
200
|
+
#
|
|
201
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksRequest]
|
|
202
|
+
# A request object representing the call parameters. Required.
|
|
203
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
204
|
+
# Uri, Body, Query string parameters
|
|
205
|
+
def self.transcode_search_document_chunks_request request_pb
|
|
206
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
207
|
+
.with_bindings(
|
|
208
|
+
uri_method: :get,
|
|
209
|
+
uri_template: "/v1/documents:searchDocumentChunks",
|
|
210
|
+
matches: []
|
|
211
|
+
)
|
|
212
|
+
transcoder.transcode request_pb
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
##
|
|
216
|
+
# @private
|
|
217
|
+
#
|
|
218
|
+
# GRPC transcoding helper method for the get_document REST call
|
|
219
|
+
#
|
|
220
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::GetDocumentRequest]
|
|
221
|
+
# A request object representing the call parameters. Required.
|
|
222
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
223
|
+
# Uri, Body, Query string parameters
|
|
224
|
+
def self.transcode_get_document_request request_pb
|
|
225
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
226
|
+
.with_bindings(
|
|
227
|
+
uri_method: :get,
|
|
228
|
+
uri_template: "/v1/{name}",
|
|
229
|
+
matches: [
|
|
230
|
+
["name", %r{^documents(?:/.*)?$}, true]
|
|
231
|
+
]
|
|
232
|
+
)
|
|
233
|
+
transcoder.transcode request_pb
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
##
|
|
237
|
+
# @private
|
|
238
|
+
#
|
|
239
|
+
# GRPC transcoding helper method for the batch_get_documents REST call
|
|
240
|
+
#
|
|
241
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsRequest]
|
|
242
|
+
# A request object representing the call parameters. Required.
|
|
243
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
244
|
+
# Uri, Body, Query string parameters
|
|
245
|
+
def self.transcode_batch_get_documents_request request_pb
|
|
246
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
247
|
+
.with_bindings(
|
|
248
|
+
uri_method: :get,
|
|
249
|
+
uri_template: "/v1/documents:batchGet",
|
|
250
|
+
matches: []
|
|
251
|
+
)
|
|
252
|
+
transcoder.transcode request_pb
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/rest"
|
|
20
|
+
require "gapic/config"
|
|
21
|
+
require "gapic/config/method"
|
|
22
|
+
|
|
23
|
+
require "google/developers/developer_knowledge/v1/version"
|
|
24
|
+
|
|
25
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/credentials"
|
|
26
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/paths"
|
|
27
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/rest/client"
|
|
28
|
+
|
|
29
|
+
module Google
|
|
30
|
+
module Developers
|
|
31
|
+
module DeveloperKnowledge
|
|
32
|
+
module V1
|
|
33
|
+
##
|
|
34
|
+
# The Developer Knowledge API provides programmatic access to Google's public
|
|
35
|
+
# developer documentation, enabling you to integrate this knowledge base into
|
|
36
|
+
# your own applications and workflows.
|
|
37
|
+
#
|
|
38
|
+
# The API is designed to be the canonical source for machine-readable access to
|
|
39
|
+
# Google's developer documentation.
|
|
40
|
+
#
|
|
41
|
+
# A typical use case is to first use
|
|
42
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#search_document_chunks DeveloperKnowledge.SearchDocumentChunks}
|
|
43
|
+
# to find relevant page URIs based on a query, and then use
|
|
44
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#get_document DeveloperKnowledge.GetDocument}
|
|
45
|
+
# or
|
|
46
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#batch_get_documents DeveloperKnowledge.BatchGetDocuments}
|
|
47
|
+
# to fetch the full content of the top results.
|
|
48
|
+
#
|
|
49
|
+
# All document content is provided in Markdown format.
|
|
50
|
+
#
|
|
51
|
+
# To load this service and instantiate a REST client:
|
|
52
|
+
#
|
|
53
|
+
# require "google/developers/developer_knowledge/v1/developer_knowledge/rest"
|
|
54
|
+
# client = ::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Rest::Client.new
|
|
55
|
+
#
|
|
56
|
+
module DeveloperKnowledge
|
|
57
|
+
# Client for the REST transport
|
|
58
|
+
module Rest
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
|
67
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/rest/helpers" if ::File.file? helper_path
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/developers/developer_knowledge/v1/version"
|
|
24
|
+
|
|
25
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/credentials"
|
|
26
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/paths"
|
|
27
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/client"
|
|
28
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/rest"
|
|
29
|
+
|
|
30
|
+
module Google
|
|
31
|
+
module Developers
|
|
32
|
+
module DeveloperKnowledge
|
|
33
|
+
module V1
|
|
34
|
+
##
|
|
35
|
+
# The Developer Knowledge API provides programmatic access to Google's public
|
|
36
|
+
# developer documentation, enabling you to integrate this knowledge base into
|
|
37
|
+
# your own applications and workflows.
|
|
38
|
+
#
|
|
39
|
+
# The API is designed to be the canonical source for machine-readable access to
|
|
40
|
+
# Google's developer documentation.
|
|
41
|
+
#
|
|
42
|
+
# A typical use case is to first use
|
|
43
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#search_document_chunks DeveloperKnowledge.SearchDocumentChunks}
|
|
44
|
+
# to find relevant page URIs based on a query, and then use
|
|
45
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#get_document DeveloperKnowledge.GetDocument}
|
|
46
|
+
# or
|
|
47
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#batch_get_documents DeveloperKnowledge.BatchGetDocuments}
|
|
48
|
+
# to fetch the full content of the top results.
|
|
49
|
+
#
|
|
50
|
+
# All document content is provided in Markdown format.
|
|
51
|
+
#
|
|
52
|
+
# @example Load this service and instantiate a gRPC client
|
|
53
|
+
#
|
|
54
|
+
# require "google/developers/developer_knowledge/v1/developer_knowledge"
|
|
55
|
+
# client = ::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client.new
|
|
56
|
+
#
|
|
57
|
+
# @example Load this service and instantiate a REST client
|
|
58
|
+
#
|
|
59
|
+
# require "google/developers/developer_knowledge/v1/developer_knowledge/rest"
|
|
60
|
+
# client = ::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Rest::Client.new
|
|
61
|
+
#
|
|
62
|
+
module DeveloperKnowledge
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
helper_path = ::File.join __dir__, "developer_knowledge", "helpers.rb"
|
|
70
|
+
require "google/developers/developer_knowledge/v1/developer_knowledge/helpers" if ::File.file? helper_path
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/developers/developer_knowledge/v1/developer_knowledge/rest"
|
|
20
|
+
require "google/developers/developer_knowledge/v1/version"
|
|
21
|
+
|
|
22
|
+
module Google
|
|
23
|
+
module Developers
|
|
24
|
+
module DeveloperKnowledge
|
|
25
|
+
##
|
|
26
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
|
27
|
+
#
|
|
28
|
+
# @example
|
|
29
|
+
#
|
|
30
|
+
# require "google/developers/developer_knowledge/v1/rest"
|
|
31
|
+
# client = ::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Rest::Client.new
|
|
32
|
+
#
|
|
33
|
+
module V1
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright 2026 Google LLC
|
|
2
4
|
#
|
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
6
|
# you may not use this file except in compliance with the License.
|
|
5
7
|
# You may obtain a copy of the License at
|
|
6
8
|
#
|
|
7
|
-
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
10
|
#
|
|
9
11
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -12,11 +14,14 @@
|
|
|
12
14
|
# See the License for the specific language governing permissions and
|
|
13
15
|
# limitations under the License.
|
|
14
16
|
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
|
|
15
20
|
module Google
|
|
16
21
|
module Developers
|
|
17
22
|
module DeveloperKnowledge
|
|
18
23
|
module V1
|
|
19
|
-
VERSION = "0.
|
|
24
|
+
VERSION = "0.1.0"
|
|
20
25
|
end
|
|
21
26
|
end
|
|
22
27
|
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/developers/developer_knowledge/v1/developer_knowledge"
|
|
20
|
+
require "google/developers/developer_knowledge/v1/version"
|
|
21
|
+
|
|
22
|
+
module Google
|
|
23
|
+
module Developers
|
|
24
|
+
module DeveloperKnowledge
|
|
25
|
+
##
|
|
26
|
+
# API client module.
|
|
27
|
+
#
|
|
28
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
|
29
|
+
#
|
|
30
|
+
# require "google/developers/developer_knowledge/v1"
|
|
31
|
+
# client = ::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client.new
|
|
32
|
+
#
|
|
33
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
|
34
|
+
#
|
|
35
|
+
# require "google/developers/developer_knowledge/v1"
|
|
36
|
+
# client = ::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Rest::Client.new
|
|
37
|
+
#
|
|
38
|
+
module V1
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
helper_path = ::File.join __dir__, "v1", "_helpers.rb"
|
|
45
|
+
require "google/developers/developer_knowledge/v1/_helpers" if ::File.file? helper_path
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: google/developers/knowledge/v1/developerknowledge.proto
|
|
4
|
+
|
|
5
|
+
require 'google/protobuf'
|
|
6
|
+
|
|
7
|
+
require 'google/api/annotations_pb'
|
|
8
|
+
require 'google/api/client_pb'
|
|
9
|
+
require 'google/api/field_behavior_pb'
|
|
10
|
+
require 'google/api/resource_pb'
|
|
11
|
+
require 'google/protobuf/timestamp_pb'
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
descriptor_data = "\n7google/developers/knowledge/v1/developerknowledge.proto\x12\x1egoogle.developers.knowledge.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe0\x02\n\x08\x44ocument\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x61ta_source\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05title\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x04view\x18\x08 \x01(\x0e\x32,.google.developers.knowledge.v1.DocumentViewB\x03\xe0\x41\x03:Z\xea\x41W\n*developerknowledge.googleapis.com/Document\x12\x14\x64ocuments/{document}*\tdocuments2\x08\x64ocument\"w\n\x1bSearchDocumentChunksRequest\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"|\n\x1cSearchDocumentChunksResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.google.developers.knowledge.v1.DocumentChunk\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x97\x01\n\x12GetDocumentRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*developerknowledge.googleapis.com/Document\x12?\n\x04view\x18\x02 \x01(\x0e\x32,.google.developers.knowledge.v1.DocumentViewB\x03\xe0\x41\x01\"\x9e\x01\n\x18\x42\x61tchGetDocumentsRequest\x12\x41\n\x05names\x18\x01 \x03(\tB2\xe0\x41\x02\xfa\x41,\n*developerknowledge.googleapis.com/Document\x12?\n\x04view\x18\x02 \x01(\x0e\x32,.google.developers.knowledge.v1.DocumentViewB\x03\xe0\x41\x01\"X\n\x19\x42\x61tchGetDocumentsResponse\x12;\n\tdocuments\x18\x01 \x03(\x0b\x32(.google.developers.knowledge.v1.Document\"\xbb\x01\n\rDocumentChunk\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x03\xfa\x41,\n*developerknowledge.googleapis.com/Document\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12?\n\x08\x64ocument\x18\x04 \x01(\x0b\x32(.google.developers.knowledge.v1.DocumentB\x03\xe0\x41\x03*y\n\x0c\x44ocumentView\x12\x1d\n\x19\x44OCUMENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44OCUMENT_VIEW_BASIC\x10\x01\x12\x16\n\x12\x44OCUMENT_VIEW_FULL\x10\x02\x12\x19\n\x15\x44OCUMENT_VIEW_CONTENT\x10\x03\x32\xec\x04\n\x12\x44\x65veloperKnowledge\x12\xbd\x01\n\x14SearchDocumentChunks\x12;.google.developers.knowledge.v1.SearchDocumentChunksRequest\x1a<.google.developers.knowledge.v1.SearchDocumentChunksResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/documents:searchDocumentChunks\x12\x93\x01\n\x0bGetDocument\x12\x32.google.developers.knowledge.v1.GetDocumentRequest\x1a(.google.developers.knowledge.v1.Document\"&\xda\x41\x04name\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/{name=documents/**}\x12\xa8\x01\n\x11\x42\x61tchGetDocuments\x12\x38.google.developers.knowledge.v1.BatchGetDocumentsRequest\x1a\x39.google.developers.knowledge.v1.BatchGetDocumentsResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/documents:batchGet\x1aU\xca\x41!developerknowledge.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n\"com.google.developers.knowledge.v1B\x17\x44\x65veloperKnowledgeProtoP\x01ZGgoogle.golang.org/genproto/googleapis/developers/knowledge/v1;knowledge\xaa\x02\'Google.Developers.DeveloperKnowledge.V1\xca\x02\'Google\\Developers\\DeveloperKnowledge\\V1\xea\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3"
|
|
15
|
+
|
|
16
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
17
|
+
pool.add_serialized_file(descriptor_data)
|
|
18
|
+
|
|
19
|
+
module Google
|
|
20
|
+
module Developers
|
|
21
|
+
module DeveloperKnowledge
|
|
22
|
+
module V1
|
|
23
|
+
Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.Document").msgclass
|
|
24
|
+
SearchDocumentChunksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.SearchDocumentChunksRequest").msgclass
|
|
25
|
+
SearchDocumentChunksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.SearchDocumentChunksResponse").msgclass
|
|
26
|
+
GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.GetDocumentRequest").msgclass
|
|
27
|
+
BatchGetDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.BatchGetDocumentsRequest").msgclass
|
|
28
|
+
BatchGetDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.BatchGetDocumentsResponse").msgclass
|
|
29
|
+
DocumentChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.DocumentChunk").msgclass
|
|
30
|
+
DocumentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.DocumentView").enummodule
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# Source: google/developers/knowledge/v1/developerknowledge.proto for package 'Google.Developers.DeveloperKnowledge.V1'
|
|
3
|
+
# Original file comments:
|
|
4
|
+
# Copyright 2026 Google LLC
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
require 'grpc'
|
|
20
|
+
require 'google/developers/knowledge/v1/developerknowledge_pb'
|
|
21
|
+
|
|
22
|
+
module Google
|
|
23
|
+
module Developers
|
|
24
|
+
module DeveloperKnowledge
|
|
25
|
+
module V1
|
|
26
|
+
module DeveloperKnowledge
|
|
27
|
+
# The Developer Knowledge API provides programmatic access to Google's public
|
|
28
|
+
# developer documentation, enabling you to integrate this knowledge base into
|
|
29
|
+
# your own applications and workflows.
|
|
30
|
+
#
|
|
31
|
+
# The API is designed to be the canonical source for machine-readable access to
|
|
32
|
+
# Google's developer documentation.
|
|
33
|
+
#
|
|
34
|
+
# A typical use case is to first use
|
|
35
|
+
# [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks]
|
|
36
|
+
# to find relevant page URIs based on a query, and then use
|
|
37
|
+
# [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
|
|
38
|
+
# or
|
|
39
|
+
# [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
|
|
40
|
+
# to fetch the full content of the top results.
|
|
41
|
+
#
|
|
42
|
+
# All document content is provided in Markdown format.
|
|
43
|
+
class Service
|
|
44
|
+
|
|
45
|
+
include ::GRPC::GenericService
|
|
46
|
+
|
|
47
|
+
self.marshal_class_method = :encode
|
|
48
|
+
self.unmarshal_class_method = :decode
|
|
49
|
+
self.service_name = 'google.developers.knowledge.v1.DeveloperKnowledge'
|
|
50
|
+
|
|
51
|
+
# Searches for developer knowledge across Google's developer documentation.
|
|
52
|
+
# Returns [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s
|
|
53
|
+
# based on the user's query. There may be many chunks from the same
|
|
54
|
+
# [Document][google.developers.knowledge.v1.Document]. To retrieve full
|
|
55
|
+
# documents, use
|
|
56
|
+
# [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
|
|
57
|
+
# or
|
|
58
|
+
# [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
|
|
59
|
+
# with the
|
|
60
|
+
# [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent]
|
|
61
|
+
# returned in the
|
|
62
|
+
# [SearchDocumentChunksResponse.results][google.developers.knowledge.v1.SearchDocumentChunksResponse.results].
|
|
63
|
+
rpc :SearchDocumentChunks, ::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksRequest, ::Google::Developers::DeveloperKnowledge::V1::SearchDocumentChunksResponse
|
|
64
|
+
# Retrieves a single document with its full Markdown content.
|
|
65
|
+
rpc :GetDocument, ::Google::Developers::DeveloperKnowledge::V1::GetDocumentRequest, ::Google::Developers::DeveloperKnowledge::V1::Document
|
|
66
|
+
# Retrieves multiple documents, each with its full Markdown content.
|
|
67
|
+
rpc :BatchGetDocuments, ::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsRequest, ::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsResponse
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
Stub = Service.rpc_stub_class
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/developers/developer_knowledge/v1"
|