Package zendesk.core
Enum Zendesk
- java.lang.Object
-
- java.lang.Enum<Zendesk>
-
- zendesk.core.Zendesk
-
-
Enum Constant Summary
Enum Constants Enum Constant and Description INSTANCE
The instance of zendesk configured usingZendesk.init(Context, String, String, String)
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Identity
getIdentity()
Return the currentIdentity
for the SDK, or null if none has been set.void
init(Context context, java.lang.String zendeskUrl, java.lang.String applicationId, java.lang.String oauthClientId)
Initialises the Zendesk Core SDK with your Zendesk subdomain settings and anIdentity
.boolean
isInitialized()
Gets whetherZendesk.init(Context, String, String, String)
was called with valid values or not.ProviderStore
provider()
Gets aProviderStore
for accessing all available SDK Providers.void
setIdentity(Identity identity)
Set theIdentity
for the SDK.static Zendesk
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Zendesk[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final Zendesk INSTANCE
The instance of zendesk configured usingZendesk.init(Context, String, String, String)
. If init was not called first then all other operations will fail.
-
-
Method Detail
-
values
public static Zendesk[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Zendesk c : Zendesk.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Zendesk valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
init
public void init(Context context, java.lang.String zendeskUrl, java.lang.String applicationId, java.lang.String oauthClientId)
Initialises the Zendesk Core SDK with your Zendesk subdomain settings and anIdentity
.This requires some authentication settings. Your zendeskUrl must be your full Zendesk URL in the form of https://{subdomain.zendesk.com You should replace {subdomain} with your own subdomain.
This method is idempotent; calling it more than once with the same values will have no effect. If called with any changed values, it will result in fresh instances of all providers being created. Any references to providers previously obtained from the
ProviderStore
viaZendesk.provider()
should be discarded and re-obtained.Before the SDK can used a valid
Identity
ust be set using theZendesk.setIdentity(Identity)
method.- Parameters:
context
- A context, used for initialising stored settingszendeskUrl
- The full URL of your Zendesk instance, https://{subdomain}.zendesk.comapplicationId
- The application id of your SDK app, as found in the web interfaceoauthClientId
- The oauth client id that was supplied when you set up oauth in the web interface
-
isInitialized
public boolean isInitialized()
Gets whetherZendesk.init(Context, String, String, String)
was called with valid values or not.- Returns:
- true if init was successfully called, false otherwise.
-
setIdentity
public void setIdentity(Identity identity)
Set theIdentity
for the SDK. If there is a previously stored Identity and this sets different Identity any user data will be wiped from the SDK.identity This can be set multiple times with different valid identities
-
getIdentity
public Identity getIdentity()
Return the currentIdentity
for the SDK, or null if none has been set.- Returns:
- the current
Identity
, or null if none has been set.
-
provider
public ProviderStore provider()
Gets aProviderStore
for accessing all available SDK Providers.- Returns:
- an instance of
ProviderStore
, ornull
if Zendesk wasn't initialized.
-
-