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

com.tinypass.client.publisher.api.PublisherOfferTemplateApi Maven / Gradle / Ivy

There is a newer version: 16.331.0
Show newest version
package com.tinypass.client.publisher.api;

import com.tinypass.client.common.*;
import com.tinypass.client.publisher.model.OfferTemplate;
import com.tinypass.client.publisher.model.OfferTemplateCategories;
import com.tinypass.client.publisher.model.OfferTemplateHistories;
import com.tinypass.client.publisher.model.OfferTemplateVersion;
import com.tinypass.client.publisher.model.TemplateConfig;

import java.util.*;
import java.math.*;
import java.io.*;

public class PublisherOfferTemplateApi {

	private String basePath = "https://api.piano.io/api/v3";
	private String token;
	private ApiInvoker apiInvoker = null;
	private Map headerParams = new LinkedHashMap();

	public PublisherOfferTemplateApi(String basePath, String token) {
		this.basePath = basePath;
		this.token = token;
	}

	public PublisherOfferTemplateApi(String basePath, String token, ApiInvoker invoker, Map headerParams) {
		this(basePath, token);
		this.apiInvoker = invoker;
		this.headerParams = headerParams;
	}

	public ApiInvoker getInvoker() {
        if(apiInvoker == null) apiInvoker = ApiInvoker.getInstance();
		return apiInvoker;
	}

	public void setApiToken(String token){
		this.token = token;
	}

	public void setBasePath(String basePath) {
		this.basePath = basePath;
	}

	public String getBasePath() {
		return basePath;
	}

	public String toQueryParam(Object arg) {
        if(arg == null)
            return null;
		if (arg instanceof Date) {
			Date date = (Date) arg;
			long epochTime = date.getTime() / 1000;
			return String.valueOf(epochTime);
		} else {
			return String.valueOf(arg);
		}

	}

    public void setQueryParam(Map> params, String paramName, Object value) {
        List currentValues = params.computeIfAbsent(paramName, k -> new ArrayList<>());
        if (value instanceof List) {
            List values = (List) value;
            values.forEach(o -> addQueryParam(currentValues, o));
        } else {
            addQueryParam(currentValues, value);
        }
    }

    private void addQueryParam(List currentValues, Object value) {
        String v = toQueryParam(value);
        if (v != null)
            currentValues.add(v);
    }


    /**
      * API Request for archive
      */
	public class archiveRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public archiveRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public archiveRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public archiveRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}
		public archiveRequest historyComment(String historyComment) {
            setQueryParam(this.queryParams, "history_comment", historyComment);
			return this;
		}






		public void  execute() throws ApiException{

			String path = "/publisher/offer/template/archive".replaceAll("\\{format\\}","json");

            getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     null,
                                                     null);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public archiveRequest archiveRequest(){
		return new archiveRequest(headerParams);
	}



    /**
      * API Request for convertBoilerplateToOfferTemplate
      */
	public class convertBoilerplateToOfferTemplateRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public convertBoilerplateToOfferTemplateRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public convertBoilerplateToOfferTemplateRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public convertBoilerplateToOfferTemplateRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}
		public convertBoilerplateToOfferTemplateRequest name(String name) {
            setQueryParam(this.queryParams, "name", name);
			return this;
		}
		public convertBoilerplateToOfferTemplateRequest description(String description) {
            setQueryParam(this.queryParams, "description", description);
			return this;
		}
		public convertBoilerplateToOfferTemplateRequest categoryId(String categoryId) {
            setQueryParam(this.queryParams, "category_id", categoryId);
			return this;
		}






		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/convertBoilerplateToTemplate".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public convertBoilerplateToOfferTemplateRequest convertBoilerplateToOfferTemplateRequest(){
		return new convertBoilerplateToOfferTemplateRequest(headerParams);
	}



    /**
      * API Request for count
      */
	public class countRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public countRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public countRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}






		public Long  execute() throws ApiException{

			String path = "/publisher/offer/template/count".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     Long.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public countRequest countRequest(){
		return new countRequest(headerParams);
	}



    /**
      * API Request for create
      */
	public class createRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public createRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }


		public createRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public createRequest name(String name) {
            setQueryParam(this.formParams, "name", name);
			return this;
		}
		public createRequest description(String description) {
            setQueryParam(this.formParams, "description", description);
			return this;
		}
		public createRequest categoryId(String categoryId) {
            setQueryParam(this.formParams, "category_id", categoryId);
			return this;
		}
		public createRequest historyComment(String historyComment) {
            setQueryParam(this.formParams, "history_comment", historyComment);
			return this;
		}





		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/create".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "POST", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public createRequest createRequest(){
		return new createRequest(headerParams);
	}



    /**
      * API Request for delete
      */
	public class deleteRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public deleteRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }


		public deleteRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public deleteRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.formParams, "offer_template_id", offerTemplateId);
			return this;
		}





		public void  execute() throws ApiException{

			String path = "/publisher/offer/template/delete".replaceAll("\\{format\\}","json");

            getInvoker().invokeAPI(basePath, path, "POST", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     null,
                                                     null);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public deleteRequest deleteRequest(){
		return new deleteRequest(headerParams);
	}



    /**
      * API Request for get
      */
	public class getRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public getRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public getRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public getRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}






		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/get".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public getRequest getRequest(){
		return new getRequest(headerParams);
	}



    /**
      * API Request for getDefaultCode
      */
	public class getDefaultCodeRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public getDefaultCodeRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public getDefaultCodeRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public getDefaultCodeRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}






		public TemplateConfig  execute() throws ApiException{

			String path = "/publisher/offer/template/defaultCode".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     TemplateConfig.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public getDefaultCodeRequest getDefaultCodeRequest(){
		return new getDefaultCodeRequest(headerParams);
	}



    /**
      * API Request for getDuplicate
      */
	public class getDuplicateRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public getDuplicateRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public getDuplicateRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public getDuplicateRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}
		public getDuplicateRequest historyComment(String historyComment) {
            setQueryParam(this.queryParams, "history_comment", historyComment);
			return this;
		}
		public getDuplicateRequest duplicateVariants(Boolean duplicateVariants) {
            setQueryParam(this.queryParams, "duplicate_variants", duplicateVariants);
			return this;
		}






		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/duplicate".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public getDuplicateRequest getDuplicateRequest(){
		return new getDuplicateRequest(headerParams);
	}



    /**
      * API Request for getHistory
      */
	public class getHistoryRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public getHistoryRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public getHistoryRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public getHistoryRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}






		public OfferTemplateHistories  execute() throws ApiException{

			String path = "/publisher/offer/template/getHistory".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateHistories.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public getHistoryRequest getHistoryRequest(){
		return new getHistoryRequest(headerParams);
	}



    /**
      * API Request for list
      */
	public class listRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public listRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public listRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public listRequest q(String q) {
            setQueryParam(this.queryParams, "q", q);
			return this;
		}
		public listRequest offset(Integer offset) {
            setQueryParam(this.queryParams, "offset", offset);
			return this;
		}
		public listRequest limit(Integer limit) {
            setQueryParam(this.queryParams, "limit", limit);
			return this;
		}
		public listRequest orderBy(String orderBy) {
            setQueryParam(this.queryParams, "order_by", orderBy);
			return this;
		}
		public listRequest orderDirection(String orderDirection) {
            setQueryParam(this.queryParams, "order_direction", orderDirection);
			return this;
		}
		public listRequest status(String status) {
            setQueryParam(this.queryParams, "status", status);
			return this;
		}
		public listRequest variantStatus(String variantStatus) {
            setQueryParam(this.queryParams, "variant_status", variantStatus);
			return this;
		}
		public listRequest filters(List filters) {
            setQueryParam(this.queryParams, "filters", filters);
			return this;
		}






		public PageList  execute() throws ApiException{

			String path = "/publisher/offer/template/list".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "array",
                                                     OfferTemplate.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public listRequest listRequest(){
		return new listRequest(headerParams);
	}



    /**
      * API Request for listBoilerplates
      */
	public class listBoilerplatesRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public listBoilerplatesRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public listBoilerplatesRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public listBoilerplatesRequest q(String q) {
            setQueryParam(this.queryParams, "q", q);
			return this;
		}
		public listBoilerplatesRequest offset(Integer offset) {
            setQueryParam(this.queryParams, "offset", offset);
			return this;
		}
		public listBoilerplatesRequest limit(Integer limit) {
            setQueryParam(this.queryParams, "limit", limit);
			return this;
		}
		public listBoilerplatesRequest orderBy(String orderBy) {
            setQueryParam(this.queryParams, "order_by", orderBy);
			return this;
		}
		public listBoilerplatesRequest orderDirection(String orderDirection) {
            setQueryParam(this.queryParams, "order_direction", orderDirection);
			return this;
		}
		public listBoilerplatesRequest status(String status) {
            setQueryParam(this.queryParams, "status", status);
			return this;
		}
		public listBoilerplatesRequest templateType(String templateType) {
            setQueryParam(this.queryParams, "templateType", templateType);
			return this;
		}
		public listBoilerplatesRequest categories(List categories) {
            setQueryParam(this.queryParams, "categories", categories);
			return this;
		}
		public listBoilerplatesRequest ensureTemplatesExists(Boolean ensureTemplatesExists) {
            setQueryParam(this.queryParams, "ensure_templates_exists", ensureTemplatesExists);
			return this;
		}






		public PageList  execute() throws ApiException{

			String path = "/publisher/offer/template/listBoilerplates".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "array",
                                                     OfferTemplateCategories.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public listBoilerplatesRequest listBoilerplatesRequest(){
		return new listBoilerplatesRequest(headerParams);
	}



    /**
      * API Request for listByCategory
      */
	public class listByCategoryRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public listByCategoryRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public listByCategoryRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public listByCategoryRequest status(String status) {
            setQueryParam(this.queryParams, "status", status);
			return this;
		}
		public listByCategoryRequest templateType(String templateType) {
            setQueryParam(this.queryParams, "templateType", templateType);
			return this;
		}
		public listByCategoryRequest categories(List categories) {
            setQueryParam(this.queryParams, "categories", categories);
			return this;
		}
		public listByCategoryRequest q(String q) {
            setQueryParam(this.queryParams, "q", q);
			return this;
		}
		public listByCategoryRequest offset(Integer offset) {
            setQueryParam(this.queryParams, "offset", offset);
			return this;
		}
		public listByCategoryRequest limit(Integer limit) {
            setQueryParam(this.queryParams, "limit", limit);
			return this;
		}
		public listByCategoryRequest orderBy(String orderBy) {
            setQueryParam(this.queryParams, "order_by", orderBy);
			return this;
		}
		public listByCategoryRequest orderDirection(String orderDirection) {
            setQueryParam(this.queryParams, "order_direction", orderDirection);
			return this;
		}
		public listByCategoryRequest ensureTemplatesExists(Boolean ensureTemplatesExists) {
            setQueryParam(this.queryParams, "ensure_templates_exists", ensureTemplatesExists);
			return this;
		}






		public PageList  execute() throws ApiException{

			String path = "/publisher/offer/template/listByCategory".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "array",
                                                     OfferTemplateCategories.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public listByCategoryRequest listByCategoryRequest(){
		return new listByCategoryRequest(headerParams);
	}



    /**
      * API Request for makeGlobal
      */
	public class makeGlobalRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public makeGlobalRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public makeGlobalRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public makeGlobalRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}






		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/makeGlobal".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public makeGlobalRequest makeGlobalRequest(){
		return new makeGlobalRequest(headerParams);
	}



    /**
      * API Request for restore
      */
	public class restoreRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public restoreRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }

		public restoreRequest aid(String aid) {
            setQueryParam(this.queryParams, "aid", aid);
			return this;
		}
		public restoreRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.queryParams, "offer_template_id", offerTemplateId);
			return this;
		}
		public restoreRequest historyComment(String historyComment) {
            setQueryParam(this.queryParams, "history_comment", historyComment);
			return this;
		}






		public void  execute() throws ApiException{

			String path = "/publisher/offer/template/restore".replaceAll("\\{format\\}","json");

            getInvoker().invokeAPI(basePath, path, "GET", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     null,
                                                     null);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public restoreRequest restoreRequest(){
		return new restoreRequest(headerParams);
	}



    /**
      * API Request for update
      */
	public class updateRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public updateRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }


		public updateRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public updateRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.formParams, "offer_template_id", offerTemplateId);
			return this;
		}
		public updateRequest name(String name) {
            setQueryParam(this.formParams, "name", name);
			return this;
		}
		public updateRequest description(String description) {
            setQueryParam(this.formParams, "description", description);
			return this;
		}
		public updateRequest categoryId(String categoryId) {
            setQueryParam(this.formParams, "category_id", categoryId);
			return this;
		}
		public updateRequest thumbnailImageUrl(String thumbnailImageUrl) {
            setQueryParam(this.formParams, "thumbnail_image_url", thumbnailImageUrl);
			return this;
		}
		public updateRequest historyComment(String historyComment) {
            setQueryParam(this.formParams, "history_comment", historyComment);
			return this;
		}





		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/update".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "POST", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public updateRequest updateRequest(){
		return new updateRequest(headerParams);
	}



    /**
      * API Request for updateFull
      */
	public class updateFullRequest implements ApiRequest {

        Map headerParams;
        Map> queryParams = new HashMap<>();
        Map> formParams = new HashMap<>();
        Object body = null;

        public updateFullRequest(Map headerParams) {
            this.headerParams = headerParams;
        }

        public Map> getPreparedFormParams() {
            return Collections.unmodifiableMap(formParams);
        }


		public updateFullRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public updateFullRequest offerTemplateId(String offerTemplateId) {
            setQueryParam(this.formParams, "offer_template_id", offerTemplateId);
			return this;
		}
		public updateFullRequest name(String name) {
            setQueryParam(this.formParams, "name", name);
			return this;
		}
		public updateFullRequest description(String description) {
            setQueryParam(this.formParams, "description", description);
			return this;
		}
		public updateFullRequest categoryId(String categoryId) {
            setQueryParam(this.formParams, "category_id", categoryId);
			return this;
		}
		public updateFullRequest thumbnailImageUrl(String thumbnailImageUrl) {
            setQueryParam(this.formParams, "thumbnail_image_url", thumbnailImageUrl);
			return this;
		}
		public updateFullRequest action(String action) {
            setQueryParam(this.formParams, "action", action);
			return this;
		}
		public updateFullRequest versionName(String versionName) {
            setQueryParam(this.formParams, "version_name", versionName);
			return this;
		}
		public updateFullRequest version(Long version) {
            setQueryParam(this.formParams, "version", version);
			return this;
		}
		public updateFullRequest content1Type(String content1Type) {
            setQueryParam(this.formParams, "content1_type", content1Type);
			return this;
		}
		public updateFullRequest content1Value(String content1Value) {
            setQueryParam(this.formParams, "content1_value", content1Value);
			return this;
		}
		public updateFullRequest content2Type(String content2Type) {
            setQueryParam(this.formParams, "content2_type", content2Type);
			return this;
		}
		public updateFullRequest content2Value(String content2Value) {
            setQueryParam(this.formParams, "content2_value", content2Value);
			return this;
		}
		public updateFullRequest externalCssList(String externalCssList) {
            setQueryParam(this.formParams, "external_css_list", externalCssList);
			return this;
		}
		public updateFullRequest contentFieldList(String contentFieldList) {
            setQueryParam(this.formParams, "content_field_list", contentFieldList);
			return this;
		}
		public updateFullRequest historyComment(String historyComment) {
            setQueryParam(this.formParams, "history_comment", historyComment);
			return this;
		}
		public updateFullRequest isValidate(Boolean isValidate) {
            setQueryParam(this.formParams, "is_validate", isValidate);
			return this;
		}





		public OfferTemplateVersion  execute() throws ApiException{

			String path = "/publisher/offer/template/updatefull".replaceAll("\\{format\\}","json");

			return getInvoker().invokeAPI(basePath, path, "POST", token,
                                                     queryParams, null,
                                                     headerParams,
                                                     formParams,
                                                     "",
                                                     OfferTemplateVersion.class);
		}

	}


    /**
      * Helper method to create a new request.
      */
	public updateFullRequest updateFullRequest(){
		return new updateFullRequest(headerParams);
	}




}