Class OAuthRequirements.Builder (2.39.1)

public static final class OAuthRequirements.Builder extends GeneratedMessageV3.Builder<OAuthRequirements.Builder> 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 Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public OAuthRequirements build()
Returns
Type Description
OAuthRequirements

buildPartial()

public OAuthRequirements buildPartial()
Returns
Type Description
OAuthRequirements

clear()

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

clearCanonicalScopes()

public OAuthRequirements.Builder clearCanonicalScopes()

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
OAuthRequirements.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public OAuthRequirements.Builder clone()
Returns
Type Description
OAuthRequirements.Builder
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

getDescriptorForType()

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

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(OAuthRequirements other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setCanonicalScopes(String value)

public OAuthRequirements.Builder setCanonicalScopes(String value)

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;

Parameter
Name Description
value String

The canonicalScopes to set.

Returns
Type Description
OAuthRequirements.Builder

This builder for chaining.

setCanonicalScopesBytes(ByteString value)

public OAuthRequirements.Builder setCanonicalScopesBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for canonicalScopes to set.

Returns
Type Description
OAuthRequirements.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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