Search in sources :

Example 1 with UserAuthorizationStatus

use of jp.ne.paypay.model.UserAuthorizationStatus in project paypayopa-sdk-java by paypay.

the class UserApi method getUserAuthorizationStatusWithHttpInfo.

/**
 * Get user authorization status
 * Get the authorization status of a user  **Timeout: 15s**
 * @param userAuthorizationId  (required)
 * @return ApiResponse<UserAuthorizationStatus>
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
protected ApiResponse<UserAuthorizationStatus> getUserAuthorizationStatusWithHttpInfo(String userAuthorizationId) throws ApiException {
    Call call = getUserAuthorizationStatusValidateBeforeCall(userAuthorizationId);
    Type localVarReturnType = new TypeToken<UserAuthorizationStatus>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType, ApiNameConstants.GET_USER_AUTH_STATUS);
}
Also used : Call(com.squareup.okhttp.Call) Type(java.lang.reflect.Type) UserAuthorizationStatus(jp.ne.paypay.model.UserAuthorizationStatus)

Example 2 with UserAuthorizationStatus

use of jp.ne.paypay.model.UserAuthorizationStatus in project paypayopa-sdk-java by paypay.

the class UserApiExample method getOrUnlinkUser.

private static void getOrUnlinkUser(String userAuthorizationId, UserApi userApi, boolean unlinkUser) {
    try {
        if (unlinkUser) {
            NotDataResponse notDataResponse = userApi.unlinkUser(userAuthorizationId);
            System.out.println(notDataResponse);
        } else {
            UserAuthorizationStatus userAuthorizationStatus = userApi.getUserAuthorizationStatus(userAuthorizationId);
            System.out.println(userAuthorizationStatus);
        }
    } catch (ApiException e) {
        System.out.println(e.getResponseBody());
    }
}
Also used : NotDataResponse(jp.ne.paypay.model.NotDataResponse) UserAuthorizationStatus(jp.ne.paypay.model.UserAuthorizationStatus) ApiException(jp.ne.paypay.ApiException)

Example 3 with UserAuthorizationStatus

use of jp.ne.paypay.model.UserAuthorizationStatus in project paypayopa-sdk-java by paypay.

the class UserApiTest method getUserAuthorizationStatusTest.

/**
 * Get user authorization status
 *
 * Get the authorization status of a user  **Timeout: 15s**
 *
 * @throws ApiException
 *          if the Api call fails
 */
@Test
public void getUserAuthorizationStatusTest() throws ApiException {
    String userAuthorizationId = "userAuthorizationId";
    UserAuthorizationStatus userAuthorizationStatus = new UserAuthorizationStatus();
    userAuthorizationStatus.setResultInfo(resultInfo);
    ApiResponse<UserAuthorizationStatus> userAuthorizationStatusApiResponse = new ApiResponse<>(00001, null, userAuthorizationStatus);
    Mockito.when(apiClient.escapeString(userAuthorizationId)).thenReturn(userAuthorizationId);
    Mockito.when(api.getUserAuthorizationStatusWithHttpInfo(userAuthorizationId)).thenReturn(userAuthorizationStatusApiResponse);
    UserAuthorizationStatus response = api.getUserAuthorizationStatus(userAuthorizationId);
    Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
Also used : ApiResponse(jp.ne.paypay.ApiResponse) UserAuthorizationStatus(jp.ne.paypay.model.UserAuthorizationStatus) Test(org.junit.jupiter.api.Test)

Aggregations

UserAuthorizationStatus (jp.ne.paypay.model.UserAuthorizationStatus)3 Call (com.squareup.okhttp.Call)1 Type (java.lang.reflect.Type)1 ApiException (jp.ne.paypay.ApiException)1 ApiResponse (jp.ne.paypay.ApiResponse)1 NotDataResponse (jp.ne.paypay.model.NotDataResponse)1 Test (org.junit.jupiter.api.Test)1