func TestModelFromSnapshot(snapshot *firestore.DocumentSnapshot) (*TestModelWrapper, error) {
	temp := &TestModel{}
	err := snapshot.DataTo(temp)
	if err != nil {
		return nil, err
	}
	path := TestModelPathToStruct(snapshot.Ref.Path)
	pathStr := TestModelStructToPath(path)
	wrapper := &TestModelWrapper{Path: path, PathStr: pathStr, pathStr: pathStr, ref: snapshot.Ref, Data: temp}
	return wrapper, nil
}
TestModelFromSnapshot is a function that will create an instance of the model from a document snapshot
package firemodel
import (
	"cloud.google.com/go/firestore"
	"context"
	"errors"
	"fmt"
	"github.com/visor-tax/firemodel/runtime"
	"google.golang.org/genproto/googleapis/type/latlng"
	"regexp"
	"time"
)
type TestModel struct {
	Name string `firestore:"name,omitempty"`
	Age int64 `firestore:"age"`
	Pi float64 `firestore:"pi"`
	Birthdate time.Time `firestore:"birthdate,omitempty"`
	IsGood     bool                     `firestore:"isGood"`
	Data       []byte                   `firestore:"data,omitempty"`
	Friend     *firestore.DocumentRef   `firestore:"friend,omitempty"`
	Location   *latlng.LatLng           `firestore:"location,omitempty"`
	Colors     []string                 `firestore:"colors,omitempty"`
	Numbers    []int64                  `firestore:"numbers,omitempty"`
	Bools      []bool                   `firestore:"bools,omitempty"`
	Doubles    []float64                `firestore:"doubles,omitempty"`
	Directions []TestEnum               `firestore:"directions,omitempty"`
	Models     []*TestStruct            `firestore:"models,omitempty"`
	Models2    []*TestStruct            `firestore:"models2,omitempty"`
	Refs       []*firestore.DocumentRef `firestore:"refs,omitempty"`
	ModelRefs  []*firestore.DocumentRef `firestore:"modelRefs,omitempty"`
	Meta       map[string]interface{}   `firestore:"meta,omitempty"`
	MetaStrs   map[string]string        `firestore:"metaStrs,omitempty"`
	Direction  TestEnum                 `firestore:"direction,omitempty"`
	TestFile   *runtime.File            `firestore:"testFile,omitempty"`
	Url        runtime.URL              `firestore:"url,omitempty"`
	Nested     *TestStruct              `firestore:"nested,omitempty"`
	CreatedAt time.Time `firestore:"createdAt"`
	UpdatedAt time.Time `firestore:"updatedAt"`
}
func TestModelPath(userId string, testModelId string) string {
	return fmt.Sprintf("users/%s/test_models/%s", userId, testModelId)
}
var TestModelRegexPath = regexp.MustCompile("^(?:projects/[^/]*/databases/[^/]*/documents/)?(?:/)?users/([a-zA-Z0-9]+)/test_models/([a-zA-Z0-9]+)$")
var TestModelRegexNamedPath = regexp.MustCompile("^(?:projects/[^/]*/databases/[^/]*/documents/)?(?:/)?users/(?P<user_id>[a-zA-Z0-9]+)/test_models/(?P<test_model_id>[a-zA-Z0-9]+)$")
type TestModelPathStruct struct {
	UserId      string
	TestModelId string
}
func TestModelPathToStruct(path string) *TestModelPathStruct {
	parsed := TestModelRegexPath.FindStringSubmatch(path)
	result := &TestModelPathStruct{UserId: parsed[1], TestModelId: parsed[2]}
	return result
}
func TestModelStructToPath(path *TestModelPathStruct) string {
	built := fmt.Sprintf("users/%s/test_models/%s", path.UserId, path.TestModelId)
	return built
}
type TestModelWrapper struct {
	Data    *TestModel
	Path    *TestModelPathStruct
	PathStr string
	client  *clientTestModel
	pathStr string
	ref     *firestore.DocumentRef
}