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

jp.gopay.sdk.builders.applicationtoken.ApplicationTokenBuilders Maven / Gradle / Ivy

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

import jp.gopay.sdk.models.common.*;
import jp.gopay.sdk.models.common.Void;
import jp.gopay.sdk.models.request.applicationtoken.CreateAppTokenReq;
import jp.gopay.sdk.models.request.applicationtoken.CreateMerchantAppJWTReq;
import jp.gopay.sdk.models.request.applicationtoken.CreateStoreAppJWTReq;
import jp.gopay.sdk.models.request.store.UpdateAppTokenReq;
import jp.gopay.sdk.models.response.PaginatedList;
import jp.gopay.sdk.models.response.applicationtoken.ApplicationToken;
import jp.gopay.sdk.models.response.applicationtoken.MerchantApplicationJWT;
import jp.gopay.sdk.models.response.applicationtoken.StoreApplicationJWT;
import jp.gopay.sdk.resources.ApplicationTokenResource;
import retrofit2.Call;
import retrofit2.Retrofit;

import java.util.List;

import static jp.gopay.sdk.builders.applicationtoken.AbstractApplicationTokenBuilders.*;

public abstract class ApplicationTokenBuilders {

    public static class ListApplicationTokenRequestBuilder
            extends AbstractListApplicationTokenRequestBuilder {

        public ListApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit, storeId);
        }

        @Override
        protected Call> getRequest(ApplicationTokenResource resource) {
            return resource.listAppTokens(storeId, processingMode);
        }
    }

    public static class UpdateApplicationTokenRequestBuilder
            extends AbstractUpdateApplicationTokenRequestBuilder {
        public UpdateApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId, AppTokenId appTokenId, List domains) {
            super(retrofit, storeId, appTokenId, domains);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.updateAppToken(storeId, appTokenId, new UpdateAppTokenReq(domains), idempotencyKey);
        }
    }

    public static class DeleteApplicationTokenRequestBuilder
            extends AbstractDeleteApplicationTokenRequestBuilder {
        public DeleteApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId, AppTokenId applicationTokenId) {
            super(retrofit, storeId, applicationTokenId);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.deleteAppToken(storeId, applicationTokenId);
        }
    }

    public static class CreateApplicationTokenRequestBuilder
            extends AbstractCreateApplicationTokenRequestBuilder {

        public CreateApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit, storeId);
        }

        public CreateApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId, List domains) {
            super(retrofit, storeId, domains);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.createAppToken(storeId, new CreateAppTokenReq(mode, domains));
        }
    }

    public static class CreateMerchantApplicationJWTRequestBuilder
            extends AbstractCreateMerchantApplicationJWTRequestBuilder {

        public CreateMerchantApplicationJWTRequestBuilder(Retrofit retrofit) {
            super(retrofit);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.createMerchantAppJWT(new CreateMerchantAppJWTReq(roles));
        }
    }

    public static class ListMerchantApplicationJWTRequestBuilder
            extends AbstractListMerchantApplicationJWTRequestBuilder {

        public ListMerchantApplicationJWTRequestBuilder(Retrofit retrofit) {
            super(retrofit);
        }

        @Override
        protected Call> getRequest(ApplicationTokenResource resource) {
            return resource.listMerchantAppJWT();
        }
    }

    public static class DeleteMerchantApplicationJWTRequestBuilder
            extends AbstractDeleteMerchantApplicationJWTRequestBuilder {

        public DeleteMerchantApplicationJWTRequestBuilder(Retrofit retrofit, AppJWTId appJWTId) {
            super(retrofit, appJWTId);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.deleteMerchantAppJWT(appJWTId);
        }
    }

    public static class CreateStoreApplicationJWTRequestBuilder
            extends AbstractCreateStoreApplicationJWTRequestBuilder {

        public CreateStoreApplicationJWTRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit, storeId);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.createStoreAppJWT(storeId, new CreateStoreAppJWTReq(mode, domains));
        }
    }

    public static class ListStoreApplicationJWTRequestBuilder
            extends AbstractListStoreApplicationJWTRequestBuilder {

        public ListStoreApplicationJWTRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit, storeId);
        }

        @Override
        protected Call> getRequest(ApplicationTokenResource resource) {
            return resource.listStoreAppJWT(storeId);
        }
    }

    public static class DeleteStoreApplicationJWTRequestBuilder
            extends AbstractDeleteStoreApplicationJWTRequestBuilder {

        public DeleteStoreApplicationJWTRequestBuilder(Retrofit retrofit, StoreId storeId, AppJWTId appJWTId) {
            super(retrofit, storeId, appJWTId);
        }

        @Override
        protected Call getRequest(ApplicationTokenResource resource) {
            return resource.deleteStoreAppJWT(storeId, appJWTId);
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy