Send feedback
Class UsageRule (2.12.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.12.0 keyboard_arrow_down
public final class UsageRule extends GeneratedMessageV3 implements UsageRuleOrBuilder
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:
selector: "google.example.library.v1.LibraryService.CreateBook"
allow_unregistered_calls: true
Protobuf type google.api.UsageRule
Static Fields
ALLOW_UNREGISTERED_CALLS_FIELD_NUMBER
public static final int ALLOW_UNREGISTERED_CALLS_FIELD_NUMBER
Field Value
SELECTOR_FIELD_NUMBER
public static final int SELECTOR_FIELD_NUMBER
Field Value
SKIP_SERVICE_CONTROL_FIELD_NUMBER
public static final int SKIP_SERVICE_CONTROL_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static UsageRule getDefaultInstance ()
Returns
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Returns
newBuilder()
public static UsageRule . Builder newBuilder ()
Returns
newBuilder(UsageRule prototype)
public static UsageRule . Builder newBuilder ( UsageRule prototype )
Parameter
Returns
public static UsageRule parseDelimitedFrom ( InputStream input )
Parameter
Returns
Exceptions
public static UsageRule parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static UsageRule parseFrom ( byte [] data )
Parameter
Name Description data byte []
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static UsageRule parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static UsageRule parseFrom ( ByteString data )
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static UsageRule parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
public static UsageRule parseFrom ( CodedInputStream input )
Parameter
Returns
Exceptions
public static UsageRule parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
public static UsageRule parseFrom ( InputStream input )
Parameter
Returns
Exceptions
public static UsageRule parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static UsageRule parseFrom ( ByteBuffer data )
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static UsageRule parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parser()
public static Parser<UsageRule> parser ()
Returns
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Returns
Overrides
getAllowUnregisteredCalls()
public boolean getAllowUnregisteredCalls ()
If true, the selected method allows unregistered calls, e.g. calls
that don't identify any user or application.
bool allow_unregistered_calls = 2;
Returns
Type Description boolean The allowUnregisteredCalls.
getDefaultInstanceForType()
public UsageRule getDefaultInstanceForType ()
Returns
getParserForType()
public Parser<UsageRule> getParserForType ()
Returns
Overrides
getSelector()
public String getSelector ()
Selects the methods to which this rule applies. Use '*' to indicate all
methods in all APIs.
Refer to selector for syntax details.
string selector = 1;
Returns
Type Description String The selector.
getSelectorBytes()
public ByteString getSelectorBytes ()
Selects the methods to which this rule applies. Use '*' to indicate all
methods in all APIs.
Refer to selector for syntax details.
string selector = 1;
Returns
getSerializedSize()
public int getSerializedSize ()
Returns
Overrides
getSkipServiceControl()
public boolean getSkipServiceControl ()
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.
bool skip_service_control = 3;
Returns
Type Description boolean The skipServiceControl.
getUnknownFields()
public final UnknownFieldSet getUnknownFields ()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Returns
Overrides
isInitialized()
public final boolean isInitialized ()
Returns
Overrides
newBuilderForType()
public UsageRule . Builder newBuilderForType ()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected UsageRule . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Parameter
Returns
Overrides
toBuilder()
public UsageRule . Builder toBuilder ()
Returns
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Parameter
Overrides
Exceptions
Send feedback
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-02-04 UTC.
Need to tell us more?
[[["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-02-04 UTC."],[],[]]