public sealed class PreconditionFailure.Types.Violation : IMessage<PreconditionFailure.Types.Violation>, IEquatable<PreconditionFailure.Types.Violation>, IDeepCloneable<PreconditionFailure.Types.Violation>, IBufferMessage, IMessage
A message type used to describe a single precondition failure.
The subject, relative to the type, that failed.
For example, "google.com/cloud" relative to the "TOS" type would indicate
which terms of service is being referenced.
The type of PreconditionFailure. We recommend using a service-specific
enum type to define the supported precondition violation subjects. For
example, "TOS" for "Terms of Service violation".
[[["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 latest version of \u003ccode\u003ePreconditionFailure.Types.Violation\u003c/code\u003e is 2.15.0, with older versions 2.10.0 and 2.2.0 also available.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePreconditionFailure.Types.Violation\u003c/code\u003e is a message type utilized for describing a single precondition failure, and implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePreconditionFailure.Types.Violation\u003c/code\u003e class includes fields such as \u003ccode\u003eDescriptionFieldNumber\u003c/code\u003e, \u003ccode\u003eSubjectFieldNumber\u003c/code\u003e, and \u003ccode\u003eTypeFieldNumber\u003c/code\u003e, which denote the field numbers for description, subject, and type respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe class features properties like \u003ccode\u003eDescription\u003c/code\u003e, \u003ccode\u003eSubject\u003c/code\u003e, and \u003ccode\u003eType\u003c/code\u003e, which represent the details of the precondition failure, and static properties like \u003ccode\u003eDescriptor\u003c/code\u003e and \u003ccode\u003eParser\u003c/code\u003e for message metadata and parsing.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods for calculations and operations such as \u003ccode\u003eCalculateSize()\u003c/code\u003e, \u003ccode\u003eClone()\u003c/code\u003e, \u003ccode\u003eEquals()\u003c/code\u003e, \u003ccode\u003eGetHashCode()\u003c/code\u003e, \u003ccode\u003eMergeFrom()\u003c/code\u003e, \u003ccode\u003eToString()\u003c/code\u003e, and \u003ccode\u003eWriteTo()\u003c/code\u003e, which are essential for managing and working with message data.\u003c/p\u003e\n"]]],[],null,["# Class PreconditionFailure.Types.Violation (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types.Violation)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Rpc.PreconditionFailure.Types.Violation)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Rpc.PreconditionFailure.Types.Violation)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Rpc.PreconditionFailure.Types.Violation) \n\n public sealed class PreconditionFailure.Types.Violation : IMessage\u003cPreconditionFailure.Types.Violation\u003e, IEquatable\u003cPreconditionFailure.Types.Violation\u003e, IDeepCloneable\u003cPreconditionFailure.Types.Violation\u003e, IBufferMessage, IMessage\n\nA message type used to describe a single precondition failure. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e PreconditionFailure.Types.Violation \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[PreconditionFailure](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure)[Types](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types)[Violation](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types.Violation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PreconditionFailure](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure)[Types](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types)[Violation](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types.Violation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[PreconditionFailure](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure)[Types](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types)[Violation](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.PreconditionFailure.Types.Violation), [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](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### Violation()\n\n public Violation()\n\n### Violation(Violation)\n\n public Violation(PreconditionFailure.Types.Violation other)\n\nFields\n------\n\n### DescriptionFieldNumber\n\n public const int DescriptionFieldNumber = 3\n\nField number for the \"description\" field.\n\n### SubjectFieldNumber\n\n public const int SubjectFieldNumber = 2\n\nField number for the \"subject\" field.\n\n### TypeFieldNumber\n\n public const int TypeFieldNumber = 1\n\nField number for the \"type\" field.\n\nProperties\n----------\n\n### Description\n\n public string Description { get; set; }\n\nA description of how the precondition failed. Developers can use this\ndescription to understand how to fix the failure.\n\nFor example: \"Terms of service not accepted\".\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cPreconditionFailure.Types.Violation\u003e Parser { get; }\n\n### Subject\n\n public string Subject { get; set; }\n\nThe subject, relative to the type, that failed.\nFor example, \"google.com/cloud\" relative to the \"TOS\" type would indicate\nwhich terms of service is being referenced.\n\n### Type\n\n public string Type { get; set; }\n\nThe type of PreconditionFailure. We recommend using a service-specific\nenum type to define the supported precondition violation subjects. For\nexample, \"TOS\" for \"Terms of Service violation\".\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public PreconditionFailure.Types.Violation Clone()\n\n### Equals(Violation)\n\n public bool Equals(PreconditionFailure.Types.Violation 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(Violation)\n\n public void MergeFrom(PreconditionFailure.Types.Violation 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)"]]