Class AuthenticationRule.Builder (2.25.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.api.AuthRequirement>
Returns
TypeDescription
AuthenticationRule.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addRequirements(AuthRequirement value)

public AuthenticationRule.Builder addRequirements(AuthRequirement value)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
NameDescription
valueAuthRequirement
Returns
TypeDescription
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
NameDescription
builderForValueAuthRequirement.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueAuthRequirement
Returns
TypeDescription
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
NameDescription
indexint
builderForValueAuthRequirement.Builder
Returns
TypeDescription
AuthenticationRule.Builder

addRequirementsBuilder()

public AuthRequirement.Builder addRequirementsBuilder()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
TypeDescription
AuthRequirement.Builder

addRequirementsBuilder(int index)

public AuthRequirement.Builder addRequirementsBuilder(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuthRequirement.Builder

build()

public AuthenticationRule build()
Returns
TypeDescription
AuthenticationRule

buildPartial()

public AuthenticationRule buildPartial()
Returns
TypeDescription
AuthenticationRule

clear()

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

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOauth()

public AuthenticationRule.Builder clearOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
AuthenticationRule.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public AuthenticationRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
AuthenticationRule.Builder
Overrides

clearRequirements()

public AuthenticationRule.Builder clearRequirements()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
TypeDescription
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
TypeDescription
AuthenticationRule.Builder

This builder for chaining.

clone()

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

The allowWithoutCredential.

getDefaultInstanceForType()

public AuthenticationRule getDefaultInstanceForType()
Returns
TypeDescription
AuthenticationRule

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getOauth()

public OAuthRequirements getOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
OAuthRequirements

The oauth.

getOauthBuilder()

public OAuthRequirements.Builder getOauthBuilder()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
OAuthRequirements.Builder

getOauthOrBuilder()

public OAuthRequirementsOrBuilder getOauthOrBuilder()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
OAuthRequirementsOrBuilder

getRequirements(int index)

public AuthRequirement getRequirements(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuthRequirement

getRequirementsBuilder(int index)

public AuthRequirement.Builder getRequirementsBuilder(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuthRequirement.Builder

getRequirementsBuilderList()

public List<AuthRequirement.Builder> getRequirementsBuilderList()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
TypeDescription
List<Builder>

getRequirementsCount()

public int getRequirementsCount()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
TypeDescription
int

getRequirementsList()

public List<AuthRequirement> getRequirementsList()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
TypeDescription
List<AuthRequirement>

getRequirementsOrBuilder(int index)

public AuthRequirementOrBuilder getRequirementsOrBuilder(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuthRequirementOrBuilder

getRequirementsOrBuilderList()

public List<? extends AuthRequirementOrBuilder> getRequirementsOrBuilderList()

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for selector.

hasOauth()

public boolean hasOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
boolean

Whether the oauth field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(AuthenticationRule other)

public AuthenticationRule.Builder mergeFrom(AuthenticationRule other)
Parameter
NameDescription
otherAuthenticationRule
Returns
TypeDescription
AuthenticationRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeOauth(OAuthRequirements value)

public AuthenticationRule.Builder mergeOauth(OAuthRequirements value)

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Parameter
NameDescription
valueOAuthRequirements
Returns
TypeDescription
AuthenticationRule.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AuthenticationRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AuthenticationRule.Builder
Overrides

removeRequirements(int index)

public AuthenticationRule.Builder removeRequirements(int index)

Requirements for additional authentication providers.

repeated .google.api.AuthRequirement requirements = 7;

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

The allowWithoutCredential to set.

Returns
TypeDescription
AuthenticationRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setOauth(OAuthRequirements value)

public AuthenticationRule.Builder setOauth(OAuthRequirements value)

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Parameter
NameDescription
valueOAuthRequirements
Returns
TypeDescription
AuthenticationRule.Builder

setOauth(OAuthRequirements.Builder builderForValue)

public AuthenticationRule.Builder setOauth(OAuthRequirements.Builder builderForValue)

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Parameter
NameDescription
builderForValueOAuthRequirements.Builder
Returns
TypeDescription
AuthenticationRule.Builder

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

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

The selector to set.

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

The bytes for selector to set.

Returns
TypeDescription
AuthenticationRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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