func (z *Zoho) GenerateTokenRequest(clientID, clientSecret, code, redirectURI string) (err error) {
	z.oauth.clientID = clientID
	z.oauth.clientSecret = clientSecret
	z.oauth.redirectURI = redirectURI
	err = z.CheckForSavedTokens()
	if err == ErrTokenExpired {
		return z.RefreshTokenRequest()
	}
	q := url.Values{}
	q.Set("client_id", clientID)
	q.Set("client_secret", clientSecret)
	q.Set("code", code)
	q.Set("redirect_uri", redirectURI)
	q.Set("grant_type", "authorization_code")
	tokenURL := fmt.Sprintf("%s%s?%s", z.oauth.baseURL, oauthGenerateTokenRequestSlug, q.Encode())
	resp, err := z.client.Post(tokenURL, "application/x-www-form-urlencoded", nil)
	if err != nil {
		return fmt.Errorf("Failed while requesting generate token: %s", err)
	}
	defer func() {
		if err := resp.Body.Close(); err != nil {
			fmt.Printf("Failed to close request body: %s\n", err)
		}
	}()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return fmt.Errorf("Failed to read request body on request to %s%s: %s", z.oauth.baseURL, oauthGenerateTokenRequestSlug, err)
	}
	if resp.StatusCode != 200 {
		return fmt.Errorf("Got non-200 status code from request to generate token: %s\n%s", resp.Status, string(body))
	}
	tokenResponse := AccessTokenResponse{}
	err = json.Unmarshal(body, &tokenResponse)
	if err != nil {
		return fmt.Errorf("Failed to unmarshal access token response from request to generate token: %s", err)
	}
	if tokenResponse.Error == "invalid_code" {
		return ErrTokenInvalidCode
	}
	if tokenResponse.Error == "invalid_client_secret" {
		return ErrClientSecretInvalidCode
	}
	z.oauth.clientID = clientID
	z.oauth.clientSecret = clientSecret
	z.oauth.redirectURI = redirectURI
	z.oauth.token = tokenResponse
	err = z.SaveTokens(z.oauth.token)
	if err != nil {
		return fmt.Errorf("Failed to save access tokens: %s", err)
	}
	return nil
}
GenerateTokenRequest will get the Access token and Refresh token and hold them in the Zoho struct. This function can be used rather than
AuthorizationCodeRequest is you do not want to click on a link and redirect to a consent screen. Instead you can go to, https://accounts.zoho.com/developerconsole
and click the kebab icon beside your clientID, and click 'Self-Client'; then you can define you scopes and an expiry, then provide the generated authorization code
to this function which will generate your access token and refresh tokens.
package zoho
import (
	"context"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net"
	"net/http"
	"net/url"
	"strings"
	"time"
)
func (z *Zoho) SetRefreshToken(refreshToken string) {
	z.oauth.token.RefreshToken = refreshToken
}
func (z *Zoho) SetClientID(clientID string) {
	z.oauth.clientID = clientID
}
func (z *Zoho) SetClientSecret(clientSecret string) {
	z.oauth.clientSecret = clientSecret
}
func (z *Zoho) RefreshTokenRequest() (err error) {
	q := url.Values{}
	q.Set("client_id", z.oauth.clientID)
	q.Set("client_secret", z.oauth.clientSecret)
	q.Set("refresh_token", z.oauth.token.RefreshToken)
	q.Set("grant_type", "refresh_token")
	tokenURL := fmt.Sprintf("%s%s?%s", z.oauth.baseURL, oauthGenerateTokenRequestSlug, q.Encode())
	resp, err := z.client.Post(tokenURL, "application/x-www-form-urlencoded", nil)
	if err != nil {
		return fmt.Errorf("Failed while requesting refresh token: %s", err)
	}
	defer func() {
		if err := resp.Body.Close(); err != nil {
			fmt.Printf("Failed to close request body: %s\n", err)
		}
	}()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return fmt.Errorf("Failed to read request body on request to %s%s: %s", z.oauth.baseURL, oauthGenerateTokenRequestSlug, err)
	}
	if resp.StatusCode != 200 {
		return fmt.Errorf("Got non-200 status code from request to refresh token: %s\n%s", resp.Status, string(body))
	}
	tokenResponse := AccessTokenResponse{}
	err = json.Unmarshal(body, &tokenResponse)
	if err != nil {
		return fmt.Errorf("Failed to unmarshal access token response from request to refresh token: %s", err)
	}
	if tokenResponse.Error == "invalid_code" {
		return ErrTokenInvalidCode
	}
	if tokenResponse.Error == "invalid_client_secret" {
		return ErrClientSecretInvalidCode
	}
	z.oauth.token.AccessToken = tokenResponse.AccessToken
	z.oauth.token.APIDomain = tokenResponse.APIDomain
	z.oauth.token.ExpiresIn = tokenResponse.ExpiresIn
	z.oauth.token.TokenType = tokenResponse.TokenType
	err = z.SaveTokens(z.oauth.token)
	if err != nil {
		return fmt.Errorf("Failed to save access tokens: %s", err)
	}
	return nil
}