protected <T extends Dto> T createObject(Class<T> classOfT, String idempotencyKey, String methodKey, T entity, String entityId, String secondEntityId) throws Exception {

        String urlMethod;

        if (entityId.length() == 0)
            urlMethod = this.getRequestUrl(methodKey);
        else if (secondEntityId.length() == 0)
            urlMethod = String.format(this.getRequestUrl(methodKey), entityId);
        else
            urlMethod = String.format(this.getRequestUrl(methodKey), entityId, secondEntityId);

        RestTool rest = new RestTool(this.root, true);
        T result = rest.request(classOfT, idempotencyKey, urlMethod, this.getRequestType(methodKey), null, null, entity);

        return result;

    }
protected < T extends Dto > T createObject ( Class < T > classOfT , String idempotencyKey , String methodKey , T entity , String entityId , String secondEntityId ) throws Exception { String urlMethod ; if ( entityId . length ( ) == 0 ) urlMethod = this . getRequestUrl ( methodKey ) ; else if ( secondEntityId . length ( ) == 0 ) urlMethod = String . format ( this . getRequestUrl ( methodKey ) , entityId ) ; else urlMethod = String . format ( this . getRequestUrl ( methodKey ) , entityId , secondEntityId ) ; RestTool rest = new RestTool ( this . root , true ) ; T result = rest . request ( classOfT , idempotencyKey , urlMethod , this . getRequestType ( methodKey ) , null , null , entity ) ; return result ; }
Creates the Dto instance.
@param <T>               Type on behalf of which the request is being called.
@param classOfT          Type on behalf of which the request is being called.
@param idempotencyKey    idempotency key for this request.
@param methodKey         Relevant method key.
@param entity            Dto instance that is going to be sent.
@param entityId          Entity identifier.
@param secondEntityId    Second entity identifier.
@return                  The Dto instance returned from API.
@throws Exception