Class AuthenticationRule.Builder (2.40.0)

public static final class AuthenticationRule.Builder extends GeneratedMessageV3.Builder<AuthenticationRule.Builder> implements AuthenticationRuleOrBuilder

Authentication rules for the service.

By default, if a method has any authentication requirements, every request must include a valid credential matching one of the requirements. It's an error to include more than one kind of credential in a single request.

If a method doesn't have any auth requirements, request credentials will be ignored.

Protobuf type google.api.AuthenticationRule

Static Methods

getDescriptor()

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

Methods

addAllRequirements(Iterable<? extends AuthRequirement> values)

public AuthenticationRule.Builder addAllRequirements(Iterable<? extends AuthRequirement> values)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
values Iterable<? extends com.google.api.AuthRequirement>
Returns
Type Description
AuthenticationRule.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addRequirements(AuthRequirement value)

public AuthenticationRule.Builder addRequirements(AuthRequirement value)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
value AuthRequirement
Returns
Type Description
AuthenticationRule.Builder

addRequirements(AuthRequirement.Builder builderForValue)

public AuthenticationRule.Builder addRequirements(AuthRequirement.Builder builderForValue)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
builderForValue AuthRequirement.Builder
Returns
Type Description
AuthenticationRule.Builder

addRequirements(int index, AuthRequirement value)

public AuthenticationRule.Builder addRequirements(int index, AuthRequirement value)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameters
Name Description
index int
value AuthRequirement
Returns
Type Description
AuthenticationRule.Builder

addRequirements(int index, AuthRequirement.Builder builderForValue)

public AuthenticationRule.Builder addRequirements(int index, AuthRequirement.Builder builderForValue)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameters
Name Description
index int
builderForValue AuthRequirement.Builder
Returns
Type Description
AuthenticationRule.Builder

addRequirementsBuilder()

public AuthRequirement.Builder addRequirementsBuilder()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
Type Description
AuthRequirement.Builder

addRequirementsBuilder(int index)

public AuthRequirement.Builder addRequirementsBuilder(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
index int
Returns
Type Description
AuthRequirement.Builder

build()

public AuthenticationRule build()
Returns
Type Description
AuthenticationRule

buildPartial()

public AuthenticationRule buildPartial()
Returns
Type Description
AuthenticationRule

clear()

public AuthenticationRule.Builder clear()
Returns
Type Description
AuthenticationRule.Builder
Overrides

clearAllowWithoutCredential()

public AuthenticationRule.Builder clearAllowWithoutCredential()

If true, the service accepts API keys without any other credential. This flag only applies to HTTP and gRPC requests.

bool allow_without_credential = 5;

Returns
Type Description
AuthenticationRule.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOauth()

public AuthenticationRule.Builder clearOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
Type Description
AuthenticationRule.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public AuthenticationRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AuthenticationRule.Builder
Overrides

clearRequirements()

public AuthenticationRule.Builder clearRequirements()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
Type Description
AuthenticationRule.Builder

clearSelector()

public AuthenticationRule.Builder clearSelector()

Selects the methods to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Returns
Type Description
AuthenticationRule.Builder

This builder for chaining.

clone()

public AuthenticationRule.Builder clone()
Returns
Type Description
AuthenticationRule.Builder
Overrides

getAllowWithoutCredential()

public boolean getAllowWithoutCredential()

If true, the service accepts API keys without any other credential. This flag only applies to HTTP and gRPC requests.

bool allow_without_credential = 5;

Returns
Type Description
boolean

The allowWithoutCredential.

getDefaultInstanceForType()

public AuthenticationRule getDefaultInstanceForType()
Returns
Type Description
AuthenticationRule

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getOauth()

public OAuthRequirements getOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
Type Description
OAuthRequirements

The oauth.

getOauthBuilder()

public OAuthRequirements.Builder getOauthBuilder()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
Type Description
OAuthRequirements.Builder

getOauthOrBuilder()

public OAuthRequirementsOrBuilder getOauthOrBuilder()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
Type Description
OAuthRequirementsOrBuilder

getRequirements(int index)

public AuthRequirement getRequirements(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
index int
Returns
Type Description
AuthRequirement

getRequirementsBuilder(int index)

public AuthRequirement.Builder getRequirementsBuilder(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
index int
Returns
Type Description
AuthRequirement.Builder

getRequirementsBuilderList()

public List<AuthRequirement.Builder> getRequirementsBuilderList()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
Type Description
List<Builder>

getRequirementsCount()

public int getRequirementsCount()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
Type Description
int

getRequirementsList()

public List<AuthRequirement> getRequirementsList()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
Type Description
List<AuthRequirement>

getRequirementsOrBuilder(int index)

public AuthRequirementOrBuilder getRequirementsOrBuilder(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
index int
Returns
Type Description
AuthRequirementOrBuilder

getRequirementsOrBuilderList()

public List<? extends AuthRequirementOrBuilder> getRequirementsOrBuilderList()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
Type Description
List<? extends com.google.api.AuthRequirementOrBuilder>

getSelector()

public String getSelector()

Selects the methods to which this rule applies.

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.

Refer to selector for syntax details.

string selector = 1;

Returns
Type Description
ByteString

The bytes for selector.

hasOauth()

public boolean hasOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
Type Description
boolean

Whether the oauth field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AuthenticationRule other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeOauth(OAuthRequirements value)

public AuthenticationRule.Builder mergeOauth(OAuthRequirements value)

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Parameter
Name Description
value OAuthRequirements
Returns
Type Description
AuthenticationRule.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AuthenticationRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AuthenticationRule.Builder
Overrides

removeRequirements(int index)

public AuthenticationRule.Builder removeRequirements(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
Name Description
index int
Returns
Type Description
AuthenticationRule.Builder

setAllowWithoutCredential(boolean value)

public AuthenticationRule.Builder setAllowWithoutCredential(boolean value)

If true, the service accepts API keys without any other credential. This flag only applies to HTTP and gRPC requests.

bool allow_without_credential = 5;

Parameter
Name Description
value boolean

The allowWithoutCredential to set.

Returns
Type Description
AuthenticationRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setOauth(OAuthRequirements value)

public AuthenticationRule.Builder setOauth(OAuthRequirements value)

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Parameter
Name Description
value OAuthRequirements
Returns
Type Description
AuthenticationRule.Builder

setOauth(OAuthRequirements.Builder builderForValue)

public AuthenticationRule.Builder setOauth(OAuthRequirements.Builder builderForValue)

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Parameter
Name Description
builderForValue OAuthRequirements.Builder
Returns
Type Description
AuthenticationRule.Builder

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

public AuthenticationRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AuthenticationRule.Builder
Overrides

setRequirements(int index, AuthRequirement value)

public AuthenticationRule.Builder setRequirements(int index, AuthRequirement value)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameters
Name Description
index int
value AuthRequirement
Returns
Type Description
AuthenticationRule.Builder

setRequirements(int index, AuthRequirement.Builder builderForValue)

public AuthenticationRule.Builder setRequirements(int index, AuthRequirement.Builder builderForValue)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameters
Name Description
index int
builderForValue AuthRequirement.Builder
Returns
Type Description
AuthenticationRule.Builder

setSelector(String value)

public AuthenticationRule.Builder setSelector(String value)

Selects the methods to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Parameter
Name Description
value String

The selector to set.

Returns
Type Description
AuthenticationRule.Builder

This builder for chaining.

setSelectorBytes(ByteString value)

public AuthenticationRule.Builder setSelectorBytes(ByteString value)

Selects the methods to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Parameter
Name Description
value ByteString

The bytes for selector to set.

Returns
Type Description
AuthenticationRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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