public abstract class GmailClient extends Object implements IBaseGmailClient
Base class for Gmail client
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
String |
getAccessToken()
Gets or sets OAuth 2.0 access token
In case if refresh token is set, access token is generated automatically.
|
String |
getDefaultEmail()
Gets or sets default email address
|
static int |
getDefaultTimeout()
Gets or sets the default timeout value for ActiveSync client instances
The default value is 100,000 milliseconds (100 seconds).
|
static IGmailClient |
getInstance(String accessToken,
com.aspose.ms.System.Net.IWebProxy proxy,
String defaultEmail)
Gets instance of Gmail client
|
static IGmailClient |
getInstance(String accessToken,
String defaultEmail)
Gets instance of Gmail client
|
static IGmailClient |
getInstance(String clientId,
String clientSecret,
String refreshToken,
com.aspose.ms.System.Net.IWebProxy proxy,
String defaultEmail)
Gets instance of Gmail client
|
static IGmailClient |
getInstance(String clientId,
String clientSecret,
String refreshToken,
String defaultEmail)
Gets instance of Gmail client
|
com.aspose.ms.System.Net.IWebProxy |
getProxy()
Gets or sets the proxy.
|
int |
getTimeout()
Gets or sets the number of milliseconds to wait before the operation times out.
|
void |
refreshToken()
Refresh access token
|
void |
setAccessToken(String value)
Gets or sets OAuth 2.0 access token
In case if refresh token is set, access token is generated automatically.
|
static void |
setDefaultTimeout(int value)
Gets or sets the default timeout value for ActiveSync client instances
The default value is 100,000 milliseconds (100 seconds).
|
void |
setProxy(com.aspose.ms.System.Net.IWebProxy value)
Gets or sets the proxy.
|
void |
setTimeout(int value)
Gets or sets the number of milliseconds to wait before the operation times out.
|
public static IGmailClient getInstance(String accessToken, String defaultEmail)
Gets instance of Gmail client
accessToken
- OAuth 2.0 access tokendefaultEmail
- Default email addresspublic static IGmailClient getInstance(String accessToken, com.aspose.ms.System.Net.IWebProxy proxy, String defaultEmail)
Gets instance of Gmail client
accessToken
- OAuth 2.0 access tokenproxy
- IWebProxy for Gmail clientdefaultEmail
- Default email addresspublic static IGmailClient getInstance(String clientId, String clientSecret, String refreshToken, String defaultEmail)
Gets instance of Gmail client
clientId
- The client ID obtained from the Google Cloud Console during application registration.clientSecret
- The client secret obtained during application registration.refreshToken
- OAuth 2.0 refresh tokendefaultEmail
- Default email addresspublic static IGmailClient getInstance(String clientId, String clientSecret, String refreshToken, com.aspose.ms.System.Net.IWebProxy proxy, String defaultEmail)
Gets instance of Gmail client
clientId
- The client ID obtained from the Google Cloud Console during application registration.clientSecret
- The client secret obtained during application registration.refreshToken
- OAuth 2.0 refresh tokenproxy
- IWebProxy for Gmail clientdefaultEmail
- Default email addresspublic void refreshToken()
Refresh access token
refreshToken
in interface IBaseGmailClient
public String getDefaultEmail()
Gets or sets default email address
getDefaultEmail
in interface IBaseGmailClient
public String getAccessToken()
Gets or sets OAuth 2.0 access token In case if refresh token is set, access token is generated automatically.
getAccessToken
in interface IBaseGmailClient
public void setAccessToken(String value)
Gets or sets OAuth 2.0 access token In case if refresh token is set, access token is generated automatically.
setAccessToken
in interface IBaseGmailClient
public com.aspose.ms.System.Net.IWebProxy getProxy()
Gets or sets the proxy.
getProxy
in interface IBaseGmailClient
public void setProxy(com.aspose.ms.System.Net.IWebProxy value)
Gets or sets the proxy.
setProxy
in interface IBaseGmailClient
public int getTimeout()
Gets or sets the number of milliseconds to wait before the operation times out. The default value is 100,000 milliseconds (100 seconds).
getTimeout
in interface IBaseGmailClient
public void setTimeout(int value)
Gets or sets the number of milliseconds to wait before the operation times out. The default value is 100,000 milliseconds (100 seconds).
setTimeout
in interface IBaseGmailClient
public static int getDefaultTimeout()
Gets or sets the default timeout value for ActiveSync client instances The default value is 100,000 milliseconds (100 seconds).
public static void setDefaultTimeout(int value)
Gets or sets the default timeout value for ActiveSync client instances The default value is 100,000 milliseconds (100 seconds).
public void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface com.aspose.ms.System.IDisposable