public class HubSpotClientUtils extends Object
Constructor and Description |
---|
HubSpotClientUtils() |
Modifier and Type | Method and Description |
---|---|
static OAuthCredentials |
authenticateResponse(String inputRequest) |
static String |
transformObjectToJson(Object o) |
static <T> T |
webResourceGet(Class<T> type,
com.sun.jersey.api.client.WebResource wr,
String userId,
HubSpotWebResourceMethods method)
Method used to eliminate boilerplate handling exceptions when calling get(String.class) from a WebResource
|
static <T> T |
webResourceGet(Class<T> type,
com.sun.jersey.api.client.WebResource wr,
String userId,
HubSpotWebResourceMethods method,
String requestBody) |
static String |
webResourceGet(com.sun.jersey.api.client.WebResource wr,
String userId,
HubSpotWebResourceMethods method) |
static String |
webResourceGet(com.sun.jersey.api.client.WebResource wr,
String userId,
HubSpotWebResourceMethods method,
String requestBody) |
public static String transformObjectToJson(Object o) throws HubSpotConnectorException
HubSpotConnectorException
public static String webResourceGet(com.sun.jersey.api.client.WebResource wr, String userId, HubSpotWebResourceMethods method) throws HubSpotConnectorAccessTokenExpiredException, HubSpotConnectorException
public static String webResourceGet(com.sun.jersey.api.client.WebResource wr, String userId, HubSpotWebResourceMethods method, String requestBody) throws HubSpotConnectorAccessTokenExpiredException, HubSpotConnectorException
public static <T> T webResourceGet(Class<T> type, com.sun.jersey.api.client.WebResource wr, String userId, HubSpotWebResourceMethods method) throws HubSpotConnectorAccessTokenExpiredException, HubSpotConnectorException
wr
- The WebResource to call getuserId
- The userId from the session usedHubSpotConnectorAccessTokenExpiredException
- If the service responded with a 401 means that the session has expiredHubSpotConnectorException
- If is not a 401 it will throw this exceptionpublic static <T> T webResourceGet(Class<T> type, com.sun.jersey.api.client.WebResource wr, String userId, HubSpotWebResourceMethods method, String requestBody) throws HubSpotConnectorAccessTokenExpiredException, HubSpotConnectorException
public static OAuthCredentials authenticateResponse(String inputRequest) throws HubSpotConnectorException, HubSpotConnectorNoAccessTokenException
Copyright © 2010–2016. All rights reserved.