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
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public UsageRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
Returns
buildPartial()
public UsageRule buildPartial()
Returns
clear()
public UsageRule.Builder clear()
Returns
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;
Returns
clearField(Descriptors.FieldDescriptor field)
public UsageRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public UsageRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
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;
Returns
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;
Returns
clone()
public UsageRule.Builder clone()
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
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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
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()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(UsageRule other)
public UsageRule.Builder mergeFrom(UsageRule other)
Parameter
Returns
public UsageRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public UsageRule.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final UsageRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
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.
|
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public UsageRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public UsageRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
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.
|
Returns
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.
|
Returns
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.
|
Returns
setUnknownFields(UnknownFieldSet unknownFields)
public final UsageRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides