public class

HubSpotClientUtils

extends Object
java.lang.Object
   ↳ org.mule.module.hubspot.client.HubSpotClientUtils

Summary

Fields
private static final Pattern PATTERN_ACCESS_TOKEN
private static final Pattern PATTERN_ERROR
private static final Pattern PATTERN_EXPIRES_AT
private static final Pattern PATTERN_REFRESH_TOKEN
private static final Pattern PATTERN_USERID
private static final ObjectMapper jacksonMapper
private static final Log logger
Public Constructors
HubSpotClientUtils()
Public Methods
static OAuthCredentials authenticateResponse(String inputRequest)
static String transformObjectToJson(Object o)
static <T> T webResourceGet(Class<T> type, WebResource wr, String userId, HubSpotWebResourceMethods method, String requestBody)
static String webResourceGet(WebResource wr, String userId, HubSpotWebResourceMethods method)
static <T> T webResourceGet(Class<T> type, WebResource wr, String userId, HubSpotWebResourceMethods method)
Method used to eliminate boilerplate handling exceptions when calling get(String.class) from a WebResource
static String webResourceGet(WebResource wr, String userId, HubSpotWebResourceMethods method, String requestBody)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private static final Pattern PATTERN_ACCESS_TOKEN

private static final Pattern PATTERN_ERROR

private static final Pattern PATTERN_EXPIRES_AT

private static final Pattern PATTERN_REFRESH_TOKEN

private static final Pattern PATTERN_USERID

private static final ObjectMapper jacksonMapper

private static final Log logger

Public Constructors

public HubSpotClientUtils ()

Public Methods

public static OAuthCredentials authenticateResponse (String inputRequest)

public static String transformObjectToJson (Object o)

Parameters
o

public static T webResourceGet (Class<T> type, WebResource wr, String userId, HubSpotWebResourceMethods method, String requestBody)

Parameters
type
wr
userId
method
requestBody

public static String webResourceGet (WebResource wr, String userId, HubSpotWebResourceMethods method)

public static T webResourceGet (Class<T> type, WebResource wr, String userId, HubSpotWebResourceMethods method)

Method used to eliminate boilerplate handling exceptions when calling get(String.class) from a WebResource

Parameters
type
wr The WebResource to call get
userId The userId from the session used
method
Returns
  • The response of the service in String format
Throws
HubSpotConnectorAccessTokenExpiredException If the service responded with a 401 means that the session has expired
HubSpotConnectorException If is not a 401 it will throw this exception

public static String webResourceGet (WebResource wr, String userId, HubSpotWebResourceMethods method, String requestBody)

Parameters
wr
userId
method
requestBody