lib/google/iam/v1/policy_pb.rb in google-iam-v1-0.4.0 vs lib/google/iam/v1/policy_pb.rb in google-iam-v1-0.5.0

- old
+ new

@@ -1,65 +1,38 @@ +# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/iam/v1/policy.proto require 'google/protobuf' require 'google/type/expr_pb' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("google/iam/v1/policy.proto", :syntax => :proto3) do - add_message "google.iam.v1.Policy" do - optional :version, :int32, 1 - repeated :bindings, :message, 4, "google.iam.v1.Binding" - repeated :audit_configs, :message, 6, "google.iam.v1.AuditConfig" - optional :etag, :bytes, 3 + +descriptor_data = "\n\x1agoogle/iam/v1/policy.proto\x12\rgoogle.iam.v1\x1a\x16google/type/expr.proto\"\x84\x01\n\x06Policy\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12(\n\x08\x62indings\x18\x04 \x03(\x0b\x32\x16.google.iam.v1.Binding\x12\x31\n\raudit_configs\x18\x06 \x03(\x0b\x32\x1a.google.iam.v1.AuditConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\x0c\"N\n\x07\x42inding\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x0f\n\x07members\x18\x02 \x03(\t\x12$\n\tcondition\x18\x03 \x01(\x0b\x32\x11.google.type.Expr\"X\n\x0b\x41uditConfig\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x38\n\x11\x61udit_log_configs\x18\x03 \x03(\x0b\x32\x1d.google.iam.v1.AuditLogConfig\"\xb7\x01\n\x0e\x41uditLogConfig\x12\x37\n\x08log_type\x18\x01 \x01(\x0e\x32%.google.iam.v1.AuditLogConfig.LogType\x12\x18\n\x10\x65xempted_members\x18\x02 \x03(\t\"R\n\x07LogType\x12\x18\n\x14LOG_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nADMIN_READ\x10\x01\x12\x0e\n\nDATA_WRITE\x10\x02\x12\r\n\tDATA_READ\x10\x03\"\x80\x01\n\x0bPolicyDelta\x12\x33\n\x0e\x62inding_deltas\x18\x01 \x03(\x0b\x32\x1b.google.iam.v1.BindingDelta\x12<\n\x13\x61udit_config_deltas\x18\x02 \x03(\x0b\x32\x1f.google.iam.v1.AuditConfigDelta\"\xbd\x01\n\x0c\x42indingDelta\x12\x32\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\".google.iam.v1.BindingDelta.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\x12$\n\tcondition\x18\x04 \x01(\x0b\x32\x11.google.type.Expr\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\"\xbd\x01\n\x10\x41uditConfigDelta\x12\x36\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32&.google.iam.v1.AuditConfigDelta.Action\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x17\n\x0f\x65xempted_member\x18\x03 \x01(\t\x12\x10\n\x08log_type\x18\x04 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42|\n\x11\x63om.google.iam.v1B\x0bPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\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 = [ + ["google.type.Expr", "google/type/expr.proto"], + ] + 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.iam.v1.Binding" do - optional :role, :string, 1 - repeated :members, :string, 2 - optional :condition, :message, 3, "google.type.Expr" - end - add_message "google.iam.v1.AuditConfig" do - optional :service, :string, 1 - repeated :audit_log_configs, :message, 3, "google.iam.v1.AuditLogConfig" - end - add_message "google.iam.v1.AuditLogConfig" do - optional :log_type, :enum, 1, "google.iam.v1.AuditLogConfig.LogType" - repeated :exempted_members, :string, 2 - end - add_enum "google.iam.v1.AuditLogConfig.LogType" do - value :LOG_TYPE_UNSPECIFIED, 0 - value :ADMIN_READ, 1 - value :DATA_WRITE, 2 - value :DATA_READ, 3 - end - add_message "google.iam.v1.PolicyDelta" do - repeated :binding_deltas, :message, 1, "google.iam.v1.BindingDelta" - repeated :audit_config_deltas, :message, 2, "google.iam.v1.AuditConfigDelta" - end - add_message "google.iam.v1.BindingDelta" do - optional :action, :enum, 1, "google.iam.v1.BindingDelta.Action" - optional :role, :string, 2 - optional :member, :string, 3 - optional :condition, :message, 4, "google.type.Expr" - end - add_enum "google.iam.v1.BindingDelta.Action" do - value :ACTION_UNSPECIFIED, 0 - value :ADD, 1 - value :REMOVE, 2 - end - add_message "google.iam.v1.AuditConfigDelta" do - optional :action, :enum, 1, "google.iam.v1.AuditConfigDelta.Action" - optional :service, :string, 2 - optional :exempted_member, :string, 3 - optional :log_type, :string, 4 - end - add_enum "google.iam.v1.AuditConfigDelta.Action" do - value :ACTION_UNSPECIFIED, 0 - value :ADD, 1 - value :REMOVE, 2 - 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 Iam module V1