Reference documentation and code samples for the Google API Common Protos Client class Api.
This message defines attributes associated with API operations, such as
a network API request. The terminology is based on the conventions used
by Google APIs, Istio, and OpenAPI.
Generated from protobuf messagegoogle.rpc.context.AttributeContext.Api
Namespace
Google \ Rpc \ Context \ AttributeContext
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ service
string
The API service name. It is a logical identifier for a networked API, such as "pubsub.googleapis.com". The naming syntax depends on the API management system being used for handling the request.
↳ operation
string
The API operation name. For gRPC requests, it is the fully qualified API method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI requests, it is theoperationId, such as "getPet".
↳ protocol
string
The API protocol used for sending the request, such as "http", "https", "grpc", or "internal".
↳ version
string
The API version associated with the API operation above, such as "v1" or "v1alpha1".
getService
The API service name. It is a logical identifier for a networked API,
such as "pubsub.googleapis.com". The naming syntax depends on the
API management system being used for handling the request.
Returns
Type
Description
string
setService
The API service name. It is a logical identifier for a networked API,
such as "pubsub.googleapis.com". The naming syntax depends on the
API management system being used for handling the request.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getOperation
The API operation name. For gRPC requests, it is the fully qualified API
method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI
requests, it is theoperationId, such as "getPet".
Returns
Type
Description
string
setOperation
The API operation name. For gRPC requests, it is the fully qualified API
method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI
requests, it is theoperationId, such as "getPet".
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getProtocol
The API protocol used for sending the request, such as "http", "https",
"grpc", or "internal".
Returns
Type
Description
string
setProtocol
The API protocol used for sending the request, such as "http", "https",
"grpc", or "internal".
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getVersion
The API version associated with the API operation above, such as "v1" or
"v1alpha1".
Returns
Type
Description
string
setVersion
The API version associated with the API operation above, such as "v1" or
"v1alpha1".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google API Common Protos Client - Class Api (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Rpc.Context.AttributeContext.Api)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Rpc.Context.AttributeContext.Api)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Rpc.Context.AttributeContext.Api)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Rpc.Context.AttributeContext.Api)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Rpc.Context.AttributeContext.Api)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Rpc.Context.AttributeContext.Api) \nReference documentation and code samples for the Google API Common Protos Client class Api.\n\nThis message defines attributes associated with API operations, such as\na network API request. The terminology is based on the conventions used\nby Google APIs, Istio, and OpenAPI.\n\nGenerated from protobuf message `google.rpc.context.AttributeContext.Api`\n\nNamespace\n---------\n\nGoogle \\\\ Rpc \\\\ Context \\\\ AttributeContext\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getService\n\nThe API service name. It is a logical identifier for a networked API,\nsuch as \"pubsub.googleapis.com\". The naming syntax depends on the\nAPI management system being used for handling the request.\n\n### setService\n\nThe API service name. It is a logical identifier for a networked API,\nsuch as \"pubsub.googleapis.com\". The naming syntax depends on the\nAPI management system being used for handling the request.\n\n### getOperation\n\nThe API operation name. For gRPC requests, it is the fully qualified API\nmethod name, such as \"google.pubsub.v1.Publisher.Publish\". For OpenAPI\nrequests, it is the `operationId`, such as \"getPet\".\n\n### setOperation\n\nThe API operation name. For gRPC requests, it is the fully qualified API\nmethod name, such as \"google.pubsub.v1.Publisher.Publish\". For OpenAPI\nrequests, it is the `operationId`, such as \"getPet\".\n\n### getProtocol\n\nThe API protocol used for sending the request, such as \"http\", \"https\",\n\"grpc\", or \"internal\".\n\n### setProtocol\n\nThe API protocol used for sending the request, such as \"http\", \"https\",\n\"grpc\", or \"internal\".\n\n### getVersion\n\nThe API version associated with the API operation above, such as \"v1\" or\n\"v1alpha1\".\n\n### setVersion\n\nThe API version associated with the API operation above, such as \"v1\" or\n\"v1alpha1\"."]]