public sealed class BadRequest.Types.FieldViolation : IMessage<BadRequest.Types.FieldViolation>, IEquatable<BadRequest.Types.FieldViolation>, IDeepCloneable<BadRequest.Types.FieldViolation>, IBufferMessage, IMessageA message type used to describe a single bad request field.
Implements
IMessageBadRequestTypesFieldViolation, IEquatableBadRequestTypesFieldViolation, IDeepCloneableBadRequestTypesFieldViolation, IBufferMessage, IMessageNamespace
Google.RpcAssembly
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 = 2Field number for the "description" field.
| Field Value | |
|---|---|
| Type | Description |
int |
|
FieldFieldNumber
public const int FieldFieldNumber = 1Field number for the "field" 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_namefor a violation in thefull_namevalueemail_addresses[1].emailfor a violation in theemailfield of the firstemail_addressesmessageemail_addresses[3].type[2]for a violation in the secondtypevalue in the thirdemail_addressesmessage.
In JSON, the same values are represented as:
fullNamefor a violation in thefullNamevalueemailAddresses[1].emailfor a violation in theemailfield of the firstemailAddressesmessageemailAddresses[3].type[2]for a violation in the secondtypevalue in the thirdemailAddressesmessage.
| Property Value | |
|---|---|
| Type | Description |
string |
|
Parser
public static MessageParser<BadRequest.Types.FieldViolation> Parser { get; }| Property Value | |
|---|---|
| Type | Description |
MessageParserBadRequestTypesFieldViolation |
|
Methods
CalculateSize()
public int CalculateSize()Calculates the size of this message in Protocol Buffer wire format, in bytes.
| Returns | |
|---|---|
| Type | Description |
int |
The number of bytes required to write this message to a coded output stream. |
Clone()
public BadRequest.Types.FieldViolation Clone()Creates a deep clone of this object.
| Returns | |
|---|---|
| Type | Description |
BadRequestTypesFieldViolation |
A deep clone of this object. |
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 |
|
GetHashCode()
public override int GetHashCode()| Returns | |
|---|---|
| Type | Description |
int |
|
MergeFrom(CodedInputStream)
public void MergeFrom(CodedInputStream input)Merges the data from the specified coded input stream with the current message.
| Parameter | |
|---|---|
| Name | Description |
input |
CodedInputStream |
See the user guide for precise merge semantics.
MergeFrom(FieldViolation)
public void MergeFrom(BadRequest.Types.FieldViolation other)Merges the given message into this one.
| Parameter | |
|---|---|
| Name | Description |
other |
BadRequestTypesFieldViolation |
See the user guide for precise merge semantics.
ToString()
public override string ToString()| Returns | |
|---|---|
| Type | Description |
string |
|
WriteTo(CodedOutputStream)
public void WriteTo(CodedOutputStream output)Writes the data to the given coded output stream.
| Parameter | |
|---|---|
| Name | Description |
output |
CodedOutputStreamCoded output stream to write the data to. Must not be null. |