google-cloud-scheduler 1.2.1 → 2.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 +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +321 -0
- data/README.md +36 -24
- data/lib/{google/cloud/scheduler/v1/doc/google/protobuf/empty.rb → google-cloud-scheduler.rb} +4 -14
- data/lib/google/cloud/scheduler.rb +88 -117
- data/lib/google/cloud/scheduler/version.rb +6 -2
- metadata +75 -74
- data/LICENSE +0 -201
- data/lib/google/cloud/scheduler/v1.rb +0 -147
- data/lib/google/cloud/scheduler/v1/cloud_scheduler_client.rb +0 -613
- data/lib/google/cloud/scheduler/v1/cloud_scheduler_client_config.json +0 -66
- data/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb +0 -65
- data/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb +0 -84
- data/lib/google/cloud/scheduler/v1/credentials.rb +0 -41
- data/lib/google/cloud/scheduler/v1/doc/google/cloud/scheduler/v1/cloudscheduler.rb +0 -124
- data/lib/google/cloud/scheduler/v1/doc/google/cloud/scheduler/v1/job.rb +0 -219
- data/lib/google/cloud/scheduler/v1/doc/google/cloud/scheduler/v1/target.rb +0 -336
- data/lib/google/cloud/scheduler/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/scheduler/v1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/scheduler/v1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/scheduler/v1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/scheduler/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/scheduler/v1/helpers.rb +0 -48
- data/lib/google/cloud/scheduler/v1/job_pb.rb +0 -58
- data/lib/google/cloud/scheduler/v1/target_pb.rb +0 -72
- data/lib/google/cloud/scheduler/v1beta1.rb +0 -147
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler_client.rb +0 -610
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler_client_config.json +0 -66
- data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb +0 -65
- data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb +0 -84
- data/lib/google/cloud/scheduler/v1beta1/credentials.rb +0 -41
- data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/cloudscheduler.rb +0 -124
- data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/job.rb +0 -221
- data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/target.rb +0 -336
- data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/scheduler/v1beta1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/scheduler/v1beta1/helpers.rb +0 -48
- data/lib/google/cloud/scheduler/v1beta1/job_pb.rb +0 -58
- data/lib/google/cloud/scheduler/v1beta1/target_pb.rb +0 -72
@@ -1,336 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
module Google
|
17
|
-
module Cloud
|
18
|
-
module Scheduler
|
19
|
-
module V1
|
20
|
-
# Http target. The job will be pushed to the job handler by means of
|
21
|
-
# an HTTP request via an {Google::Cloud::Scheduler::V1::HttpTarget#http_method http_method} such as HTTP
|
22
|
-
# POST, HTTP GET, etc. The job is acknowledged by means of an HTTP
|
23
|
-
# response code in the range [200 - 299]. A failure to receive a response
|
24
|
-
# constitutes a failed execution. For a redirected request, the response
|
25
|
-
# returned by the redirected request is considered.
|
26
|
-
# @!attribute [rw] uri
|
27
|
-
# @return [String]
|
28
|
-
# Required. The full URI path that the request will be sent to. This string
|
29
|
-
# must begin with either "http://" or "https://". Some examples of
|
30
|
-
# valid values for {Google::Cloud::Scheduler::V1::HttpTarget#uri uri} are:
|
31
|
-
# `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
|
32
|
-
# encode some characters for safety and compatibility. The maximum allowed
|
33
|
-
# URL length is 2083 characters after encoding.
|
34
|
-
# @!attribute [rw] http_method
|
35
|
-
# @return [Google::Cloud::Scheduler::V1::HttpMethod]
|
36
|
-
# Which HTTP method to use for the request.
|
37
|
-
# @!attribute [rw] headers
|
38
|
-
# @return [Hash{String => String}]
|
39
|
-
# The user can specify HTTP request headers to send with the job's
|
40
|
-
# HTTP request. This map contains the header field names and
|
41
|
-
# values. Repeated headers are not supported, but a header value can
|
42
|
-
# contain commas. These headers represent a subset of the headers
|
43
|
-
# that will accompany the job's HTTP request. Some HTTP request
|
44
|
-
# headers will be ignored or replaced. A partial list of headers that
|
45
|
-
# will be ignored or replaced is below:
|
46
|
-
# * Host: This will be computed by Cloud Scheduler and derived from
|
47
|
-
# {Google::Cloud::Scheduler::V1::HttpTarget#uri uri}.
|
48
|
-
# * `Content-Length`: This will be computed by Cloud Scheduler.
|
49
|
-
# * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
|
50
|
-
# * `X-Google-*`: Google internal use only.
|
51
|
-
# * `X-AppEngine-*`: Google internal use only.
|
52
|
-
#
|
53
|
-
# The total size of headers must be less than 80KB.
|
54
|
-
# @!attribute [rw] body
|
55
|
-
# @return [String]
|
56
|
-
# HTTP request body. A request body is allowed only if the HTTP
|
57
|
-
# method is POST, PUT, or PATCH. It is an error to set body on a job with an
|
58
|
-
# incompatible {Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}.
|
59
|
-
# @!attribute [rw] oauth_token
|
60
|
-
# @return [Google::Cloud::Scheduler::V1::OAuthToken]
|
61
|
-
# If specified, an
|
62
|
-
# [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
|
63
|
-
# will be generated and attached as an `Authorization` header in the HTTP
|
64
|
-
# request.
|
65
|
-
#
|
66
|
-
# This type of authorization should generally only be used when calling
|
67
|
-
# Google APIs hosted on *.googleapis.com.
|
68
|
-
# @!attribute [rw] oidc_token
|
69
|
-
# @return [Google::Cloud::Scheduler::V1::OidcToken]
|
70
|
-
# If specified, an
|
71
|
-
# [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
|
72
|
-
# token will be generated and attached as an `Authorization` header in the
|
73
|
-
# HTTP request.
|
74
|
-
#
|
75
|
-
# This type of authorization can be used for many scenarios, including
|
76
|
-
# calling Cloud Run, or endpoints where you intend to validate the token
|
77
|
-
# yourself.
|
78
|
-
class HttpTarget; end
|
79
|
-
|
80
|
-
# App Engine target. The job will be pushed to a job handler by means
|
81
|
-
# of an HTTP request via an {Google::Cloud::Scheduler::V1::AppEngineHttpTarget#http_method http_method} such
|
82
|
-
# as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an
|
83
|
-
# HTTP response code in the range [200 - 299]. Error 503 is
|
84
|
-
# considered an App Engine system error instead of an application
|
85
|
-
# error. Requests returning error 503 will be retried regardless of
|
86
|
-
# retry configuration and not counted against retry counts. Any other
|
87
|
-
# response code, or a failure to receive a response before the
|
88
|
-
# deadline, constitutes a failed attempt.
|
89
|
-
# @!attribute [rw] http_method
|
90
|
-
# @return [Google::Cloud::Scheduler::V1::HttpMethod]
|
91
|
-
# The HTTP method to use for the request. PATCH and OPTIONS are not
|
92
|
-
# permitted.
|
93
|
-
# @!attribute [rw] app_engine_routing
|
94
|
-
# @return [Google::Cloud::Scheduler::V1::AppEngineRouting]
|
95
|
-
# App Engine Routing setting for the job.
|
96
|
-
# @!attribute [rw] relative_uri
|
97
|
-
# @return [String]
|
98
|
-
# The relative URI.
|
99
|
-
#
|
100
|
-
# The relative URL must begin with "/" and must be a valid HTTP relative URL.
|
101
|
-
# It can contain a path, query string arguments, and `#` fragments.
|
102
|
-
# If the relative URL is empty, then the root path "/" will be used.
|
103
|
-
# No spaces are allowed, and the maximum length allowed is 2083 characters.
|
104
|
-
# @!attribute [rw] headers
|
105
|
-
# @return [Hash{String => String}]
|
106
|
-
# HTTP request headers.
|
107
|
-
#
|
108
|
-
# This map contains the header field names and values. Headers can be set
|
109
|
-
# when the job is created.
|
110
|
-
#
|
111
|
-
# Cloud Scheduler sets some headers to default values:
|
112
|
-
#
|
113
|
-
# * `User-Agent`: By default, this header is
|
114
|
-
# `"AppEngine-Google; (+http://code.google.com/appengine)"`.
|
115
|
-
# This header can be modified, but Cloud Scheduler will append
|
116
|
-
# `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
|
117
|
-
# modified `User-Agent`.
|
118
|
-
# * `X-CloudScheduler`: This header will be set to true.
|
119
|
-
#
|
120
|
-
# If the job has an {Google::Cloud::Scheduler::V1::AppEngineHttpTarget#body body}, Cloud Scheduler sets
|
121
|
-
# the following headers:
|
122
|
-
#
|
123
|
-
# * `Content-Type`: By default, the `Content-Type` header is set to
|
124
|
-
# `"application/octet-stream"`. The default can be overridden by explictly
|
125
|
-
# setting `Content-Type` to a particular media type when the job is
|
126
|
-
# created.
|
127
|
-
# For example, `Content-Type` can be set to `"application/json"`.
|
128
|
-
# * `Content-Length`: This is computed by Cloud Scheduler. This value is
|
129
|
-
# output only. It cannot be changed.
|
130
|
-
#
|
131
|
-
# The headers below are output only. They cannot be set or overridden:
|
132
|
-
#
|
133
|
-
# * `X-Google-*`: For Google internal use only.
|
134
|
-
# * `X-AppEngine-*`: For Google internal use only.
|
135
|
-
#
|
136
|
-
# In addition, some App Engine headers, which contain
|
137
|
-
# job-specific information, are also be sent to the job handler.
|
138
|
-
# @!attribute [rw] body
|
139
|
-
# @return [String]
|
140
|
-
# Body.
|
141
|
-
#
|
142
|
-
# HTTP request body. A request body is allowed only if the HTTP method is
|
143
|
-
# POST or PUT. It will result in invalid argument error to set a body on a
|
144
|
-
# job with an incompatible {Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}.
|
145
|
-
class AppEngineHttpTarget; end
|
146
|
-
|
147
|
-
# Pub/Sub target. The job will be delivered by publishing a message to
|
148
|
-
# the given Pub/Sub topic.
|
149
|
-
# @!attribute [rw] topic_name
|
150
|
-
# @return [String]
|
151
|
-
# Required. The name of the Cloud Pub/Sub topic to which messages will
|
152
|
-
# be published when a job is delivered. The topic name must be in the
|
153
|
-
# same format as required by PubSub's
|
154
|
-
# [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
|
155
|
-
# for example `projects/PROJECT_ID/topics/TOPIC_ID`.
|
156
|
-
#
|
157
|
-
# The topic must be in the same project as the Cloud Scheduler job.
|
158
|
-
# @!attribute [rw] data
|
159
|
-
# @return [String]
|
160
|
-
# The message payload for PubsubMessage.
|
161
|
-
#
|
162
|
-
# Pubsub message must contain either non-empty data, or at least one
|
163
|
-
# attribute.
|
164
|
-
# @!attribute [rw] attributes
|
165
|
-
# @return [Hash{String => String}]
|
166
|
-
# Attributes for PubsubMessage.
|
167
|
-
#
|
168
|
-
# Pubsub message must contain either non-empty data, or at least one
|
169
|
-
# attribute.
|
170
|
-
class PubsubTarget; end
|
171
|
-
|
172
|
-
# App Engine Routing.
|
173
|
-
#
|
174
|
-
# For more information about services, versions, and instances see
|
175
|
-
# [An Overview of App
|
176
|
-
# Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
|
177
|
-
# [Microservices Architecture on Google App
|
178
|
-
# Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
|
179
|
-
# [App Engine Standard request
|
180
|
-
# routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
|
181
|
-
# and [App Engine Flex request
|
182
|
-
# routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
|
183
|
-
# @!attribute [rw] service
|
184
|
-
# @return [String]
|
185
|
-
# App service.
|
186
|
-
#
|
187
|
-
# By default, the job is sent to the service which is the default
|
188
|
-
# service when the job is attempted.
|
189
|
-
# @!attribute [rw] version
|
190
|
-
# @return [String]
|
191
|
-
# App version.
|
192
|
-
#
|
193
|
-
# By default, the job is sent to the version which is the default
|
194
|
-
# version when the job is attempted.
|
195
|
-
# @!attribute [rw] instance
|
196
|
-
# @return [String]
|
197
|
-
# App instance.
|
198
|
-
#
|
199
|
-
# By default, the job is sent to an instance which is available when
|
200
|
-
# the job is attempted.
|
201
|
-
#
|
202
|
-
# Requests can only be sent to a specific instance if
|
203
|
-
# [manual scaling is used in App Engine
|
204
|
-
# Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
|
205
|
-
# App Engine Flex does not support instances. For more information, see
|
206
|
-
# [App Engine Standard request
|
207
|
-
# routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
|
208
|
-
# and [App Engine Flex request
|
209
|
-
# routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
|
210
|
-
# @!attribute [rw] host
|
211
|
-
# @return [String]
|
212
|
-
# Output only. The host that the job is sent to.
|
213
|
-
#
|
214
|
-
# For more information about how App Engine requests are routed, see
|
215
|
-
# [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
|
216
|
-
#
|
217
|
-
# The host is constructed as:
|
218
|
-
#
|
219
|
-
#
|
220
|
-
# * `host = [application_domain_name]`</br>
|
221
|
-
# `| [service] + '.' + [application_domain_name]`</br>
|
222
|
-
# `| [version] + '.' + [application_domain_name]`</br>
|
223
|
-
# `| [version_dot_service]+ '.' + [application_domain_name]`</br>
|
224
|
-
# `| [instance] + '.' + [application_domain_name]`</br>
|
225
|
-
# `| [instance_dot_service] + '.' + [application_domain_name]`</br>
|
226
|
-
# `| [instance_dot_version] + '.' + [application_domain_name]`</br>
|
227
|
-
# `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
|
228
|
-
#
|
229
|
-
# * `application_domain_name` = The domain name of the app, for
|
230
|
-
# example <app-id>.appspot.com, which is associated with the
|
231
|
-
# job's project ID.
|
232
|
-
#
|
233
|
-
# * `service =` {Google::Cloud::Scheduler::V1::AppEngineRouting#service service}
|
234
|
-
#
|
235
|
-
# * `version =` {Google::Cloud::Scheduler::V1::AppEngineRouting#version version}
|
236
|
-
#
|
237
|
-
# * `version_dot_service =`
|
238
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +`
|
239
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#service service}
|
240
|
-
#
|
241
|
-
# * `instance =` {Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance}
|
242
|
-
#
|
243
|
-
# * `instance_dot_service =`
|
244
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +`
|
245
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#service service}
|
246
|
-
#
|
247
|
-
# * `instance_dot_version =`
|
248
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +`
|
249
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#version version}
|
250
|
-
#
|
251
|
-
# * `instance_dot_version_dot_service =`
|
252
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +`
|
253
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +`
|
254
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#service service}
|
255
|
-
#
|
256
|
-
#
|
257
|
-
# If {Google::Cloud::Scheduler::V1::AppEngineRouting#service service} is empty, then the job will be sent
|
258
|
-
# to the service which is the default service when the job is attempted.
|
259
|
-
#
|
260
|
-
# If {Google::Cloud::Scheduler::V1::AppEngineRouting#version version} is empty, then the job will be sent
|
261
|
-
# to the version which is the default version when the job is attempted.
|
262
|
-
#
|
263
|
-
# If {Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is empty, then the job will be
|
264
|
-
# sent to an instance which is available when the job is attempted.
|
265
|
-
#
|
266
|
-
# If {Google::Cloud::Scheduler::V1::AppEngineRouting#service service},
|
267
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#version version}, or
|
268
|
-
# {Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is invalid, then the job will be sent
|
269
|
-
# to the default version of the default service when the job is attempted.
|
270
|
-
class AppEngineRouting; end
|
271
|
-
|
272
|
-
# Contains information needed for generating an
|
273
|
-
# [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
|
274
|
-
# This type of authorization should generally only be used when calling Google
|
275
|
-
# APIs hosted on *.googleapis.com.
|
276
|
-
# @!attribute [rw] service_account_email
|
277
|
-
# @return [String]
|
278
|
-
# [Service account email](https://cloud.google.com/iam/docs/service-accounts)
|
279
|
-
# to be used for generating OAuth token.
|
280
|
-
# The service account must be within the same project as the job. The caller
|
281
|
-
# must have iam.serviceAccounts.actAs permission for the service account.
|
282
|
-
# @!attribute [rw] scope
|
283
|
-
# @return [String]
|
284
|
-
# OAuth scope to be used for generating OAuth access token.
|
285
|
-
# If not specified, "https://www.googleapis.com/auth/cloud-platform"
|
286
|
-
# will be used.
|
287
|
-
class OAuthToken; end
|
288
|
-
|
289
|
-
# Contains information needed for generating an
|
290
|
-
# [OpenID Connect
|
291
|
-
# token](https://developers.google.com/identity/protocols/OpenIDConnect).
|
292
|
-
# This type of authorization can be used for many scenarios, including
|
293
|
-
# calling Cloud Run, or endpoints where you intend to validate the token
|
294
|
-
# yourself.
|
295
|
-
# @!attribute [rw] service_account_email
|
296
|
-
# @return [String]
|
297
|
-
# [Service account email](https://cloud.google.com/iam/docs/service-accounts)
|
298
|
-
# to be used for generating OIDC token.
|
299
|
-
# The service account must be within the same project as the job. The caller
|
300
|
-
# must have iam.serviceAccounts.actAs permission for the service account.
|
301
|
-
# @!attribute [rw] audience
|
302
|
-
# @return [String]
|
303
|
-
# Audience to be used when generating OIDC token. If not specified, the URI
|
304
|
-
# specified in target will be used.
|
305
|
-
class OidcToken; end
|
306
|
-
|
307
|
-
# The HTTP method used to execute the job.
|
308
|
-
module HttpMethod
|
309
|
-
# HTTP method unspecified. Defaults to POST.
|
310
|
-
HTTP_METHOD_UNSPECIFIED = 0
|
311
|
-
|
312
|
-
# HTTP POST
|
313
|
-
POST = 1
|
314
|
-
|
315
|
-
# HTTP GET
|
316
|
-
GET = 2
|
317
|
-
|
318
|
-
# HTTP HEAD
|
319
|
-
HEAD = 3
|
320
|
-
|
321
|
-
# HTTP PUT
|
322
|
-
PUT = 4
|
323
|
-
|
324
|
-
# HTTP DELETE
|
325
|
-
DELETE = 5
|
326
|
-
|
327
|
-
# HTTP PATCH
|
328
|
-
PATCH = 6
|
329
|
-
|
330
|
-
# HTTP OPTIONS
|
331
|
-
OPTIONS = 7
|
332
|
-
end
|
333
|
-
end
|
334
|
-
end
|
335
|
-
end
|
336
|
-
end
|
@@ -1,131 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
module Google
|
17
|
-
module Protobuf
|
18
|
-
# `Any` contains an arbitrary serialized protocol buffer message along with a
|
19
|
-
# URL that describes the type of the serialized message.
|
20
|
-
#
|
21
|
-
# Protobuf library provides support to pack/unpack Any values in the form
|
22
|
-
# of utility functions or additional generated methods of the Any type.
|
23
|
-
#
|
24
|
-
# Example 1: Pack and unpack a message in C++.
|
25
|
-
#
|
26
|
-
# Foo foo = ...;
|
27
|
-
# Any any;
|
28
|
-
# any.PackFrom(foo);
|
29
|
-
# ...
|
30
|
-
# if (any.UnpackTo(&foo)) {
|
31
|
-
# ...
|
32
|
-
# }
|
33
|
-
#
|
34
|
-
# Example 2: Pack and unpack a message in Java.
|
35
|
-
#
|
36
|
-
# Foo foo = ...;
|
37
|
-
# Any any = Any.pack(foo);
|
38
|
-
# ...
|
39
|
-
# if (any.is(Foo.class)) {
|
40
|
-
# foo = any.unpack(Foo.class);
|
41
|
-
# }
|
42
|
-
#
|
43
|
-
# Example 3: Pack and unpack a message in Python.
|
44
|
-
#
|
45
|
-
# foo = Foo(...)
|
46
|
-
# any = Any()
|
47
|
-
# any.Pack(foo)
|
48
|
-
# ...
|
49
|
-
# if any.Is(Foo.DESCRIPTOR):
|
50
|
-
# any.Unpack(foo)
|
51
|
-
# ...
|
52
|
-
#
|
53
|
-
# Example 4: Pack and unpack a message in Go
|
54
|
-
#
|
55
|
-
# foo := &pb.Foo{...}
|
56
|
-
# any, err := ptypes.MarshalAny(foo)
|
57
|
-
# ...
|
58
|
-
# foo := &pb.Foo{}
|
59
|
-
# if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
60
|
-
# ...
|
61
|
-
# }
|
62
|
-
#
|
63
|
-
# The pack methods provided by protobuf library will by default use
|
64
|
-
# 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
65
|
-
# methods only use the fully qualified type name after the last '/'
|
66
|
-
# in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
67
|
-
# name "y.z".
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# = JSON
|
71
|
-
#
|
72
|
-
# The JSON representation of an `Any` value uses the regular
|
73
|
-
# representation of the deserialized, embedded message, with an
|
74
|
-
# additional field `@type` which contains the type URL. Example:
|
75
|
-
#
|
76
|
-
# package google.profile;
|
77
|
-
# message Person {
|
78
|
-
# string first_name = 1;
|
79
|
-
# string last_name = 2;
|
80
|
-
# }
|
81
|
-
#
|
82
|
-
# {
|
83
|
-
# "@type": "type.googleapis.com/google.profile.Person",
|
84
|
-
# "firstName": <string>,
|
85
|
-
# "lastName": <string>
|
86
|
-
# }
|
87
|
-
#
|
88
|
-
# If the embedded message type is well-known and has a custom JSON
|
89
|
-
# representation, that representation will be embedded adding a field
|
90
|
-
# `value` which holds the custom JSON in addition to the `@type`
|
91
|
-
# field. Example (for message {Google::Protobuf::Duration}):
|
92
|
-
#
|
93
|
-
# {
|
94
|
-
# "@type": "type.googleapis.com/google.protobuf.Duration",
|
95
|
-
# "value": "1.212s"
|
96
|
-
# }
|
97
|
-
# @!attribute [rw] type_url
|
98
|
-
# @return [String]
|
99
|
-
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
-
# protocol buffer message. This string must contain at least
|
101
|
-
# one "/" character. The last segment of the URL's path must represent
|
102
|
-
# the fully qualified name of the type (as in
|
103
|
-
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
104
|
-
# (e.g., leading "." is not accepted).
|
105
|
-
#
|
106
|
-
# In practice, teams usually precompile into the binary all types that they
|
107
|
-
# expect it to use in the context of Any. However, for URLs which use the
|
108
|
-
# scheme `http`, `https`, or no scheme, one can optionally set up a type
|
109
|
-
# server that maps type URLs to message definitions as follows:
|
110
|
-
#
|
111
|
-
# * If no scheme is provided, `https` is assumed.
|
112
|
-
# * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
|
113
|
-
# value in binary format, or produce an error.
|
114
|
-
# * Applications are allowed to cache lookup results based on the
|
115
|
-
# URL, or have them precompiled into a binary to avoid any
|
116
|
-
# lookup. Therefore, binary compatibility needs to be preserved
|
117
|
-
# on changes to types. (Use versioned type names to manage
|
118
|
-
# breaking changes.)
|
119
|
-
#
|
120
|
-
# Note: this functionality is not currently available in the official
|
121
|
-
# protobuf release, and it is not used for type URLs beginning with
|
122
|
-
# type.googleapis.com.
|
123
|
-
#
|
124
|
-
# Schemes other than `http`, `https` (or the empty scheme) might be
|
125
|
-
# used with implementation specific semantics.
|
126
|
-
# @!attribute [rw] value
|
127
|
-
# @return [String]
|
128
|
-
# Must be a valid serialized protocol buffer of the above specified type.
|
129
|
-
class Any; end
|
130
|
-
end
|
131
|
-
end
|