Class UsageRule (2.32.0)

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

Implements

UsageRuleOrBuilder

Static Fields

ALLOW_UNREGISTERED_CALLS_FIELD_NUMBER

public static final int ALLOW_UNREGISTERED_CALLS_FIELD_NUMBER
Field Value
TypeDescription
int

SELECTOR_FIELD_NUMBER

public static final int SELECTOR_FIELD_NUMBER
Field Value
TypeDescription
int

SKIP_SERVICE_CONTROL_FIELD_NUMBER

public static final int SKIP_SERVICE_CONTROL_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static UsageRule getDefaultInstance()
Returns
TypeDescription
UsageRule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static UsageRule.Builder newBuilder()
Returns
TypeDescription
UsageRule.Builder

newBuilder(UsageRule prototype)

public static UsageRule.Builder newBuilder(UsageRule prototype)
Parameter
NameDescription
prototypeUsageRule
Returns
TypeDescription
UsageRule.Builder

parseDelimitedFrom(InputStream input)

public static UsageRule parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static UsageRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static UsageRule parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static UsageRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static UsageRule parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static UsageRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static UsageRule parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static UsageRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static UsageRule parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static UsageRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static UsageRule parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static UsageRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<UsageRule> parser()
Returns
TypeDescription
Parser<UsageRule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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
TypeDescription
boolean

The allowUnregisteredCalls.

getDefaultInstanceForType()

public UsageRule getDefaultInstanceForType()
Returns
TypeDescription
UsageRule

getParserForType()

public Parser<UsageRule> getParserForType()
Returns
TypeDescription
Parser<UsageRule>
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
TypeDescription
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
TypeDescription
ByteString

The bytes for selector.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
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
TypeDescription
boolean

The skipServiceControl.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public UsageRule.Builder newBuilderForType()
Returns
TypeDescription
UsageRule.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected UsageRule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
UsageRule.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public UsageRule.Builder toBuilder()
Returns
TypeDescription
UsageRule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException