Class Restrictions (0.58.0) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 0.58.0keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   final   class  Restrictions   extends   GeneratedMessageV3   implements   RestrictionsOrBuilder  
   Describes the restrictions on the key.
 Protobuf type google.api.apikeys.v2.Restrictions
    Inherited Members 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT) 
    
    
      com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int) 
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>) 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int) 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
   
  Static Fields
   
  ANDROID_KEY_RESTRICTIONS_FIELD_NUMBER 
  
    
public   static   final   int   ANDROID_KEY_RESTRICTIONS_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  API_TARGETS_FIELD_NUMBER 
  
    
public   static   final   int   API_TARGETS_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  BROWSER_KEY_RESTRICTIONS_FIELD_NUMBER 
  
    
public   static   final   int   BROWSER_KEY_RESTRICTIONS_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  IOS_KEY_RESTRICTIONS_FIELD_NUMBER 
  
    
public   static   final   int   IOS_KEY_RESTRICTIONS_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  SERVER_KEY_RESTRICTIONS_FIELD_NUMBER 
  
    
public   static   final   int   SERVER_KEY_RESTRICTIONS_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  Static Methods
   
  getDefaultInstance() 
  
    
public   static   Restrictions   getDefaultInstance ()  
  
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
  
  newBuilder() 
  
    
public   static   Restrictions . Builder   newBuilder ()  
  
  newBuilder(Restrictions prototype) 
  
    
public   static   Restrictions . Builder   newBuilder ( Restrictions   prototype )  
  
  
  
    
public   static   Restrictions   parseDelimitedFrom ( InputStream   input )  
  
  
  
  
    
public   static   Restrictions   parseDelimitedFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parseFrom(byte[] data) 
  
    
public   static   Restrictions   parseFrom ( byte []   data )  
  
    
      
        Parameter  
      
        Name Description  
      
        databyte [] 
     
  
  
  
  parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Restrictions   parseFrom ( byte []   data ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parseFrom(ByteString data) 
  
    
public   static   Restrictions   parseFrom ( ByteString   data )  
  
  
  
  parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Restrictions   parseFrom ( ByteString   data ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  
    
public   static   Restrictions   parseFrom ( CodedInputStream   input )  
  
  
  
  
    
public   static   Restrictions   parseFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  
    
public   static   Restrictions   parseFrom ( InputStream   input )  
  
  
  
  
    
public   static   Restrictions   parseFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parseFrom(ByteBuffer data) 
  
    
public   static   Restrictions   parseFrom ( ByteBuffer   data )  
  
  
  
  parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Restrictions   parseFrom ( ByteBuffer   data ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parser() 
  
    
public   static   Parser<Restrictions>   parser ()  
  
  Methods
   
  equals(Object obj) 
  
    
public   boolean   equals ( Object   obj )  
  
    
      
        Parameter  
      
        Name Description  
      
        objObject  
     
  
  
  Overrides 
  
  getAndroidKeyRestrictions() 
  
    
public   AndroidKeyRestrictions   getAndroidKeyRestrictions ()  
   The Android apps that are allowed to use the key.
 .google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;
getAndroidKeyRestrictionsOrBuilder() 
  
    
public   AndroidKeyRestrictionsOrBuilder   getAndroidKeyRestrictionsOrBuilder ()  
   The Android apps that are allowed to use the key.
 .google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;
getApiTargets(int index) 
  
    
public   ApiTarget   getApiTargets ( int   index )  
   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.
 repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  getApiTargetsCount() 
  
    
public   int   getApiTargetsCount ()  
   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.
 repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  getApiTargetsList() 
  
    
public   List<ApiTarget>   getApiTargetsList ()  
   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.
 repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;
getApiTargetsOrBuilder(int index) 
  
    
public   ApiTargetOrBuilder   getApiTargetsOrBuilder ( int   index )  
   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.
 repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  getApiTargetsOrBuilderList() 
  
    
public   List <?   extends   ApiTargetOrBuilder >  getApiTargetsOrBuilderList ()  
   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.
 repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;
    
      
        Returns  
      
        Type Description  
      
        List <? extends com.google.api.apikeys.v2.ApiTargetOrBuilder > 
     
  
  getBrowserKeyRestrictions() 
  
    
public   BrowserKeyRestrictions   getBrowserKeyRestrictions ()  
   The HTTP referrers (websites) that are allowed to use the key.
 .google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;
getBrowserKeyRestrictionsOrBuilder() 
  
    
public   BrowserKeyRestrictionsOrBuilder   getBrowserKeyRestrictionsOrBuilder ()  
   The HTTP referrers (websites) that are allowed to use the key.
 .google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;
getClientRestrictionsCase() 
  
    
public   Restrictions . ClientRestrictionsCase   getClientRestrictionsCase ()  
  
  getDefaultInstanceForType() 
  
    
public   Restrictions   getDefaultInstanceForType ()  
  
  getIosKeyRestrictions() 
  
    
public   IosKeyRestrictions   getIosKeyRestrictions ()  
   The iOS apps that are allowed to use the key.
 .google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;
getIosKeyRestrictionsOrBuilder() 
  
    
public   IosKeyRestrictionsOrBuilder   getIosKeyRestrictionsOrBuilder ()  
   The iOS apps that are allowed to use the key.
 .google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;
getParserForType() 
  
    
public   Parser<Restrictions>   getParserForType ()  
  
  Overrides 
  
  getSerializedSize() 
  
    
public   int   getSerializedSize ()  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  getServerKeyRestrictions() 
  
    
public   ServerKeyRestrictions   getServerKeyRestrictions ()  
   The IP addresses of callers that are allowed to use the key.
 .google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;
getServerKeyRestrictionsOrBuilder() 
  
    
public   ServerKeyRestrictionsOrBuilder   getServerKeyRestrictionsOrBuilder ()  
   The IP addresses of callers that are allowed to use the key.
 .google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;
hasAndroidKeyRestrictions() 
  
    
public   boolean   hasAndroidKeyRestrictions ()  
   The Android apps that are allowed to use the key.
 .google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the androidKeyRestrictions field is set.
 
     
  
  hasBrowserKeyRestrictions() 
  
    
public   boolean   hasBrowserKeyRestrictions ()  
   The HTTP referrers (websites) that are allowed to use the key.
 .google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the browserKeyRestrictions field is set.
 
     
  
  hasIosKeyRestrictions() 
  
    
public   boolean   hasIosKeyRestrictions ()  
   The iOS apps that are allowed to use the key.
 .google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the iosKeyRestrictions field is set.
 
     
  
  hasServerKeyRestrictions() 
  
    
public   boolean   hasServerKeyRestrictions ()  
   The IP addresses of callers that are allowed to use the key.
 .google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the serverKeyRestrictions field is set.
 
     
  
  hashCode() 
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
  
  Overrides 
  
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
  
  Overrides 
  
  newBuilderForType() 
  
    
public   Restrictions . Builder   newBuilderForType ()  
  
  newBuilderForType(GeneratedMessageV3.BuilderParent parent) 
  
    
protected   Restrictions . Builder   newBuilderForType ( GeneratedMessageV3 . BuilderParent   parent )  
  
  
  Overrides 
  
  newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) 
  
    
protected   Object   newInstance ( GeneratedMessageV3 . UnusedPrivateParameter   unused )  
  
  
    
      
        Returns  
      
        Type Description  
      
        Object  
     
  
  Overrides 
  
  toBuilder() 
  
    
public   Restrictions . Builder   toBuilder ()  
  
  writeTo(CodedOutputStream output) 
  
    
public   void   writeTo ( CodedOutputStream   output )  
  
  Overrides 
  
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-10 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-10 UTC."],[],[]]