All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.gopay.sdk.builders.authentication.AuthenticationBuilders Maven / Gradle / Ivy

There is a newer version: 0.11.17
Show newest version
package jp.gopay.sdk.builders.authentication;

import jp.gopay.sdk.models.common.Void;
import jp.gopay.sdk.models.request.authentication.AuthenticationRequestData;
import jp.gopay.sdk.models.response.authentication.LoginTokenInfo;
import jp.gopay.sdk.resources.AuthenticationResource;
import retrofit2.Call;
import retrofit2.Retrofit;

import static jp.gopay.sdk.builders.authentication.AbstractAuthenticationBuilders.AbstractLoginRequestBuilder;
import static jp.gopay.sdk.builders.authentication.AbstractAuthenticationBuilders.AbstractLogoutRequestBuilder;

public abstract class AuthenticationBuilders {

    public static class LoginRequestBuilder extends AbstractLoginRequestBuilder{
        public LoginRequestBuilder(Retrofit retrofit, String email, String password) {
            super(retrofit, email, password);
        }

        @Override
        protected Call getRequest(AuthenticationResource resource) {
            return resource.getLoginToken(new AuthenticationRequestData(email, password));
        }
    }

    public static class LogoutRequestBuilder extends AbstractLogoutRequestBuilder{
        public LogoutRequestBuilder(Retrofit retrofit) {
            super(retrofit);
        }

        @Override
        protected Call getRequest(AuthenticationResource resource) {
            return resource.deleteAuthToken();
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy