// Helper: Create an ID for a route
485976
func resourceAwsRouteID(d *schema.ResourceData, r *ec2.Route) string {

	if r.DestinationIpv6CidrBlock != nil && *r.DestinationIpv6CidrBlock != "" {
		return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationIpv6CidrBlock))
	}

	return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationCidrBlock))
}
878992
func (r *Route) create(path []string, parentPath string) *Route {

	// ensure this path matches us
	if r.pattern != path[0] {
		// not us
		return nil
	}

	// if this is us, return, no creation necessary
	if len(path) == 1 {
		return r
	}

	// iterate over all children looking for a place to put this
	for _, child := range r.getChildren() {
		if r := child.create(path[1:], r.fullPath); r != nil {
			return r
		}
	}

	// child can't create it, so we will
	newRoute := newRoute()

	// set the pattern name
	newRoute.pattern = path[1]
	newRoute.fullPath = r.fullPath + "/" + path[1]

	// check if it's a path param
	if strings.HasPrefix(path[1], ":") {
		newRoute.isParam = true
		newRoute.paramName = strings.TrimLeft(path[1], ":")

		// save it in the correct place
		r.paramChild = newRoute

	} else if path[1] == "*" {
		// check if this is a rooted subtree
		newRoute.isWildcard = true

		// save to wildcard child
		r.wildcardChild = newRoute

		// go no deeper
		return newRoute
	} else {
		// Just a regular child
		r.children = append(r.children, newRoute)

		// sort children alphabetically for efficient run time searching
		sort.Sort(r.children)
	}

	// the cycle continues
	return newRoute.create(path[1:], r.fullPath)
}
967040
func (m CustomMapper) ID(fields ...interface{}) (rowIDs []int64, err error) {
	return m.Mapper.ID(m.Func(fields...))
}
596367
func (r *Resource) Id() string {
	switch r.Mode {
	case ManagedResourceMode:
		return fmt.Sprintf("%s.%s", r.Type, r.Name)
	case DataResourceMode:
		return fmt.Sprintf("data.%s.%s", r.Type, r.Name)
	default:
		panic(fmt.Errorf("unknown resource mode %s", r.Mode))
	}
}
1270821
func (s Session) ID() string {
	if sessionIDStr, ok := s[SessionIDKey]; ok {
		return sessionIDStr.(string)
	}

	buffer := uuid.NewV4()

	s[SessionIDKey] = hex.EncodeToString(buffer.Bytes())
	return s[SessionIDKey].(string)
}
676342
func (self *Wind) Id() string {
	return fmt.Sprintf("%02x:%02x", self.id>>8, self.id&0xff)
}
59360
func (s *DeleteScriptService) Id(id string) *DeleteScriptService {
	s.id = id
	return s
}
500995
func (g *Group) Id(name string) *Statement {
	s := Id(name)
	g.items = append(g.items, s)
	return s
}
1183233
func (p Path) ParentID() uuid.UUID {
	if len(p) > 1 {
		return p[len(p)-2]
	}
	return uuid.Nil
}
478185
func (p *Packet) ID() string {
	return strconv.Itoa(int(p.ipHdr.ipID))
}
1012527
func (b *UpdateService) Id(id string) *UpdateService {
	b.id = id
	return b
}
1011265
func (s *IngestPutPipelineService) Id(id string) *IngestPutPipelineService {
	s.id = id
	return s
}
671788
func (i Identity) ID() string {
	out := i.Name
	if i.Comment != "" {
		out += " (" + i.Comment + ")"
	}
	out += " <" + i.Email + ">"
	return out
}
1176739
func (r *RoutesService) Create(route *Route) (*Route, *http.Response, error) {
	return r.CreateWithContext(context.TODO(), route)
}
558503
func (d *LDAPUserAttributeDefiner) ID(user *ldap.Entry) string {
	// support binary ID fields as those the only stable identifiers in some environments
	return GetRawAttributeValue(user, d.attributeMapping.ID)
}
994152
func (s *DeleteRouteResponseInput) SetRouteId(v string) *DeleteRouteResponseInput {
	s.RouteId = &v
	return s
}
720157
func (s *GetScriptService) Id(id string) *GetScriptService {
	s.id = id
	return s
}