Class UsageRule.Builder (2.44.0)

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

Implements

UsageRuleOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public UsageRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
UsageRule.Builder
Overrides

build()

public UsageRule build()
Returns
Type Description
UsageRule

buildPartial()

public UsageRule buildPartial()
Returns
Type Description
UsageRule

clear()

public UsageRule.Builder clear()
Returns
Type Description
UsageRule.Builder
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
Type Description
UsageRule.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public UsageRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
UsageRule.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public UsageRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
UsageRule.Builder
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
Type Description
UsageRule.Builder

This builder for chaining.

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
Type Description
UsageRule.Builder

This builder for chaining.

clone()

public UsageRule.Builder clone()
Returns
Type Description
UsageRule.Builder
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
Type Description
UsageRule

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
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()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(UsageRule other)

public UsageRule.Builder mergeFrom(UsageRule other)
Parameter
Name Description
other UsageRule
Returns
Type Description
UsageRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public UsageRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
UsageRule.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public UsageRule.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
UsageRule.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final UsageRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
UsageRule.Builder
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
Type Description
UsageRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public UsageRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
UsageRule.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public UsageRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
UsageRule.Builder
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
Type Description
UsageRule.Builder

This builder for chaining.

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
Type Description
UsageRule.Builder

This builder for chaining.

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
Type Description
UsageRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final UsageRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
UsageRule.Builder
Overrides