|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.paypal.base.BaseAPIContext
com.paypal.base.rest.APIContext
public class APIContext
APIContext wraps wire-level parameters for the API call.
AccessToken, which is essentially an OAuth token, is treated as a mandatory
parameter for (PayPal REST APIs). RequestId is generated if not supplied for
marking Idempotency of the API call. OAuth token can be generated using
OAuthTokenCredential. The Application Header property may be used by
clients to access application level headers. The clients are responsible to
cast the Application Header property to appropriate type.
| Constructor Summary | |
|---|---|
APIContext()
Default Constructor |
|
APIContext(String accessToken)
APIContext, requestId is auto generated, calling setMaskRequestId(true) will override the requestId getter to return null |
|
APIContext(String accessToken,
String requestId)
APIContext |
|
| Method Summary | |
|---|---|
String |
getAccessToken()
Returns the Access Token |
Map<String,String> |
getHeadersMap()
Deprecated. Use getHTTPHeaders() instead |
String |
getRequestId()
Returns the unique requestId set during creation, if not available and if maskRequestId is set to false returns a generated one, else returns null. |
SDKVersion |
getSdkVersion()
|
void |
setHeadersMap(Map<String,String> headersMap)
Deprecated. |
void |
setMaskRequestId(boolean maskRequestId)
|
void |
setSdkVersion(SDKVersion sdkVersion)
|
| Methods inherited from class com.paypal.base.BaseAPIContext |
|---|
getConfigurationMap, getHTTPHeaders, getSOAPHeader, setConfigurationMap, setHTTPHeaders, setSOAPHeader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public APIContext()
public APIContext(String accessToken)
accessToken - OAuthToken required for the call. OAuth token used by the REST
API service. The token should be of the form 'Bearer xxxx..'.
See OAuthTokenCredential to generate OAuthToken
public APIContext(String accessToken,
String requestId)
accessToken - OAuthToken required for the call. OAuth token used by the REST
API service. The token should be of the form 'Bearer xxxx..'.
See OAuthTokenCredential to generate OAuthTokenrequestId - Unique requestId required for the call. Idempotency id,
Calling setMaskRequestId(true) will override the requestId
getter to return null, which can be used by the client (null
check) to forcibly not sent requestId in the API call.| Method Detail |
|---|
public String getAccessToken()
public String getRequestId()
public void setMaskRequestId(boolean maskRequestId)
maskRequestId - the maskRequestId to setpublic SDKVersion getSdkVersion()
public void setSdkVersion(SDKVersion sdkVersion)
sdkVersion - the sdkVersion to setpublic Map<String,String> getHeadersMap()
public void setHeadersMap(Map<String,String> headersMap)
headersMap - the headersMap to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||