Interface UserProvider
- 
 
 public interface UserProviderSetting tags and fields on a user are features. Your plan must support these features in order to work with them. A provider which will offer a higher level of abstraction compared to the UserService
 You can create an instance of UserProvider like this:import com.zendesk.sdk.network.UserProvider; import com.zendesk.sdk.network.impl.ZendeskConfig; ... UserProvider provider = ZendeskConfig.INSTANCE.provider().userProvider(); ...Once you have an instance of the provider you can call methods on it and handle the results in callbacks. A success callback will give you the resource(s) that you are requesting. The error callback will be called if there was some issue with the method call and it will define details about the error in an For example you can upload a file like this:ErrorResponseprovider.addTags(Arrays.asList("tag", "foo", "bar"), new ZendeskCallback<List<String>>() { @Override public void onSuccess(final List<String> tags) { // Handle success } @Override public void onError(final ErrorResponse errorResponse) { // Handle error } });
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddTags(java.util.List<java.lang.String> tags, <any> callback)Calls a user service to add tags to a user on behalf of the end-user.voiddeleteTags(java.util.List<java.lang.String> tags, <any> callback)Calls a user service to remove tags from a user on behalf of the end-user.voidgetUser(<any> callback)Calls a user service to get information about the current logged in user, including the values of any user fields that have been set on the current user.voidgetUserFields(<any> callback)Gets a list of user field definitions that are available in your account.voidsetUserFields(java.util.Map<java.lang.String,java.lang.String> userFields, <any> callback)Sets the user fields for the current user.
 
- 
- 
- 
Method Detail- 
addTagsvoid addTags(java.util.List<java.lang.String> tags, <any> callback)Calls a user service to add tags to a user on behalf of the end-user.- Parameters:
- tags- A list of tags.
- callback- Callback that will deliver the list of the user's tags after the call or an- ErrorResponse
- Since:
- 1.4.0.1
 
 - 
deleteTagsvoid deleteTags(java.util.List<java.lang.String> tags, <any> callback)Calls a user service to remove tags from a user on behalf of the end-user.- Parameters:
- tags- A list of tags
- callback- Callback that will deliver the list of the user's tags after the call or an- ErrorResponse
 
 - 
getUserFieldsvoid getUserFields(<any> callback) Gets a list of user field definitions that are available in your account.Note that this retrieves the definitions, and not the values of the user fields for the current user. To retrieve the values you should call #getUser(ZendeskCallback), and then callUser.getUserFields()on the returnedUserobject.- Parameters:
- callback- Callback that will deliver a newly created list containing- UserFieldor- ErrorResponse
- Since:
- 1.4.0.1
 
 - 
setUserFieldsvoid setUserFields(java.util.Map<java.lang.String,java.lang.String> userFields, <any> callback)Sets the user fields for the current user.User fields must have been created in your Zendesk account before they can be set by this method. The userFields map is a map from the key of your user field to the value of your user field. Map<String, String> userFields = new HashMap<>(); userFields.put("sdk_phone_number", "12345"); userProvider.setUserFields(userFields, new ZendeskCallback<Map<String, String>>() { // handle callbacks });- Parameters:
- userFields- A map containing the fields to be set. The map is from a field's key to its value
- callback- Callback that will deliver the map of the user's fields and their values after the call or an- ErrorResponse
- Since:
- 1.4.0.1
- See Also:
- Adding custom fields to users
 
 - 
getUservoid getUser(<any> callback) Calls a user service to get information about the current logged in user, including the values of any user fields that have been set on the current user.The Userobject which is returned from this method's callback only contains the user's tags and fields at this time.- Parameters:
- callback- Callback that will deliver a newly created request of type- Useror- ErrorResponse
- Since:
- 1.4.0.1
 
 
- 
 
-