An API request message that is scrubbed based on the method annotation.
This field should only be filled if audit_log field is present.
Service Control will use this to assemble a complete log for Cloud Audit
Logs and Google internal audit logs.
An API response message that is scrubbed based on the method annotation.
This field should only be filled if audit_log field is present.
Service Control will use this to assemble a complete log for Cloud Audit
Logs and Google internal audit logs.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eAuditContext\u003c/code\u003e class provides essential information for audit logging within the Google.Rpc.Context namespace in the Google.Api.CommonProtos.dll assembly.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements several interfaces, including IMessage, IEquatable, IDeepCloneable, and IBufferMessage, providing methods for message handling, comparison, deep cloning, and buffer manipulation.\u003c/p\u003e\n"],["\u003cp\u003eKey fields in \u003ccode\u003eAuditContext\u003c/code\u003e include \u003ccode\u003eAuditLogFieldNumber\u003c/code\u003e, \u003ccode\u003eScrubbedRequestFieldNumber\u003c/code\u003e, \u003ccode\u003eScrubbedResponseFieldNumber\u003c/code\u003e, \u003ccode\u003eScrubbedResponseItemCountFieldNumber\u003c/code\u003e, and \u003ccode\u003eTargetResourceFieldNumber\u003c/code\u003e, each representing specific data points for auditing.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAuditContext\u003c/code\u003e class includes properties such as \u003ccode\u003eAuditLog\u003c/code\u003e, \u003ccode\u003eScrubbedRequest\u003c/code\u003e, \u003ccode\u003eScrubbedResponse\u003c/code\u003e, \u003ccode\u003eScrubbedResponseItemCount\u003c/code\u003e, and \u003ccode\u003eTargetResource\u003c/code\u003e, which are used to store and access audit-related data.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers methods for creating a deep clone, calculating message size, merging data from streams or other AuditContext instances, determining equality, and reading or writing to protocol buffer streams.\u003c/p\u003e\n"]]],[],null,["# Class AuditContext (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AuditContext)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Rpc.Context.AuditContext)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Rpc.Context.AuditContext)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Rpc.Context.AuditContext) \n\n public sealed class AuditContext : IMessage\u003cAuditContext\u003e, IEquatable\u003cAuditContext\u003e, IDeepCloneable\u003cAuditContext\u003e, IBufferMessage, IMessage\n\n`AuditContext` provides information that is needed for audit logging. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AuditContext \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AuditContext](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AuditContext), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AuditContext](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AuditContext), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AuditContext](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context.AuditContext), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Rpc.Context](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Context)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### AuditContext()\n\n public AuditContext()\n\n### AuditContext(AuditContext)\n\n public AuditContext(AuditContext other)\n\nFields\n------\n\n### AuditLogFieldNumber\n\n public const int AuditLogFieldNumber = 1\n\nField number for the \"audit_log\" field.\n\n### ScrubbedRequestFieldNumber\n\n public const int ScrubbedRequestFieldNumber = 2\n\nField number for the \"scrubbed_request\" field.\n\n### ScrubbedResponseFieldNumber\n\n public const int ScrubbedResponseFieldNumber = 3\n\nField number for the \"scrubbed_response\" field.\n\n### ScrubbedResponseItemCountFieldNumber\n\n public const int ScrubbedResponseItemCountFieldNumber = 4\n\nField number for the \"scrubbed_response_item_count\" field.\n\n### TargetResourceFieldNumber\n\n public const int TargetResourceFieldNumber = 5\n\nField number for the \"target_resource\" field.\n\nProperties\n----------\n\n### AuditLog\n\n public ByteString AuditLog { get; set; }\n\nSerialized audit log.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cAuditContext\u003e Parser { get; }\n\n### ScrubbedRequest\n\n public Struct ScrubbedRequest { get; set; }\n\nAn API request message that is scrubbed based on the method annotation.\nThis field should only be filled if audit_log field is present.\nService Control will use this to assemble a complete log for Cloud Audit\nLogs and Google internal audit logs.\n\n### ScrubbedResponse\n\n public Struct ScrubbedResponse { get; set; }\n\nAn API response message that is scrubbed based on the method annotation.\nThis field should only be filled if audit_log field is present.\nService Control will use this to assemble a complete log for Cloud Audit\nLogs and Google internal audit logs.\n\n### ScrubbedResponseItemCount\n\n public int ScrubbedResponseItemCount { get; set; }\n\nNumber of scrubbed response items.\n\n### TargetResource\n\n public string TargetResource { get; set; }\n\nAudit resource name which is scrubbed.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public AuditContext Clone()\n\n### Equals(AuditContext)\n\n public bool Equals(AuditContext other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### MergeFrom(AuditContext)\n\n public void MergeFrom(AuditContext other)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]