Class AuthenticationRule (2.33.0)

public final class AuthenticationRule extends GeneratedMessageV3 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 Fields

ALLOW_WITHOUT_CREDENTIAL_FIELD_NUMBER

public static final int ALLOW_WITHOUT_CREDENTIAL_FIELD_NUMBER
Field Value
TypeDescription
int

OAUTH_FIELD_NUMBER

public static final int OAUTH_FIELD_NUMBER
Field Value
TypeDescription
int

REQUIREMENTS_FIELD_NUMBER

public static final int REQUIREMENTS_FIELD_NUMBER
Field Value
TypeDescription
int

SELECTOR_FIELD_NUMBER

public static final int SELECTOR_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static AuthenticationRule getDefaultInstance()
Returns
TypeDescription
AuthenticationRule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static AuthenticationRule.Builder newBuilder()
Returns
TypeDescription
AuthenticationRule.Builder

newBuilder(AuthenticationRule prototype)

public static AuthenticationRule.Builder newBuilder(AuthenticationRule prototype)
Parameter
NameDescription
prototypeAuthenticationRule
Returns
TypeDescription
AuthenticationRule.Builder

parseDelimitedFrom(InputStream input)

public static AuthenticationRule parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AuthenticationRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static AuthenticationRule parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static AuthenticationRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static AuthenticationRule parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static AuthenticationRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static AuthenticationRule parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static AuthenticationRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static AuthenticationRule parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AuthenticationRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static AuthenticationRule parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static AuthenticationRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuthenticationRule
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<AuthenticationRule> parser()
Returns
TypeDescription
Parser<AuthenticationRule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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

getOauth()

public OAuthRequirements getOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
OAuthRequirements

The oauth.

getOauthOrBuilder()

public OAuthRequirementsOrBuilder getOauthOrBuilder()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
OAuthRequirementsOrBuilder

getParserForType()

public Parser<AuthenticationRule> getParserForType()
Returns
TypeDescription
Parser<AuthenticationRule>
Overrides

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

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.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hasOauth()

public boolean hasOauth()

The requirements for OAuth credentials.

.google.api.OAuthRequirements oauth = 2;

Returns
TypeDescription
boolean

Whether the oauth field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public AuthenticationRule.Builder newBuilderForType()
Returns
TypeDescription
AuthenticationRule.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected AuthenticationRule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
AuthenticationRule.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public AuthenticationRule.Builder toBuilder()
Returns
TypeDescription
AuthenticationRule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException