// Name returns the name for the resource and ID.
512745
func (s *LookupService) Name(ctx context.Context, resource platform.ResourceType, id platform.ID) (string, error) {
	return s.NameFn(ctx, resource, id)
}
931295
func (e *Element) Name() (string, error) {
	var str string
	err := e.c.get(e.path("/name"), &str)
	return str, err
}
335144
func (s *XPackSecurityGetRoleService) Name(name string) *XPackSecurityGetRoleService {
	s.name = name
	return s
}
451564
func (r *Route) Name(name string) *Route {
	r.name = name
	r.group.router.routes[name] = r
	return r
}
301108
func (r *PURuntime) Name() string {
	r.Lock()
	defer r.Unlock()

	return r.name
}
1136407
func (c *Client) Name(ctx context.Context, resource platform.ResourceType, id platform.ID) (string, error) {
	if err := resource.Valid(); err != nil {
		return "", err
	}

	if ok := id.Valid(); !ok {
		return "", platform.ErrInvalidID
	}

	switch resource {
	case platform.TasksResourceType: // 5 // TODO(goller): unify task bolt storage here so we can lookup names
	case platform.AuthorizationsResourceType: // 0 TODO(goller): authorizations should also have optional names
	case platform.BucketsResourceType: // 1
		r, err := c.FindBucketByID(ctx, id)
		if err != nil {
			return "", err
		}
		return r.Name, nil
	case platform.DashboardsResourceType: // 2
		r, err := c.FindDashboardByID(ctx, id)
		if err != nil {
			return "", err
		}
		return r.Name, nil
	case platform.OrgsResourceType: // 3
		r, err := c.FindOrganizationByID(ctx, id)
		if err != nil {
			return "", err
		}
		return r.Name, nil
	case platform.SourcesResourceType: // 4
		r, err := c.FindSourceByID(ctx, id)
		if err != nil {
			return "", err
		}
		return r.Name, nil
	case platform.TelegrafsResourceType: // 6
		r, err := c.FindTelegrafConfigByID(ctx, id)
		if err != nil {
			return "", err
		}
		return r.Name, nil
	case platform.UsersResourceType: // 7
		r, err := c.FindUserByID(ctx, id)
		if err != nil {
			return "", err
		}
		return r.Name, nil
	}

	return "", nil
}
655398
func (s *Session) Name() string {
	if s.sessionType == apitypes.MachineSession {
		return s.identity.(*envelope.Machine).Body.Name
	}

	return s.identity.(envelope.UserInf).Name()
}
1117425
func (g *Generator) Name() (first, middle, last string) {
	if g.FlipCoin(50) {
		return g.FemaleName()
	}
	return g.MaleName()
}
1362036
func (fiInfo *FieldInfo) Name() string {
	tagJSON := ucon.NewTagJSON(fiInfo.Base.Tag)
	name := tagJSON.Name()
	if name == "" {
		name = fiInfo.Base.Name
	}

	return name
}
160094
func (s *XPackSecurityGetRoleMappingService) Name(name string) *XPackSecurityGetRoleMappingService {
	s.name = name
	return s
}
645324
func (s *IndicesExistsTemplateService) Name(name string) *IndicesExistsTemplateService {
	s.name = name
	return s
}
221204
func (c *UsergroupsUpdateCall) Name(name string) *UsergroupsUpdateCall {
	c.name = name
	return c
}
1357454
func (ij *isolatedFile) name() string {
	name := filepath.Base(ij.path)
	if i := strings.LastIndex(name, "."); i != -1 {
		name = name[:i]
	}
	return name
}
196953
func (r *Request) Name(resourceName string) *Request {
	if r.err != nil {
		return r
	}
	if len(resourceName) == 0 {
		r.err = fmt.Errorf("resource name may not be empty")
		return r
	}
	if len(r.resourceName) != 0 {
		r.err = fmt.Errorf("resource name already set to %q, cannot change to %q", r.resourceName, resourceName)
		return r
	}
	if msgs := IsValidPathSegmentName(resourceName); len(msgs) != 0 {
		r.err = fmt.Errorf("invalid resource name %q: %v", resourceName, msgs)
		return r
	}
	r.resourceName = resourceName
	return r
}
1319819
func (s *enumService) Name() string {
	if s.name != nil {
		return syscall.UTF16ToString((*[1 << 16]uint16)(unsafe.Pointer(s.name))[:])
	}
	return ""
}
941690
func (c Common) Name() string {
	if c.InventoryPath == "" {
		return ""
	}
	return path.Base(c.InventoryPath)
}
186927
func (at AnyType) Name(d Domain) string {
	if at.IDName != "" {
		return nameInDomain(d, at.IDName, "")
	}

	return lint.Name(at.NameName)
}