A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
getBrowserKeyRestrictions
The HTTP referrers (websites) that are allowed to use the key.
A restriction for a specific service and optionally one or
more specific methods. Requests are allowed if they
match any of these restrictions. If no restrictions are
specified, all targets are allowed.
A restriction for a specific service and optionally one or
more specific methods. Requests are allowed if they
match any of these restrictions. If no restrictions are
specified, all targets are allowed.
[[["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 Cloud Api Keys V2 Client - Class Restrictions (1.0.5)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.5 (latest)](/php/docs/reference/cloud-api-keys/latest/V2.Restrictions)\n- [1.0.4](/php/docs/reference/cloud-api-keys/1.0.4/V2.Restrictions)\n- [0.4.5](/php/docs/reference/cloud-api-keys/0.4.5/V2.Restrictions)\n- [0.3.3](/php/docs/reference/cloud-api-keys/0.3.3/V2.Restrictions)\n- [0.2.2](/php/docs/reference/cloud-api-keys/0.2.2/V2.Restrictions)\n- [0.1.7](/php/docs/reference/cloud-api-keys/0.1.7/V2.Restrictions) \nReference documentation and code samples for the Google Cloud Api Keys V2 Client class Restrictions.\n\nDescribes the restrictions on the key.\n\nGenerated from protobuf message `google.api.apikeys.v2.Restrictions`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ApiKeys \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getBrowserKeyRestrictions\n\nThe HTTP referrers (websites) that are allowed to use the key.\n\n### hasBrowserKeyRestrictions\n\n### setBrowserKeyRestrictions\n\nThe HTTP referrers (websites) that are allowed to use the key.\n\n### getServerKeyRestrictions\n\nThe IP addresses of callers that are allowed to use the key.\n\n### hasServerKeyRestrictions\n\n### setServerKeyRestrictions\n\nThe IP addresses of callers that are allowed to use the key.\n\n### getAndroidKeyRestrictions\n\nThe Android apps that are allowed to use the key.\n\n### hasAndroidKeyRestrictions\n\n### setAndroidKeyRestrictions\n\nThe Android apps that are allowed to use the key.\n\n### getIosKeyRestrictions\n\nThe iOS apps that are allowed to use the key.\n\n### hasIosKeyRestrictions\n\n### setIosKeyRestrictions\n\nThe iOS apps that are allowed to use the key.\n\n### getApiTargets\n\nA restriction for a specific service and optionally one or\nmore specific methods. Requests are allowed if they\nmatch any of these restrictions. If no restrictions are\nspecified, all targets are allowed.\n\n### setApiTargets\n\nA restriction for a specific service and optionally one or\nmore specific methods. Requests are allowed if they\nmatch any of these restrictions. If no restrictions are\nspecified, all targets are allowed.\n\n### getClientRestrictions"]]