func UnmarshalJSON(response []byte, result interface{}) error {
	err := json.Unmarshal(response, result)
	if err != nil {
		return err
	}
	customFieldExtraction(result, response)
	return nil
}
UnmarshalJSON is used to unmarshal the response to Result / ResultList struct.
package chargebee
import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"runtime"
	"strings"
)
type RequestObj struct {
	Params *url.Values
	Method string
	Path   string
	Header map[string]string
}
func basicAuth(key string) string {
	return base64.StdEncoding.EncodeToString([]byte(key))
}
func Send(method string, path string, params interface{}) RequestObj {
	var form *url.Values
	if params != nil {
		form = SerializeParams(params)
	}
	return RequestObj{
		Params: form,
		Method: method,
		Path:   path,
	}
}
func SendList(method string, path string, params interface{}) RequestObj {
	var form *url.Values
	if params != nil {
		form = SerializeListParams(params)
	}
	return RequestObj{
		Params: form,
		Method: method,
		Path:   path,
	}
}
func (request RequestObj) AddParams(key string, value interface{}) RequestObj {
	request.Params.Set(key, fmt.Sprintf("%v", value))
	return request
}
func (request RequestObj) Headers(key string, value string) RequestObj {
	if request.Header == nil {
		request.Header = make(map[string]string)
	}
	request.Header[key] = value
	return request
}
func newRequest(env Environment, method string, path string, body io.Reader, headers map[string]string) (*http.Request, error) {
	if !strings.HasPrefix(path, "/") {
		path = "/" + path
	}
	path = env.apiBaseUrl() + path
	httpReq, err := http.NewRequest(method, path, body)
	if err != nil {
		panic(err)
	}
	addHeaders(httpReq, env)
	addCustomHeaders(httpReq, headers)
	return httpReq, err
}
func addHeaders(httpReq *http.Request, env Environment) {
	httpReq.Header.Add("Accept-Charset", Charset)
	httpReq.Header.Add("Content-Type", "application/x-www-form-urlencoded")
	httpReq.Header.Add("Accept", "application/json")
	httpReq.Header.Add("User-Agent", "ChargeBee-Go-Client v"+Version)
	httpReq.Header.Add("Authorization", "Basic "+basicAuth(env.Key))
	httpReq.Header.Add("Lang-Version", runtime.Version())
	httpReq.Header.Add("OS-Version", runtime.GOOS+" "+runtime.GOARCH)
}
func addCustomHeaders(httpReq *http.Request, headers map[string]string) {
	for k, v := range headers {
		httpReq.Header.Add(k, v)
	}
}