# ForcingMappingTicket

class ForcingMappingTicket : ValueObject

If the addMapping API fails with error AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER (3302), you can force addMapping with this VO.

Example Usage:

    void addMappingForcibly() {
        Gamebase.addMapping(activity, mappingProvider, new GamebaseDataCallback<AuthToken>() {
            @Override
            public void onCallback(AuthToken authToken, GamebaseException exception) {
                if (!Gamebase.isSuccess(exception)) {
                    if (exception.getCode() == GamebaseError.AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER) {
                        // ForcingMappingTicket from GamebaseException
                        final ForcingMappingTicket ticket = ForcingMappingTicket.from(exception);
                        if (ticket != null) {
                            // Show the mappedUserId to be erased to the user, and ask whether or not to force addMapping.
                            ticket.mappedUserId;    // This userId will be erased.

                            Gamebase.addMappingForcibly(activity, mappingProvider, ticket.forcingMappingKey, new GamebaseDataCallback<AuthToken>() {
                                @Override
                                public void onCallback(AuthToken forceAddMappingAuthToken, GamebaseException forceAddMappingException) {
                                    if (Gamebase.isSuccess(forceAddMappingException)) {
                                        // Force AddMapping Success.
                                        return;
                                    }

                                    // Force AddMapping Failed.
                                }
                            }
                        }
                    } else {
                        // AddMapping Failed.
                    }
                    return;
                }

                // AddMapping Succeeded.
            }
        });
    }

Content copied to clipboard

#### Since

Added 2.2.0

#### See also

Gamebase
GamebaseException

## Properties

accessToken
Link copied to clipboard
open var accessToken: String
expirationDate
Link copied to clipboard
open var expirationDate: Long
extraParams
Link copied to clipboard
open var extraParams: Map<String, Any>
forcingMappingKey
Link copied to clipboard
open var forcingMappingKey: String
idPCode
Link copied to clipboard
open var idPCode: String
mappedUserId
Link copied to clipboard
open var mappedUserId: String
UserId that can be cleared by force mapping.
mappedUserValid
Link copied to clipboard
open var mappedUserValid: String
The status of mapped user.
subCode
Link copied to clipboard
open var subCode: String

## Functions

from
Link copied to clipboard
open fun from(@NonNull exception: GamebaseException): ForcingMappingTicket
Factory method to create VO instance.
fromJson
Link copied to clipboard
open fun <T> fromJson(@NonNull json: String, classOfT: Class<T>): T
open fun <T> fromJson(@NonNull json: String, type: Type): T
open fun <T> fromJson(@NonNull jsonObject: JSONObject, classOfT: Class<T>): T
toJsonString
Link copied to clipboard
open fun toJsonString(): String
toPrettyJsonString
Link copied to clipboard
open fun toPrettyJsonString(): String
toString
Link copied to clipboard
open fun toString(): String