diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java index 6a6a8c4b..fcf5897a 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java @@ -541,6 +541,60 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB return authorizationInfo_.get(index); } + public static final int POLICY_VIOLATION_INFO_FIELD_NUMBER = 25; + private com.google.cloud.audit.PolicyViolationInfo policyViolationInfo_; + /** + * + * + *
+   * Indicates the policy violations for this request. If the request
+   * is denied by the policy, violation information will be logged
+   * here.
+   * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + * + * @return Whether the policyViolationInfo field is set. + */ + @java.lang.Override + public boolean hasPolicyViolationInfo() { + return policyViolationInfo_ != null; + } + /** + * + * + *
+   * Indicates the policy violations for this request. If the request
+   * is denied by the policy, violation information will be logged
+   * here.
+   * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + * + * @return The policyViolationInfo. + */ + @java.lang.Override + public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() { + return policyViolationInfo_ == null + ? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance() + : policyViolationInfo_; + } + /** + * + * + *
+   * Indicates the policy violations for this request. If the request
+   * is denied by the policy, violation information will be logged
+   * here.
+   * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + @java.lang.Override + public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInfoOrBuilder() { + return getPolicyViolationInfo(); + } + public static final int REQUEST_METADATA_FIELD_NUMBER = 4; private com.google.cloud.audit.RequestMetadata requestMetadata_; /** @@ -774,7 +828,7 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { * .google.protobuf.Any service_data = 15 [deprecated = true]; * * @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See - * google/cloud/audit/audit_log.proto;l=104 + * google/cloud/audit/audit_log.proto;l=110 * @return Whether the serviceData field is set. */ @java.lang.Override @@ -794,7 +848,7 @@ public boolean hasServiceData() { * .google.protobuf.Any service_data = 15 [deprecated = true]; * * @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See - * google/cloud/audit/audit_log.proto;l=104 + * google/cloud/audit/audit_log.proto;l=110 * @return The serviceData. */ @java.lang.Override @@ -875,6 +929,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (resourceLocation_ != null) { output.writeMessage(20, getResourceLocation()); } + if (policyViolationInfo_ != null) { + output.writeMessage(25, getPolicyViolationInfo()); + } getUnknownFields().writeTo(output); } @@ -928,6 +985,10 @@ public int getSerializedSize() { if (resourceLocation_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getResourceLocation()); } + if (policyViolationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(25, getPolicyViolationInfo()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -964,6 +1025,10 @@ public boolean equals(final java.lang.Object obj) { if (!getAuthenticationInfo().equals(other.getAuthenticationInfo())) return false; } if (!getAuthorizationInfoList().equals(other.getAuthorizationInfoList())) return false; + if (hasPolicyViolationInfo() != other.hasPolicyViolationInfo()) return false; + if (hasPolicyViolationInfo()) { + if (!getPolicyViolationInfo().equals(other.getPolicyViolationInfo())) return false; + } if (hasRequestMetadata() != other.hasRequestMetadata()) return false; if (hasRequestMetadata()) { if (!getRequestMetadata().equals(other.getRequestMetadata())) return false; @@ -1023,6 +1088,10 @@ public int hashCode() { hash = (37 * hash) + AUTHORIZATION_INFO_FIELD_NUMBER; hash = (53 * hash) + getAuthorizationInfoList().hashCode(); } + if (hasPolicyViolationInfo()) { + hash = (37 * hash) + POLICY_VIOLATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPolicyViolationInfo().hashCode(); + } if (hasRequestMetadata()) { hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER; hash = (53 * hash) + getRequestMetadata().hashCode(); @@ -1218,6 +1287,12 @@ public Builder clear() { authorizationInfoBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); + if (policyViolationInfoBuilder_ == null) { + policyViolationInfo_ = null; + } else { + policyViolationInfo_ = null; + policyViolationInfoBuilder_ = null; + } if (requestMetadataBuilder_ == null) { requestMetadata_ = null; } else { @@ -1308,6 +1383,11 @@ public com.google.cloud.audit.AuditLog buildPartial() { } else { result.authorizationInfo_ = authorizationInfoBuilder_.build(); } + if (policyViolationInfoBuilder_ == null) { + result.policyViolationInfo_ = policyViolationInfo_; + } else { + result.policyViolationInfo_ = policyViolationInfoBuilder_.build(); + } if (requestMetadataBuilder_ == null) { result.requestMetadata_ = requestMetadata_; } else { @@ -1436,6 +1516,9 @@ public Builder mergeFrom(com.google.cloud.audit.AuditLog other) { } } } + if (other.hasPolicyViolationInfo()) { + mergePolicyViolationInfo(other.getPolicyViolationInfo()); + } if (other.hasRequestMetadata()) { mergeRequestMetadata(other.getRequestMetadata()); } @@ -1571,6 +1654,13 @@ public Builder mergeFrom( break; } // case 162 + case 202: + { + input.readMessage( + getPolicyViolationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 202 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3183,6 +3273,210 @@ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuil return authorizationInfoBuilder_; } + private com.google.cloud.audit.PolicyViolationInfo policyViolationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.audit.PolicyViolationInfo, + com.google.cloud.audit.PolicyViolationInfo.Builder, + com.google.cloud.audit.PolicyViolationInfoOrBuilder> + policyViolationInfoBuilder_; + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + * + * @return Whether the policyViolationInfo field is set. + */ + public boolean hasPolicyViolationInfo() { + return policyViolationInfoBuilder_ != null || policyViolationInfo_ != null; + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + * + * @return The policyViolationInfo. + */ + public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() { + if (policyViolationInfoBuilder_ == null) { + return policyViolationInfo_ == null + ? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance() + : policyViolationInfo_; + } else { + return policyViolationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + public Builder setPolicyViolationInfo(com.google.cloud.audit.PolicyViolationInfo value) { + if (policyViolationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyViolationInfo_ = value; + onChanged(); + } else { + policyViolationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + public Builder setPolicyViolationInfo( + com.google.cloud.audit.PolicyViolationInfo.Builder builderForValue) { + if (policyViolationInfoBuilder_ == null) { + policyViolationInfo_ = builderForValue.build(); + onChanged(); + } else { + policyViolationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + public Builder mergePolicyViolationInfo(com.google.cloud.audit.PolicyViolationInfo value) { + if (policyViolationInfoBuilder_ == null) { + if (policyViolationInfo_ != null) { + policyViolationInfo_ = + com.google.cloud.audit.PolicyViolationInfo.newBuilder(policyViolationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + policyViolationInfo_ = value; + } + onChanged(); + } else { + policyViolationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + public Builder clearPolicyViolationInfo() { + if (policyViolationInfoBuilder_ == null) { + policyViolationInfo_ = null; + onChanged(); + } else { + policyViolationInfo_ = null; + policyViolationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + public com.google.cloud.audit.PolicyViolationInfo.Builder getPolicyViolationInfoBuilder() { + + onChanged(); + return getPolicyViolationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInfoOrBuilder() { + if (policyViolationInfoBuilder_ != null) { + return policyViolationInfoBuilder_.getMessageOrBuilder(); + } else { + return policyViolationInfo_ == null + ? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance() + : policyViolationInfo_; + } + } + /** + * + * + *
+     * Indicates the policy violations for this request. If the request
+     * is denied by the policy, violation information will be logged
+     * here.
+     * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.audit.PolicyViolationInfo, + com.google.cloud.audit.PolicyViolationInfo.Builder, + com.google.cloud.audit.PolicyViolationInfoOrBuilder> + getPolicyViolationInfoFieldBuilder() { + if (policyViolationInfoBuilder_ == null) { + policyViolationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.audit.PolicyViolationInfo, + com.google.cloud.audit.PolicyViolationInfo.Builder, + com.google.cloud.audit.PolicyViolationInfoOrBuilder>( + getPolicyViolationInfo(), getParentForChildren(), isClean()); + policyViolationInfo_ = null; + } + return policyViolationInfoBuilder_; + } + private com.google.cloud.audit.RequestMetadata requestMetadata_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.audit.RequestMetadata, @@ -4023,7 +4317,7 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { * .google.protobuf.Any service_data = 15 [deprecated = true]; * * @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See - * google/cloud/audit/audit_log.proto;l=104 + * google/cloud/audit/audit_log.proto;l=110 * @return Whether the serviceData field is set. */ @java.lang.Deprecated @@ -4042,7 +4336,7 @@ public boolean hasServiceData() { * .google.protobuf.Any service_data = 15 [deprecated = true]; * * @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See - * google/cloud/audit/audit_log.proto;l=104 + * google/cloud/audit/audit_log.proto;l=110 * @return The serviceData. */ @java.lang.Deprecated diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java index 49410158..65774871 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java @@ -350,6 +350,47 @@ public interface AuditLogOrBuilder */ com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrBuilder(int index); + /** + * + * + *
+   * Indicates the policy violations for this request. If the request
+   * is denied by the policy, violation information will be logged
+   * here.
+   * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + * + * @return Whether the policyViolationInfo field is set. + */ + boolean hasPolicyViolationInfo(); + /** + * + * + *
+   * Indicates the policy violations for this request. If the request
+   * is denied by the policy, violation information will be logged
+   * here.
+   * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + * + * @return The policyViolationInfo. + */ + com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo(); + /** + * + * + *
+   * Indicates the policy violations for this request. If the request
+   * is denied by the policy, violation information will be logged
+   * here.
+   * 
+ * + * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; + */ + com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInfoOrBuilder(); + /** * * @@ -535,7 +576,7 @@ public interface AuditLogOrBuilder * .google.protobuf.Any service_data = 15 [deprecated = true]; * * @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See - * google/cloud/audit/audit_log.proto;l=104 + * google/cloud/audit/audit_log.proto;l=110 * @return Whether the serviceData field is set. */ @java.lang.Deprecated @@ -552,7 +593,7 @@ public interface AuditLogOrBuilder * .google.protobuf.Any service_data = 15 [deprecated = true]; * * @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See - * google/cloud/audit/audit_log.proto;l=104 + * google/cloud/audit/audit_log.proto;l=110 * @return The serviceData. */ @java.lang.Deprecated diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java index 3bea60db..2269b3f7 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java @@ -59,6 +59,22 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_audit_PolicyViolationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_audit_ViolationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -69,64 +85,85 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\"google/cloud/audit/audit_log.proto\022\022go" - + "ogle.cloud.audit\032\031google/protobuf/any.pr" - + "oto\032\034google/protobuf/struct.proto\032*googl" - + "e/rpc/context/attribute_context.proto\032\027g" - + "oogle/rpc/status.proto\"\376\004\n\010AuditLog\022\024\n\014s" - + "ervice_name\030\007 \001(\t\022\023\n\013method_name\030\010 \001(\t\022\025" - + "\n\rresource_name\030\013 \001(\t\022?\n\021resource_locati" - + "on\030\024 \001(\0132$.google.cloud.audit.ResourceLo" - + "cation\0228\n\027resource_original_state\030\023 \001(\0132" - + "\027.google.protobuf.Struct\022\032\n\022num_response" - + "_items\030\014 \001(\003\022\"\n\006status\030\002 \001(\0132\022.google.rp" - + "c.Status\022C\n\023authentication_info\030\003 \001(\0132&." - + "google.cloud.audit.AuthenticationInfo\022A\n" - + "\022authorization_info\030\t \003(\0132%.google.cloud" - + ".audit.AuthorizationInfo\022=\n\020request_meta" - + "data\030\004 \001(\0132#.google.cloud.audit.RequestM" - + "etadata\022(\n\007request\030\020 \001(\0132\027.google.protob" - + "uf.Struct\022)\n\010response\030\021 \001(\0132\027.google.pro" - + "tobuf.Struct\022)\n\010metadata\030\022 \001(\0132\027.google." - + "protobuf.Struct\022.\n\014service_data\030\017 \001(\0132\024." - + "google.protobuf.AnyB\002\030\001\"\231\002\n\022Authenticati" - + "onInfo\022\027\n\017principal_email\030\001 \001(\t\022\032\n\022autho" - + "rity_selector\030\002 \001(\t\0226\n\025third_party_princ" - + "ipal\030\004 \001(\0132\027.google.protobuf.Struct\022 \n\030s" - + "ervice_account_key_name\030\005 \001(\t\022Y\n\037service" - + "_account_delegation_info\030\006 \003(\01320.google." - + "cloud.audit.ServiceAccountDelegationInfo" - + "\022\031\n\021principal_subject\030\010 \001(\t\"\226\001\n\021Authoriz" - + "ationInfo\022\020\n\010resource\030\001 \001(\t\022\022\n\npermissio" - + "n\030\002 \001(\t\022\017\n\007granted\030\003 \001(\010\022J\n\023resource_att" - + "ributes\030\005 \001(\0132-.google.rpc.context.Attri" - + "buteContext.Resource\"\365\001\n\017RequestMetadata" - + "\022\021\n\tcaller_ip\030\001 \001(\t\022\"\n\032caller_supplied_u" - + "ser_agent\030\002 \001(\t\022\026\n\016caller_network\030\003 \001(\t\022" - + "H\n\022request_attributes\030\007 \001(\0132,.google.rpc" - + ".context.AttributeContext.Request\022I\n\026des" - + "tination_attributes\030\010 \001(\0132).google.rpc.c" - + "ontext.AttributeContext.Peer\"I\n\020Resource" - + "Location\022\031\n\021current_locations\030\001 \003(\t\022\032\n\022o" - + "riginal_locations\030\002 \003(\t\"\303\003\n\034ServiceAccou" - + "ntDelegationInfo\022\031\n\021principal_subject\030\003 " - + "\001(\t\022e\n\025first_party_principal\030\001 \001(\0132D.goo" - + "gle.cloud.audit.ServiceAccountDelegation" - + "Info.FirstPartyPrincipalH\000\022e\n\025third_part" - + "y_principal\030\002 \001(\0132D.google.cloud.audit.S" - + "erviceAccountDelegationInfo.ThirdPartyPr" - + "incipalH\000\032a\n\023FirstPartyPrincipal\022\027\n\017prin" - + "cipal_email\030\001 \001(\t\0221\n\020service_metadata\030\002 " - + "\001(\0132\027.google.protobuf.Struct\032J\n\023ThirdPar" - + "tyPrincipal\0223\n\022third_party_claims\030\001 \001(\0132" - + "\027.google.protobuf.StructB\013\n\tAuthorityBe\n" - + "\026com.google.cloud.auditB\rAuditLogProtoP\001" - + "Z7google.golang.org/genproto/googleapis/" - + "cloud/audit;audit\370\001\001b\006proto3" + + "ogle.cloud.audit\032\037google/api/field_behav" + + "ior.proto\032\031google/protobuf/any.proto\032\034go" + + "ogle/protobuf/struct.proto\032*google/rpc/c" + + "ontext/attribute_context.proto\032\027google/r" + + "pc/status.proto\"\306\005\n\010AuditLog\022\024\n\014service_" + + "name\030\007 \001(\t\022\023\n\013method_name\030\010 \001(\t\022\025\n\rresou" + + "rce_name\030\013 \001(\t\022?\n\021resource_location\030\024 \001(" + + "\0132$.google.cloud.audit.ResourceLocation\022" + + "8\n\027resource_original_state\030\023 \001(\0132\027.googl" + + "e.protobuf.Struct\022\032\n\022num_response_items\030" + + "\014 \001(\003\022\"\n\006status\030\002 \001(\0132\022.google.rpc.Statu" + + "s\022C\n\023authentication_info\030\003 \001(\0132&.google." + + "cloud.audit.AuthenticationInfo\022A\n\022author" + + "ization_info\030\t \003(\0132%.google.cloud.audit." + + "AuthorizationInfo\022F\n\025policy_violation_in" + + "fo\030\031 \001(\0132\'.google.cloud.audit.PolicyViol" + + "ationInfo\022=\n\020request_metadata\030\004 \001(\0132#.go" + + "ogle.cloud.audit.RequestMetadata\022(\n\007requ" + + "est\030\020 \001(\0132\027.google.protobuf.Struct\022)\n\010re" + + "sponse\030\021 \001(\0132\027.google.protobuf.Struct\022)\n" + + "\010metadata\030\022 \001(\0132\027.google.protobuf.Struct" + + "\022.\n\014service_data\030\017 \001(\0132\024.google.protobuf" + + ".AnyB\002\030\001\"\231\002\n\022AuthenticationInfo\022\027\n\017princ" + + "ipal_email\030\001 \001(\t\022\032\n\022authority_selector\030\002" + + " \001(\t\0226\n\025third_party_principal\030\004 \001(\0132\027.go" + + "ogle.protobuf.Struct\022 \n\030service_account_" + + "key_name\030\005 \001(\t\022Y\n\037service_account_delega" + + "tion_info\030\006 \003(\01320.google.cloud.audit.Ser" + + "viceAccountDelegationInfo\022\031\n\021principal_s" + + "ubject\030\010 \001(\t\"\226\001\n\021AuthorizationInfo\022\020\n\010re" + + "source\030\001 \001(\t\022\022\n\npermission\030\002 \001(\t\022\017\n\007gran" + + "ted\030\003 \001(\010\022J\n\023resource_attributes\030\005 \001(\0132-" + + ".google.rpc.context.AttributeContext.Res" + + "ource\"\365\001\n\017RequestMetadata\022\021\n\tcaller_ip\030\001" + + " \001(\t\022\"\n\032caller_supplied_user_agent\030\002 \001(\t" + + "\022\026\n\016caller_network\030\003 \001(\t\022H\n\022request_attr" + + "ibutes\030\007 \001(\0132,.google.rpc.context.Attrib" + + "uteContext.Request\022I\n\026destination_attrib" + + "utes\030\010 \001(\0132).google.rpc.context.Attribut" + + "eContext.Peer\"I\n\020ResourceLocation\022\031\n\021cur" + + "rent_locations\030\001 \003(\t\022\032\n\022original_locatio" + + "ns\030\002 \003(\t\"\303\003\n\034ServiceAccountDelegationInf" + + "o\022\031\n\021principal_subject\030\003 \001(\t\022e\n\025first_pa" + + "rty_principal\030\001 \001(\0132D.google.cloud.audit" + + ".ServiceAccountDelegationInfo.FirstParty" + + "PrincipalH\000\022e\n\025third_party_principal\030\002 \001" + + "(\0132D.google.cloud.audit.ServiceAccountDe" + + "legationInfo.ThirdPartyPrincipalH\000\032a\n\023Fi" + + "rstPartyPrincipal\022\027\n\017principal_email\030\001 \001" + + "(\t\0221\n\020service_metadata\030\002 \001(\0132\027.google.pr" + + "otobuf.Struct\032J\n\023ThirdPartyPrincipal\0223\n\022" + + "third_party_claims\030\001 \001(\0132\027.google.protob" + + "uf.StructB\013\n\tAuthority\"d\n\023PolicyViolatio" + + "nInfo\022M\n\031org_policy_violation_info\030\001 \001(\013" + + "2*.google.cloud.audit.OrgPolicyViolation" + + "Info\"\262\002\n\026OrgPolicyViolationInfo\022-\n\007paylo" + + "ad\030\001 \001(\0132\027.google.protobuf.StructB\003\340A\001\022\032" + + "\n\rresource_type\030\002 \001(\tB\003\340A\001\022X\n\rresource_t" + + "ags\030\003 \003(\0132<.google.cloud.audit.OrgPolicy" + + "ViolationInfo.ResourceTagsEntryB\003\340A\001\022>\n\016" + + "violation_info\030\004 \003(\0132!.google.cloud.audi" + + "t.ViolationInfoB\003\340A\001\0323\n\021ResourceTagsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\227\002\n\rVi" + + "olationInfo\022\027\n\nconstraint\030\001 \001(\tB\003\340A\001\022\032\n\r" + + "error_message\030\002 \001(\tB\003\340A\001\022\032\n\rchecked_valu" + + "e\030\003 \001(\tB\003\340A\001\022F\n\013policy_type\030\004 \001(\0162,.goog" + + "le.cloud.audit.ViolationInfo.PolicyTypeB" + + "\003\340A\001\"m\n\nPolicyType\022\033\n\027POLICY_TYPE_UNSPEC" + + "IFIED\020\000\022\026\n\022BOOLEAN_CONSTRAINT\020\001\022\023\n\017LIST_" + + "CONSTRAINT\020\002\022\025\n\021CUSTOM_CONSTRAINT\020\003Be\n\026c" + + "om.google.cloud.auditB\rAuditLogProtoP\001Z7" + + "google.golang.org/genproto/googleapis/cl" + + "oud/audit;audit\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.AnyProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), com.google.rpc.context.AttributeContextProto.getDescriptor(), @@ -147,6 +184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Status", "AuthenticationInfo", "AuthorizationInfo", + "PolicyViolationInfo", "RequestMetadata", "Request", "Response", @@ -222,6 +260,46 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ThirdPartyClaims", }); + internal_static_google_cloud_audit_PolicyViolationInfo_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_audit_PolicyViolationInfo_descriptor, + new java.lang.String[] { + "OrgPolicyViolationInfo", + }); + internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor, + new java.lang.String[] { + "Payload", "ResourceType", "ResourceTags", "ViolationInfo", + }); + internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor = + internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_audit_ViolationInfo_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_audit_ViolationInfo_descriptor, + new java.lang.String[] { + "Constraint", "ErrorMessage", "CheckedValue", "PolicyType", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); com.google.rpc.context.AttributeContextProto.getDescriptor(); diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java index b165bed4..d3c4627e 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java @@ -81,8 +81,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -109,8 +109,8 @@ public java.lang.String getPrincipalEmail() { * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -962,8 +962,8 @@ public Builder mergeFrom( * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -989,8 +989,8 @@ public java.lang.String getPrincipalEmail() { * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -1016,8 +1016,8 @@ public com.google.protobuf.ByteString getPrincipalEmailBytes() { * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -1042,8 +1042,8 @@ public Builder setPrincipalEmail(java.lang.String value) { * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -1064,8 +1064,8 @@ public Builder clearPrincipalEmail() { * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java index d00cee31..2dfe54d9 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java @@ -31,8 +31,8 @@ public interface AuthenticationInfoOrBuilder * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; @@ -48,8 +48,8 @@ public interface AuthenticationInfoOrBuilder * of third party principal) making the request. For third party identity * callers, the `principal_subject` field is populated instead of this field. * For privacy reasons, the principal email address is sometimes redacted. - * For more information, see - * https://cloud.google.com/logging/docs/audit#user-id. + * For more information, see [Caller identities in audit + * logs](https://cloud.google.com/logging/docs/audit#user-id). * * * string principal_email = 1; diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java new file mode 100644 index 00000000..d7c61fad --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java @@ -0,0 +1,1834 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/audit/audit_log.proto + +package com.google.cloud.audit; + +/** + * + * + *
+ * Represents OrgPolicy Violation information.
+ * 
+ * + * Protobuf type {@code google.cloud.audit.OrgPolicyViolationInfo} + */ +public final class OrgPolicyViolationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.audit.OrgPolicyViolationInfo) + OrgPolicyViolationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrgPolicyViolationInfo.newBuilder() to construct. + private OrgPolicyViolationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrgPolicyViolationInfo() { + resourceType_ = ""; + violationInfo_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OrgPolicyViolationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetResourceTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.audit.OrgPolicyViolationInfo.class, + com.google.cloud.audit.OrgPolicyViolationInfo.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private com.google.protobuf.Struct payload_; + /** + * + * + *
+   * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+   * conditions. This payload may be the subset of the actual Resource that may
+   * come in the request. This payload should not contain any core content.
+   * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return payload_ != null; + } + /** + * + * + *
+   * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+   * conditions. This payload may be the subset of the actual Resource that may
+   * come in the request. This payload should not contain any core content.
+   * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + /** + * + * + *
+   * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+   * conditions. This payload may be the subset of the actual Resource that may
+   * come in the request. This payload should not contain any core content.
+   * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + return getPayload(); + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceType_; + /** + * + * + *
+   * Optional. Resource type that the orgpolicy is checked against.
+   * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+   * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The resourceType. + */ + @java.lang.Override + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Resource type that the orgpolicy is checked against.
+   * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+   * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for resourceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_TAGS_FIELD_NUMBER = 3; + + private static final class ResourceTagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField resourceTags_; + + private com.google.protobuf.MapField + internalGetResourceTags() { + if (resourceTags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourceTagsDefaultEntryHolder.defaultEntry); + } + return resourceTags_; + } + + public int getResourceTagsCount() { + return internalGetResourceTags().getMap().size(); + } + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsResourceTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetResourceTags().getMap().containsKey(key); + } + /** Use {@link #getResourceTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getResourceTags() { + return getResourceTagsMap(); + } + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getResourceTagsMap() { + return internalGetResourceTags().getMap(); + } + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getResourceTagsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetResourceTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getResourceTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetResourceTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int VIOLATION_INFO_FIELD_NUMBER = 4; + private java.util.List violationInfo_; + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getViolationInfoList() { + return violationInfo_; + } + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getViolationInfoOrBuilderList() { + return violationInfo_; + } + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getViolationInfoCount() { + return violationInfo_.size(); + } + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.audit.ViolationInfo getViolationInfo(int index) { + return violationInfo_.get(index); + } + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.audit.ViolationInfoOrBuilder getViolationInfoOrBuilder(int index) { + return violationInfo_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payload_ != null) { + output.writeMessage(1, getPayload()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceType_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetResourceTags(), ResourceTagsDefaultEntryHolder.defaultEntry, 3); + for (int i = 0; i < violationInfo_.size(); i++) { + output.writeMessage(4, violationInfo_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPayload()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceType_); + } + for (java.util.Map.Entry entry : + internalGetResourceTags().getMap().entrySet()) { + com.google.protobuf.MapEntry resourceTags__ = + ResourceTagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, resourceTags__); + } + for (int i = 0; i < violationInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, violationInfo_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.audit.OrgPolicyViolationInfo)) { + return super.equals(obj); + } + com.google.cloud.audit.OrgPolicyViolationInfo other = + (com.google.cloud.audit.OrgPolicyViolationInfo) obj; + + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) return false; + } + if (!getResourceType().equals(other.getResourceType())) return false; + if (!internalGetResourceTags().equals(other.internalGetResourceTags())) return false; + if (!getViolationInfoList().equals(other.getViolationInfoList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + } + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getResourceType().hashCode(); + if (!internalGetResourceTags().getMap().isEmpty()) { + hash = (37 * hash) + RESOURCE_TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetResourceTags().hashCode(); + } + if (getViolationInfoCount() > 0) { + hash = (37 * hash) + VIOLATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getViolationInfoList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.audit.OrgPolicyViolationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents OrgPolicy Violation information.
+   * 
+ * + * Protobuf type {@code google.cloud.audit.OrgPolicyViolationInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.audit.OrgPolicyViolationInfo) + com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetResourceTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableResourceTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.audit.OrgPolicyViolationInfo.class, + com.google.cloud.audit.OrgPolicyViolationInfo.Builder.class); + } + + // Construct using com.google.cloud.audit.OrgPolicyViolationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (payloadBuilder_ == null) { + payload_ = null; + } else { + payload_ = null; + payloadBuilder_ = null; + } + resourceType_ = ""; + + internalGetMutableResourceTags().clear(); + if (violationInfoBuilder_ == null) { + violationInfo_ = java.util.Collections.emptyList(); + } else { + violationInfo_ = null; + violationInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.audit.OrgPolicyViolationInfo getDefaultInstanceForType() { + return com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.audit.OrgPolicyViolationInfo build() { + com.google.cloud.audit.OrgPolicyViolationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.audit.OrgPolicyViolationInfo buildPartial() { + com.google.cloud.audit.OrgPolicyViolationInfo result = + new com.google.cloud.audit.OrgPolicyViolationInfo(this); + int from_bitField0_ = bitField0_; + if (payloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = payloadBuilder_.build(); + } + result.resourceType_ = resourceType_; + result.resourceTags_ = internalGetResourceTags(); + result.resourceTags_.makeImmutable(); + if (violationInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + violationInfo_ = java.util.Collections.unmodifiableList(violationInfo_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.violationInfo_ = violationInfo_; + } else { + result.violationInfo_ = violationInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.audit.OrgPolicyViolationInfo) { + return mergeFrom((com.google.cloud.audit.OrgPolicyViolationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.audit.OrgPolicyViolationInfo other) { + if (other == com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance()) return this; + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + if (!other.getResourceType().isEmpty()) { + resourceType_ = other.resourceType_; + onChanged(); + } + internalGetMutableResourceTags().mergeFrom(other.internalGetResourceTags()); + if (violationInfoBuilder_ == null) { + if (!other.violationInfo_.isEmpty()) { + if (violationInfo_.isEmpty()) { + violationInfo_ = other.violationInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureViolationInfoIsMutable(); + violationInfo_.addAll(other.violationInfo_); + } + onChanged(); + } + } else { + if (!other.violationInfo_.isEmpty()) { + if (violationInfoBuilder_.isEmpty()) { + violationInfoBuilder_.dispose(); + violationInfoBuilder_ = null; + violationInfo_ = other.violationInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + violationInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getViolationInfoFieldBuilder() + : null; + } else { + violationInfoBuilder_.addAllMessages(other.violationInfo_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPayloadFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + resourceType_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry resourceTags__ = + input.readMessage( + ResourceTagsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableResourceTags() + .getMutableMap() + .put(resourceTags__.getKey(), resourceTags__.getValue()); + break; + } // case 26 + case 34: + { + com.google.cloud.audit.ViolationInfo m = + input.readMessage( + com.google.cloud.audit.ViolationInfo.parser(), extensionRegistry); + if (violationInfoBuilder_ == null) { + ensureViolationInfoIsMutable(); + violationInfo_.add(m); + } else { + violationInfoBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Struct payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + payloadBuilder_; + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the payload field is set. + */ + public boolean hasPayload() { + return payloadBuilder_ != null || payload_ != null; + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The payload. + */ + public com.google.protobuf.Struct getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setPayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergePayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (payload_ != null) { + payload_ = + com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + payloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + payload_ = null; + onChanged(); + } else { + payload_ = null; + payloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.Struct.Builder getPayloadBuilder() { + + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + } + /** + * + * + *
+     * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+     * conditions. This payload may be the subset of the actual Resource that may
+     * come in the request. This payload should not contain any core content.
+     * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + private java.lang.Object resourceType_ = ""; + /** + * + * + *
+     * Optional. Resource type that the orgpolicy is checked against.
+     * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+     * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The resourceType. + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Resource type that the orgpolicy is checked against.
+     * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+     * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for resourceType. + */ + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Resource type that the orgpolicy is checked against.
+     * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+     * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource type that the orgpolicy is checked against.
+     * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+     * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearResourceType() { + + resourceType_ = getDefaultInstance().getResourceType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource type that the orgpolicy is checked against.
+     * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+     * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField resourceTags_; + + private com.google.protobuf.MapField + internalGetResourceTags() { + if (resourceTags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourceTagsDefaultEntryHolder.defaultEntry); + } + return resourceTags_; + } + + private com.google.protobuf.MapField + internalGetMutableResourceTags() { + onChanged(); + ; + if (resourceTags_ == null) { + resourceTags_ = + com.google.protobuf.MapField.newMapField(ResourceTagsDefaultEntryHolder.defaultEntry); + } + if (!resourceTags_.isMutable()) { + resourceTags_ = resourceTags_.copy(); + } + return resourceTags_; + } + + public int getResourceTagsCount() { + return internalGetResourceTags().getMap().size(); + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsResourceTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetResourceTags().getMap().containsKey(key); + } + /** Use {@link #getResourceTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getResourceTags() { + return getResourceTagsMap(); + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getResourceTagsMap() { + return internalGetResourceTags().getMap(); + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getResourceTagsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetResourceTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getResourceTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetResourceTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearResourceTags() { + internalGetMutableResourceTags().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeResourceTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableResourceTags().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableResourceTags() { + return internalGetMutableResourceTags().getMutableMap(); + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putResourceTags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableResourceTags().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Tags referenced on the resource at the time of evaluation. These also
+     * include the federated tags, if they are supplied in the CheckOrgPolicy
+     * or CheckCustomConstraints Requests.
+     * Optional field as of now. These tags are the Cloud tags that are
+     * available on the resource during the policy evaluation and will
+     * be available as part of the OrgPolicy check response for logging purposes.
+     * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllResourceTags(java.util.Map values) { + internalGetMutableResourceTags().getMutableMap().putAll(values); + return this; + } + + private java.util.List violationInfo_ = + java.util.Collections.emptyList(); + + private void ensureViolationInfoIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + violationInfo_ = + new java.util.ArrayList(violationInfo_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.audit.ViolationInfo, + com.google.cloud.audit.ViolationInfo.Builder, + com.google.cloud.audit.ViolationInfoOrBuilder> + violationInfoBuilder_; + + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getViolationInfoList() { + if (violationInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(violationInfo_); + } else { + return violationInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getViolationInfoCount() { + if (violationInfoBuilder_ == null) { + return violationInfo_.size(); + } else { + return violationInfoBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.audit.ViolationInfo getViolationInfo(int index) { + if (violationInfoBuilder_ == null) { + return violationInfo_.get(index); + } else { + return violationInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setViolationInfo(int index, com.google.cloud.audit.ViolationInfo value) { + if (violationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationInfoIsMutable(); + violationInfo_.set(index, value); + onChanged(); + } else { + violationInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setViolationInfo( + int index, com.google.cloud.audit.ViolationInfo.Builder builderForValue) { + if (violationInfoBuilder_ == null) { + ensureViolationInfoIsMutable(); + violationInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + violationInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addViolationInfo(com.google.cloud.audit.ViolationInfo value) { + if (violationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationInfoIsMutable(); + violationInfo_.add(value); + onChanged(); + } else { + violationInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addViolationInfo(int index, com.google.cloud.audit.ViolationInfo value) { + if (violationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationInfoIsMutable(); + violationInfo_.add(index, value); + onChanged(); + } else { + violationInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addViolationInfo(com.google.cloud.audit.ViolationInfo.Builder builderForValue) { + if (violationInfoBuilder_ == null) { + ensureViolationInfoIsMutable(); + violationInfo_.add(builderForValue.build()); + onChanged(); + } else { + violationInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addViolationInfo( + int index, com.google.cloud.audit.ViolationInfo.Builder builderForValue) { + if (violationInfoBuilder_ == null) { + ensureViolationInfoIsMutable(); + violationInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + violationInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllViolationInfo( + java.lang.Iterable values) { + if (violationInfoBuilder_ == null) { + ensureViolationInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, violationInfo_); + onChanged(); + } else { + violationInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearViolationInfo() { + if (violationInfoBuilder_ == null) { + violationInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + violationInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeViolationInfo(int index) { + if (violationInfoBuilder_ == null) { + ensureViolationInfoIsMutable(); + violationInfo_.remove(index); + onChanged(); + } else { + violationInfoBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.audit.ViolationInfo.Builder getViolationInfoBuilder(int index) { + return getViolationInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.audit.ViolationInfoOrBuilder getViolationInfoOrBuilder(int index) { + if (violationInfoBuilder_ == null) { + return violationInfo_.get(index); + } else { + return violationInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getViolationInfoOrBuilderList() { + if (violationInfoBuilder_ != null) { + return violationInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(violationInfo_); + } + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder() { + return getViolationInfoFieldBuilder() + .addBuilder(com.google.cloud.audit.ViolationInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder(int index) { + return getViolationInfoFieldBuilder() + .addBuilder(index, com.google.cloud.audit.ViolationInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Policy violations
+     * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getViolationInfoBuilderList() { + return getViolationInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.audit.ViolationInfo, + com.google.cloud.audit.ViolationInfo.Builder, + com.google.cloud.audit.ViolationInfoOrBuilder> + getViolationInfoFieldBuilder() { + if (violationInfoBuilder_ == null) { + violationInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.audit.ViolationInfo, + com.google.cloud.audit.ViolationInfo.Builder, + com.google.cloud.audit.ViolationInfoOrBuilder>( + violationInfo_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + violationInfo_ = null; + } + return violationInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.audit.OrgPolicyViolationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.audit.OrgPolicyViolationInfo) + private static final com.google.cloud.audit.OrgPolicyViolationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.audit.OrgPolicyViolationInfo(); + } + + public static com.google.cloud.audit.OrgPolicyViolationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrgPolicyViolationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.audit.OrgPolicyViolationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java new file mode 100644 index 00000000..a41399ce --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java @@ -0,0 +1,244 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/audit/audit_log.proto + +package com.google.cloud.audit; + +public interface OrgPolicyViolationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.audit.OrgPolicyViolationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+   * conditions. This payload may be the subset of the actual Resource that may
+   * come in the request. This payload should not contain any core content.
+   * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + /** + * + * + *
+   * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+   * conditions. This payload may be the subset of the actual Resource that may
+   * come in the request. This payload should not contain any core content.
+   * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The payload. + */ + com.google.protobuf.Struct getPayload(); + /** + * + * + *
+   * Optional. Resource payload that is currently in scope and is subjected to orgpolicy
+   * conditions. This payload may be the subset of the actual Resource that may
+   * come in the request. This payload should not contain any core content.
+   * 
+ * + * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.StructOrBuilder getPayloadOrBuilder(); + + /** + * + * + *
+   * Optional. Resource type that the orgpolicy is checked against.
+   * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+   * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The resourceType. + */ + java.lang.String getResourceType(); + /** + * + * + *
+   * Optional. Resource type that the orgpolicy is checked against.
+   * Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
+   * 
+ * + * string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for resourceType. + */ + com.google.protobuf.ByteString getResourceTypeBytes(); + + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getResourceTagsCount(); + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsResourceTags(java.lang.String key); + /** Use {@link #getResourceTagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getResourceTags(); + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getResourceTagsMap(); + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + + /* nullable */ + java.lang.String getResourceTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Tags referenced on the resource at the time of evaluation. These also
+   * include the federated tags, if they are supplied in the CheckOrgPolicy
+   * or CheckCustomConstraints Requests.
+   * Optional field as of now. These tags are the Cloud tags that are
+   * available on the resource during the policy evaluation and will
+   * be available as part of the OrgPolicy check response for logging purposes.
+   * 
+ * + * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getResourceTagsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getViolationInfoList(); + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.audit.ViolationInfo getViolationInfo(int index); + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getViolationInfoCount(); + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getViolationInfoOrBuilderList(); + /** + * + * + *
+   * Optional. Policy violations
+   * 
+ * + * + * repeated .google.cloud.audit.ViolationInfo violation_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.audit.ViolationInfoOrBuilder getViolationInfoOrBuilder(int index); +} diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java new file mode 100644 index 00000000..4f8d213f --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java @@ -0,0 +1,709 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/audit/audit_log.proto + +package com.google.cloud.audit; + +/** + * + * + *
+ * Information related to policy violations for this request.
+ * 
+ * + * Protobuf type {@code google.cloud.audit.PolicyViolationInfo} + */ +public final class PolicyViolationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.audit.PolicyViolationInfo) + PolicyViolationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyViolationInfo.newBuilder() to construct. + private PolicyViolationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PolicyViolationInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PolicyViolationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_PolicyViolationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.audit.PolicyViolationInfo.class, + com.google.cloud.audit.PolicyViolationInfo.Builder.class); + } + + public static final int ORG_POLICY_VIOLATION_INFO_FIELD_NUMBER = 1; + private com.google.cloud.audit.OrgPolicyViolationInfo orgPolicyViolationInfo_; + /** + * + * + *
+   * Indicates the orgpolicy violations for this resource.
+   * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + * + * @return Whether the orgPolicyViolationInfo field is set. + */ + @java.lang.Override + public boolean hasOrgPolicyViolationInfo() { + return orgPolicyViolationInfo_ != null; + } + /** + * + * + *
+   * Indicates the orgpolicy violations for this resource.
+   * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + * + * @return The orgPolicyViolationInfo. + */ + @java.lang.Override + public com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo() { + return orgPolicyViolationInfo_ == null + ? com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance() + : orgPolicyViolationInfo_; + } + /** + * + * + *
+   * Indicates the orgpolicy violations for this resource.
+   * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + @java.lang.Override + public com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder + getOrgPolicyViolationInfoOrBuilder() { + return getOrgPolicyViolationInfo(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (orgPolicyViolationInfo_ != null) { + output.writeMessage(1, getOrgPolicyViolationInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (orgPolicyViolationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOrgPolicyViolationInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.audit.PolicyViolationInfo)) { + return super.equals(obj); + } + com.google.cloud.audit.PolicyViolationInfo other = + (com.google.cloud.audit.PolicyViolationInfo) obj; + + if (hasOrgPolicyViolationInfo() != other.hasOrgPolicyViolationInfo()) return false; + if (hasOrgPolicyViolationInfo()) { + if (!getOrgPolicyViolationInfo().equals(other.getOrgPolicyViolationInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOrgPolicyViolationInfo()) { + hash = (37 * hash) + ORG_POLICY_VIOLATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOrgPolicyViolationInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.PolicyViolationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.audit.PolicyViolationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information related to policy violations for this request.
+   * 
+ * + * Protobuf type {@code google.cloud.audit.PolicyViolationInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.audit.PolicyViolationInfo) + com.google.cloud.audit.PolicyViolationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_PolicyViolationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.audit.PolicyViolationInfo.class, + com.google.cloud.audit.PolicyViolationInfo.Builder.class); + } + + // Construct using com.google.cloud.audit.PolicyViolationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (orgPolicyViolationInfoBuilder_ == null) { + orgPolicyViolationInfo_ = null; + } else { + orgPolicyViolationInfo_ = null; + orgPolicyViolationInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_PolicyViolationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.audit.PolicyViolationInfo getDefaultInstanceForType() { + return com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.audit.PolicyViolationInfo build() { + com.google.cloud.audit.PolicyViolationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.audit.PolicyViolationInfo buildPartial() { + com.google.cloud.audit.PolicyViolationInfo result = + new com.google.cloud.audit.PolicyViolationInfo(this); + if (orgPolicyViolationInfoBuilder_ == null) { + result.orgPolicyViolationInfo_ = orgPolicyViolationInfo_; + } else { + result.orgPolicyViolationInfo_ = orgPolicyViolationInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.audit.PolicyViolationInfo) { + return mergeFrom((com.google.cloud.audit.PolicyViolationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.audit.PolicyViolationInfo other) { + if (other == com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance()) return this; + if (other.hasOrgPolicyViolationInfo()) { + mergeOrgPolicyViolationInfo(other.getOrgPolicyViolationInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getOrgPolicyViolationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.audit.OrgPolicyViolationInfo orgPolicyViolationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.audit.OrgPolicyViolationInfo, + com.google.cloud.audit.OrgPolicyViolationInfo.Builder, + com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder> + orgPolicyViolationInfoBuilder_; + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + * + * @return Whether the orgPolicyViolationInfo field is set. + */ + public boolean hasOrgPolicyViolationInfo() { + return orgPolicyViolationInfoBuilder_ != null || orgPolicyViolationInfo_ != null; + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + * + * @return The orgPolicyViolationInfo. + */ + public com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo() { + if (orgPolicyViolationInfoBuilder_ == null) { + return orgPolicyViolationInfo_ == null + ? com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance() + : orgPolicyViolationInfo_; + } else { + return orgPolicyViolationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + public Builder setOrgPolicyViolationInfo(com.google.cloud.audit.OrgPolicyViolationInfo value) { + if (orgPolicyViolationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + orgPolicyViolationInfo_ = value; + onChanged(); + } else { + orgPolicyViolationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + public Builder setOrgPolicyViolationInfo( + com.google.cloud.audit.OrgPolicyViolationInfo.Builder builderForValue) { + if (orgPolicyViolationInfoBuilder_ == null) { + orgPolicyViolationInfo_ = builderForValue.build(); + onChanged(); + } else { + orgPolicyViolationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + public Builder mergeOrgPolicyViolationInfo( + com.google.cloud.audit.OrgPolicyViolationInfo value) { + if (orgPolicyViolationInfoBuilder_ == null) { + if (orgPolicyViolationInfo_ != null) { + orgPolicyViolationInfo_ = + com.google.cloud.audit.OrgPolicyViolationInfo.newBuilder(orgPolicyViolationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + orgPolicyViolationInfo_ = value; + } + onChanged(); + } else { + orgPolicyViolationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + public Builder clearOrgPolicyViolationInfo() { + if (orgPolicyViolationInfoBuilder_ == null) { + orgPolicyViolationInfo_ = null; + onChanged(); + } else { + orgPolicyViolationInfo_ = null; + orgPolicyViolationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + public com.google.cloud.audit.OrgPolicyViolationInfo.Builder + getOrgPolicyViolationInfoBuilder() { + + onChanged(); + return getOrgPolicyViolationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + public com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder + getOrgPolicyViolationInfoOrBuilder() { + if (orgPolicyViolationInfoBuilder_ != null) { + return orgPolicyViolationInfoBuilder_.getMessageOrBuilder(); + } else { + return orgPolicyViolationInfo_ == null + ? com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance() + : orgPolicyViolationInfo_; + } + } + /** + * + * + *
+     * Indicates the orgpolicy violations for this resource.
+     * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.audit.OrgPolicyViolationInfo, + com.google.cloud.audit.OrgPolicyViolationInfo.Builder, + com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder> + getOrgPolicyViolationInfoFieldBuilder() { + if (orgPolicyViolationInfoBuilder_ == null) { + orgPolicyViolationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.audit.OrgPolicyViolationInfo, + com.google.cloud.audit.OrgPolicyViolationInfo.Builder, + com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder>( + getOrgPolicyViolationInfo(), getParentForChildren(), isClean()); + orgPolicyViolationInfo_ = null; + } + return orgPolicyViolationInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.audit.PolicyViolationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.audit.PolicyViolationInfo) + private static final com.google.cloud.audit.PolicyViolationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.audit.PolicyViolationInfo(); + } + + public static com.google.cloud.audit.PolicyViolationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyViolationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.audit.PolicyViolationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java new file mode 100644 index 00000000..c0da04a1 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/audit/audit_log.proto + +package com.google.cloud.audit; + +public interface PolicyViolationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.audit.PolicyViolationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Indicates the orgpolicy violations for this resource.
+   * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + * + * @return Whether the orgPolicyViolationInfo field is set. + */ + boolean hasOrgPolicyViolationInfo(); + /** + * + * + *
+   * Indicates the orgpolicy violations for this resource.
+   * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + * + * @return The orgPolicyViolationInfo. + */ + com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo(); + /** + * + * + *
+   * Indicates the orgpolicy violations for this resource.
+   * 
+ * + * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; + */ + com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder getOrgPolicyViolationInfoOrBuilder(); +} diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java index dd1d0420..a9789399 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java @@ -76,14 +76,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * The IP address of the caller.
-   * For caller from internet, this will be public IPv4 or IPv6 address.
-   * For caller from a Compute Engine VM with external IP address, this
-   * will be the VM's external IP address. For caller from a Compute
-   * Engine VM without external IP address, if the VM is in the same
-   * organization (or project) as the accessed resource, `caller_ip` will
-   * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-   * redacted to "gce-internal-ip".
-   * See https://cloud.google.com/compute/docs/vpc/ for more information.
+   * For a caller from the internet, this will be the public IPv4 or IPv6
+   * address. For calls made from inside Google's internal production network
+   * from one GCP service to another, `caller_ip` will be redacted to "private".
+   * For a caller from a Compute Engine VM with a external IP address,
+   * `caller_ip` will be the VM's external IP address. For a caller from a
+   * Compute Engine VM without a external IP address, if the VM is in the same
+   * organization (or project) as the accessed resource, `caller_ip` will be the
+   * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+   * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+   * information.
    * 
* * string caller_ip = 1; @@ -107,14 +109,16 @@ public java.lang.String getCallerIp() { * *
    * The IP address of the caller.
-   * For caller from internet, this will be public IPv4 or IPv6 address.
-   * For caller from a Compute Engine VM with external IP address, this
-   * will be the VM's external IP address. For caller from a Compute
-   * Engine VM without external IP address, if the VM is in the same
-   * organization (or project) as the accessed resource, `caller_ip` will
-   * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-   * redacted to "gce-internal-ip".
-   * See https://cloud.google.com/compute/docs/vpc/ for more information.
+   * For a caller from the internet, this will be the public IPv4 or IPv6
+   * address. For calls made from inside Google's internal production network
+   * from one GCP service to another, `caller_ip` will be redacted to "private".
+   * For a caller from a Compute Engine VM with a external IP address,
+   * `caller_ip` will be the VM's external IP address. For a caller from a
+   * Compute Engine VM without a external IP address, if the VM is in the same
+   * organization (or project) as the accessed resource, `caller_ip` will be the
+   * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+   * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+   * information.
    * 
* * string caller_ip = 1; @@ -832,14 +836,16 @@ public Builder mergeFrom( * *
      * The IP address of the caller.
-     * For caller from internet, this will be public IPv4 or IPv6 address.
-     * For caller from a Compute Engine VM with external IP address, this
-     * will be the VM's external IP address. For caller from a Compute
-     * Engine VM without external IP address, if the VM is in the same
-     * organization (or project) as the accessed resource, `caller_ip` will
-     * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-     * redacted to "gce-internal-ip".
-     * See https://cloud.google.com/compute/docs/vpc/ for more information.
+     * For a caller from the internet, this will be the public IPv4 or IPv6
+     * address. For calls made from inside Google's internal production network
+     * from one GCP service to another, `caller_ip` will be redacted to "private".
+     * For a caller from a Compute Engine VM with a external IP address,
+     * `caller_ip` will be the VM's external IP address. For a caller from a
+     * Compute Engine VM without a external IP address, if the VM is in the same
+     * organization (or project) as the accessed resource, `caller_ip` will be the
+     * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+     * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+     * information.
      * 
* * string caller_ip = 1; @@ -862,14 +868,16 @@ public java.lang.String getCallerIp() { * *
      * The IP address of the caller.
-     * For caller from internet, this will be public IPv4 or IPv6 address.
-     * For caller from a Compute Engine VM with external IP address, this
-     * will be the VM's external IP address. For caller from a Compute
-     * Engine VM without external IP address, if the VM is in the same
-     * organization (or project) as the accessed resource, `caller_ip` will
-     * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-     * redacted to "gce-internal-ip".
-     * See https://cloud.google.com/compute/docs/vpc/ for more information.
+     * For a caller from the internet, this will be the public IPv4 or IPv6
+     * address. For calls made from inside Google's internal production network
+     * from one GCP service to another, `caller_ip` will be redacted to "private".
+     * For a caller from a Compute Engine VM with a external IP address,
+     * `caller_ip` will be the VM's external IP address. For a caller from a
+     * Compute Engine VM without a external IP address, if the VM is in the same
+     * organization (or project) as the accessed resource, `caller_ip` will be the
+     * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+     * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+     * information.
      * 
* * string caller_ip = 1; @@ -892,14 +900,16 @@ public com.google.protobuf.ByteString getCallerIpBytes() { * *
      * The IP address of the caller.
-     * For caller from internet, this will be public IPv4 or IPv6 address.
-     * For caller from a Compute Engine VM with external IP address, this
-     * will be the VM's external IP address. For caller from a Compute
-     * Engine VM without external IP address, if the VM is in the same
-     * organization (or project) as the accessed resource, `caller_ip` will
-     * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-     * redacted to "gce-internal-ip".
-     * See https://cloud.google.com/compute/docs/vpc/ for more information.
+     * For a caller from the internet, this will be the public IPv4 or IPv6
+     * address. For calls made from inside Google's internal production network
+     * from one GCP service to another, `caller_ip` will be redacted to "private".
+     * For a caller from a Compute Engine VM with a external IP address,
+     * `caller_ip` will be the VM's external IP address. For a caller from a
+     * Compute Engine VM without a external IP address, if the VM is in the same
+     * organization (or project) as the accessed resource, `caller_ip` will be the
+     * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+     * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+     * information.
      * 
* * string caller_ip = 1; @@ -921,14 +931,16 @@ public Builder setCallerIp(java.lang.String value) { * *
      * The IP address of the caller.
-     * For caller from internet, this will be public IPv4 or IPv6 address.
-     * For caller from a Compute Engine VM with external IP address, this
-     * will be the VM's external IP address. For caller from a Compute
-     * Engine VM without external IP address, if the VM is in the same
-     * organization (or project) as the accessed resource, `caller_ip` will
-     * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-     * redacted to "gce-internal-ip".
-     * See https://cloud.google.com/compute/docs/vpc/ for more information.
+     * For a caller from the internet, this will be the public IPv4 or IPv6
+     * address. For calls made from inside Google's internal production network
+     * from one GCP service to another, `caller_ip` will be redacted to "private".
+     * For a caller from a Compute Engine VM with a external IP address,
+     * `caller_ip` will be the VM's external IP address. For a caller from a
+     * Compute Engine VM without a external IP address, if the VM is in the same
+     * organization (or project) as the accessed resource, `caller_ip` will be the
+     * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+     * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+     * information.
      * 
* * string caller_ip = 1; @@ -946,14 +958,16 @@ public Builder clearCallerIp() { * *
      * The IP address of the caller.
-     * For caller from internet, this will be public IPv4 or IPv6 address.
-     * For caller from a Compute Engine VM with external IP address, this
-     * will be the VM's external IP address. For caller from a Compute
-     * Engine VM without external IP address, if the VM is in the same
-     * organization (or project) as the accessed resource, `caller_ip` will
-     * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-     * redacted to "gce-internal-ip".
-     * See https://cloud.google.com/compute/docs/vpc/ for more information.
+     * For a caller from the internet, this will be the public IPv4 or IPv6
+     * address. For calls made from inside Google's internal production network
+     * from one GCP service to another, `caller_ip` will be redacted to "private".
+     * For a caller from a Compute Engine VM with a external IP address,
+     * `caller_ip` will be the VM's external IP address. For a caller from a
+     * Compute Engine VM without a external IP address, if the VM is in the same
+     * organization (or project) as the accessed resource, `caller_ip` will be the
+     * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+     * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+     * information.
      * 
* * string caller_ip = 1; diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java index 38384aee..59354148 100644 --- a/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java @@ -28,14 +28,16 @@ public interface RequestMetadataOrBuilder * *
    * The IP address of the caller.
-   * For caller from internet, this will be public IPv4 or IPv6 address.
-   * For caller from a Compute Engine VM with external IP address, this
-   * will be the VM's external IP address. For caller from a Compute
-   * Engine VM without external IP address, if the VM is in the same
-   * organization (or project) as the accessed resource, `caller_ip` will
-   * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-   * redacted to "gce-internal-ip".
-   * See https://cloud.google.com/compute/docs/vpc/ for more information.
+   * For a caller from the internet, this will be the public IPv4 or IPv6
+   * address. For calls made from inside Google's internal production network
+   * from one GCP service to another, `caller_ip` will be redacted to "private".
+   * For a caller from a Compute Engine VM with a external IP address,
+   * `caller_ip` will be the VM's external IP address. For a caller from a
+   * Compute Engine VM without a external IP address, if the VM is in the same
+   * organization (or project) as the accessed resource, `caller_ip` will be the
+   * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+   * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+   * information.
    * 
* * string caller_ip = 1; @@ -48,14 +50,16 @@ public interface RequestMetadataOrBuilder * *
    * The IP address of the caller.
-   * For caller from internet, this will be public IPv4 or IPv6 address.
-   * For caller from a Compute Engine VM with external IP address, this
-   * will be the VM's external IP address. For caller from a Compute
-   * Engine VM without external IP address, if the VM is in the same
-   * organization (or project) as the accessed resource, `caller_ip` will
-   * be the VM's internal IPv4 address, otherwise the `caller_ip` will be
-   * redacted to "gce-internal-ip".
-   * See https://cloud.google.com/compute/docs/vpc/ for more information.
+   * For a caller from the internet, this will be the public IPv4 or IPv6
+   * address. For calls made from inside Google's internal production network
+   * from one GCP service to another, `caller_ip` will be redacted to "private".
+   * For a caller from a Compute Engine VM with a external IP address,
+   * `caller_ip` will be the VM's external IP address. For a caller from a
+   * Compute Engine VM without a external IP address, if the VM is in the same
+   * organization (or project) as the accessed resource, `caller_ip` will be the
+   * VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
+   * "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
+   * information.
    * 
* * string caller_ip = 1; diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java new file mode 100644 index 00000000..8137443e --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java @@ -0,0 +1,1325 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/audit/audit_log.proto + +package com.google.cloud.audit; + +/** + * + * + *
+ * Provides information about the Policy violation info for this request.
+ * 
+ * + * Protobuf type {@code google.cloud.audit.ViolationInfo} + */ +public final class ViolationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.audit.ViolationInfo) + ViolationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ViolationInfo.newBuilder() to construct. + private ViolationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ViolationInfo() { + constraint_ = ""; + errorMessage_ = ""; + checkedValue_ = ""; + policyType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ViolationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_ViolationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.audit.ViolationInfo.class, + com.google.cloud.audit.ViolationInfo.Builder.class); + } + + /** + * + * + *
+   * Policy Type enum
+   * 
+ * + * Protobuf enum {@code google.cloud.audit.ViolationInfo.PolicyType} + */ + public enum PolicyType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value should not be used.
+     * 
+ * + * POLICY_TYPE_UNSPECIFIED = 0; + */ + POLICY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates boolean policy constraint
+     * 
+ * + * BOOLEAN_CONSTRAINT = 1; + */ + BOOLEAN_CONSTRAINT(1), + /** + * + * + *
+     * Indicates list policy constraint
+     * 
+ * + * LIST_CONSTRAINT = 2; + */ + LIST_CONSTRAINT(2), + /** + * + * + *
+     * Indicates custom policy constraint
+     * 
+ * + * CUSTOM_CONSTRAINT = 3; + */ + CUSTOM_CONSTRAINT(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value should not be used.
+     * 
+ * + * POLICY_TYPE_UNSPECIFIED = 0; + */ + public static final int POLICY_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates boolean policy constraint
+     * 
+ * + * BOOLEAN_CONSTRAINT = 1; + */ + public static final int BOOLEAN_CONSTRAINT_VALUE = 1; + /** + * + * + *
+     * Indicates list policy constraint
+     * 
+ * + * LIST_CONSTRAINT = 2; + */ + public static final int LIST_CONSTRAINT_VALUE = 2; + /** + * + * + *
+     * Indicates custom policy constraint
+     * 
+ * + * CUSTOM_CONSTRAINT = 3; + */ + public static final int CUSTOM_CONSTRAINT_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PolicyType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PolicyType forNumber(int value) { + switch (value) { + case 0: + return POLICY_TYPE_UNSPECIFIED; + case 1: + return BOOLEAN_CONSTRAINT; + case 2: + return LIST_CONSTRAINT; + case 3: + return CUSTOM_CONSTRAINT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PolicyType findValueByNumber(int number) { + return PolicyType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.audit.ViolationInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final PolicyType[] VALUES = values(); + + public static PolicyType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PolicyType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.audit.ViolationInfo.PolicyType) + } + + public static final int CONSTRAINT_FIELD_NUMBER = 1; + private volatile java.lang.Object constraint_; + /** + * + * + *
+   * Optional. Constraint name
+   * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The constraint. + */ + @java.lang.Override + public java.lang.String getConstraint() { + java.lang.Object ref = constraint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constraint_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Constraint name
+   * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for constraint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConstraintBytes() { + java.lang.Object ref = constraint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + constraint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object errorMessage_; + /** + * + * + *
+   * Optional. Error message that policy is indicating.
+   * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Error message that policy is indicating.
+   * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHECKED_VALUE_FIELD_NUMBER = 3; + private volatile java.lang.Object checkedValue_; + /** + * + * + *
+   * Optional. Value that is being checked for the policy.
+   * This could be in encrypted form (if pii sensitive).
+   * This field will only be emitted in LIST_POLICY types
+   * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The checkedValue. + */ + @java.lang.Override + public java.lang.String getCheckedValue() { + java.lang.Object ref = checkedValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + checkedValue_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Value that is being checked for the policy.
+   * This could be in encrypted form (if pii sensitive).
+   * This field will only be emitted in LIST_POLICY types
+   * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for checkedValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCheckedValueBytes() { + java.lang.Object ref = checkedValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + checkedValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_TYPE_FIELD_NUMBER = 4; + private int policyType_; + /** + * + * + *
+   * Optional. Indicates the type of the policy.
+   * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for policyType. + */ + @java.lang.Override + public int getPolicyTypeValue() { + return policyType_; + } + /** + * + * + *
+   * Optional. Indicates the type of the policy.
+   * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The policyType. + */ + @java.lang.Override + public com.google.cloud.audit.ViolationInfo.PolicyType getPolicyType() { + @SuppressWarnings("deprecation") + com.google.cloud.audit.ViolationInfo.PolicyType result = + com.google.cloud.audit.ViolationInfo.PolicyType.valueOf(policyType_); + return result == null ? com.google.cloud.audit.ViolationInfo.PolicyType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constraint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, constraint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(checkedValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, checkedValue_); + } + if (policyType_ + != com.google.cloud.audit.ViolationInfo.PolicyType.POLICY_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, policyType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constraint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, constraint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(checkedValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, checkedValue_); + } + if (policyType_ + != com.google.cloud.audit.ViolationInfo.PolicyType.POLICY_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, policyType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.audit.ViolationInfo)) { + return super.equals(obj); + } + com.google.cloud.audit.ViolationInfo other = (com.google.cloud.audit.ViolationInfo) obj; + + if (!getConstraint().equals(other.getConstraint())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) return false; + if (!getCheckedValue().equals(other.getCheckedValue())) return false; + if (policyType_ != other.policyType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getConstraint().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (37 * hash) + CHECKED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getCheckedValue().hashCode(); + hash = (37 * hash) + POLICY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + policyType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.audit.ViolationInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.audit.ViolationInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.ViolationInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.audit.ViolationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.audit.ViolationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Provides information about the Policy violation info for this request.
+   * 
+ * + * Protobuf type {@code google.cloud.audit.ViolationInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.audit.ViolationInfo) + com.google.cloud.audit.ViolationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_ViolationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.audit.ViolationInfo.class, + com.google.cloud.audit.ViolationInfo.Builder.class); + } + + // Construct using com.google.cloud.audit.ViolationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + constraint_ = ""; + + errorMessage_ = ""; + + checkedValue_ = ""; + + policyType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.audit.AuditLogProto + .internal_static_google_cloud_audit_ViolationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.audit.ViolationInfo getDefaultInstanceForType() { + return com.google.cloud.audit.ViolationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.audit.ViolationInfo build() { + com.google.cloud.audit.ViolationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.audit.ViolationInfo buildPartial() { + com.google.cloud.audit.ViolationInfo result = new com.google.cloud.audit.ViolationInfo(this); + result.constraint_ = constraint_; + result.errorMessage_ = errorMessage_; + result.checkedValue_ = checkedValue_; + result.policyType_ = policyType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.audit.ViolationInfo) { + return mergeFrom((com.google.cloud.audit.ViolationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.audit.ViolationInfo other) { + if (other == com.google.cloud.audit.ViolationInfo.getDefaultInstance()) return this; + if (!other.getConstraint().isEmpty()) { + constraint_ = other.constraint_; + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + onChanged(); + } + if (!other.getCheckedValue().isEmpty()) { + checkedValue_ = other.checkedValue_; + onChanged(); + } + if (other.policyType_ != 0) { + setPolicyTypeValue(other.getPolicyTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + constraint_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + errorMessage_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + checkedValue_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + policyType_ = input.readEnum(); + + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object constraint_ = ""; + /** + * + * + *
+     * Optional. Constraint name
+     * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The constraint. + */ + public java.lang.String getConstraint() { + java.lang.Object ref = constraint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constraint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Constraint name
+     * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for constraint. + */ + public com.google.protobuf.ByteString getConstraintBytes() { + java.lang.Object ref = constraint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + constraint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Constraint name
+     * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The constraint to set. + * @return This builder for chaining. + */ + public Builder setConstraint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + constraint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Constraint name
+     * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConstraint() { + + constraint_ = getDefaultInstance().getConstraint(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Constraint name
+     * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for constraint to set. + * @return This builder for chaining. + */ + public Builder setConstraintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + constraint_ = value; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * Optional. Error message that policy is indicating.
+     * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Error message that policy is indicating.
+     * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Error message that policy is indicating.
+     * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errorMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Error message that policy is indicating.
+     * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + + errorMessage_ = getDefaultInstance().getErrorMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Error message that policy is indicating.
+     * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errorMessage_ = value; + onChanged(); + return this; + } + + private java.lang.Object checkedValue_ = ""; + /** + * + * + *
+     * Optional. Value that is being checked for the policy.
+     * This could be in encrypted form (if pii sensitive).
+     * This field will only be emitted in LIST_POLICY types
+     * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The checkedValue. + */ + public java.lang.String getCheckedValue() { + java.lang.Object ref = checkedValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + checkedValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Value that is being checked for the policy.
+     * This could be in encrypted form (if pii sensitive).
+     * This field will only be emitted in LIST_POLICY types
+     * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for checkedValue. + */ + public com.google.protobuf.ByteString getCheckedValueBytes() { + java.lang.Object ref = checkedValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + checkedValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Value that is being checked for the policy.
+     * This could be in encrypted form (if pii sensitive).
+     * This field will only be emitted in LIST_POLICY types
+     * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The checkedValue to set. + * @return This builder for chaining. + */ + public Builder setCheckedValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + checkedValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Value that is being checked for the policy.
+     * This could be in encrypted form (if pii sensitive).
+     * This field will only be emitted in LIST_POLICY types
+     * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCheckedValue() { + + checkedValue_ = getDefaultInstance().getCheckedValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Value that is being checked for the policy.
+     * This could be in encrypted form (if pii sensitive).
+     * This field will only be emitted in LIST_POLICY types
+     * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for checkedValue to set. + * @return This builder for chaining. + */ + public Builder setCheckedValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + checkedValue_ = value; + onChanged(); + return this; + } + + private int policyType_ = 0; + /** + * + * + *
+     * Optional. Indicates the type of the policy.
+     * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for policyType. + */ + @java.lang.Override + public int getPolicyTypeValue() { + return policyType_; + } + /** + * + * + *
+     * Optional. Indicates the type of the policy.
+     * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for policyType to set. + * @return This builder for chaining. + */ + public Builder setPolicyTypeValue(int value) { + + policyType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Indicates the type of the policy.
+     * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The policyType. + */ + @java.lang.Override + public com.google.cloud.audit.ViolationInfo.PolicyType getPolicyType() { + @SuppressWarnings("deprecation") + com.google.cloud.audit.ViolationInfo.PolicyType result = + com.google.cloud.audit.ViolationInfo.PolicyType.valueOf(policyType_); + return result == null ? com.google.cloud.audit.ViolationInfo.PolicyType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Indicates the type of the policy.
+     * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The policyType to set. + * @return This builder for chaining. + */ + public Builder setPolicyType(com.google.cloud.audit.ViolationInfo.PolicyType value) { + if (value == null) { + throw new NullPointerException(); + } + + policyType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Indicates the type of the policy.
+     * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolicyType() { + + policyType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.audit.ViolationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.audit.ViolationInfo) + private static final com.google.cloud.audit.ViolationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.audit.ViolationInfo(); + } + + public static com.google.cloud.audit.ViolationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ViolationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.audit.ViolationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java new file mode 100644 index 00000000..080151ef --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/audit/audit_log.proto + +package com.google.cloud.audit; + +public interface ViolationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.audit.ViolationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Constraint name
+   * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The constraint. + */ + java.lang.String getConstraint(); + /** + * + * + *
+   * Optional. Constraint name
+   * 
+ * + * string constraint = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for constraint. + */ + com.google.protobuf.ByteString getConstraintBytes(); + + /** + * + * + *
+   * Optional. Error message that policy is indicating.
+   * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+   * Optional. Error message that policy is indicating.
+   * 
+ * + * string error_message = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + + /** + * + * + *
+   * Optional. Value that is being checked for the policy.
+   * This could be in encrypted form (if pii sensitive).
+   * This field will only be emitted in LIST_POLICY types
+   * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The checkedValue. + */ + java.lang.String getCheckedValue(); + /** + * + * + *
+   * Optional. Value that is being checked for the policy.
+   * This could be in encrypted form (if pii sensitive).
+   * This field will only be emitted in LIST_POLICY types
+   * 
+ * + * string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for checkedValue. + */ + com.google.protobuf.ByteString getCheckedValueBytes(); + + /** + * + * + *
+   * Optional. Indicates the type of the policy.
+   * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for policyType. + */ + int getPolicyTypeValue(); + /** + * + * + *
+   * Optional. Indicates the type of the policy.
+   * 
+ * + * + * .google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The policyType. + */ + com.google.cloud.audit.ViolationInfo.PolicyType getPolicyType(); +} diff --git a/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto b/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto index 33d50083..ed4ae5f4 100644 --- a/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto +++ b/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.audit; +import "google/api/field_behavior.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/rpc/context/attribute_context.proto"; @@ -76,6 +77,11 @@ message AuditLog { // one AuthorizationInfo element for each {resource, permission} tuple. repeated AuthorizationInfo authorization_info = 9; + // Indicates the policy violations for this request. If the request + // is denied by the policy, violation information will be logged + // here. + PolicyViolationInfo policy_violation_info = 25; + // Metadata about the operation. RequestMetadata request_metadata = 4; @@ -111,8 +117,8 @@ message AuthenticationInfo { // of third party principal) making the request. For third party identity // callers, the `principal_subject` field is populated instead of this field. // For privacy reasons, the principal email address is sometimes redacted. - // For more information, see - // https://cloud.google.com/logging/docs/audit#user-id. + // For more information, see [Caller identities in audit + // logs](https://cloud.google.com/logging/docs/audit#user-id). string principal_email = 1; // The authority selector specified by the requestor, if any. @@ -173,14 +179,16 @@ message AuthorizationInfo { // Metadata about the request. message RequestMetadata { // The IP address of the caller. - // For caller from internet, this will be public IPv4 or IPv6 address. - // For caller from a Compute Engine VM with external IP address, this - // will be the VM's external IP address. For caller from a Compute - // Engine VM without external IP address, if the VM is in the same - // organization (or project) as the accessed resource, `caller_ip` will - // be the VM's internal IPv4 address, otherwise the `caller_ip` will be - // redacted to "gce-internal-ip". - // See https://cloud.google.com/compute/docs/vpc/ for more information. + // For a caller from the internet, this will be the public IPv4 or IPv6 + // address. For calls made from inside Google's internal production network + // from one GCP service to another, `caller_ip` will be redacted to "private". + // For a caller from a Compute Engine VM with a external IP address, + // `caller_ip` will be the VM's external IP address. For a caller from a + // Compute Engine VM without a external IP address, if the VM is in the same + // organization (or project) as the accessed resource, `caller_ip` will be the + // VM's internal IPv4 address, otherwise `caller_ip` will be redacted to + // "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more + // information. string caller_ip = 1; // The user agent of the caller. @@ -281,3 +289,65 @@ message ServiceAccountDelegationInfo { ThirdPartyPrincipal third_party_principal = 2; } } + +// Information related to policy violations for this request. +message PolicyViolationInfo { + // Indicates the orgpolicy violations for this resource. + OrgPolicyViolationInfo org_policy_violation_info = 1; +} + +// Represents OrgPolicy Violation information. +message OrgPolicyViolationInfo { + // Optional. Resource payload that is currently in scope and is subjected to orgpolicy + // conditions. This payload may be the subset of the actual Resource that may + // come in the request. This payload should not contain any core content. + google.protobuf.Struct payload = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource type that the orgpolicy is checked against. + // Example: compute.googleapis.com/Instance, store.googleapis.com/bucket + string resource_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tags referenced on the resource at the time of evaluation. These also + // include the federated tags, if they are supplied in the CheckOrgPolicy + // or CheckCustomConstraints Requests. + // + // Optional field as of now. These tags are the Cloud tags that are + // available on the resource during the policy evaluation and will + // be available as part of the OrgPolicy check response for logging purposes. + map resource_tags = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Policy violations + repeated ViolationInfo violation_info = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Provides information about the Policy violation info for this request. +message ViolationInfo { + // Policy Type enum + enum PolicyType { + // Default value. This value should not be used. + POLICY_TYPE_UNSPECIFIED = 0; + + // Indicates boolean policy constraint + BOOLEAN_CONSTRAINT = 1; + + // Indicates list policy constraint + LIST_CONSTRAINT = 2; + + // Indicates custom policy constraint + CUSTOM_CONSTRAINT = 3; + } + + // Optional. Constraint name + string constraint = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Error message that policy is indicating. + string error_message = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value that is being checked for the policy. + // This could be in encrypted form (if pii sensitive). + // This field will only be emitted in LIST_POLICY types + string checked_value = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates the type of the policy. + PolicyType policy_type = 4 [(google.api.field_behavior) = OPTIONAL]; +} \ No newline at end of file