lib/google/cloud/tasks/v2/target_pb.rb in google-cloud-tasks-v2-0.7.0 vs lib/google/cloud/tasks/v2/target_pb.rb in google-cloud-tasks-v2-0.8.0

- old
+ new

@@ -1,55 +1,37 @@ +# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/tasks/v2/target.proto require 'google/protobuf' require 'google/api/field_behavior_pb' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/cloud/tasks/v2/target.proto", :syntax => :proto3) do - add_message "google.cloud.tasks.v2.HttpRequest" do - optional :url, :string, 1 - optional :http_method, :enum, 2, "google.cloud.tasks.v2.HttpMethod" - map :headers, :string, :string, 3 - optional :body, :bytes, 4 - oneof :authorization_header do - optional :oauth_token, :message, 5, "google.cloud.tasks.v2.OAuthToken" - optional :oidc_token, :message, 6, "google.cloud.tasks.v2.OidcToken" - end + +descriptor_data = "\n\"google/cloud/tasks/v2/target.proto\x12\x15google.cloud.tasks.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xe1\x02\n\x0bHttpRequest\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x0bhttp_method\x18\x02 \x01(\x0e\x32!.google.cloud.tasks.v2.HttpMethod\x12@\n\x07headers\x18\x03 \x03(\x0b\x32/.google.cloud.tasks.v2.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12\x38\n\x0boauth_token\x18\x05 \x01(\x0b\x32!.google.cloud.tasks.v2.OAuthTokenH\x00\x12\x36\n\noidc_token\x18\x06 \x01(\x0b\x32 .google.cloud.tasks.v2.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xb2\x02\n\x14\x41ppEngineHttpRequest\x12\x36\n\x0bhttp_method\x18\x01 \x01(\x0e\x32!.google.cloud.tasks.v2.HttpMethod\x12\x43\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32\'.google.cloud.tasks.v2.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12I\n\x07headers\x18\x04 \x03(\x0b\x32\x38.google.cloud.tasks.v2.AppEngineHttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42j\n\x19\x63om.google.cloud.tasks.v2B\x0bTargetProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" end - add_message "google.cloud.tasks.v2.AppEngineHttpRequest" do - optional :http_method, :enum, 1, "google.cloud.tasks.v2.HttpMethod" - optional :app_engine_routing, :message, 2, "google.cloud.tasks.v2.AppEngineRouting" - optional :relative_uri, :string, 3 - map :headers, :string, :string, 4 - optional :body, :bytes, 5 - end - add_message "google.cloud.tasks.v2.AppEngineRouting" do - optional :service, :string, 1 - optional :version, :string, 2 - optional :instance, :string, 3 - optional :host, :string, 4 - end - add_message "google.cloud.tasks.v2.OAuthToken" do - optional :service_account_email, :string, 1 - optional :scope, :string, 2 - end - add_message "google.cloud.tasks.v2.OidcToken" do - optional :service_account_email, :string, 1 - optional :audience, :string, 2 - end - add_enum "google.cloud.tasks.v2.HttpMethod" do - value :HTTP_METHOD_UNSPECIFIED, 0 - value :POST, 1 - value :GET, 2 - value :HEAD, 3 - value :PUT, 4 - value :DELETE, 5 - value :PATCH, 6 - value :OPTIONS, 7 - end end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." end module Google module Cloud module Tasks