func (p *FileInf) createProjectForAppsScriptApi(scriptId string) *ProjectForAppsScriptApi {
	pr := &ProjectForAppsScriptApi{}
	pr.ScriptId = scriptId
	if len(p.UpFilename) > 0 {
		for _, elm := range p.UpFilename {
			if ChkExtention(filepath.Ext(elm)) {
				filedata := &FilesForAppsScriptApi{
					Name:   strings.Replace(filepath.Base(elm), filepath.Ext(elm), "", -1),
					Type:   ExtToType(filepath.Ext(elm), true),
					Source: ConvGasToUpload(elm),
				}
				pr.Files = append(pr.Files, *filedata)
			}
		}
		if len(pr.Files) == 0 {
			fmt.Fprintf(os.Stderr, "Error: Inputted files cannot be used for GAS project.\n")
			os.Exit(1)
		}
	} else {
		filedata := &FilesForAppsScriptApi{
			Name:   "Code",
			Type:   "SERVER_JS",
			Source: "function myFunction() {\n  \n}\n",
		}
		pr.Files = append(pr.Files, *filedata)
	}
	return pr
}
createProjectForAppsScriptApi : Create json of project for Apps Script API.
package utl
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/url"
	"os"
	"path"
	"path/filepath"
	"strconv"
	"strings"
	"time"
)
const (
	appsscriptapi = "https://script.googleapis.com/v1/projects"
)
type AppsScriptApiInf struct {
	ScriptId       string         `json:"scriptId"`
	ParentId       string         `json:"parentId"`
	Title          string         `json:"title"`
	CreateTime     time.Time      `json:"createTime"`
	UpdateTime     time.Time      `json:"updateTime"`
	Creator        creator        `json:"creator"`
	LastModifyUser lastmodifyuser `json:"lastModifyUser"`
}
type creator struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}
type lastmodifyuser struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}
type ProjectForAppsScriptApi struct {
	ScriptId string                  `json:"scriptId,omitempty"`
	Files    []FilesForAppsScriptApi `json:"files"`
}
type FilesForAppsScriptApi struct {
	Name           string          `json:"name"`
	Type           string          `json:"type"`
	Source         string          `json:"source"`
	CreateTime     time.Time       `json:"createTime,omitempty"`
	UpdateTime     time.Time       `json:"updateTime,omitempty"`
	Creator        *creator        `json:"creator,omitempty"`
	LastModifyUser *lastmodifyuser `json:"lastModifyUser,omitempty"`
}
type manifestsStruct struct {
	TimeZone          string        `json:"timeZone,omitempty"`
	OauthScopes       []interface{} `json:"oauthScopes,omitempty"`
	Dependencies      interface{}   `json:"dependencies,omitempty"`
	ExceptionLogging  interface{}   `json:"exceptionLogging,omitempty"`
	Webapp            interface{}   `json:"webapp,omitempty"`
	ExecutionApi      interface{}   `json:"executionApi,omitempty"`
	UrlFetchWhitelist []interface{} `json:"urlFetchWhitelist,omitempty"`
	Gmail             interface{}   `json:"gmail,omitempty"`
}
type projectVersionList struct {
	Versions []struct {
		ScriptId      string    `json:"scriptId"`
		VersionNumber int       `json:"versionNumber"`
		Description   string    `json:"description"`
		CreateTime    time.Time `json:"createTime"`
	} `json:"versions"`
	NextPageToken string `json:"nextPageToken,omitempty"`
}
type createVersionSt struct {
	VersionNumber string `json:"versionNumber,omitempty"`
	Description   string `json:"description"`
	CreateTime    string `json:"createTime,omitempty"`
}
func (p *FileInf) getBoundScriptInf(id string) {
	tokenparams := url.Values{}
	tokenparams.Set("fields", "createTime,creator,lastModifyUser,parentId,scriptId,title,updateTime")
	r := &RequestParams{
		Method:      "GET",
		APIURL:      appsscriptapi + "/" + id + "?" + tokenparams.Encode(),
		Data:        nil,
		Contenttype: "application/x-www-form-urlencoded",
		Accesstoken: p.Accesstoken,
		Dtime:       30,
	}
	body, err := r.FetchAPI()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error: File ID '%s' is not found. ", id)
		DispScopeError2(body)
		os.Exit(1)
	}
	var i *AppsScriptApiInf
	json.Unmarshal(body, &i)
	p.FileName = i.Title
	p.MimeType = "application/vnd.google-apps.script"
	p.ParentID = i.ParentId
	p.FileID = i.ScriptId
	o := &owners{}
	o.Email = i.Creator.Email
	o.Name = i.Creator.Name
	p.Owners = append(p.Owners, *o)
	if i.LastModifyUser.Email != "" || i.LastModifyUser.Name != "" {
		lmu := &lastmodifieduser{
			i.LastModifyUser.Email,
			i.LastModifyUser.Name,
		}
		p.LastModifyingUser = lmu
	}
}
func (p *FileInf) getBoundScript(id string) *ProjectForAppsScriptApi {
	tokenparams := url.Values{}
	tokenparams.Set("fields", "files,scriptId")
	u, _ := url.Parse(appsscriptapi)
	u.Path = path.Join(u.Path, id+"/content")
	r := &RequestParams{
		Method:      "GET",
		APIURL:      u.String() + "?" + tokenparams.Encode(),
		Data:        nil,
		Contenttype: "application/x-www-form-urlencoded",
		Accesstoken: p.Accesstoken,
		Dtime:       30,
	}
	body, err := r.FetchAPI()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error: File ID '%s' is not found. ", p.SearchByID)
		DispScopeError2(body)
		os.Exit(1)
	}
	pf := &ProjectForAppsScriptApi{}
	json.Unmarshal(body, &pf)
	return pf
}
func (p *FileInf) boundScriptCreator(metadata []byte) *AppsScriptApiInf {
	tokenparams := url.Values{}
	tokenparams.Set("fields", "createTime,creator,lastModifyUser,parentId,scriptId,title,updateTime")
	r := &RequestParams{
		Method:      "POST",
		APIURL:      appsscriptapi + "?" + tokenparams.Encode(),
		Data:        bytes.NewBuffer(metadata),
		Accesstoken: p.Accesstoken,
		Dtime:       30,
	}
	body, err := r.FetchAPI()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error: %v.\n%v\n\n", err, string(body))
		fmt.Fprintf(os.Stderr, "One of reasons of error :\n Was the inputted parent ID correct?.\n")
		var u map[string]interface{}
		json.Unmarshal(body, &u)
		em := u["error"].(map[string]interface{})["message"]
		if em == "Request had insufficient authentication scopes." {
			DispScopeError1()
		} else if em == "Request contains an invalid argument." {
			fmt.Fprintf(os.Stderr, " - If this error occurs when you try to create project in Google Slides, this may be a bug. https://issuetracker.google.com/issues/72238499\n")
		}
		os.Exit(1)
	}
	var a *AppsScriptApiInf
	json.Unmarshal(body, &a)
	var uf uploadedFile
	uf.ID = a.ScriptId
	uf.Name = a.Title
	uf.MimeType = "application/vnd.google-apps.script"
	p.UppedFiles = append(p.UppedFiles, uf)
	return a
}
func (p *FileInf) ProjectUpdateByAppsScriptApi(pr *ProjectForAppsScriptApi) *AppsScriptApiInf {
	pre, _ := json.Marshal(pr)
	tokenparams := url.Values{}
	tokenparams.Set("fields", "files,scriptId")
	u, _ := url.Parse(appsscriptapi)
	u.Path = path.Join(u.Path, pr.ScriptId+"/content")
	r := &RequestParams{
		Method:      "PUT",
		APIURL:      u.String() + "?" + tokenparams.Encode(),
		Data:        bytes.NewBuffer(pre),
		Accesstoken: p.Accesstoken,
		Dtime:       30,
	}
	body, err := r.FetchAPI()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error: %v. ", err)
		DispScopeError2(body)
		os.Exit(1)
	}
	var asi *AppsScriptApiInf
	json.Unmarshal(body, &asi)
	return asi
}