// NewPathLinkMetadata returns a new PathLinkMetadata instance
333186
func NewPathLinkMetadata(Url string, Visibility *Visibility, Path string) *PathLinkMetadata {
	s := new(PathLinkMetadata)
	s.Url = Url
	s.Visibility = Visibility
	s.Path = Path
	return s
}
655711
func addToPathMap(info *descriptor.SourceCodeInfo, i interface{}, path []int32) {
	loc := findLoc(info, path)
	if loc != nil {
		pathMap[i] = loc
	}
	switch d := i.(type) {
	case *descriptor.FileDescriptorProto:
		for index, descriptor := range d.MessageType {
			addToPathMap(info, descriptor, newPath(path, 4, index))
		}
		for index, descriptor := range d.EnumType {
			addToPathMap(info, descriptor, newPath(path, 5, index))
		}
		for index, descriptor := range d.Service {
			addToPathMap(info, descriptor, newPath(path, 6, index))
		}
	case *descriptor.DescriptorProto:
		for index, descriptor := range d.Field {
			addToPathMap(info, descriptor, newPath(path, 2, index))
		}
		for index, descriptor := range d.NestedType {
			addToPathMap(info, descriptor, newPath(path, 3, index))
		}
		for index, descriptor := range d.EnumType {
			addToPathMap(info, descriptor, newPath(path, 4, index))
		}
	case *descriptor.EnumDescriptorProto:
		for index, descriptor := range d.Value {
			addToPathMap(info, descriptor, newPath(path, 2, index))
		}
	case *descriptor.ServiceDescriptorProto:
		for index, descriptor := range d.Method {
			addToPathMap(info, descriptor, newPath(path, 2, index))
		}
	}
}
1360355
func parseMetadata(ctx context.Context, path, scheme string) (string, string, string, error) {
	rc, err := fetchMetadata(ctx, path, scheme)
	if err != nil {
		return "", "", "", err
	}
	defer rc.Close()

	imports, err := parseMetaGoImports(rc)
	if err != nil {
		return "", "", "", err
	}
	match := -1
	for i, im := range imports {
		if !strings.HasPrefix(path, im.Prefix) {
			continue
		}
		if match != -1 {
			return "", "", "", fmt.Errorf("multiple meta tags match import path %q", path)
		}
		match = i
	}
	if match == -1 {
		return "", "", "", fmt.Errorf("go-import metadata not found")
	}
	return imports[match].Prefix, imports[match].VCS, imports[match].RepoRoot, nil
}
681029
func NewFolderLinkMetadata(Url string, Name string, LinkPermissions *LinkPermissions) *FolderLinkMetadata {
	s := new(FolderLinkMetadata)
	s.Url = Url
	s.Name = Name
	s.LinkPermissions = LinkPermissions
	return s
}
813378
func NewGetTemporaryUploadLinkResult(Link string) *GetTemporaryUploadLinkResult {
	s := new(GetTemporaryUploadLinkResult)
	s.Link = Link
	return s
}
933292
func NewAlphaGetMetadataArg(Path string) *AlphaGetMetadataArg {
	s := new(AlphaGetMetadataArg)
	s.Path = Path
	s.IncludeMediaInfo = false
	s.IncludeDeleted = false
	s.IncludeHasExplicitSharedMembers = false
	return s
}
1200685
func NewAppLinkUserType(Description string) *AppLinkUserType {
	s := new(AppLinkUserType)
	s.Description = Description
	return s
}
253308
func NewAppLinkTeamType(Description string) *AppLinkTeamType {
	s := new(AppLinkTeamType)
	s.Description = Description
	return s
}
1238128
func (c *Client) NewPathClient(path string) (*Client, error) {
	u, err := url.Parse(c.server)
	if err != nil {
		return nil, fmt.Errorf("bogus server %q for NewPathClient receiver: %v", c.server, err)
	}
	u.Path = path
	pc, err := New(OptionServer(u.String()))
	if err != nil {
		return nil, err
	}
	pc.authMode = c.authMode
	pc.discoOnce.Do(noop)
	return pc, nil
}
682295
func NewSharedLinkMetadata(Url string, Name string, LinkPermissions *LinkPermissions) *SharedLinkMetadata {
	s := new(SharedLinkMetadata)
	s.Url = Url
	s.Name = Name
	s.LinkPermissions = LinkPermissions
	return s
}
777518
func (o *UplinkConnection) CreateMetadata(child *Metadata) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
185114
func NewMetadata(Name string) *Metadata {
	s := new(Metadata)
	s.Name = Name
	return s
}
1127707
func NewLinkAsset(u *url.URL, id, text string) *Link {
	return &Link{
		Asset: Asset{
			URL:  u,
			ID:   id,
			Type: LinkAsset,
		},
		Text: text,
	}
}
775405
func NewMetadata(kafkaClient Client, brokers *Brokers, metadataTTL time.Duration) *Metadata {
	return &Metadata{
		Brokers:            brokers,
		kafka:              kafkaClient,
		metadataTTL:        metadataTTL,
		metadata:           make(map[string]map[int32]int32),
		metadataExpires:    make(map[string]time.Time),
		offsetCoordinators: make(map[string]int32),
	}
}
303678
func (p *Params) AddMetadata(key, value string) {
	if p.Metadata == nil {
		p.Metadata = make(map[string]string)
	}

	p.Metadata[key] = value
}
922913
func NewMetadata(path string, create bool) (*SnapshotMetadata, error) {
	// check if the metadata dir exists.  If not, return an error if create is false
	dir := filepath.Dir(path)
	_, err := os.Stat(dir)
	if os.IsNotExist(err) {
		if !create {
			return nil, ErrNoMetadata
		}
	} else if err != nil {
		glog.Errorf("Could not stat dir %s: %s", dir, err)
		return nil, err
	}

	if err := os.MkdirAll(dir, 0755); err != nil && !os.IsExist(err) {
		return nil, err
	}
	metadata := &SnapshotMetadata{
		path: path,
		snapshotMetadata: snapshotMetadata{
			Snapshots: make(map[string]string),
		},
	}
	metadata.Lock()
	defer metadata.Unlock()
	if _, err := os.Stat(path); os.IsNotExist(err) {
		if create {
			metadata.save()
		} else {
			return nil, ErrNoMetadata
		}
	} else {
		if err := metadata.load(); err != nil {
			return nil, err
		}
	}
	return metadata, nil
}
1144092
func (c *ALIModelContext) LinkToNatGateway() *alitasks.NatGateway {
	return &alitasks.NatGateway{Name: s(c.GetNameForNatGateway())}
}