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

com.tinypass.client.publisher.api.PublisherUserApi 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 java.math.BigDecimal;
import java.util.Date;
import com.tinypass.client.publisher.model.User;

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

public class PublisherUserApi {

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

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

	public PublisherUserApi(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 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 uid(String uid) {
            setQueryParam(this.formParams, "uid", uid);
			return this;
		}
		public createRequest email(String email) {
            setQueryParam(this.formParams, "email", email);
			return this;
		}
		public createRequest firstName(String firstName) {
            setQueryParam(this.formParams, "first_name", firstName);
			return this;
		}
		public createRequest lastName(String lastName) {
            setQueryParam(this.formParams, "last_name", lastName);
			return this;
		}
		public createRequest createFromExternal(Boolean createFromExternal) {
            setQueryParam(this.formParams, "create_from_external", createFromExternal);
			return this;
		}





		public User  execute() throws ApiException{

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

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

	}


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



    /**
      * API Request for disable
      */
	public class disableRequest implements ApiRequest {

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

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

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


		public disableRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public disableRequest uid(String uid) {
            setQueryParam(this.formParams, "uid", uid);
			return this;
		}





		public void  execute() throws ApiException{

			String path = "/publisher/user/disable".replaceAll("\\{format\\}","json");

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

	}


    /**
      * Helper method to create a new request.
      */
	public disableRequest disableRequest(){
		return new disableRequest(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.formParams, "aid", aid);
			return this;
		}
		public getRequest uid(String uid) {
            setQueryParam(this.formParams, "uid", uid);
			return this;
		}
		public getRequest disabled(Boolean disabled) {
            setQueryParam(this.formParams, "disabled", disabled);
			return this;
		}





		public User  execute() throws ApiException{

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

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

	}


    /**
      * Helper method to create a new request.
      */
	public getRequest getRequest(){
		return new getRequest(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.formParams, "aid", aid);
			return this;
		}
		public listRequest disabled(Boolean disabled) {
            setQueryParam(this.formParams, "disabled", disabled);
			return this;
		}
		public listRequest q(String q) {
            setQueryParam(this.formParams, "q", q);
			return this;
		}
		public listRequest offset(Integer offset) {
            setQueryParam(this.formParams, "offset", offset);
			return this;
		}
		public listRequest limit(Integer limit) {
            setQueryParam(this.formParams, "limit", limit);
			return this;
		}
		public listRequest searchAfter(String searchAfter) {
            setQueryParam(this.formParams, "search_after", searchAfter);
			return this;
		}





		public PageList  execute() throws ApiException{

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

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

	}


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



    /**
      * API Request for register
      */
	public class registerRequest implements ApiRequest {

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

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

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


		public registerRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public registerRequest email(String email) {
            setQueryParam(this.formParams, "email", email);
			return this;
		}
		public registerRequest firstName(String firstName) {
            setQueryParam(this.formParams, "first_name", firstName);
			return this;
		}
		public registerRequest lastName(String lastName) {
            setQueryParam(this.formParams, "last_name", lastName);
			return this;
		}





		public User  execute() throws ApiException{

			String path = "/publisher/user/register".replaceAll("\\{format\\}","json");

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

	}


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



    /**
      * API Request for search
      */
	public class searchRequest implements ApiRequest {

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

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

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


		public searchRequest aid(String aid) {
            setQueryParam(this.formParams, "aid", aid);
			return this;
		}
		public searchRequest uid(String uid) {
            setQueryParam(this.formParams, "uid", uid);
			return this;
		}
		public searchRequest excludeCfMetadata(Boolean excludeCfMetadata) {
            setQueryParam(this.formParams, "exclude_cf_metadata", excludeCfMetadata);
			return this;
		}
		public searchRequest name(String name) {
            setQueryParam(this.formParams, "name", name);
			return this;
		}
		public searchRequest email(String email) {
            setQueryParam(this.formParams, "email", email);
			return this;
		}
		public searchRequest registeredFrom(Date registeredFrom) {
            setQueryParam(this.formParams, "registered_from", registeredFrom);
			return this;
		}
		public searchRequest registeredUntil(Date registeredUntil) {
            setQueryParam(this.formParams, "registered_until", registeredUntil);
			return this;
		}
		public searchRequest accessToResources(List accessToResources) {
            setQueryParam(this.formParams, "access_to_resources", accessToResources);
			return this;
		}
		public searchRequest convertedTerms(List convertedTerms) {
            setQueryParam(this.formParams, "converted_terms", convertedTerms);
			return this;
		}
		public searchRequest accessFrom(Date accessFrom) {
            setQueryParam(this.formParams, "access_from", accessFrom);
			return this;
		}
		public searchRequest accessUntil(Date accessUntil) {
            setQueryParam(this.formParams, "access_until", accessUntil);
			return this;
		}
		public searchRequest convertedTermFrom(Date convertedTermFrom) {
            setQueryParam(this.formParams, "converted_term_from", convertedTermFrom);
			return this;
		}
		public searchRequest convertedTermUntil(Date convertedTermUntil) {
            setQueryParam(this.formParams, "converted_term_until", convertedTermUntil);
			return this;
		}
		public searchRequest convertedTermSharingType(String convertedTermSharingType) {
            setQueryParam(this.formParams, "converted_term_sharing_type", convertedTermSharingType);
			return this;
		}
		public searchRequest redeemedPromotions(List redeemedPromotions) {
            setQueryParam(this.formParams, "redeemed_promotions", redeemedPromotions);
			return this;
		}
		public searchRequest redeemedPromotionFrom(Date redeemedPromotionFrom) {
            setQueryParam(this.formParams, "redeemed_promotion_from", redeemedPromotionFrom);
			return this;
		}
		public searchRequest redeemedPromotionUntil(Date redeemedPromotionUntil) {
            setQueryParam(this.formParams, "redeemed_promotion_until", redeemedPromotionUntil);
			return this;
		}
		public searchRequest trialPeriodIsActive(Boolean trialPeriodIsActive) {
            setQueryParam(this.formParams, "trial_period_is_active", trialPeriodIsActive);
			return this;
		}
		public searchRequest hasTrialPeriod(Boolean hasTrialPeriod) {
            setQueryParam(this.formParams, "has_trial_period", hasTrialPeriod);
			return this;
		}
		public searchRequest hasAccess(Boolean hasAccess) {
            setQueryParam(this.formParams, "has_access", hasAccess);
			return this;
		}
		public searchRequest hasConversionTerm(Boolean hasConversionTerm) {
            setQueryParam(this.formParams, "has_conversion_term", hasConversionTerm);
			return this;
		}
		public searchRequest hasRedeemedPromotion(Boolean hasRedeemedPromotion) {
            setQueryParam(this.formParams, "has_redeemed_promotion", hasRedeemedPromotion);
			return this;
		}
		public searchRequest includeTrialRedemptions(Boolean includeTrialRedemptions) {
            setQueryParam(this.formParams, "include_trial_redemptions", includeTrialRedemptions);
			return this;
		}
		public searchRequest convertedTermTypes(List convertedTermTypes) {
            setQueryParam(this.formParams, "converted_term_types", convertedTermTypes);
			return this;
		}
		public searchRequest hasConversionTermType(Boolean hasConversionTermType) {
            setQueryParam(this.formParams, "has_conversion_term_type", hasConversionTermType);
			return this;
		}
		public searchRequest spentMoneyCurrency(String spentMoneyCurrency) {
            setQueryParam(this.formParams, "spent_money_currency", spentMoneyCurrency);
			return this;
		}
		public searchRequest spentMoneyFrom(BigDecimal spentMoneyFrom) {
            setQueryParam(this.formParams, "spent_money_from", spentMoneyFrom);
			return this;
		}
		public searchRequest spentMoneyUntil(BigDecimal spentMoneyUntil) {
            setQueryParam(this.formParams, "spent_money_until", spentMoneyUntil);
			return this;
		}
		public searchRequest spentFromDate(Date spentFromDate) {
            setQueryParam(this.formParams, "spent_from_date", spentFromDate);
			return this;
		}
		public searchRequest spentUntilDate(Date spentUntilDate) {
            setQueryParam(this.formParams, "spent_until_date", spentUntilDate);
			return this;
		}
		public searchRequest paymentMethods(List paymentMethods) {
            setQueryParam(this.formParams, "payment_methods", paymentMethods);
			return this;
		}
		public searchRequest billingFailureFrom(Date billingFailureFrom) {
            setQueryParam(this.formParams, "billing_failure_from", billingFailureFrom);
			return this;
		}
		public searchRequest billingFailureUntil(Date billingFailureUntil) {
            setQueryParam(this.formParams, "billing_failure_until", billingFailureUntil);
			return this;
		}
		public searchRequest hadBillingFailure(Boolean hadBillingFailure) {
            setQueryParam(this.formParams, "had_billing_failure", hadBillingFailure);
			return this;
		}
		public searchRequest hasPayment(Boolean hasPayment) {
            setQueryParam(this.formParams, "has_payment", hasPayment);
			return this;
		}
		public searchRequest upiExtCustomerId(String upiExtCustomerId) {
            setQueryParam(this.formParams, "upi_ext_customer_id", upiExtCustomerId);
			return this;
		}
		public searchRequest creditCardWillExpire(String creditCardWillExpire) {
            setQueryParam(this.formParams, "credit_card_will_expire", creditCardWillExpire);
			return this;
		}
		public searchRequest activeSubscriptionToResources(List activeSubscriptionToResources) {
            setQueryParam(this.formParams, "active_subscription_to_resources", activeSubscriptionToResources);
			return this;
		}
		public searchRequest hasActiveSubscription(Boolean hasActiveSubscription) {
            setQueryParam(this.formParams, "has_active_subscription", hasActiveSubscription);
			return this;
		}
		public searchRequest subscriptionStartFrom(Date subscriptionStartFrom) {
            setQueryParam(this.formParams, "subscription_start_from", subscriptionStartFrom);
			return this;
		}
		public searchRequest subscriptionStartUntil(Date subscriptionStartUntil) {
            setQueryParam(this.formParams, "subscription_start_until", subscriptionStartUntil);
			return this;
		}
		public searchRequest subscriptionRenewFrom(Date subscriptionRenewFrom) {
            setQueryParam(this.formParams, "subscription_renew_from", subscriptionRenewFrom);
			return this;
		}
		public searchRequest subscriptionRenewUntil(Date subscriptionRenewUntil) {
            setQueryParam(this.formParams, "subscription_renew_until", subscriptionRenewUntil);
			return this;
		}
		public searchRequest subscriptionExpireFrom(Date subscriptionExpireFrom) {
            setQueryParam(this.formParams, "subscription_expire_from", subscriptionExpireFrom);
			return this;
		}
		public searchRequest subscriptionExpireUntil(Date subscriptionExpireUntil) {
            setQueryParam(this.formParams, "subscription_expire_until", subscriptionExpireUntil);
			return this;
		}
		public searchRequest trialExpireFrom(Date trialExpireFrom) {
            setQueryParam(this.formParams, "trial_expire_from", trialExpireFrom);
			return this;
		}
		public searchRequest trialExpireUntil(Date trialExpireUntil) {
            setQueryParam(this.formParams, "trial_expire_until", trialExpireUntil);
			return this;
		}
		public searchRequest hasAnySubscriptions(Boolean hasAnySubscriptions) {
            setQueryParam(this.formParams, "has_any_subscriptions", hasAnySubscriptions);
			return this;
		}
		public searchRequest hasSubscriptionWillRenew(Boolean hasSubscriptionWillRenew) {
            setQueryParam(this.formParams, "has_subscription_will_renew", hasSubscriptionWillRenew);
			return this;
		}
		public searchRequest hasSubscriptionWillExpire(Boolean hasSubscriptionWillExpire) {
            setQueryParam(this.formParams, "has_subscription_will_expire", hasSubscriptionWillExpire);
			return this;
		}
		public searchRequest hasSubscriptionStarts(Boolean hasSubscriptionStarts) {
            setQueryParam(this.formParams, "has_subscription_starts", hasSubscriptionStarts);
			return this;
		}
		public searchRequest hasUnresolvedInquiry(Boolean hasUnresolvedInquiry) {
            setQueryParam(this.formParams, "has_unresolved_inquiry", hasUnresolvedInquiry);
			return this;
		}
		public searchRequest submittedInquiryFrom(Date submittedInquiryFrom) {
            setQueryParam(this.formParams, "submitted_inquiry_from", submittedInquiryFrom);
			return this;
		}
		public searchRequest submittedInquiryUntil(Date submittedInquiryUntil) {
            setQueryParam(this.formParams, "submitted_inquiry_until", submittedInquiryUntil);
			return this;
		}
		public searchRequest receivedResponseFrom(Date receivedResponseFrom) {
            setQueryParam(this.formParams, "received_response_from", receivedResponseFrom);
			return this;
		}
		public searchRequest receivedResponseUntil(Date receivedResponseUntil) {
            setQueryParam(this.formParams, "received_response_until", receivedResponseUntil);
			return this;
		}
		public searchRequest resolvedInquiryFrom(Date resolvedInquiryFrom) {
            setQueryParam(this.formParams, "resolved_inquiry_from", resolvedInquiryFrom);
			return this;
		}
		public searchRequest resolvedInquiryUntil(Date resolvedInquiryUntil) {
            setQueryParam(this.formParams, "resolved_inquiry_until", resolvedInquiryUntil);
			return this;
		}
		public searchRequest hasSubmittedInquiry(Boolean hasSubmittedInquiry) {
            setQueryParam(this.formParams, "has_submitted_inquiry", hasSubmittedInquiry);
			return this;
		}
		public searchRequest hasReceivedResponseInquiry(Boolean hasReceivedResponseInquiry) {
            setQueryParam(this.formParams, "has_received_response_inquiry", hasReceivedResponseInquiry);
			return this;
		}
		public searchRequest hasResolvedInquiry(Boolean hasResolvedInquiry) {
            setQueryParam(this.formParams, "has_resolved_inquiry", hasResolvedInquiry);
			return this;
		}
		public searchRequest hasLicensingContractRedemptions(Boolean hasLicensingContractRedemptions) {
            setQueryParam(this.formParams, "has_licensing_contract_redemptions", hasLicensingContractRedemptions);
			return this;
		}
		public searchRequest selectedLicensees(List selectedLicensees) {
            setQueryParam(this.formParams, "selected_licensees", selectedLicensees);
			return this;
		}
		public searchRequest selectedContracts(List selectedContracts) {
            setQueryParam(this.formParams, "selected_contracts", selectedContracts);
			return this;
		}
		public searchRequest licensingContractRedeemedFrom(Date licensingContractRedeemedFrom) {
            setQueryParam(this.formParams, "licensing_contract_redeemed_from", licensingContractRedeemedFrom);
			return this;
		}
		public searchRequest licensingContractRedeemedUntil(Date licensingContractRedeemedUntil) {
            setQueryParam(this.formParams, "licensing_contract_redeemed_until", licensingContractRedeemedUntil);
			return this;
		}
		public searchRequest dataType(List dataType) {
            setQueryParam(this.formParams, "data_type", dataType);
			return this;
		}
		public searchRequest data(String data) {
            setQueryParam(this.formParams, "data", data);
			return this;
		}
		public searchRequest hasData(Boolean hasData) {
            setQueryParam(this.formParams, "has_data", hasData);
			return this;
		}
		public searchRequest hasLastAccessTime(Boolean hasLastAccessTime) {
            setQueryParam(this.formParams, "has_last_access_time", hasLastAccessTime);
			return this;
		}
		public searchRequest lastAccessTimeFrom(Date lastAccessTimeFrom) {
            setQueryParam(this.formParams, "last_access_time_from", lastAccessTimeFrom);
			return this;
		}
		public searchRequest lastAccessTimeUntil(Date lastAccessTimeUntil) {
            setQueryParam(this.formParams, "last_access_time_until", lastAccessTimeUntil);
			return this;
		}
		public searchRequest selectedConsentsMap(List selectedConsentsMap) {
            setQueryParam(this.formParams, "selected_consents_map", selectedConsentsMap);
			return this;
		}
		public searchRequest consentChecked(Boolean consentChecked) {
            setQueryParam(this.formParams, "consent_checked", consentChecked);
			return this;
		}
		public searchRequest customFields(String customFields) {
            setQueryParam(this.formParams, "custom_fields", customFields);
			return this;
		}
		public searchRequest source(String source) {
            setQueryParam(this.formParams, "source", source);
			return this;
		}
		public searchRequest invertCreditCardWillExpire(Boolean invertCreditCardWillExpire) {
            setQueryParam(this.formParams, "invert_credit_card_will_expire", invertCreditCardWillExpire);
			return this;
		}
		public searchRequest hasEmailConfirmationRequired(Boolean hasEmailConfirmationRequired) {
            setQueryParam(this.formParams, "has_emailConfirmation_required", hasEmailConfirmationRequired);
			return this;
		}
		public searchRequest consentHasData(Boolean consentHasData) {
            setQueryParam(this.formParams, "consent_has_data", consentHasData);
			return this;
		}
		public searchRequest orderBy(String orderBy) {
            setQueryParam(this.formParams, "order_by", orderBy);
			return this;
		}
		public searchRequest orderDirection(String orderDirection) {
            setQueryParam(this.formParams, "order_direction", orderDirection);
			return this;
		}
		public searchRequest q(String q) {
            setQueryParam(this.formParams, "q", q);
			return this;
		}
		public searchRequest offset(Integer offset) {
            setQueryParam(this.formParams, "offset", offset);
			return this;
		}
		public searchRequest limit(Integer limit) {
            setQueryParam(this.formParams, "limit", limit);
			return this;
		}
		public searchRequest searchAfter(String searchAfter) {
            setQueryParam(this.formParams, "search_after", searchAfter);
			return this;
		}
		public searchRequest esdebug(Boolean esdebug) {
            setQueryParam(this.formParams, "esdebug", esdebug);
			return this;
		}





		public PageList  execute() throws ApiException{

			String path = "/publisher/user/search".replaceAll("\\{format\\}","json");

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

	}


    /**
      * Helper method to create a new request.
      */
	public searchRequest searchRequest(){
		return new searchRequest(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 uid(String uid) {
            setQueryParam(this.formParams, "uid", uid);
			return this;
		}
		public updateRequest email(String email) {
            setQueryParam(this.formParams, "email", email);
			return this;
		}
		public updateRequest firstName(String firstName) {
            setQueryParam(this.formParams, "first_name", firstName);
			return this;
		}
		public updateRequest lastName(String lastName) {
            setQueryParam(this.formParams, "last_name", lastName);
			return this;
		}



        public updateRequest customFields(Object customFields) {
            this.body = customFields;
			return this;
		}
        public updateRequest customFields(InputStream customFields) {
            this.body = customFields;
			return this;
		}
        public updateRequest customFieldsString(String customFields) {
            this.body = customFields;
            return this;
        }


		public User  execute() throws ApiException{

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

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

	}


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




}