func (c *googleAPIClient) UsersAndGroups() ([]*cua.LinuxUserView, []*cua.LinuxGroupView, error) {
	logger.Info("Fetching users and groups.")
	p, z, i, err := c.instanceInfo()
	if err != nil {
		return nil, nil, err
	}
	view, err := c.service.Linux.GetLinuxAccountViews(p, z, i).Do()
	if err != nil {
		return nil, nil, err
	} else if view.Resource == nil {
		return nil, nil, nil
	} else {
		return view.Resource.UserViews, view.Resource.GroupViews, nil
	}
}
UsersAndGroups satisfies APIClient.
package apiclient
import (
	"fmt"
	"net/http"
	"path"
	"strings"
	"time"
	"golang.org/x/oauth2"
	"golang.org/x/oauth2/google"
	"google.golang.org/api/googleapi"
	"google.golang.org/cloud/compute/metadata"
	"github.com/GoogleCloudPlatform/compute-user-accounts/logger"
	cua "google.golang.org/api/clouduseraccounts/vm_beta"
)
type APIClient interface {
	UsersAndGroups() ([]*cua.LinuxUserView, []*cua.LinuxGroupView, error)
	AuthorizedKeys(username string) (*cua.AuthorizedKeysView, error)
}
type Config struct {
	APIBase string
	InstanceBase string
	UserAgent string
	Timeout time.Duration
}
type googleAPIClient struct {
	config  *Config
	service *cua.Service
}
func New(config *Config) (APIClient, error) {
	service, err := cua.New(&http.Client{
		Transport: &oauth2.Transport{Source: google.ComputeTokenSource("")},
		Timeout:   config.Timeout,
	})
	if err != nil {
		return nil, err
	}
	service.BasePath = strings.TrimRight(config.APIBase, "/") + "/projects/"
	service.UserAgent = config.UserAgent
	client := &googleAPIClient{
		config:  config,
		service: service,
	}
	return client, nil
}