Reference documentation and code samples for the Google API Common Protos Client class UsageRule.
Usage configuration rules for the service.
NOTE: Under development.
Use this rule to configure unregistered calls for the service. Unregistered
calls are calls that do not contain consumer project identity.
(Example: calls that do not contain an API key).
By default, API methods do not allow unregistered calls, and each method call
must be identified by a consumer project identity. Use this rule to
allow/disallow unregistered calls.
Example of an API that wants to allow unregistered calls for entire service.
usage:
rules:
selector: "*"
allow_unregistered_calls: true
Example of a method that wants to allow unregistered calls.
usage:
rules:
Generated from protobuf message google.api.UsageRule
Namespace
Google \ Api
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ selector
string
Selects the methods to which this rule applies. Use '*' to indicate all methods in all APIs. Refer to selector for syntax details.
↳ allow_unregistered_calls
bool
If true, the selected method allows unregistered calls, e.g. calls that don't identify any user or application.
↳ skip_service_control
bool
If true, the selected method should skip service control and the control plane features, such as quota and billing, will not be available. This flag is used by Google Cloud Endpoints to bypass checks for internal methods, such as service health check methods.
getSelector
Selects the methods to which this rule applies. Use '*' to indicate all
methods in all APIs.
[[["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 UsageRule (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.UsageRule)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.UsageRule)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.UsageRule)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.UsageRule)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.UsageRule)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.UsageRule) \nReference documentation and code samples for the Google API Common Protos Client class UsageRule.\n\nUsage configuration rules for the service.\n\nNOTE: Under development.\nUse this rule to configure unregistered calls for the service. Unregistered\ncalls are calls that do not contain consumer project identity.\n(Example: calls that do not contain an API key).\nBy default, API methods do not allow unregistered calls, and each method call\nmust be identified by a consumer project identity. Use this rule to\nallow/disallow unregistered calls.\nExample of an API that wants to allow unregistered calls for entire service.\nusage:\nrules:\n\n- selector: \"\\*\" allow_unregistered_calls: true Example of a method that wants to allow unregistered calls. usage: rules:\n- selector: \"google.example.library.v1.LibraryService.CreateBook\" allow_unregistered_calls: true\n\nGenerated from protobuf message `google.api.UsageRule`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSelector\n\nSelects the methods to which this rule applies. Use '\\*' to indicate all\nmethods in all APIs.\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\n\n### setSelector\n\nSelects the methods to which this rule applies. Use '\\*' to indicate all\nmethods in all APIs.\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\n\n### getAllowUnregisteredCalls\n\nIf true, the selected method allows unregistered calls, e.g. calls\nthat don't identify any user or application.\n\n### setAllowUnregisteredCalls\n\nIf true, the selected method allows unregistered calls, e.g. calls\nthat don't identify any user or application.\n\n### getSkipServiceControl\n\nIf true, the selected method should skip service control and the control\nplane features, such as quota and billing, will not be available.\n\nThis flag is used by Google Cloud Endpoints to bypass checks for internal\nmethods, such as service health check methods.\n\n### setSkipServiceControl\n\nIf true, the selected method should skip service control and the control\nplane features, such as quota and billing, will not be available.\n\nThis flag is used by Google Cloud Endpoints to bypass checks for internal\nmethods, such as service health check methods."]]