Google API Common Protos Client - Class Request (4.8.2)

Reference documentation and code samples for the Google API Common Protos Client class Request.

This message defines attributes for an HTTP request. If the actual request is not an HTTP request, the runtime system should try to map the actual request to an equivalent HTTP request.

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

Namespace

Google \ Rpc \ Context \ AttributeContext

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ id string

The unique ID for a request, which can be propagated to downstream systems. The ID should have low probability of collision within a single day for a specific service.

↳ method string

The HTTP request method, such as GET, POST.

↳ headers array|Google\Protobuf\Internal\MapField

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

↳ path string

The HTTP URL path, excluding the query parameters.

↳ host string

The HTTP request Host header value.

↳ scheme string

The HTTP URL scheme, such as http and https.

↳ query string

The HTTP URL query in the format of name1=value1&name2=value2, as it appears in the first line of the HTTP request. No decoding is performed.

↳ time Google\Protobuf\Timestamp

The timestamp when the destination service receives the last byte of the request.

↳ size int|string

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

↳ protocol string

The network protocol used with the request, such as "http/1.1", "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for details.

↳ reason string

A special parameter for request reason. It is used by security systems to associate auditing information with a request.

↳ auth Google\Rpc\Context\AttributeContext\Auth

The request authentication. May be absent for unauthenticated requests. Derived from the HTTP request Authorization header or equivalent.

getId

The unique ID for a request, which can be propagated to downstream systems. The ID should have low probability of collision within a single day for a specific service.

Returns
Type Description
string

setId

The unique ID for a request, which can be propagated to downstream systems. The ID should have low probability of collision within a single day for a specific service.

Parameter
Name Description
var string
Returns
Type Description
$this

getMethod

The HTTP request method, such as GET, POST.

Returns
Type Description
string

setMethod

The HTTP request method, such as GET, POST.

Parameter
Name Description
var string
Returns
Type Description
$this

getHeaders

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

Returns
Type Description
Google\Protobuf\Internal\MapField

setHeaders

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

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getPath

The HTTP URL path, excluding the query parameters.

Returns
Type Description
string

setPath

The HTTP URL path, excluding the query parameters.

Parameter
Name Description
var string
Returns
Type Description
$this

getHost

The HTTP request Host header value.

Returns
Type Description
string

setHost

The HTTP request Host header value.

Parameter
Name Description
var string
Returns
Type Description
$this

getScheme

The HTTP URL scheme, such as http and https.

Returns
Type Description
string

setScheme

The HTTP URL scheme, such as http and https.

Parameter
Name Description
var string
Returns
Type Description
$this

getQuery

The HTTP URL query in the format of name1=value1&name2=value2, as it appears in the first line of the HTTP request. No decoding is performed.

Returns
Type Description
string

setQuery

The HTTP URL query in the format of name1=value1&name2=value2, as it appears in the first line of the HTTP request. No decoding is performed.

Parameter
Name Description
var string
Returns
Type Description
$this

getTime

The timestamp when the destination service receives the last byte of the request.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasTime

clearTime

setTime

The timestamp when the destination service receives the last byte of the request.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getSize

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

Returns
Type Description
int|string

setSize

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

Parameter
Name Description
var int|string
Returns
Type Description
$this

getProtocol

The network protocol used with the request, such as "http/1.1", "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for details.

Returns
Type Description
string

setProtocol

The network protocol used with the request, such as "http/1.1", "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for details.

Parameter
Name Description
var string
Returns
Type Description
$this

getReason

A special parameter for request reason. It is used by security systems to associate auditing information with a request.

Returns
Type Description
string

setReason

A special parameter for request reason. It is used by security systems to associate auditing information with a request.

Parameter
Name Description
var string
Returns
Type Description
$this

getAuth

The request authentication. May be absent for unauthenticated requests.

Derived from the HTTP request Authorization header or equivalent.

Returns
Type Description
Google\Rpc\Context\AttributeContext\Auth|null

hasAuth

clearAuth

setAuth

The request authentication. May be absent for unauthenticated requests.

Derived from the HTTP request Authorization header or equivalent.

Parameter
Name Description
var Google\Rpc\Context\AttributeContext\Auth
Returns
Type Description
$this