Google OAuth2 API v2 (revision 38)



com.google.api.services.oauth2
Class Oauth2Request<T>

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.googleapis.services.AbstractGoogleClientRequest<T>
              extended by com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest<T>
                  extended by com.google.api.services.oauth2.Oauth2Request<T>
All Implemented Interfaces:
Cloneable, Map<String,Object>
Direct Known Subclasses:
Oauth2.Tokeninfo, Oauth2.Userinfo.Get, Oauth2.Userinfo.V2.Me.Get

public abstract class Oauth2Request<T>
extends AbstractGoogleJsonClientRequest<T>

Oauth2 request.

Upgrade warning: this class now extends AbstractGoogleJsonClientRequest, whereas in prior version 1.8 it extended JsonHttpRequest.

Since:
1.3

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
Oauth2Request(Oauth2 client, String method, String uriTemplate, Object content, Class<T> responseClass)
           
 
Method Summary
 Oauth2 getAbstractGoogleClient()
           
 String getAlt()
          Data format for the response.
 String getFields()
          Selector specifying which fields to include in a partial response.
 String getKey()
          API key.
 String getOauthToken()
          OAuth 2.0 token for the current user.
 Boolean getPrettyPrint()
          Returns response with indentations and line breaks.
 String getQuotaUser()
          Available to use for quota purposes for server-side applications.
 String getUserIp()
          IP address of the site where the request originates.
 Oauth2Request<T> setAlt(String alt)
          Data format for the response.
 Oauth2Request<T> setDisableGZipContent(boolean disableGZipContent)
           
 Oauth2Request<T> setFields(String fields)
          Selector specifying which fields to include in a partial response.
 Oauth2Request<T> setKey(String key)
          API key.
 Oauth2Request<T> setOauthToken(String oauthToken)
          OAuth 2.0 token for the current user.
 Oauth2Request<T> setPrettyPrint(Boolean prettyPrint)
          Returns response with indentations and line breaks.
 Oauth2Request<T> setQuotaUser(String quotaUser)
          Available to use for quota purposes for server-side applications.
 Oauth2Request<T> setRequestHeaders(HttpHeaders headers)
           
 Oauth2Request<T> setUserIp(String userIp)
          IP address of the site where the request originates.
 
Methods inherited from class com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest
getJsonContent, newExceptionOnError, queue
 
Methods inherited from class com.google.api.client.googleapis.services.AbstractGoogleClientRequest
buildHttpRequest, buildHttpRequestUrl, buildHttpRequestUsingHead, execute, executeAndDownloadTo, executeAsInputStream, executeMedia, executeMediaAndDownloadTo, executeMediaAsInputStream, executeUnparsed, executeUsingHead, getDisableGZipContent, getHttpContent, getLastResponseHeaders, getLastStatusCode, getLastStatusMessage, getMediaHttpDownloader, getMediaHttpUploader, getRequestHeaders, getRequestMethod, getResponseClass, getUriTemplate, initializeMediaDownload, initializeMediaUpload, queue
 
Methods inherited from class com.google.api.client.util.GenericData
clone, entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Oauth2Request

public Oauth2Request(Oauth2 client,
                     String method,
                     String uriTemplate,
                     Object content,
                     Class<T> responseClass)
Parameters:
client - Google client
method - HTTP Method
uriTemplate - URI template for the path relative to the base URL. If it starts with a "/" the base path from the base URL will be stripped out. The URI template can also be a full URL. URI template expansion is done using UriTemplate.expand(String, String, Object, boolean)
content - A POJO that can be serialized into JSON or null for none
responseClass - response class to parse into
Method Detail

getAlt

public String getAlt()
Data format for the response. [default: json]


setAlt

public Oauth2Request<T> setAlt(String alt)
Data format for the response.


getFields

public String getFields()
Selector specifying which fields to include in a partial response.


setFields

public Oauth2Request<T> setFields(String fields)
Selector specifying which fields to include in a partial response.


getKey

public String getKey()
API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.


setKey

public Oauth2Request<T> setKey(String key)
API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.


getOauthToken

public String getOauthToken()
OAuth 2.0 token for the current user.


setOauthToken

public Oauth2Request<T> setOauthToken(String oauthToken)
OAuth 2.0 token for the current user.


getPrettyPrint

public Boolean getPrettyPrint()
Returns response with indentations and line breaks. [default: true]


setPrettyPrint

public Oauth2Request<T> setPrettyPrint(Boolean prettyPrint)
Returns response with indentations and line breaks.


getQuotaUser

public String getQuotaUser()
Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.


setQuotaUser

public Oauth2Request<T> setQuotaUser(String quotaUser)
Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.


getUserIp

public String getUserIp()
IP address of the site where the request originates. Use this if you want to enforce per-user limits.


setUserIp

public Oauth2Request<T> setUserIp(String userIp)
IP address of the site where the request originates. Use this if you want to enforce per-user limits.


getAbstractGoogleClient

public final Oauth2 getAbstractGoogleClient()
Overrides:
getAbstractGoogleClient in class AbstractGoogleJsonClientRequest<T>

setDisableGZipContent

public Oauth2Request<T> setDisableGZipContent(boolean disableGZipContent)
Overrides:
setDisableGZipContent in class AbstractGoogleJsonClientRequest<T>

setRequestHeaders

public Oauth2Request<T> setRequestHeaders(HttpHeaders headers)
Overrides:
setRequestHeaders in class AbstractGoogleJsonClientRequest<T>