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

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

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

import jp.gopay.sdk.builders.IdempotentRetrofitRequestBuilder;
import jp.gopay.sdk.builders.RetrofitRequestBuilder;
import jp.gopay.sdk.builders.RetrofitRequestBuilderPaginated;
import jp.gopay.sdk.models.common.*;
import jp.gopay.sdk.models.common.Void;
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.types.MerchantRole;
import jp.gopay.sdk.types.ProcessingMode;
import retrofit2.Retrofit;

import java.util.List;
import java.util.Set;

public abstract class AbstractApplicationTokenBuilders {

    public static abstract class AbstractListApplicationTokenRequestBuilder
            extends RetrofitRequestBuilderPaginated {

        protected ProcessingMode processingMode;
        protected StoreId storeId;

        protected ProcessingMode getProcessingMode() {
            return processingMode;
        }

        protected StoreId getStoreId() {
            return storeId;
        }

        public AbstractListApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit);
            this.storeId = storeId;
        }

        public B withAnyMode() {
            this.processingMode = null;
            return (B)this;
        }

        public B withOnlyLiveMode() {
            this.processingMode = ProcessingMode.LIVE;
            return (B)this;
        }

        public B withOnlyTestMode() {
            this.processingMode = ProcessingMode.TEST;
            return (B)this;
        }

    }

    public static abstract class AbstractUpdateApplicationTokenRequestBuilder
            extends IdempotentRetrofitRequestBuilder {

        protected StoreId storeId;
        protected AppTokenId appTokenId;
        protected List domains;

        protected StoreId getStoreId() {
            return storeId;
        }

        protected AppTokenId getAppTokenId() {
            return appTokenId;
        }

        protected List getDomains() {
            return domains;
        }

        public AbstractUpdateApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId, AppTokenId appTokenId, List domains) {
            super(retrofit);
            this.storeId = storeId;
            this.appTokenId = appTokenId;
            this.domains = domains;
        }

        public B withDomains(List domains) {
            this.domains = domains;
            return (B)this;
        }

    }

    public static abstract class AbstractDeleteApplicationTokenRequestBuilder
            extends RetrofitRequestBuilder {

        protected StoreId storeId;
        protected AppTokenId applicationTokenId;

        protected StoreId getStoreId() {
            return storeId;
        }

        protected AppTokenId getApplicationTokenId() {
            return applicationTokenId;
        }

        public AbstractDeleteApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId, AppTokenId applicationTokenId) {
            super(retrofit);
            this.storeId = storeId;
            this.applicationTokenId = applicationTokenId;
        }
    }

    public static abstract class AbstractCreateApplicationTokenRequestBuilder
            extends RetrofitRequestBuilder {

        protected StoreId storeId;
        protected ProcessingMode mode = ProcessingMode.TEST;
        protected List domains;

        protected StoreId getStoreId() {
            return storeId;
        }

        protected ProcessingMode getMode() {
            return mode;
        }

        protected List getDomains() {
            return domains;
        }

        public AbstractCreateApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit);
            this.storeId = storeId;
        }

        public AbstractCreateApplicationTokenRequestBuilder(Retrofit retrofit, StoreId storeId, List domains) {
            super(retrofit);
            this.storeId = storeId;
            this.domains = domains;
        }

        public B withMode(ProcessingMode processingMode) {
            this.mode = processingMode;
            return (B)this;
        }

        @Deprecated
        public B withDomains(List domains) {
            this.domains = domains;
            return (B)this;
        }

    }

    public static abstract class AbstractCreateMerchantApplicationJWTRequestBuilder
            extends RetrofitRequestBuilder{

        protected Set roles;

        protected Set getRoles() {
            return roles;
        }

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

        public B withRoles(Set roles) {
            this.roles = roles;
            return (B)this;
        }

    }

    public static abstract class AbstractListMerchantApplicationJWTRequestBuilder
            extends RetrofitRequestBuilder, R> {

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

    }

    public static abstract class AbstractDeleteMerchantApplicationJWTRequestBuilder
            extends RetrofitRequestBuilder{

        protected AppJWTId appJWTId;

        public AppJWTId getAppJWTId() {
            return appJWTId;
        }

        public AbstractDeleteMerchantApplicationJWTRequestBuilder(Retrofit retrofit, AppJWTId appJWTId) {
            super(retrofit);
            this.appJWTId = appJWTId;
        }
    }

    public static abstract class AbstractCreateStoreApplicationJWTRequestBuilder
            extends RetrofitRequestBuilder{

        protected ProcessingMode mode;
        protected StoreId storeId;
        protected List domains;

        protected StoreId getStoreId() {
            return storeId;
        }

        protected ProcessingMode getMode() {
            return mode;
        }

        public AbstractCreateStoreApplicationJWTRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit);
            this.storeId = storeId;
        }

        public B withMode(ProcessingMode processingMode) {
            this.mode = processingMode;
            return (B)this;
        }

        public B withDomains(List domains) {
            this.domains = domains;
            return (B)this;
        }

    }

    public static abstract class AbstractListStoreApplicationJWTRequestBuilder
            extends RetrofitRequestBuilder, R> {

        protected StoreId storeId;

        protected StoreId getStoreId() {
            return storeId;
        }

        public AbstractListStoreApplicationJWTRequestBuilder(Retrofit retrofit, StoreId storeId) {
            super(retrofit);
            this.storeId = storeId;
        }

    }

    public static abstract class AbstractDeleteStoreApplicationJWTRequestBuilder
            extends RetrofitRequestBuilder{

        protected AppJWTId appJWTId;
        protected StoreId storeId;

        protected AppJWTId getAppJWTId() {
            return appJWTId;
        }

        protected StoreId getStoreId() {
            return storeId;
        }

        public AbstractDeleteStoreApplicationJWTRequestBuilder(Retrofit retrofit, StoreId storeId, AppJWTId appJWTId) {
            super(retrofit);
            this.appJWTId = appJWTId;
            this.storeId = storeId;
        }

    }

}