Reference documentation and code samples for the Google API Common Protos Client class MethodPolicy.
Defines policies applying to an RPC method.
Generated from protobuf message google.api.MethodPolicy
Namespace
Google \ Api
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ selector
string
Selects a method to which these policies should be enforced, for example, "google.pubsub.v1.Subscriber.CreateSubscription". Refer to selector for syntax details. NOTE: This field must not be set in the proto annotation. It will be automatically filled by the service config compiler .
Policies that are applicable to the request message.
getSelector
Selects a method to which these policies should be enforced, for example,
"google.pubsub.v1.Subscriber.CreateSubscription".
Refer to selector for syntax
details.
NOTE: This field must not be set in the proto annotation. It will be
automatically filled by the service config compiler .
Returns
Type
Description
string
setSelector
Selects a method to which these policies should be enforced, for example,
"google.pubsub.v1.Subscriber.CreateSubscription".
Refer to selector for syntax
details.
NOTE: This field must not be set in the proto annotation. It will be
automatically filled by the service config compiler .
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getRequestPolicies
Policies that are applicable to the request message.
[[["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-08-28 UTC."],[],[],null,["# Google API Common Protos Client - Class MethodPolicy (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.MethodPolicy)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.MethodPolicy)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.MethodPolicy)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.MethodPolicy)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.MethodPolicy)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.MethodPolicy) \nReference documentation and code samples for the Google API Common Protos Client class MethodPolicy.\n\nDefines policies applying to an RPC method.\n\nGenerated from protobuf message `google.api.MethodPolicy`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSelector\n\nSelects a method to which these policies should be enforced, for example,\n\"google.pubsub.v1.Subscriber.CreateSubscription\".\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\nNOTE: This field must not be set in the proto annotation. It will be\nautomatically filled by the service config compiler .\n\n### setSelector\n\nSelects a method to which these policies should be enforced, for example,\n\"google.pubsub.v1.Subscriber.CreateSubscription\".\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\nNOTE: This field must not be set in the proto annotation. It will be\nautomatically filled by the service config compiler .\n\n### getRequestPolicies\n\nPolicies that are applicable to the request message.\n\n### setRequestPolicies\n\nPolicies that are applicable to the request message."]]