package main

import (
	"os"

	.  "github.com/aspose-cells-cloud/aspose-cells-cloud-go/v25"
)

func main() {
	instance := NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"), "https://api.aspose.cloud", "v3.0")
	remoteFolder := "TestData/In"

	localName := "Book1.xlsx"
	remoteName := "Book1.xlsx"

	localNameRequest := new(UploadFileRequest)
	localNameRequest.UploadFiles = make(map[string]string)
	localNameRequest.UploadFiles[localName] = localName
	localNameRequest.Path = remoteFolder + "/" + remoteName
	localNameRequest.StorageName = ""
	instance.UploadFile(localNameRequest)

	var tableTotalRequeststableTotalRequest0 = new(TableTotalRequest)
	tableTotalRequeststableTotalRequest0.ListColumnIndex = int64(1)
	tableTotalRequeststableTotalRequest0.TotalsCalculation = "Average"
	var tableTotalRequests = []TableTotalRequest{*tableTotalRequeststableTotalRequest0}

	request := new(PostWorksheetListColumnsTotalRequest)
	request.Name = remoteName
	request.SheetName = "Sheet7"
	request.ListObjectIndex = int64(0)
	request.TableTotalRequests = tableTotalRequests
	request.Folder = remoteFolder
	request.StorageName = ""
	_, httpResponse, err := instance.PostWorksheetListColumnsTotal(request)
	if err != nil {
		println(err.Error())
	} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
		println("Fail")
	}
}