Documentation

Response extends Message
in package

This message defines attributes for a typical network response. It generally models semantics of an HTTP response.

Generated from protobuf message google.rpc.context.AttributeContext.Response

Table of Contents

Properties

$backend_latency  : mixed
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
$code  : mixed
The HTTP response status code, such as `200` and `404`.
$size  : mixed
The HTTP response size in bytes. If unknown, it must be -1.
$time  : mixed
The timestamp when the `destination` service sends the last byte of the response.
$headers  : mixed
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.

Methods

__construct()  : mixed
Constructor.
clearBackendLatency()  : mixed
clearTime()  : mixed
getBackendLatency()  : Duration|null
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
getCode()  : int|string
The HTTP response status code, such as `200` and `404`.
getHeaders()  : MapField
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
getSize()  : int|string
The HTTP response size in bytes. If unknown, it must be -1.
getTime()  : Timestamp|null
The timestamp when the `destination` service sends the last byte of the response.
hasBackendLatency()  : mixed
hasTime()  : mixed
setBackendLatency()  : $this
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
setCode()  : $this
The HTTP response status code, such as `200` and `404`.
setHeaders()  : $this
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
setSize()  : $this
The HTTP response size in bytes. If unknown, it must be -1.
setTime()  : $this
The timestamp when the `destination` service sends the last byte of the response.

Properties

$backend_latency

The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.

protected mixed $backend_latency = null

Generated from protobuf field .google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"];

$code

The HTTP response status code, such as `200` and `404`.

protected mixed $code = 0

Generated from protobuf field int64 code = 1 [json_name = "code"];

$size

The HTTP response size in bytes. If unknown, it must be -1.

protected mixed $size = 0

Generated from protobuf field int64 size = 2 [json_name = "size"];

$time

The timestamp when the `destination` service sends the last byte of the response.

protected mixed $time = null

Generated from protobuf field .google.protobuf.Timestamp time = 4 [json_name = "time"];

$headers

The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.

private mixed $headers

Generated from protobuf field map<string, string> headers = 3 [json_name = "headers"];

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 int|string $code
      The HTTP response status code, such as `200` and `404`.
@type int|string $size
      The HTTP response size in bytes. If unknown, it must be -1.
@type array|\Google\Protobuf\Internal\MapField $headers
      The HTTP response headers. If multiple headers share the same key, they
      must be merged according to HTTP spec. All header keys must be
      lowercased, because HTTP header keys are case-insensitive.
@type \Google\Protobuf\Timestamp $time
      The timestamp when the `destination` service sends the last byte of
      the response.
@type \Google\Protobuf\Duration $backend_latency
      The amount of time it takes the backend service to fully respond to a
      request. Measured from when the destination service starts to send the
      request to the backend until when the destination service receives the
      complete response from the backend.

}

clearBackendLatency()

public clearBackendLatency() : mixed

getBackendLatency()

The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.

public getBackendLatency() : Duration|null

Generated from protobuf field .google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"];

Return values
Duration|null

getCode()

The HTTP response status code, such as `200` and `404`.

public getCode() : int|string

Generated from protobuf field int64 code = 1 [json_name = "code"];

Return values
int|string

getHeaders()

The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.

public getHeaders() : MapField

Generated from protobuf field map<string, string> headers = 3 [json_name = "headers"];

Return values
MapField

getSize()

The HTTP response size in bytes. If unknown, it must be -1.

public getSize() : int|string

Generated from protobuf field int64 size = 2 [json_name = "size"];

Return values
int|string

getTime()

The timestamp when the `destination` service sends the last byte of the response.

public getTime() : Timestamp|null

Generated from protobuf field .google.protobuf.Timestamp time = 4 [json_name = "time"];

Return values
Timestamp|null

hasBackendLatency()

public hasBackendLatency() : mixed

setBackendLatency()

The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.

public setBackendLatency(Duration $var) : $this

Generated from protobuf field .google.protobuf.Duration backend_latency = 5 [json_name = "backendLatency"];

Parameters
$var : Duration
Return values
$this

setCode()

The HTTP response status code, such as `200` and `404`.

public setCode(int|string $var) : $this

Generated from protobuf field int64 code = 1 [json_name = "code"];

Parameters
$var : int|string
Return values
$this

setHeaders()

The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.

public setHeaders(array<string|int, mixed>|MapField $var) : $this

Generated from protobuf field map<string, string> headers = 3 [json_name = "headers"];

Parameters
$var : array<string|int, mixed>|MapField
Return values
$this

setSize()

The HTTP response size in bytes. If unknown, it must be -1.

public setSize(int|string $var) : $this

Generated from protobuf field int64 size = 2 [json_name = "size"];

Parameters
$var : int|string
Return values
$this

setTime()

The timestamp when the `destination` service sends the last byte of the response.

public setTime(Timestamp $var) : $this

Generated from protobuf field .google.protobuf.Timestamp time = 4 [json_name = "time"];

Parameters
$var : Timestamp
Return values
$this

        
On this page

Search results