-
Notifications
You must be signed in to change notification settings - Fork 535
/
schema.rb
303 lines (276 loc) · 12.1 KB
/
schema.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# frozen_string_literal: true
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
module Google
module Cloud
module PubSub
module V1
# A schema resource.
# @!attribute [rw] name
# @return [::String]
# Required. Name of the schema.
# Format is `projects/{project}/schemas/{schema}`.
# @!attribute [rw] type
# @return [::Google::Cloud::PubSub::V1::Schema::Type]
# The type of the schema definition.
# @!attribute [rw] definition
# @return [::String]
# The definition of the schema. This should contain a string representing
# the full definition of the schema that is a valid schema definition of
# the type specified in `type`.
# @!attribute [r] revision_id
# @return [::String]
# Output only. Immutable. The revision ID of the schema.
# @!attribute [r] revision_create_time
# @return [::Google::Protobuf::Timestamp]
# Output only. The timestamp that the revision was created.
class Schema
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
# Possible schema definition types.
module Type
# Default value. This value is unused.
TYPE_UNSPECIFIED = 0
# A Protocol Buffer schema definition.
PROTOCOL_BUFFER = 1
# An Avro schema definition.
AVRO = 2
end
end
# Request for the CreateSchema method.
# @!attribute [rw] parent
# @return [::String]
# Required. The name of the project in which to create the schema.
# Format is `projects/{project-id}`.
# @!attribute [rw] schema
# @return [::Google::Cloud::PubSub::V1::Schema]
# Required. The schema object to create.
#
# This schema's `name` parameter is ignored. The schema object returned
# by CreateSchema will have a `name` made using the given `parent` and
# `schema_id`.
# @!attribute [rw] schema_id
# @return [::String]
# The ID to use for the schema, which will become the final component of
# the schema's resource name.
#
# See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for
# resource name constraints.
class CreateSchemaRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the GetSchema method.
# @!attribute [rw] name
# @return [::String]
# Required. The name of the schema to get.
# Format is `projects/{project}/schemas/{schema}`.
# @!attribute [rw] view
# @return [::Google::Cloud::PubSub::V1::SchemaView]
# The set of fields to return in the response. If not set, returns a Schema
# with all fields filled out. Set to `BASIC` to omit the `definition`.
class GetSchemaRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `ListSchemas` method.
# @!attribute [rw] parent
# @return [::String]
# Required. The name of the project in which to list schemas.
# Format is `projects/{project-id}`.
# @!attribute [rw] view
# @return [::Google::Cloud::PubSub::V1::SchemaView]
# The set of Schema fields to return in the response. If not set, returns
# Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
# retrieve all fields.
# @!attribute [rw] page_size
# @return [::Integer]
# Maximum number of schemas to return.
# @!attribute [rw] page_token
# @return [::String]
# The value returned by the last `ListSchemasResponse`; indicates that
# this is a continuation of a prior `ListSchemas` call, and that the
# system should return the next page of data.
class ListSchemasRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Response for the `ListSchemas` method.
# @!attribute [rw] schemas
# @return [::Array<::Google::Cloud::PubSub::V1::Schema>]
# The resulting schemas.
# @!attribute [rw] next_page_token
# @return [::String]
# If not empty, indicates that there may be more schemas that match the
# request; this value should be passed in a new `ListSchemasRequest`.
class ListSchemasResponse
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `ListSchemaRevisions` method.
# @!attribute [rw] name
# @return [::String]
# Required. The name of the schema to list revisions for.
# @!attribute [rw] view
# @return [::Google::Cloud::PubSub::V1::SchemaView]
# The set of Schema fields to return in the response. If not set, returns
# Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
# retrieve all fields.
# @!attribute [rw] page_size
# @return [::Integer]
# The maximum number of revisions to return per page.
# @!attribute [rw] page_token
# @return [::String]
# The page token, received from a previous ListSchemaRevisions call.
# Provide this to retrieve the subsequent page.
class ListSchemaRevisionsRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Response for the `ListSchemaRevisions` method.
# @!attribute [rw] schemas
# @return [::Array<::Google::Cloud::PubSub::V1::Schema>]
# The revisions of the schema.
# @!attribute [rw] next_page_token
# @return [::String]
# A token that can be sent as `page_token` to retrieve the next page.
# If this field is empty, there are no subsequent pages.
class ListSchemaRevisionsResponse
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for CommitSchema method.
# @!attribute [rw] name
# @return [::String]
# Required. The name of the schema we are revising.
# Format is `projects/{project}/schemas/{schema}`.
# @!attribute [rw] schema
# @return [::Google::Cloud::PubSub::V1::Schema]
# Required. The schema revision to commit.
class CommitSchemaRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `RollbackSchema` method.
# @!attribute [rw] name
# @return [::String]
# Required. The schema being rolled back with revision id.
# @!attribute [rw] revision_id
# @return [::String]
# Required. The revision ID to roll back to.
# It must be a revision of the same schema.
#
# Example: c7cfa2a8
class RollbackSchemaRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `DeleteSchemaRevision` method.
# @!attribute [rw] name
# @return [::String]
# Required. The name of the schema revision to be deleted, with a revision ID
# explicitly included.
#
# Example: `projects/123/schemas/my-schema@c7cfa2a8`
# @!attribute [rw] revision_id
# @deprecated This field is deprecated and may be removed in the next major version update.
# @return [::String]
# Optional. This field is deprecated and should not be used for specifying
# the revision ID. The revision ID should be specified via the `name`
# parameter.
class DeleteSchemaRevisionRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `DeleteSchema` method.
# @!attribute [rw] name
# @return [::String]
# Required. Name of the schema to delete.
# Format is `projects/{project}/schemas/{schema}`.
class DeleteSchemaRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `ValidateSchema` method.
# @!attribute [rw] parent
# @return [::String]
# Required. The name of the project in which to validate schemas.
# Format is `projects/{project-id}`.
# @!attribute [rw] schema
# @return [::Google::Cloud::PubSub::V1::Schema]
# Required. The schema object to validate.
class ValidateSchemaRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Response for the `ValidateSchema` method.
# Empty for now.
class ValidateSchemaResponse
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Request for the `ValidateMessage` method.
# @!attribute [rw] parent
# @return [::String]
# Required. The name of the project in which to validate schemas.
# Format is `projects/{project-id}`.
# @!attribute [rw] name
# @return [::String]
# Name of the schema against which to validate.
#
# Format is `projects/{project}/schemas/{schema}`.
# @!attribute [rw] schema
# @return [::Google::Cloud::PubSub::V1::Schema]
# Ad-hoc schema against which to validate
# @!attribute [rw] message
# @return [::String]
# Message to validate against the provided `schema_spec`.
# @!attribute [rw] encoding
# @return [::Google::Cloud::PubSub::V1::Encoding]
# The encoding expected for messages
class ValidateMessageRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# Response for the `ValidateMessage` method.
# Empty for now.
class ValidateMessageResponse
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
# View of Schema object fields to be returned by GetSchema and ListSchemas.
module SchemaView
# The default / unset value.
# The API will default to the BASIC view.
SCHEMA_VIEW_UNSPECIFIED = 0
# Include the name and type of the schema, but not the definition.
BASIC = 1
# Include all Schema object fields.
FULL = 2
end
# Possible encoding types for messages.
module Encoding
# Unspecified
ENCODING_UNSPECIFIED = 0
# JSON encoding
JSON = 1
# Binary encoding, as defined by the schema type. For some schema types,
# binary encoding may not be available.
BINARY = 2
end
end
end
end
end