Class UsageRule.Builder

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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public UsageRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
UsageRule.Builder
Overrides

build()

public UsageRule build()
Returns
TypeDescription
UsageRule

buildPartial()

public UsageRule buildPartial()
Returns
TypeDescription
UsageRule

clear()

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

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public UsageRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
UsageRule.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public UsageRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
UsageRule.Builder

This builder for chaining.

clone()

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

The allowUnregisteredCalls.

getDefaultInstanceForType()

public UsageRule getDefaultInstanceForType()
Returns
TypeDescription
UsageRule

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
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.

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.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(UsageRule other)

public UsageRule.Builder mergeFrom(UsageRule other)
Parameter
NameDescription
otherUsageRule
Returns
TypeDescription
UsageRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public UsageRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UsageRule.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public UsageRule.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
UsageRule.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final UsageRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueboolean

The allowUnregisteredCalls to set.

Returns
TypeDescription
UsageRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public UsageRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
UsageRule.Builder
Overrides

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

public UsageRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The selector to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for selector to set.

Returns
TypeDescription
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
NameDescription
valueboolean

The skipServiceControl to set.

Returns
TypeDescription
UsageRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final UsageRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
UsageRule.Builder
Overrides