2.17.0 (latest) 2.15.0 2.10.0 2.2.0

    public sealed class BadRequest.Types.FieldViolation : IMessage<BadRequest.Types.FieldViolation>, IEquatable<BadRequest.Types.FieldViolation>, IDeepCloneable<BadRequest.Types.FieldViolation>, IBufferMessage, IMessage

A message type used to describe a single bad request field.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> BadRequest.Types.FieldViolation

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[BadRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.md.txt)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.Types.md.txt)[FieldViolation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.Types.FieldViolation.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BadRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.md.txt)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.Types.md.txt)[FieldViolation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.Types.FieldViolation.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[BadRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.md.txt)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.Types.md.txt)[FieldViolation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.BadRequest.Types.FieldViolation.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## Inherited Members

[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)

## Namespace

[Google.Rpc](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.md.txt)

## Assembly

Google.Api.CommonProtos.dll

## Constructors

### FieldViolation()

    public FieldViolation()

### FieldViolation(FieldViolation)

    public FieldViolation(BadRequest.Types.FieldViolation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `BadRequestTypesFieldViolation` |

## Fields

### DescriptionFieldNumber

    public const int DescriptionFieldNumber = 2

Field number for the "description" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### FieldFieldNumber

    public const int FieldFieldNumber = 1

Field number for the "field" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### LocalizedMessageFieldNumber

    public const int LocalizedMessageFieldNumber = 4

Field number for the "localized_message" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### ReasonFieldNumber

    public const int ReasonFieldNumber = 3

Field number for the "reason" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

## Properties

### Description

    public string Description { get; set; }

A description of why the request element is bad.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### Descriptor

    public static MessageDescriptor Descriptor { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `MessageDescriptor` |   |

### Field

    public string Field { get; set; }

A path that leads to a field in the request body. The value will be a
sequence of dot-separated identifiers that identify a protocol buffer
field.

Consider the following:

    message CreateContactRequest {
      message EmailAddress {
        enum Type {
          TYPE_UNSPECIFIED = 0;
          HOME = 1;
          WORK = 2;
        }

        optional string email = 1;
        repeated EmailType type = 2;
      }

      string full_name = 1;
      repeated EmailAddress email_addresses = 2;
    }

In this example, in proto `field` could take one of the following values:

- `full_name` for a violation in the `full_name` value
- `email_addresses[1].email` for a violation in the `email` field of the first `email_addresses` message
- `email_addresses[3].type[2]` for a violation in the second `type` value in the third `email_addresses` message.

In JSON, the same values are represented as:

- `fullName` for a violation in the `fullName` value
- `emailAddresses[1].email` for a violation in the `email` field of the first `emailAddresses` message
- `emailAddresses[3].type[2]` for a violation in the second `type` value in the third `emailAddresses` message.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### LocalizedMessage

    public LocalizedMessage LocalizedMessage { get; set; }

Provides a localized error message for field-level errors that is safe to
return to the API consumer.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `LocalizedMessage` |   |

### Parser

    public static MessageParser<BadRequest.Types.FieldViolation> Parser { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `MessageParserBadRequestTypesFieldViolation` |   |

### Reason

    public string Reason { get; set; }

The reason of the field-level error. This is a constant value that
identifies the proximate cause of the field-level error. It should
uniquely identify the type of the FieldViolation within the scope of the
google.rpc.ErrorInfo.domain. This should be at most 63
characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
which represents UPPER_SNAKE_CASE.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

## Methods

### CalculateSize()

    public int CalculateSize()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### Clone()

    public BadRequest.Types.FieldViolation Clone()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BadRequestTypesFieldViolation` |   |

### Equals(FieldViolation)

    public bool Equals(BadRequest.Types.FieldViolation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `BadRequestTypesFieldViolation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### Equals(object)

    public override bool Equals(object other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `object` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

**Overrides** [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### MergeFrom(CodedInputStream)

    public void MergeFrom(CodedInputStream input)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `input` | `CodedInputStream` |

### MergeFrom(FieldViolation)

    public void MergeFrom(BadRequest.Types.FieldViolation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `BadRequestTypesFieldViolation` |

### ToString()

    public override string ToString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### WriteTo(CodedOutputStream)

    public void WriteTo(CodedOutputStream output)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `output` | `CodedOutputStream` |