FieldViolation
extends Message
in package
A message type used to describe a single bad request field.
Generated from protobuf message google.rpc.BadRequest.FieldViolation
Table of Contents
Properties
- $description : mixed
- A description of why the request element is bad.
- $field : mixed
- 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.
Methods
- __construct() : mixed
- Constructor.
- getDescription() : string
- A description of why the request element is bad.
- getField() : string
- 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.
- setDescription() : $this
- A description of why the request element is bad.
- setField() : $this
- 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.
Properties
$description
A description of why the request element is bad.
protected
mixed
$description
= ''
Generated from protobuf field string description = 2 [json_name = "description"];
$field
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.
protected
mixed
$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_namevalue -
email_addresses[1].emailfor a violation in theemailfield of the firstemail_addressesmessage -
email_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 thefullNamevalue -
emailAddresses[1].emailfor a violation in theemailfield of the firstemailAddressesmessage -
emailAddresses[3].type[2]for a violation in the secondtypevalue in the thirdemailAddressesmessage.
Generated from protobuf field string field = 1 [json_name = "field"];
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
- $data : array<string|int, mixed> = NULL
-
{ Optional. Data for populating the Message object.
@type string $field 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. @type string $description A description of why the request element is bad.}
getDescription()
A description of why the request element is bad.
public
getDescription() : string
Generated from protobuf field string description = 2 [json_name = "description"];
Return values
stringgetField()
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.
public
getField() : string
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_namevalue -
email_addresses[1].emailfor a violation in theemailfield of the firstemail_addressesmessage -
email_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 thefullNamevalue -
emailAddresses[1].emailfor a violation in theemailfield of the firstemailAddressesmessage -
emailAddresses[3].type[2]for a violation in the secondtypevalue in the thirdemailAddressesmessage.
Generated from protobuf field string field = 1 [json_name = "field"];
Return values
stringsetDescription()
A description of why the request element is bad.
public
setDescription(string $var) : $this
Generated from protobuf field string description = 2 [json_name = "description"];
Parameters
- $var : string
Return values
$thissetField()
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.
public
setField(string $var) : $this
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_namevalue -
email_addresses[1].emailfor a violation in theemailfield of the firstemail_addressesmessage -
email_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 thefullNamevalue -
emailAddresses[1].emailfor a violation in theemailfield of the firstemailAddressesmessage -
emailAddresses[3].type[2]for a violation in the secondtypevalue in the thirdemailAddressesmessage.
Generated from protobuf field string field = 1 [json_name = "field"];
Parameters
- $var : string