google-cloud-eventarc-publishing-v1 1.0.1 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cd1c83ababa7c196f226a4a144544b5877d7a54394242b9c56f6da1de9153cf
4
- data.tar.gz: 484c1c3bb112022f605007801321590e086194db771f1f630f3771b1971c73e2
3
+ metadata.gz: bd77d006f942e02bcbd0c4d1d9e233ed12a2c644083e2cb6ee75e13fdb9015a6
4
+ data.tar.gz: 2e92aac534dda2a9ba402f78840aa2e4c224cce6d3dd886857f6eab59837ddad
5
5
  SHA512:
6
- metadata.gz: 03e3726392a006be4f7560b5511381754b7dce940b0eb76123d3d8240732042e11e5f00be4dbb8bc74c580be56af08b434703f8f96691530c63ccd3a08f8f5ac
7
- data.tar.gz: 5b4b176c7e66dfa6d81316a11759be0d97e5d3d39f3407d4e81262e45a5d1ec118a29713585e9f5e0028ea065487ba06db8082d3d217155b0809c0e613489a07
6
+ metadata.gz: 30bfe2239cb458002e5e14270c22f6045e338d51325f62d85d3c6580528428c7b929762125afe1abc735251dc490d58d588bf333cf1bbc3faac5cfd294a40fb6
7
+ data.tar.gz: '015915bd3e73c7dacca98376a8d7026050cbea752008922ad45707dbf7e7954694fc9ed71998bda9b6a1292afb30b12975d110fe7c692dd95e0a1e35d2166053'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Eventarc Publishing V1 API
2
2
 
3
- API Client library for the Eventarc Publishing V1 API
3
+ Processes events generated by an event provider and delivers them to a subscriber.
4
4
 
5
5
  Eventarc lets you asynchronously deliver events from Google services, SaaS, and your own apps using loosely coupled services that react to state changes. Eventarc requires no infrastructure management — you can optimize productivity and costs while building a modern, event-driven solution.
6
6
 
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: google/cloud/eventarc/publishing/v1/cloud_event.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/protobuf/any_pb'
9
+ require 'google/protobuf/timestamp_pb'
10
+
11
+
12
+ descriptor_data = "\n5google/cloud/eventarc/publishing/v1/cloud_event.proto\x12#google.cloud.eventarc.publishing.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfc\x04\n\nCloudEvent\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06source\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cspec_version\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12X\n\nattributes\x18\x05 \x03(\x0b\x32?.google.cloud.eventarc.publishing.v1.CloudEvent.AttributesEntryB\x03\xe0\x41\x01\x12\x1a\n\x0b\x62inary_data\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x12\x18\n\ttext_data\x18\x07 \x01(\tB\x03\xe0\x41\x01H\x00\x12/\n\nproto_data\x18\x08 \x01(\x0b\x32\x14.google.protobuf.AnyB\x03\xe0\x41\x01H\x00\x1a\xd3\x01\n\x18\x43loudEventAttributeValue\x12\x14\n\nce_boolean\x18\x01 \x01(\x08H\x00\x12\x14\n\nce_integer\x18\x02 \x01(\x05H\x00\x12\x13\n\tce_string\x18\x03 \x01(\tH\x00\x12\x12\n\x08\x63\x65_bytes\x18\x04 \x01(\x0cH\x00\x12\x10\n\x06\x63\x65_uri\x18\x05 \x01(\tH\x00\x12\x14\n\nce_uri_ref\x18\x06 \x01(\tH\x00\x12\x32\n\x0c\x63\x65_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x06\n\x04\x61ttr\x1a{\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12W\n\x05value\x18\x02 \x01(\x0b\x32H.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue:\x02\x38\x01\x42\x06\n\x04\x64\x61taB\xfb\x01\n\'com.google.cloud.eventarc.publishing.v1B\x0f\x43loudEventProtoP\x01ZGcloud.google.com/go/eventarc/publishing/apiv1/publishingpb;publishingpb\xaa\x02#Google.Cloud.Eventarc.Publishing.V1\xca\x02#Google\\Cloud\\Eventarc\\Publishing\\V1\xea\x02\'Google::Cloud::Eventarc::Publishing::V1b\x06proto3"
13
+
14
+ pool = Google::Protobuf::DescriptorPool.generated_pool
15
+
16
+ begin
17
+ pool.add_serialized_file(descriptor_data)
18
+ rescue TypeError
19
+ # Compatibility code: will be removed in the next major version.
20
+ require 'google/protobuf/descriptor_pb'
21
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
22
+ parsed.clear_dependency
23
+ serialized = parsed.class.encode(parsed)
24
+ file = pool.add_serialized_file(serialized)
25
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
+ imports = [
27
+ ["google.protobuf.Any", "google/protobuf/any.proto"],
28
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
29
+ ]
30
+ imports.each do |type_name, expected_filename|
31
+ import_file = pool.lookup(type_name).file_descriptor
32
+ if import_file.name != expected_filename
33
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
34
+ end
35
+ end
36
+ warn "Each proto file must use a consistent fully-qualified name."
37
+ warn "This will become an error in the next major version."
38
+ end
39
+
40
+ module Google
41
+ module Cloud
42
+ module Eventarc
43
+ module Publishing
44
+ module V1
45
+ CloudEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.CloudEvent").msgclass
46
+ CloudEvent::CloudEventAttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue").msgclass
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -94,6 +94,8 @@ module Google
94
94
 
95
95
  default_config.rpcs.publish_channel_connection_events.timeout = 60.0
96
96
 
97
+ default_config.rpcs.publish.timeout = 60.0
98
+
97
99
  default_config
98
100
  end
99
101
  yield @configure if block_given?
@@ -379,6 +381,105 @@ module Google
379
381
  raise ::Google::Cloud::Error.from_error(e)
380
382
  end
381
383
 
384
+ ##
385
+ # Publish events to a message bus.
386
+ #
387
+ # @overload publish(request, options = nil)
388
+ # Pass arguments to `publish` via a request object, either of type
389
+ # {::Google::Cloud::Eventarc::Publishing::V1::PublishRequest} or an equivalent Hash.
390
+ #
391
+ # @param request [::Google::Cloud::Eventarc::Publishing::V1::PublishRequest, ::Hash]
392
+ # A request object representing the call parameters. Required. To specify no
393
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
394
+ # @param options [::Gapic::CallOptions, ::Hash]
395
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
396
+ #
397
+ # @overload publish(message_bus: nil, proto_message: nil, json_message: nil, avro_message: nil)
398
+ # Pass arguments to `publish` via keyword arguments. Note that at
399
+ # least one keyword argument is required. To specify no parameters, or to keep all
400
+ # the default parameter values, pass an empty Hash as a request object (see above).
401
+ #
402
+ # @param message_bus [::String]
403
+ # Required. The full name of the message bus to publish events to. Format:
404
+ # `projects/{project}/locations/{location}/messageBuses/{messageBus}`.
405
+ # @param proto_message [::Google::Cloud::Eventarc::Publishing::V1::CloudEvent, ::Hash]
406
+ # The Protobuf format of the CloudEvent being published. Specification can
407
+ # be found here:
408
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md
409
+ # @param json_message [::String]
410
+ # The JSON format of the CloudEvent being published. Specification can be
411
+ # found here:
412
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
413
+ # @param avro_message [::String]
414
+ # The Avro format of the CloudEvent being published. Specification can
415
+ # be found here:
416
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md
417
+ #
418
+ # @yield [response, operation] Access the result along with the RPC operation
419
+ # @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishResponse]
420
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
421
+ #
422
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishResponse]
423
+ #
424
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
425
+ #
426
+ # @example Basic example
427
+ # require "google/cloud/eventarc/publishing/v1"
428
+ #
429
+ # # Create a client object. The client can be reused for multiple calls.
430
+ # client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
431
+ #
432
+ # # Create a request. To set request fields, pass in keyword arguments.
433
+ # request = Google::Cloud::Eventarc::Publishing::V1::PublishRequest.new
434
+ #
435
+ # # Call the publish method.
436
+ # result = client.publish request
437
+ #
438
+ # # The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishResponse.
439
+ # p result
440
+ #
441
+ def publish request, options = nil
442
+ raise ::ArgumentError, "request must be provided" if request.nil?
443
+
444
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::Publishing::V1::PublishRequest
445
+
446
+ # Converts hash and nil to an options object
447
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
448
+
449
+ # Customize the options with defaults
450
+ metadata = @config.rpcs.publish.metadata.to_h
451
+
452
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
453
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
455
+ gapic_version: ::Google::Cloud::Eventarc::Publishing::V1::VERSION
456
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
457
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
458
+
459
+ header_params = {}
460
+ if request.message_bus
461
+ header_params["message_bus"] = request.message_bus
462
+ end
463
+
464
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
465
+ metadata[:"x-goog-request-params"] ||= request_params_header
466
+
467
+ options.apply_defaults timeout: @config.rpcs.publish.timeout,
468
+ metadata: metadata,
469
+ retry_policy: @config.rpcs.publish.retry_policy
470
+
471
+ options.apply_defaults timeout: @config.timeout,
472
+ metadata: @config.metadata,
473
+ retry_policy: @config.retry_policy
474
+
475
+ @publisher_stub.call_rpc :publish, request, options: options do |response, operation|
476
+ yield response, operation if block_given?
477
+ return response
478
+ end
479
+ rescue ::GRPC::BadStatus => e
480
+ raise ::Google::Cloud::Error.from_error(e)
481
+ end
482
+
382
483
  ##
383
484
  # Configuration class for the Publisher API.
384
485
  #
@@ -542,6 +643,11 @@ module Google
542
643
  # @return [::Gapic::Config::Method]
543
644
  #
544
645
  attr_reader :publish_events
646
+ ##
647
+ # RPC-specific configuration for `publish`
648
+ # @return [::Gapic::Config::Method]
649
+ #
650
+ attr_reader :publish
545
651
 
546
652
  # @private
547
653
  def initialize parent_rpcs = nil
@@ -549,6 +655,8 @@ module Google
549
655
  @publish_channel_connection_events = ::Gapic::Config::Method.new publish_channel_connection_events_config
550
656
  publish_events_config = parent_rpcs.publish_events if parent_rpcs.respond_to? :publish_events
551
657
  @publish_events = ::Gapic::Config::Method.new publish_events_config
658
+ publish_config = parent_rpcs.publish if parent_rpcs.respond_to? :publish
659
+ @publish = ::Gapic::Config::Method.new publish_config
552
660
 
553
661
  yield self if block_given?
554
662
  end
@@ -96,6 +96,8 @@ module Google
96
96
 
97
97
  default_config.rpcs.publish_channel_connection_events.timeout = 60.0
98
98
 
99
+ default_config.rpcs.publish.timeout = 60.0
100
+
99
101
  default_config
100
102
  end
101
103
  yield @configure if block_given?
@@ -358,6 +360,98 @@ module Google
358
360
  raise ::Google::Cloud::Error.from_error(e)
359
361
  end
360
362
 
363
+ ##
364
+ # Publish events to a message bus.
365
+ #
366
+ # @overload publish(request, options = nil)
367
+ # Pass arguments to `publish` via a request object, either of type
368
+ # {::Google::Cloud::Eventarc::Publishing::V1::PublishRequest} or an equivalent Hash.
369
+ #
370
+ # @param request [::Google::Cloud::Eventarc::Publishing::V1::PublishRequest, ::Hash]
371
+ # A request object representing the call parameters. Required. To specify no
372
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
373
+ # @param options [::Gapic::CallOptions, ::Hash]
374
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
375
+ #
376
+ # @overload publish(message_bus: nil, proto_message: nil, json_message: nil, avro_message: nil)
377
+ # Pass arguments to `publish` via keyword arguments. Note that at
378
+ # least one keyword argument is required. To specify no parameters, or to keep all
379
+ # the default parameter values, pass an empty Hash as a request object (see above).
380
+ #
381
+ # @param message_bus [::String]
382
+ # Required. The full name of the message bus to publish events to. Format:
383
+ # `projects/{project}/locations/{location}/messageBuses/{messageBus}`.
384
+ # @param proto_message [::Google::Cloud::Eventarc::Publishing::V1::CloudEvent, ::Hash]
385
+ # The Protobuf format of the CloudEvent being published. Specification can
386
+ # be found here:
387
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md
388
+ # @param json_message [::String]
389
+ # The JSON format of the CloudEvent being published. Specification can be
390
+ # found here:
391
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
392
+ # @param avro_message [::String]
393
+ # The Avro format of the CloudEvent being published. Specification can
394
+ # be found here:
395
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md
396
+ # @yield [result, operation] Access the result along with the TransportOperation object
397
+ # @yieldparam result [::Google::Cloud::Eventarc::Publishing::V1::PublishResponse]
398
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
399
+ #
400
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishResponse]
401
+ #
402
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
403
+ #
404
+ # @example Basic example
405
+ # require "google/cloud/eventarc/publishing/v1"
406
+ #
407
+ # # Create a client object. The client can be reused for multiple calls.
408
+ # client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new
409
+ #
410
+ # # Create a request. To set request fields, pass in keyword arguments.
411
+ # request = Google::Cloud::Eventarc::Publishing::V1::PublishRequest.new
412
+ #
413
+ # # Call the publish method.
414
+ # result = client.publish request
415
+ #
416
+ # # The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishResponse.
417
+ # p result
418
+ #
419
+ def publish request, options = nil
420
+ raise ::ArgumentError, "request must be provided" if request.nil?
421
+
422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::Publishing::V1::PublishRequest
423
+
424
+ # Converts hash and nil to an options object
425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
426
+
427
+ # Customize the options with defaults
428
+ call_metadata = @config.rpcs.publish.metadata.to_h
429
+
430
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
431
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
433
+ gapic_version: ::Google::Cloud::Eventarc::Publishing::V1::VERSION,
434
+ transports_version_send: [:rest]
435
+
436
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
437
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ options.apply_defaults timeout: @config.rpcs.publish.timeout,
440
+ metadata: call_metadata,
441
+ retry_policy: @config.rpcs.publish.retry_policy
442
+
443
+ options.apply_defaults timeout: @config.timeout,
444
+ metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @publisher_stub.publish request, options do |result, operation|
448
+ yield result, operation if block_given?
449
+ return result
450
+ end
451
+ rescue ::Gapic::Rest::Error => e
452
+ raise ::Google::Cloud::Error.from_error(e)
453
+ end
454
+
361
455
  ##
362
456
  # Configuration class for the Publisher REST API.
363
457
  #
@@ -501,6 +595,11 @@ module Google
501
595
  # @return [::Gapic::Config::Method]
502
596
  #
503
597
  attr_reader :publish_events
598
+ ##
599
+ # RPC-specific configuration for `publish`
600
+ # @return [::Gapic::Config::Method]
601
+ #
602
+ attr_reader :publish
504
603
 
505
604
  # @private
506
605
  def initialize parent_rpcs = nil
@@ -508,6 +607,8 @@ module Google
508
607
  @publish_channel_connection_events = ::Gapic::Config::Method.new publish_channel_connection_events_config
509
608
  publish_events_config = parent_rpcs.publish_events if parent_rpcs.respond_to? :publish_events
510
609
  @publish_events = ::Gapic::Config::Method.new publish_events_config
610
+ publish_config = parent_rpcs.publish if parent_rpcs.respond_to? :publish
611
+ @publish = ::Gapic::Config::Method.new publish_config
511
612
 
512
613
  yield self if block_given?
513
614
  end
@@ -138,6 +138,44 @@ module Google
138
138
  result
139
139
  end
140
140
 
141
+ ##
142
+ # Baseline implementation for the publish REST call
143
+ #
144
+ # @param request_pb [::Google::Cloud::Eventarc::Publishing::V1::PublishRequest]
145
+ # A request object representing the call parameters. Required.
146
+ # @param options [::Gapic::CallOptions]
147
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
148
+ #
149
+ # @yield [result, operation] Access the result along with the TransportOperation object
150
+ # @yieldparam result [::Google::Cloud::Eventarc::Publishing::V1::PublishResponse]
151
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
152
+ #
153
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishResponse]
154
+ # A result object deserialized from the server's reply
155
+ def publish request_pb, options = nil
156
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
157
+
158
+ verb, uri, query_string_params, body = ServiceStub.transcode_publish_request request_pb
159
+ query_string_params = if query_string_params.any?
160
+ query_string_params.to_h { |p| p.split "=", 2 }
161
+ else
162
+ {}
163
+ end
164
+
165
+ response = @client_stub.make_http_request(
166
+ verb,
167
+ uri: uri,
168
+ body: body || "",
169
+ params: query_string_params,
170
+ options: options
171
+ )
172
+ operation = ::Gapic::Rest::TransportOperation.new response
173
+ result = ::Google::Cloud::Eventarc::Publishing::V1::PublishResponse.decode_json response.body, ignore_unknown_fields: true
174
+
175
+ yield result, operation if block_given?
176
+ result
177
+ end
178
+
141
179
  ##
142
180
  # @private
143
181
  #
@@ -181,6 +219,28 @@ module Google
181
219
  )
182
220
  transcoder.transcode request_pb
183
221
  end
222
+
223
+ ##
224
+ # @private
225
+ #
226
+ # GRPC transcoding helper method for the publish REST call
227
+ #
228
+ # @param request_pb [::Google::Cloud::Eventarc::Publishing::V1::PublishRequest]
229
+ # A request object representing the call parameters. Required.
230
+ # @return [Array(String, [String, nil], Hash{String => String})]
231
+ # Uri, Body, Query string parameters
232
+ def self.transcode_publish_request request_pb
233
+ transcoder = Gapic::Rest::GrpcTranscoder.new
234
+ .with_bindings(
235
+ uri_method: :post,
236
+ uri_template: "/v1/{message_bus}:publish",
237
+ body: "*",
238
+ matches: [
239
+ ["message_bus", %r{^projects/[^/]+/locations/[^/]+/messageBuses/[^/]+/?$}, false]
240
+ ]
241
+ )
242
+ transcoder.transcode request_pb
243
+ end
184
244
  end
185
245
  end
186
246
  end
@@ -6,10 +6,13 @@ require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
8
  require 'google/api/client_pb'
9
+ require 'google/api/field_behavior_pb'
10
+ require 'google/api/field_info_pb'
11
+ require 'google/cloud/eventarc/publishing/v1/cloud_event_pb'
9
12
  require 'google/protobuf/any_pb'
10
13
 
11
14
 
12
- descriptor_data = "\n3google/cloud/eventarc/publishing/v1/publisher.proto\x12#google.cloud.eventarc.publishing.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/protobuf/any.proto\"~\n%PublishChannelConnectionEventsRequest\x12\x1a\n\x12\x63hannel_connection\x18\x01 \x01(\t\x12$\n\x06\x65vents\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x12\x13\n\x0btext_events\x18\x03 \x03(\t\"(\n&PublishChannelConnectionEventsResponse\"b\n\x14PublishEventsRequest\x12\x0f\n\x07\x63hannel\x18\x01 \x01(\t\x12$\n\x06\x65vents\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x12\x13\n\x0btext_events\x18\x03 \x03(\t\"\x17\n\x15PublishEventsResponse2\xd0\x04\n\tPublisher\x12\x98\x02\n\x1ePublishChannelConnectionEvents\x12J.google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest\x1aK.google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse\"]\x82\xd3\xe4\x93\x02W\"R/v1/{channel_connection=projects/*/locations/*/channelConnections/*}:publishEvents:\x01*\x12\xd0\x01\n\rPublishEvents\x12\x39.google.cloud.eventarc.publishing.v1.PublishEventsRequest\x1a:.google.cloud.eventarc.publishing.v1.PublishEventsResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v1/{channel=projects/*/locations/*/channels/*}:publishEvents:\x01*\x1aU\xca\x41!eventarcpublishing.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfa\x01\n\'com.google.cloud.eventarc.publishing.v1B\x0ePublisherProtoP\x01ZGcloud.google.com/go/eventarc/publishing/apiv1/publishingpb;publishingpb\xaa\x02#Google.Cloud.Eventarc.Publishing.V1\xca\x02#Google\\Cloud\\Eventarc\\Publishing\\V1\xea\x02\'Google::Cloud::Eventarc::Publishing::V1b\x06proto3"
15
+ descriptor_data = "\n3google/cloud/eventarc/publishing/v1/publisher.proto\x12#google.cloud.eventarc.publishing.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x35google/cloud/eventarc/publishing/v1/cloud_event.proto\x1a\x19google/protobuf/any.proto\"~\n%PublishChannelConnectionEventsRequest\x12\x1a\n\x12\x63hannel_connection\x18\x01 \x01(\t\x12$\n\x06\x65vents\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x12\x13\n\x0btext_events\x18\x03 \x03(\t\"(\n&PublishChannelConnectionEventsResponse\"b\n\x14PublishEventsRequest\x12\x0f\n\x07\x63hannel\x18\x01 \x01(\t\x12$\n\x06\x65vents\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x12\x13\n\x0btext_events\x18\x03 \x03(\t\"\x17\n\x15PublishEventsResponse\"\xae\x01\n\x0ePublishRequest\x12\x18\n\x0bmessage_bus\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\rproto_message\x18\x02 \x01(\x0b\x32/.google.cloud.eventarc.publishing.v1.CloudEventH\x00\x12\x16\n\x0cjson_message\x18\x03 \x01(\tH\x00\x12\x16\n\x0c\x61vro_message\x18\x04 \x01(\x0cH\x00\x42\x08\n\x06\x66ormat\"\x11\n\x0fPublishResponse2\x93\x06\n\tPublisher\x12\x98\x02\n\x1ePublishChannelConnectionEvents\x12J.google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest\x1aK.google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse\"]\x82\xd3\xe4\x93\x02W\"R/v1/{channel_connection=projects/*/locations/*/channelConnections/*}:publishEvents:\x01*\x12\xd0\x01\n\rPublishEvents\x12\x39.google.cloud.eventarc.publishing.v1.PublishEventsRequest\x1a:.google.cloud.eventarc.publishing.v1.PublishEventsResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v1/{channel=projects/*/locations/*/channels/*}:publishEvents:\x01*\x12\xc0\x01\n\x07Publish\x12\x33.google.cloud.eventarc.publishing.v1.PublishRequest\x1a\x34.google.cloud.eventarc.publishing.v1.PublishResponse\"J\x82\xd3\xe4\x93\x02\x44\"?/v1/{message_bus=projects/*/locations/*/messageBuses/*}:publish:\x01*\x1aU\xca\x41!eventarcpublishing.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfa\x01\n\'com.google.cloud.eventarc.publishing.v1B\x0ePublisherProtoP\x01ZGcloud.google.com/go/eventarc/publishing/apiv1/publishingpb;publishingpb\xaa\x02#Google.Cloud.Eventarc.Publishing.V1\xca\x02#Google\\Cloud\\Eventarc\\Publishing\\V1\xea\x02\'Google::Cloud::Eventarc::Publishing::V1b\x06proto3"
13
16
 
14
17
  pool = Google::Protobuf::DescriptorPool.generated_pool
15
18
 
@@ -25,6 +28,7 @@ rescue TypeError
25
28
  warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
29
  imports = [
27
30
  ["google.protobuf.Any", "google/protobuf/any.proto"],
31
+ ["google.cloud.eventarc.publishing.v1.CloudEvent", "google/cloud/eventarc/publishing/v1/cloud_event.proto"],
28
32
  ]
29
33
  imports.each do |type_name, expected_filename|
30
34
  import_file = pool.lookup(type_name).file_descriptor
@@ -45,6 +49,8 @@ module Google
45
49
  PublishChannelConnectionEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse").msgclass
46
50
  PublishEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishEventsRequest").msgclass
47
51
  PublishEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishEventsResponse").msgclass
52
+ PublishRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishRequest").msgclass
53
+ PublishResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishResponse").msgclass
48
54
  end
49
55
  end
50
56
  end
@@ -14,6 +14,7 @@
14
14
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
+ #
17
18
 
18
19
  require 'grpc'
19
20
  require 'google/cloud/eventarc/publishing/v1/publisher_pb'
@@ -60,6 +61,8 @@ module Google
60
61
  rpc :PublishChannelConnectionEvents, ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest, ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse
61
62
  # Publish events to a subscriber's channel.
62
63
  rpc :PublishEvents, ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest, ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse
64
+ # Publish events to a message bus.
65
+ rpc :Publish, ::Google::Cloud::Eventarc::Publishing::V1::PublishRequest, ::Google::Cloud::Eventarc::Publishing::V1::PublishResponse
63
66
  end
64
67
 
65
68
  Stub = Service.rpc_stub_class
@@ -22,7 +22,7 @@ module Google
22
22
  module Eventarc
23
23
  module Publishing
24
24
  module V1
25
- VERSION = "1.0.1"
25
+ VERSION = "1.1.0"
26
26
  end
27
27
  end
28
28
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -375,6 +384,17 @@ module Google
375
384
  end
376
385
  end
377
386
 
387
+ # This message is used to configure the generation of a subset of the RPCs in
388
+ # a service for client libraries.
389
+ # @!attribute [rw] methods
390
+ # @return [::Array<::String>]
391
+ # An allowlist of the fully qualified names of RPCs that should be included
392
+ # on public client surfaces.
393
+ class SelectiveGapicGeneration
394
+ include ::Google::Protobuf::MessageExts
395
+ extend ::Google::Protobuf::MessageExts::ClassMethods
396
+ end
397
+
378
398
  # The organization for which the client libraries are being published.
379
399
  # Affects the url where generated docs are published, etc.
380
400
  module ClientLibraryOrganization
@@ -0,0 +1,85 @@
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
+
20
+ module Google
21
+ module Api
22
+ # An indicator of the behavior of a given field (for example, that a field
23
+ # is required in requests, or given as output but ignored as input).
24
+ # This **does not** change the behavior in protocol buffers itself; it only
25
+ # denotes the behavior and may affect how API tooling handles the field.
26
+ #
27
+ # Note: This enum **may** receive new values in the future.
28
+ module FieldBehavior
29
+ # Conventional default for enums. Do not use this.
30
+ FIELD_BEHAVIOR_UNSPECIFIED = 0
31
+
32
+ # Specifically denotes a field as optional.
33
+ # While all fields in protocol buffers are optional, this may be specified
34
+ # for emphasis if appropriate.
35
+ OPTIONAL = 1
36
+
37
+ # Denotes a field as required.
38
+ # This indicates that the field **must** be provided as part of the request,
39
+ # and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
40
+ REQUIRED = 2
41
+
42
+ # Denotes a field as output only.
43
+ # This indicates that the field is provided in responses, but including the
44
+ # field in a request does nothing (the server *must* ignore it and
45
+ # *must not* throw an error as a result of the field's presence).
46
+ OUTPUT_ONLY = 3
47
+
48
+ # Denotes a field as input only.
49
+ # This indicates that the field is provided in requests, and the
50
+ # corresponding field is not included in output.
51
+ INPUT_ONLY = 4
52
+
53
+ # Denotes a field as immutable.
54
+ # This indicates that the field may be set once in a request to create a
55
+ # resource, but may not be changed thereafter.
56
+ IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
69
+
70
+ # Denotes that the field in a resource (a message annotated with
71
+ # google.api.resource) is used in the resource name to uniquely identify the
72
+ # resource. For AIP-compliant APIs, this should only be applied to the
73
+ # `name` field on the resource.
74
+ #
75
+ # This behavior should not be applied to references to other resources within
76
+ # the message.
77
+ #
78
+ # The identifier field of resources often have different field behavior
79
+ # depending on the request it is embedded in (e.g. for Create methods name
80
+ # is optional and unused, while for Update methods it is required). Instead
81
+ # of method-specific annotations, only `IDENTIFIER` is required.
82
+ IDENTIFIER = 8
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,88 @@
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
+
20
+ module Google
21
+ module Api
22
+ # Rich semantic information of an API field beyond basic typing.
23
+ # @!attribute [rw] format
24
+ # @return [::Google::Api::FieldInfo::Format]
25
+ # The standard format of a field value. This does not explicitly configure
26
+ # any API consumer, just documents the API's format for the field it is
27
+ # applied to.
28
+ # @!attribute [rw] referenced_types
29
+ # @return [::Array<::Google::Api::TypeReference>]
30
+ # The type(s) that the annotated, generic field may represent.
31
+ #
32
+ # Currently, this must only be used on fields of type `google.protobuf.Any`.
33
+ # Supporting other generic types may be considered in the future.
34
+ class FieldInfo
35
+ include ::Google::Protobuf::MessageExts
36
+ extend ::Google::Protobuf::MessageExts::ClassMethods
37
+
38
+ # The standard format of a field value. The supported formats are all backed
39
+ # by either an RFC defined by the IETF or a Google-defined AIP.
40
+ module Format
41
+ # Default, unspecified value.
42
+ FORMAT_UNSPECIFIED = 0
43
+
44
+ # Universally Unique Identifier, version 4, value as defined by
45
+ # https://datatracker.ietf.org/doc/html/rfc4122. The value may be
46
+ # normalized to entirely lowercase letters. For example, the value
47
+ # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
48
+ # `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
49
+ UUID4 = 1
50
+
51
+ # Internet Protocol v4 value as defined by [RFC
52
+ # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
53
+ # condensed, with leading zeros in each octet stripped. For example,
54
+ # `001.022.233.040` would be condensed to `1.22.233.40`.
55
+ IPV4 = 2
56
+
57
+ # Internet Protocol v6 value as defined by [RFC
58
+ # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
59
+ # normalized to entirely lowercase letters with zeros compressed, following
60
+ # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example,
61
+ # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
62
+ IPV6 = 3
63
+
64
+ # An IP address in either v4 or v6 format as described by the individual
65
+ # values defined herein. See the comments on the IPV4 and IPV6 types for
66
+ # allowed normalizations of each.
67
+ IPV4_OR_IPV6 = 4
68
+ end
69
+ end
70
+
71
+ # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}.
72
+ # @!attribute [rw] type_name
73
+ # @return [::String]
74
+ # The name of the type that the annotated, generic field may represent.
75
+ # If the type is in the same protobuf package, the value can be the simple
76
+ # message name e.g., `"MyMessage"`. Otherwise, the value must be the
77
+ # fully-qualified message name e.g., `"google.library.v1.Book"`.
78
+ #
79
+ # If the type(s) are unknown to the service (e.g. the field accepts generic
80
+ # user input), use the wildcard `"*"` to denote this behavior.
81
+ #
82
+ # See [AIP-202](https://google.aip.dev/202#type-references) for more details.
83
+ class TypeReference
84
+ include ::Google::Protobuf::MessageExts
85
+ extend ::Google::Protobuf::MessageExts::ClassMethods
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,99 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module Eventarc
23
+ module Publishing
24
+ module V1
25
+ # CloudEvent represents a vendor-neutral specification for defining the format
26
+ # of event data.
27
+ # @!attribute [rw] id
28
+ # @return [::String]
29
+ # Required. Identifies the event. Producers MUST ensure that source + id is
30
+ # unique for each distinct event.
31
+ # @!attribute [rw] source
32
+ # @return [::String]
33
+ # Required. Identifies the context in which an event happened.
34
+ # URI-reference
35
+ # @!attribute [rw] spec_version
36
+ # @return [::String]
37
+ # Required. The version of the CloudEvents specification which the event
38
+ # uses.
39
+ # @!attribute [rw] type
40
+ # @return [::String]
41
+ # Required. This attribute contains a value describing the type of event
42
+ # related to the originating occurrence.
43
+ # @!attribute [rw] attributes
44
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Eventarc::Publishing::V1::CloudEvent::CloudEventAttributeValue}]
45
+ # Optional. Used for Optional & Extension Attributes
46
+ # @!attribute [rw] binary_data
47
+ # @return [::String]
48
+ # Optional. Binary data.
49
+ # @!attribute [rw] text_data
50
+ # @return [::String]
51
+ # Optional. Text data.
52
+ # @!attribute [rw] proto_data
53
+ # @return [::Google::Protobuf::Any]
54
+ # Optional. Proto data.
55
+ class CloudEvent
56
+ include ::Google::Protobuf::MessageExts
57
+ extend ::Google::Protobuf::MessageExts::ClassMethods
58
+
59
+ # The following abstract data types are available for use in attributes.
60
+ # @!attribute [rw] ce_boolean
61
+ # @return [::Boolean]
62
+ # Boolean value.
63
+ # @!attribute [rw] ce_integer
64
+ # @return [::Integer]
65
+ # Integer value.
66
+ # @!attribute [rw] ce_string
67
+ # @return [::String]
68
+ # String value.
69
+ # @!attribute [rw] ce_bytes
70
+ # @return [::String]
71
+ # Bytes value.
72
+ # @!attribute [rw] ce_uri
73
+ # @return [::String]
74
+ # URI value.
75
+ # @!attribute [rw] ce_uri_ref
76
+ # @return [::String]
77
+ # URI-reference value.
78
+ # @!attribute [rw] ce_timestamp
79
+ # @return [::Google::Protobuf::Timestamp]
80
+ # Timestamp value.
81
+ class CloudEventAttributeValue
82
+ include ::Google::Protobuf::MessageExts
83
+ extend ::Google::Protobuf::MessageExts::ClassMethods
84
+ end
85
+
86
+ # @!attribute [rw] key
87
+ # @return [::String]
88
+ # @!attribute [rw] value
89
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::CloudEvent::CloudEventAttributeValue]
90
+ class AttributesEntry
91
+ include ::Google::Protobuf::MessageExts
92
+ extend ::Google::Protobuf::MessageExts::ClassMethods
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -75,6 +75,37 @@ module Google
75
75
  include ::Google::Protobuf::MessageExts
76
76
  extend ::Google::Protobuf::MessageExts::ClassMethods
77
77
  end
78
+
79
+ # The request message for the Publish method.
80
+ # @!attribute [rw] message_bus
81
+ # @return [::String]
82
+ # Required. The full name of the message bus to publish events to. Format:
83
+ # `projects/{project}/locations/{location}/messageBuses/{messageBus}`.
84
+ # @!attribute [rw] proto_message
85
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::CloudEvent]
86
+ # The Protobuf format of the CloudEvent being published. Specification can
87
+ # be found here:
88
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md
89
+ # @!attribute [rw] json_message
90
+ # @return [::String]
91
+ # The JSON format of the CloudEvent being published. Specification can be
92
+ # found here:
93
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
94
+ # @!attribute [rw] avro_message
95
+ # @return [::String]
96
+ # The Avro format of the CloudEvent being published. Specification can
97
+ # be found here:
98
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md
99
+ class PublishRequest
100
+ include ::Google::Protobuf::MessageExts
101
+ extend ::Google::Protobuf::MessageExts::ClassMethods
102
+ end
103
+
104
+ # The response message for the Publish method.
105
+ class PublishResponse
106
+ include ::Google::Protobuf::MessageExts
107
+ extend ::Google::Protobuf::MessageExts::ClassMethods
108
+ end
78
109
  end
79
110
  end
80
111
  end
@@ -0,0 +1,127 @@
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
+
20
+ module Google
21
+ module Protobuf
22
+ # A Timestamp represents a point in time independent of any time zone or local
23
+ # calendar, encoded as a count of seconds and fractions of seconds at
24
+ # nanosecond resolution. The count is relative to an epoch at UTC midnight on
25
+ # January 1, 1970, in the proleptic Gregorian calendar which extends the
26
+ # Gregorian calendar backwards to year one.
27
+ #
28
+ # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
29
+ # second table is needed for interpretation, using a [24-hour linear
30
+ # smear](https://developers.google.com/time/smear).
31
+ #
32
+ # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
33
+ # restricting to that range, we ensure that we can convert to and from [RFC
34
+ # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
35
+ #
36
+ # # Examples
37
+ #
38
+ # Example 1: Compute Timestamp from POSIX `time()`.
39
+ #
40
+ # Timestamp timestamp;
41
+ # timestamp.set_seconds(time(NULL));
42
+ # timestamp.set_nanos(0);
43
+ #
44
+ # Example 2: Compute Timestamp from POSIX `gettimeofday()`.
45
+ #
46
+ # struct timeval tv;
47
+ # gettimeofday(&tv, NULL);
48
+ #
49
+ # Timestamp timestamp;
50
+ # timestamp.set_seconds(tv.tv_sec);
51
+ # timestamp.set_nanos(tv.tv_usec * 1000);
52
+ #
53
+ # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
54
+ #
55
+ # FILETIME ft;
56
+ # GetSystemTimeAsFileTime(&ft);
57
+ # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
58
+ #
59
+ # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
60
+ # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
61
+ # Timestamp timestamp;
62
+ # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
63
+ # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
64
+ #
65
+ # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
66
+ #
67
+ # long millis = System.currentTimeMillis();
68
+ #
69
+ # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
+ # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
+ #
72
+ # Example 5: Compute Timestamp from Java `Instant.now()`.
73
+ #
74
+ # Instant now = Instant.now();
75
+ #
76
+ # Timestamp timestamp =
77
+ # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
78
+ # .setNanos(now.getNano()).build();
79
+ #
80
+ # Example 6: Compute Timestamp from current time in Python.
81
+ #
82
+ # timestamp = Timestamp()
83
+ # timestamp.GetCurrentTime()
84
+ #
85
+ # # JSON Mapping
86
+ #
87
+ # In JSON format, the Timestamp type is encoded as a string in the
88
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
89
+ # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
90
+ # where \\{year} is always expressed using four digits while \\{month}, \\{day},
91
+ # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
92
+ # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
93
+ # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
94
+ # is required. A proto3 JSON serializer should always use UTC (as indicated by
95
+ # "Z") when printing the Timestamp type and a proto3 JSON parser should be
96
+ # able to accept both UTC and other timezones (as indicated by an offset).
97
+ #
98
+ # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
99
+ # 01:30 UTC on January 15, 2017.
100
+ #
101
+ # In JavaScript, one can convert a Date object to this format using the
102
+ # standard
103
+ # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
104
+ # method. In Python, a standard `datetime.datetime` object can be converted
105
+ # to this format using
106
+ # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
107
+ # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
108
+ # the Joda Time's [`ISODateTimeFormat.dateTime()`](
109
+ # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
110
+ # ) to obtain a formatter capable of generating timestamps in this format.
111
+ # @!attribute [rw] seconds
112
+ # @return [::Integer]
113
+ # Represents seconds of UTC time since Unix epoch
114
+ # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
115
+ # 9999-12-31T23:59:59Z inclusive.
116
+ # @!attribute [rw] nanos
117
+ # @return [::Integer]
118
+ # Non-negative fractions of a second at nanosecond resolution. Negative
119
+ # second values with fractions must still have non-negative nanos values
120
+ # that count forward in time. Must be from 0 to 999,999,999
121
+ # inclusive.
122
+ class Timestamp
123
+ include ::Google::Protobuf::MessageExts
124
+ extend ::Google::Protobuf::MessageExts::ClassMethods
125
+ end
126
+ end
127
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-eventarc-publishing-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.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: 2024-08-30 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -62,6 +62,7 @@ files:
62
62
  - README.md
63
63
  - lib/google-cloud-eventarc-publishing-v1.rb
64
64
  - lib/google/cloud/eventarc/publishing/v1.rb
65
+ - lib/google/cloud/eventarc/publishing/v1/cloud_event_pb.rb
65
66
  - lib/google/cloud/eventarc/publishing/v1/publisher.rb
66
67
  - lib/google/cloud/eventarc/publishing/v1/publisher/client.rb
67
68
  - lib/google/cloud/eventarc/publishing/v1/publisher/credentials.rb
@@ -74,11 +75,15 @@ files:
74
75
  - lib/google/cloud/eventarc/publishing/v1/version.rb
75
76
  - proto_docs/README.md
76
77
  - proto_docs/google/api/client.rb
78
+ - proto_docs/google/api/field_behavior.rb
79
+ - proto_docs/google/api/field_info.rb
77
80
  - proto_docs/google/api/launch_stage.rb
78
81
  - proto_docs/google/api/resource.rb
82
+ - proto_docs/google/cloud/eventarc/publishing/v1/cloud_event.rb
79
83
  - proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb
80
84
  - proto_docs/google/protobuf/any.rb
81
85
  - proto_docs/google/protobuf/duration.rb
86
+ - proto_docs/google/protobuf/timestamp.rb
82
87
  homepage: https://github.com/googleapis/google-cloud-ruby
83
88
  licenses:
84
89
  - Apache-2.0
@@ -98,8 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
103
  - !ruby/object:Gem::Version
99
104
  version: '0'
100
105
  requirements: []
101
- rubygems_version: 3.5.6
106
+ rubygems_version: 3.5.22
102
107
  signing_key:
103
108
  specification_version: 4
104
- summary: API Client library for the Eventarc Publishing V1 API
109
+ summary: Processes events generated by an event provider and delivers them to a subscriber.
105
110
  test_files: []