Send feedback
Class OAuthRequirements.Builder (2.33.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.33.0 keyboard_arrow_down
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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public OAuthRequirements . Builder addRepeatedField ( Descriptors . FieldDescriptor field , Object value )
Overrides
build()
public OAuthRequirements build ()
buildPartial()
public OAuthRequirements buildPartial ()
clear()
public OAuthRequirements . Builder clear ()
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;
clearField(Descriptors.FieldDescriptor field)
public OAuthRequirements . Builder clearField ( Descriptors . FieldDescriptor field )
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public OAuthRequirements . Builder clearOneof ( Descriptors . OneofDescriptor oneof )
Overrides
clone()
public OAuthRequirements . Builder clone ()
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 ()
getDescriptorForType()
public Descriptors . Descriptor getDescriptorForType ()
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
mergeFrom(OAuthRequirements other)
public OAuthRequirements . Builder mergeFrom ( OAuthRequirements other )
public OAuthRequirements . Builder mergeFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Overrides
mergeFrom(Message other)
public OAuthRequirements . Builder mergeFrom ( Message other )
Parameter Name Description other
Message
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final OAuthRequirements . Builder mergeUnknownFields ( UnknownFieldSet unknownFields )
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.
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.
setField(Descriptors.FieldDescriptor field, Object value)
public OAuthRequirements . Builder setField ( Descriptors . FieldDescriptor field , Object value )
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public OAuthRequirements . Builder setRepeatedField ( Descriptors . FieldDescriptor field , int index , Object value )
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final OAuthRequirements . Builder setUnknownFields ( UnknownFieldSet unknownFields )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-27 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-27 UTC."],[],[]]