// Enumerate mocks base method
424649
func (m *MockFilterDeleter) Enumerate(arg0 ...alerts.Filter) ([]*api.Alert, error) {
	varargs := []interface{}{}
	for _, a := range arg0 {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "Enumerate", varargs...)
	ret0, _ := ret[0].([]*api.Alert)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
241999
func EnumerateAllFrom(ctx context.Context, src BlobEnumerator, after string, fn func(blob.SizedRef) error) error {
	const batchSize = 1000
	var mu sync.Mutex // protects returning with an error while fn is still running
	errc := make(chan error, 1)
	for {
		ch := make(chan blob.SizedRef, 16)
		n := 0
		go func() {
			var err error
			for sb := range ch {
				if err != nil {
					continue
				}
				mu.Lock()
				err = fn(sb)
				mu.Unlock()
				after = sb.Ref.String()
				n++
			}
			errc <- err
		}()
		err := src.EnumerateBlobs(ctx, ch, after, batchSize)
		if err != nil {
			mu.Lock() // make sure fn callback finished; no need to unlock
			return err
		}
		if err := <-errc; err != nil {
			return err
		}
		if n == 0 {
			return nil
		}
	}
}
819303
func (m *MockCollection) Count() (int, error) {
	ret := m.ctrl.Call(m, "Count")
	ret0, _ := ret[0].(int)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
506562
func (m *MockStorage) List(ctx context.Context) (jsh.List, jsh.ErrorType) {
	var err *jsh.Error

	return m.SampleList(m.ListCount), err
}
820470
func (sto *unionStorage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error {
	return blobserver.MergedEnumerateStorage(ctx, dest, sto.subsets, after, limit)
}
347510
func (mr *MockEncoderMockRecorder) Encode(message interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Encode", reflect.TypeOf((*MockEncoder)(nil).Encode), message)
}
157213
func (m *MockVolumeDriver) CloudBackupSchedEnumerate() (*api.CloudBackupSchedEnumerateResponse, error) {
	ret := m.ctrl.Call(m, "CloudBackupSchedEnumerate")
	ret0, _ := ret[0].(*api.CloudBackupSchedEnumerateResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
451376
func (mr *MockManagerMockRecorder) List() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockManager)(nil).List))
}
315568
func (s *CloudBackupServer) SchedEnumerate(
	ctx context.Context,
	req *api.SdkCloudBackupSchedEnumerateRequest,
) (*api.SdkCloudBackupSchedEnumerateResponse, error) {
	if s.driver(ctx) == nil {
		return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
	}

	// Pass in ownership and show only valid ones
	r, err := s.driver(ctx).CloudBackupSchedEnumerate()
	if err != nil {
		return nil, status.Errorf(codes.Internal, "Failed to enumerate backups: %v", err)
	}
	// since can't import sdk/utils to api because of cyclic import, converting
	// api.CloudBackupScheduleInfo to api.SdkCloudBackupScheduleInfo
	return ToSdkCloudBackupSchedEnumerateResponse(r), nil
}
273566
func (self *EnumTypeDef) Init() *EnumTypeDef {
	if self.Elements == nil {
		self.Elements = make([]*EnumElementDef, 0)
	}
	return self
}
945232
func (s *NodeServer) Enumerate(
	ctx context.Context,
	req *api.SdkNodeEnumerateRequest,
) (*api.SdkNodeEnumerateResponse, error) {
	if s.cluster() == nil {
		return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
	}
	c, err := s.cluster().Enumerate()
	if err != nil {
		return nil, status.Error(codes.Internal, err.Error())
	}

	nodeIds := make([]string, len(c.Nodes))
	for i, v := range c.Nodes {
		nodeIds[i] = v.Id
	}

	return &api.SdkNodeEnumerateResponse{
		NodeIds: nodeIds,
	}, nil
}
279766
func (s *SchedulePolicyServer) Enumerate(
	ctx context.Context,
	req *api.SdkSchedulePolicyEnumerateRequest,
) (*api.SdkSchedulePolicyEnumerateResponse, error) {
	if s.cluster() == nil {
		return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
	}

	policies, err := s.cluster().SchedPolicyEnumerate()

	if err != nil {
		return nil, status.Errorf(
			codes.Internal,
			"Failed to enumerate schedule policy: %v",
			err.Error())
	}
	sdkpolicies := []*api.SdkSchedulePolicy{}
	for _, policy := range policies {

		schedules, err := retainInternalSpecYamlByteToSdkSched([]byte(policy.Schedule))
		if err != nil {
			return nil, err
		}

		p := &api.SdkSchedulePolicy{
			Name:      policy.Name,
			Schedules: schedules,
		}
		sdkpolicies = append(sdkpolicies, p)
	}

	return &api.SdkSchedulePolicyEnumerateResponse{Policies: sdkpolicies}, err
}
1334394
func (m *MockConfigMapInterface) List(arg0 v10.ListOptions) (*v1.ConfigMapList, error) {
	ret := m.ctrl.Call(m, "List", arg0)
	ret0, _ := ret[0].(*v1.ConfigMapList)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
186782
func newEnumerator(itrs []vellum.Iterator) (*enumerator, error) {
	rv := &enumerator{
		itrs:    itrs,
		currKs:  make([][]byte, len(itrs)),
		currVs:  make([]uint64, len(itrs)),
		lowIdxs: make([]int, 0, len(itrs)),
	}
	for i, itr := range rv.itrs {
		rv.currKs[i], rv.currVs[i] = itr.Current()
	}
	rv.updateMatches(false)
	if rv.lowK == nil && len(rv.lowIdxs) == 0 {
		return rv, vellum.ErrIteratorDone
	}
	return rv, nil
}
1136200
func (kva *KvAlert) Enumerate(filter *api.Alert) ([]*api.Alert, error) {
	kv := kva.GetKvdbInstance()
	return kva.enumerate(kv, filter)
}
981118
func (c *Client) SimpleEnumerateBlobs(ctx context.Context, ch chan<- blob.SizedRef) error {
	return c.EnumerateBlobsOpts(ctx, ch, EnumerateOpts{})
}
104365
func (m *MockVolumeDriver) CredsEnumerate() (map[string]interface{}, error) {
	ret := m.ctrl.Call(m, "CredsEnumerate")
	ret0, _ := ret[0].(map[string]interface{})
	ret1, _ := ret[1].(error)
	return ret0, ret1
}