// IterateAttributes calls the given iterator passing in each attribute sorted in alphabetical order.
// Iteration stops if an iterator returns an error and in this case IterateObject returns that
// error.
548551
func (o Object) IterateAttributes(it AttributeIterator) error {
	names := make([]string, len(o))
	i := 0
	for n := range o {
		names[i] = n
		i++
	}
	sort.Strings(names)
	for _, n := range names {
		if err := it(n, o[n]); err != nil {
			return err
		}
	}
	return nil
}
643771
func (s *RegisterInstanceInput) SetAttributes(v map[string]*string) *RegisterInstanceInput {
	s.Attributes = v
	return s
}
108078
func (s *ContainerInstance) SetAttributes(v []*Attribute) *ContainerInstance {
	s.Attributes = v
	return s
}
31519
func (s *Stack) SetAttributes(v map[string]*string) *Stack {
	s.Attributes = v
	return s
}
124836
func (s *ReservationUtilizationGroup) SetAttributes(v map[string]*string) *ReservationUtilizationGroup {
	s.Attributes = v
	return s
}
1190515
func (n Node) DOTAttributes() []dot.Attribute {
	return []dot.Attribute{{Key: "label", Value: fmt.Sprintf("%q", n.UniqueName)}}
}
625175
func (s *EndpointResponse) SetAttributes(v map[string][]*string) *EndpointResponse {
	s.Attributes = v
	return s
}
627387
func (s *Device) SetAttributes(v *Attributes) *Device {
	s.Attributes = v
	return s
}
1092559
func (s *StartOutboundVoiceContactInput) SetAttributes(v map[string]*string) *StartOutboundVoiceContactInput {
	s.Attributes = v
	return s
}
472363
func (f *FixedAttributeGroup) Attributes() []Attribute {
	ret := make([]Attribute, len(f.attributes))
	// Add Attributes
	for i, a := range f.attributes {
		ret[i] = a
	}
	return ret
}
1186165
func (s *SetQueueAttributesInput) SetAttributes(v map[string]*string) *SetQueueAttributesInput {
	s.Attributes = v
	return s
}
46415
func (s *DescribeThingOutput) SetAttributes(v map[string]*string) *DescribeThingOutput {
	s.Attributes = v
	return s
}
1376
func Iterate(ctx context.Context, it Iterator) *IterateChain {
	if ctx == nil {
		ctx = context.Background()
	}
	return &IterateChain{
		ctx: ctx, it: it,
		limit: -1, paths: true,
		optimize: true,
	}
}
1198745
func (s *App) SetAttributes(v map[string]*string) *App {
	s.Attributes = v
	return s
}
1040722
func (b *BinaryAttributeGroup) Attributes() []Attribute {
	ret := make([]Attribute, len(b.attributes))
	for i, a := range b.attributes {
		ret[i] = a
	}
	return ret
}
808087
func (r *ResourceDefinition) IterateActions(it ActionIterator) error {
	names := make([]string, len(r.Actions))
	i := 0
	for n := range r.Actions {
		names[i] = n
		i++
	}
	sort.Strings(names)
	for _, n := range names {
		if err := it(r.Actions[n]); err != nil {
			return err
		}
	}
	return nil
}
767149
func Iterate(val Value, it Iteratee) (int, error) {
	if val == nil {
		return 0, nil
	}
	r := reflect.Indirect(reflect.ValueOf(val))
	switch r.Kind() {
	case reflect.Slice, reflect.Array:
		ln := r.Len()
		l := Loop{ln == 1, 1, 0}
		for i := 0; i < ln; i++ {
			v := r.Index(i)
			brk, err := it(i, v.Interface(), l)
			if brk || err != nil {
				return i + 1, err
			}

			l.Index++
			l.Index0++
			l.Last = ln == l.Index
		}
		return ln, nil
	case reflect.Map:
		keys := r.MapKeys()
		ln := r.Len()
		l := Loop{ln == 1, 1, 0}
		for i, k := range keys {
			v := r.MapIndex(k)
			brk, err := it(k.Interface(), v.Interface(), l)
			if brk || err != nil {
				return i + 1, err
			}

			l.Index++
			l.Index0++
			l.Last = ln == l.Index
		}
		return ln, nil
	default:
		return 0, fmt.Errorf(`stick: unable to iterate over %s "%v"`, r.Kind(), val)
	}
}