google-cloud-pubsub-v1 0.1.2 → 0.2.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.
@@ -0,0 +1,58 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/pubsub/v1/schema.proto for package 'Google.Cloud.PubSub.V1'
3
+ # Original file comments:
4
+ # Copyright 2020 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/pubsub/v1/schema_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module PubSub
25
+ module V1
26
+ module SchemaService
27
+ # Service for doing schema-related operations.
28
+ #
29
+ # EXPERIMENTAL: The Schema service is in development and may not work yet.
30
+ #
31
+ class Service
32
+
33
+ include GRPC::GenericService
34
+
35
+ self.marshal_class_method = :encode
36
+ self.unmarshal_class_method = :decode
37
+ self.service_name = 'google.pubsub.v1.SchemaService'
38
+
39
+ # Creates a schema.
40
+ rpc :CreateSchema, ::Google::Cloud::PubSub::V1::CreateSchemaRequest, ::Google::Cloud::PubSub::V1::Schema
41
+ # Gets a schema.
42
+ rpc :GetSchema, ::Google::Cloud::PubSub::V1::GetSchemaRequest, ::Google::Cloud::PubSub::V1::Schema
43
+ # Lists schemas in a project.
44
+ rpc :ListSchemas, ::Google::Cloud::PubSub::V1::ListSchemasRequest, ::Google::Cloud::PubSub::V1::ListSchemasResponse
45
+ # Deletes a schema.
46
+ rpc :DeleteSchema, ::Google::Cloud::PubSub::V1::DeleteSchemaRequest, ::Google::Protobuf::Empty
47
+ # Validates a schema.
48
+ rpc :ValidateSchema, ::Google::Cloud::PubSub::V1::ValidateSchemaRequest, ::Google::Cloud::PubSub::V1::ValidateSchemaResponse
49
+ # Validates a message against a schema.
50
+ rpc :ValidateMessage, ::Google::Cloud::PubSub::V1::ValidateMessageRequest, ::Google::Cloud::PubSub::V1::ValidateMessageResponse
51
+ end
52
+
53
+ Stub = Service.rpc_stub_class
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -34,6 +34,21 @@ module Google
34
34
  extend ::Google::Protobuf::MessageExts::ClassMethods
35
35
  end
36
36
 
37
+ # Settings for validating messages published against a schema.
38
+ # @!attribute [rw] schema
39
+ # @return [::String]
40
+ # Required. The name of the schema that messages published should be
41
+ # validated against. Format is `projects/{project}/schemas/{schema}`. The
42
+ # value of this field will be `_deleted-schema_` if the schema has been
43
+ # deleted.
44
+ # @!attribute [rw] encoding
45
+ # @return [::Google::Cloud::PubSub::V1::Encoding]
46
+ # The encoding of messages validated against `schema`.
47
+ class SchemaSettings
48
+ include ::Google::Protobuf::MessageExts
49
+ extend ::Google::Protobuf::MessageExts::ClassMethods
50
+ end
51
+
37
52
  # A topic resource.
38
53
  # @!attribute [rw] name
39
54
  # @return [::String]
@@ -58,6 +73,15 @@ module Google
58
73
  # to messages published on this topic.
59
74
  #
60
75
  # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
76
+ # @!attribute [rw] schema_settings
77
+ # @return [::Google::Cloud::PubSub::V1::SchemaSettings]
78
+ # Settings for validating messages published against a schema.
79
+ #
80
+ # EXPERIMENTAL: Schema support is in development and may not work yet.
81
+ # @!attribute [rw] satisfies_pzs
82
+ # @return [::Boolean]
83
+ # Reserved for future use. This field is set only in responses from the
84
+ # server; it is ignored if it is set in any requests.
61
85
  class Topic
62
86
  include ::Google::Protobuf::MessageExts
63
87
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -0,0 +1,216 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module PubSub
23
+ module V1
24
+ # A schema resource.
25
+ # @!attribute [rw] name
26
+ # @return [::String]
27
+ # Required. Name of the schema.
28
+ # Format is `projects/{project}/schemas/{schema}`.
29
+ # @!attribute [rw] type
30
+ # @return [::Google::Cloud::PubSub::V1::Schema::Type]
31
+ # The type of the schema definition.
32
+ # @!attribute [rw] definition
33
+ # @return [::String]
34
+ # The definition of the schema. This should contain a string representing
35
+ # the full definition of the schema that is a valid schema definition of
36
+ # the type specified in `type`.
37
+ class Schema
38
+ include ::Google::Protobuf::MessageExts
39
+ extend ::Google::Protobuf::MessageExts::ClassMethods
40
+
41
+ # Possible schema definition types.
42
+ module Type
43
+ # Default value. This value is unused.
44
+ TYPE_UNSPECIFIED = 0
45
+
46
+ # A Protocol Buffer schema definition.
47
+ PROTOCOL_BUFFER = 1
48
+
49
+ # An Avro schema definition.
50
+ AVRO = 2
51
+ end
52
+ end
53
+
54
+ # Request for the CreateSchema method.
55
+ # @!attribute [rw] parent
56
+ # @return [::String]
57
+ # Required. The name of the project in which to create the schema.
58
+ # Format is `projects/{project-id}`.
59
+ # @!attribute [rw] schema
60
+ # @return [::Google::Cloud::PubSub::V1::Schema]
61
+ # Required. The schema object to create.
62
+ #
63
+ # This schema's `name` parameter is ignored. The schema object returned
64
+ # by CreateSchema will have a `name` made using the given `parent` and
65
+ # `schema_id`.
66
+ # @!attribute [rw] schema_id
67
+ # @return [::String]
68
+ # The ID to use for the schema, which will become the final component of
69
+ # the schema's resource name.
70
+ #
71
+ # See https://cloud.google.com/pubsub/docs/admin#resource_names for resource
72
+ # name constraints.
73
+ class CreateSchemaRequest
74
+ include ::Google::Protobuf::MessageExts
75
+ extend ::Google::Protobuf::MessageExts::ClassMethods
76
+ end
77
+
78
+ # Request for the GetSchema method.
79
+ # @!attribute [rw] name
80
+ # @return [::String]
81
+ # Required. The name of the schema to get.
82
+ # Format is `projects/{project}/schemas/{schema}`.
83
+ # @!attribute [rw] view
84
+ # @return [::Google::Cloud::PubSub::V1::SchemaView]
85
+ # The set of fields to return in the response. If not set, returns a Schema
86
+ # with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
87
+ # fields.
88
+ class GetSchemaRequest
89
+ include ::Google::Protobuf::MessageExts
90
+ extend ::Google::Protobuf::MessageExts::ClassMethods
91
+ end
92
+
93
+ # Request for the `ListSchemas` method.
94
+ # @!attribute [rw] parent
95
+ # @return [::String]
96
+ # Required. The name of the project in which to list schemas.
97
+ # Format is `projects/{project-id}`.
98
+ # @!attribute [rw] view
99
+ # @return [::Google::Cloud::PubSub::V1::SchemaView]
100
+ # The set of Schema fields to return in the response. If not set, returns
101
+ # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
102
+ # retrieve all fields.
103
+ # @!attribute [rw] page_size
104
+ # @return [::Integer]
105
+ # Maximum number of schemas to return.
106
+ # @!attribute [rw] page_token
107
+ # @return [::String]
108
+ # The value returned by the last `ListSchemasResponse`; indicates that
109
+ # this is a continuation of a prior `ListSchemas` call, and that the
110
+ # system should return the next page of data.
111
+ class ListSchemasRequest
112
+ include ::Google::Protobuf::MessageExts
113
+ extend ::Google::Protobuf::MessageExts::ClassMethods
114
+ end
115
+
116
+ # Response for the `ListSchemas` method.
117
+ # @!attribute [rw] schemas
118
+ # @return [::Array<::Google::Cloud::PubSub::V1::Schema>]
119
+ # The resulting schemas.
120
+ # @!attribute [rw] next_page_token
121
+ # @return [::String]
122
+ # If not empty, indicates that there may be more schemas that match the
123
+ # request; this value should be passed in a new `ListSchemasRequest`.
124
+ class ListSchemasResponse
125
+ include ::Google::Protobuf::MessageExts
126
+ extend ::Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
129
+ # Request for the `DeleteSchema` method.
130
+ # @!attribute [rw] name
131
+ # @return [::String]
132
+ # Required. Name of the schema to delete.
133
+ # Format is `projects/{project}/schemas/{schema}`.
134
+ class DeleteSchemaRequest
135
+ include ::Google::Protobuf::MessageExts
136
+ extend ::Google::Protobuf::MessageExts::ClassMethods
137
+ end
138
+
139
+ # Request for the `ValidateSchema` method.
140
+ # @!attribute [rw] parent
141
+ # @return [::String]
142
+ # Required. The name of the project in which to validate schemas.
143
+ # Format is `projects/{project-id}`.
144
+ # @!attribute [rw] schema
145
+ # @return [::Google::Cloud::PubSub::V1::Schema]
146
+ # Required. The schema object to validate.
147
+ class ValidateSchemaRequest
148
+ include ::Google::Protobuf::MessageExts
149
+ extend ::Google::Protobuf::MessageExts::ClassMethods
150
+ end
151
+
152
+ # Response for the `ValidateSchema` method.
153
+ class ValidateSchemaResponse
154
+ include ::Google::Protobuf::MessageExts
155
+ extend ::Google::Protobuf::MessageExts::ClassMethods
156
+ end
157
+
158
+ # Request for the `ValidateMessage` method.
159
+ # @!attribute [rw] parent
160
+ # @return [::String]
161
+ # Required. The name of the project in which to validate schemas.
162
+ # Format is `projects/{project-id}`.
163
+ # @!attribute [rw] name
164
+ # @return [::String]
165
+ # Name of the schema against which to validate.
166
+ #
167
+ # Format is `projects/{project}/schemas/{schema}`.
168
+ # @!attribute [rw] schema
169
+ # @return [::Google::Cloud::PubSub::V1::Schema]
170
+ # Ad-hoc schema against which to validate
171
+ # @!attribute [rw] message
172
+ # @return [::String]
173
+ # Message to validate against the provided `schema_spec`.
174
+ # @!attribute [rw] encoding
175
+ # @return [::Google::Cloud::PubSub::V1::Encoding]
176
+ # The encoding expected for messages
177
+ class ValidateMessageRequest
178
+ include ::Google::Protobuf::MessageExts
179
+ extend ::Google::Protobuf::MessageExts::ClassMethods
180
+ end
181
+
182
+ # Response for the `ValidateMessage` method.
183
+ class ValidateMessageResponse
184
+ include ::Google::Protobuf::MessageExts
185
+ extend ::Google::Protobuf::MessageExts::ClassMethods
186
+ end
187
+
188
+ # View of Schema object fields to be returned by GetSchema and ListSchemas.
189
+ module SchemaView
190
+ # The default / unset value.
191
+ # The API will default to the BASIC view.
192
+ SCHEMA_VIEW_UNSPECIFIED = 0
193
+
194
+ # Include the name and type of the schema, but not the definition.
195
+ BASIC = 1
196
+
197
+ # Include all Schema object fields.
198
+ FULL = 2
199
+ end
200
+
201
+ # Possible encoding types for messages.
202
+ module Encoding
203
+ # Unspecified
204
+ ENCODING_UNSPECIFIED = 0
205
+
206
+ # JSON encoding
207
+ JSON = 1
208
+
209
+ # Binary encoding, as defined by the schema type. For some schema types,
210
+ # binary encoding may not be available.
211
+ BINARY = 2
212
+ end
213
+ end
214
+ end
215
+ end
216
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-pubsub-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-10 00:00:00.000000000 Z
11
+ date: 2021-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -191,6 +191,10 @@ files:
191
191
  - lib/google/cloud/pubsub/v1/publisher/credentials.rb
192
192
  - lib/google/cloud/pubsub/v1/publisher/helpers.rb
193
193
  - lib/google/cloud/pubsub/v1/publisher/paths.rb
194
+ - lib/google/cloud/pubsub/v1/schema_service.rb
195
+ - lib/google/cloud/pubsub/v1/schema_service/client.rb
196
+ - lib/google/cloud/pubsub/v1/schema_service/credentials.rb
197
+ - lib/google/cloud/pubsub/v1/schema_service/paths.rb
194
198
  - lib/google/cloud/pubsub/v1/subscriber.rb
195
199
  - lib/google/cloud/pubsub/v1/subscriber/client.rb
196
200
  - lib/google/cloud/pubsub/v1/subscriber/credentials.rb
@@ -200,6 +204,8 @@ files:
200
204
  - lib/google/iam/v1/iam_policy_services_pb.rb
201
205
  - lib/google/pubsub/v1/pubsub_pb.rb
202
206
  - lib/google/pubsub/v1/pubsub_services_pb.rb
207
+ - lib/google/pubsub/v1/schema_pb.rb
208
+ - lib/google/pubsub/v1/schema_services_pb.rb
203
209
  - proto_docs/README.md
204
210
  - proto_docs/google/api/field_behavior.rb
205
211
  - proto_docs/google/api/resource.rb
@@ -211,6 +217,7 @@ files:
211
217
  - proto_docs/google/protobuf/field_mask.rb
212
218
  - proto_docs/google/protobuf/timestamp.rb
213
219
  - proto_docs/google/pubsub/v1/pubsub.rb
220
+ - proto_docs/google/pubsub/v1/schema.rb
214
221
  - proto_docs/google/type/expr.rb
215
222
  homepage: https://github.com/googleapis/google-cloud-ruby
216
223
  licenses:
@@ -231,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
238
  - !ruby/object:Gem::Version
232
239
  version: '0'
233
240
  requirements: []
234
- rubygems_version: 3.1.3
241
+ rubygems_version: 3.1.4
235
242
  signing_key:
236
243
  specification_version: 4
237
244
  summary: API Client library for the Cloud Pub/Sub V1 API