Documentation

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_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.

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
string

getField()

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_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.

Generated from protobuf field string field = 1 [json_name = "field"];

Return values
string

setDescription()

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
$this

setField()

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_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.

Generated from protobuf field string field = 1 [json_name = "field"];

Parameters
$var : string
Return values
$this

        
On this page

Search results