public static final class UsageRule.Builder extends GeneratedMessageV3.Builder<UsageRule.Builder> 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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public UsageRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
buildPartial()
public UsageRule buildPartial()
clear()
public UsageRule.Builder clear()
Overrides
clearAllowUnregisteredCalls()
public UsageRule.Builder clearAllowUnregisteredCalls()
If true, the selected method allows unregistered calls, e.g. calls
that don't identify any user or application.
bool allow_unregistered_calls = 2;
clearField(Descriptors.FieldDescriptor field)
public UsageRule.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public UsageRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearSelector()
public UsageRule.Builder clearSelector()
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;
clearSkipServiceControl()
public UsageRule.Builder clearSkipServiceControl()
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;
clone()
public UsageRule.Builder clone()
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()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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 |
---|
Type | Description |
ByteString | The bytes for selector.
|
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.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(UsageRule other)
public UsageRule.Builder mergeFrom(UsageRule other)
public UsageRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public UsageRule.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final UsageRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
setAllowUnregisteredCalls(boolean value)
public UsageRule.Builder setAllowUnregisteredCalls(boolean value)
If true, the selected method allows unregistered calls, e.g. calls
that don't identify any user or application.
bool allow_unregistered_calls = 2;
Parameter |
---|
Name | Description |
value | boolean
The allowUnregisteredCalls to set.
|
setField(Descriptors.FieldDescriptor field, Object value)
public UsageRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public UsageRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setSelector(String value)
public UsageRule.Builder setSelector(String value)
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;
Parameter |
---|
Name | Description |
value | String
The selector to set.
|
setSelectorBytes(ByteString value)
public UsageRule.Builder setSelectorBytes(ByteString value)
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;
Parameter |
---|
Name | Description |
value | ByteString
The bytes for selector to set.
|
setSkipServiceControl(boolean value)
public UsageRule.Builder setSkipServiceControl(boolean value)
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;
Parameter |
---|
Name | Description |
value | boolean
The skipServiceControl to set.
|
setUnknownFields(UnknownFieldSet unknownFields)
public final UsageRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides