func (is *InstanceStat) GetName() string {
	if is == nil || is.Name == nil {
		return ""
	}
	return *is.Name
}
GetName returns the Name field if it's non-nil, zero value otherwise.
package tillclient
import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"sync"
	"github.com/go-resty/resty/v2"
)
type InstanceStatsService service
type InstanceStat struct {
	Name                *string `json:"name,omitempty"`
	Requests            *uint64 `json:"requests,omitempty"`
	InterceptedRequests *uint64 `json:"intercepted_requests,omitempty"`
	SuccessfulRequests  *uint64 `json:"successful_requests,omitempty"`
	FailedRequests      *uint64 `json:"failed_requests,omitempty"`
	CacheHits           *uint64 `json:"cache_hits,omitempty"`
	CacheSets           *uint64 `json:"cache_sets,omitempty"`
}
type InstanceStatMutex struct {
	InstanceStat
	Mutex *sync.Mutex
}
func (s *InstanceStatsService) Update(ctx context.Context, is InstanceStat) (*Instance, *resty.Response, error) {
	if is.GetName() == "" {
		return nil, nil, errors.New("instance name is required")
	}
	u := fmt.Sprintf("instances/%v/stats", is.GetName())
	req, err := s.client.NewRequest(ctx, u, nil)
	req.SetBody(is)
	instance := new(Instance)
	resp, err := req.Put(u)
	if err != nil {
		return nil, resp, err
	}
	defer resp.RawResponse.Body.Close()
	b, err := ioutil.ReadAll(resp.RawResponse.Body)
	if err != nil {
		return nil, nil, err
	}
	json.Unmarshal(b, &instance)
	return instance, resp, nil
}
func (is *InstanceStat) GetRequests() uint64 {
	if is == nil || is.Requests == nil {
		return 0
	}
	return *is.Requests
}
func (is *InstanceStat) GetInterceptedRequests() uint64 {
	if is == nil || is.InterceptedRequests == nil {
		return 0
	}
	return *is.InterceptedRequests
}
func (is *InstanceStat) GetFailedRequests() uint64 {
	if is == nil || is.FailedRequests == nil {
		return 0
	}
	return *is.FailedRequests
}
func (is *InstanceStat) GetSuccessfulRequests() uint64 {
	if is == nil || is.SuccessfulRequests == nil {
		return 0
	}
	return *is.SuccessfulRequests
}
func (is *InstanceStat) GetCacheHits() uint64 {
	if is == nil || is.CacheHits == nil {
		return 0
	}
	return *is.CacheHits
}
func (is *InstanceStat) GetCacheSets() uint64 {
	if is == nil || is.CacheSets == nil {
		return 0
	}
	return *is.CacheSets
}