Class OAuthRequirements (2.42.0)

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
Type Description
int

Static Methods

getDefaultInstance()

public static OAuthRequirements getDefaultInstance()
Returns
Type Description
OAuthRequirements

getDescriptor()

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

newBuilder()

public static OAuthRequirements.Builder newBuilder()
Returns
Type Description
OAuthRequirements.Builder

newBuilder(OAuthRequirements prototype)

public static OAuthRequirements.Builder newBuilder(OAuthRequirements prototype)
Parameter
Name Description
prototype OAuthRequirements
Returns
Type Description
OAuthRequirements.Builder

parseDelimitedFrom(InputStream input)

public static OAuthRequirements parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OAuthRequirements parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static OAuthRequirements parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static OAuthRequirements parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static OAuthRequirements parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static OAuthRequirements parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static OAuthRequirements parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static OAuthRequirements parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static OAuthRequirements parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OAuthRequirements parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static OAuthRequirements parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static OAuthRequirements parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthRequirements
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<OAuthRequirements> parser()
Returns
Type Description
Parser<OAuthRequirements>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for canonicalScopes.

getDefaultInstanceForType()

public OAuthRequirements getDefaultInstanceForType()
Returns
Type Description
OAuthRequirements

getParserForType()

public Parser<OAuthRequirements> getParserForType()
Returns
Type Description
Parser<OAuthRequirements>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public OAuthRequirements.Builder newBuilderForType()
Returns
Type Description
OAuthRequirements.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected OAuthRequirements.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
OAuthRequirements.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public OAuthRequirements.Builder toBuilder()
Returns
Type Description
OAuthRequirements.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException