Class OAuthRequirements (2.37.1)

public final class OAuthRequirements extends GeneratedMessageV3 implements OAuthRequirementsOrBuilder

OAuth scopes are a way to define data and permissions on data. For example, there are scopes defined for "Read-only access to Google Calendar" and "Access to Cloud Platform". Users can consent to a scope for an application, giving it permission to access that data on their behalf.

OAuth scope specifications should be fairly coarse grained; a user will need to see and understand the text description of what your scope means.

In most cases: use one or at most two OAuth scopes for an entire family of products. If your product has multiple APIs, you should probably be sharing the OAuth scope across all of those APIs.

When you need finer grained OAuth consent screens: talk with your product management about how developers will use them in practice.

Please note that even though each of the canonical scopes is enough for a request to be accepted and passed to the backend, a request can still fail due to the backend requiring additional scopes or permissions.

Protobuf type google.api.OAuthRequirements

Static Fields

CANONICAL_SCOPES_FIELD_NUMBER

public static final int CANONICAL_SCOPES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static OAuthRequirements getDefaultInstance()
Returns
TypeDescription
OAuthRequirements

getDescriptor()

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

newBuilder()

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

newBuilder(OAuthRequirements prototype)

public static OAuthRequirements.Builder newBuilder(OAuthRequirements prototype)
Parameter
NameDescription
prototypeOAuthRequirements
Returns
TypeDescription
OAuthRequirements.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCanonicalScopes()

public String getCanonicalScopes()

The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted.

Example:

  canonical_scopes: https://www.googleapis.com/auth/calendar,
                    https://www.googleapis.com/auth/calendar.read

string canonical_scopes = 1;

Returns
TypeDescription
String

The canonicalScopes.

getCanonicalScopesBytes()

public ByteString getCanonicalScopesBytes()

The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted.

Example:

  canonical_scopes: https://www.googleapis.com/auth/calendar,
                    https://www.googleapis.com/auth/calendar.read

string canonical_scopes = 1;

Returns
TypeDescription
ByteString

The bytes for canonicalScopes.

getDefaultInstanceForType()

public OAuthRequirements getDefaultInstanceForType()
Returns
TypeDescription
OAuthRequirements

getParserForType()

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

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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 OAuthRequirements.Builder newBuilderForType()
Returns
TypeDescription
OAuthRequirements.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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