func (rm *resourceManager) requiredFieldsMissingFromReadManyInput(
	r *resource,
) bool {
	return r.ko.Spec.UserGroupID == nil
}
requiredFieldsMissingFromReadManyInput returns true if there are any fields
for the ReadMany Input shape that are required but not present in the
resource's Spec or Status
package user_group
import (
	"context"
	"strings"
	ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
	ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
	ackcondition "github.com/aws-controllers-k8s/runtime/pkg/condition"
	ackerr "github.com/aws-controllers-k8s/runtime/pkg/errors"
	ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log"
	"github.com/aws/aws-sdk-go/aws"
	svcsdk "github.com/aws/aws-sdk-go/service/elasticache"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	svcapitypes "github.com/aws-controllers-k8s/elasticache-controller/apis/v1alpha1"
)
var (
	_ = &metav1.Time{}
	_ = strings.ToLower("")
	_ = &aws.JSONValue{}
	_ = &svcsdk.ElastiCache{}
	_ = &svcapitypes.UserGroup{}
	_ = ackv1alpha1.AWSAccountID("")
	_ = &ackerr.NotFound
	_ = &ackcondition.NotManagedMessage
)
func (rm *resourceManager) sdkFind(
	ctx context.Context,
	r *resource,
) (latest *resource, err error) {
	rlog := ackrtlog.FromContext(ctx)
	exit := rlog.Trace("rm.sdkFind")
	defer exit(err)
	if rm.requiredFieldsMissingFromReadManyInput(r) {
		return nil, ackerr.NotFound
	}
	input, err := rm.newListRequestPayload(r)
	if err != nil {
		return nil, err
	}
	var resp *svcsdk.DescribeUserGroupsOutput
	resp, err = rm.sdkapi.DescribeUserGroupsWithContext(ctx, input)
	rm.metrics.RecordAPICall("READ_MANY", "DescribeUserGroups", err)
	if err != nil {
		if awsErr, ok := ackerr.AWSError(err); ok && awsErr.Code() == "UserGroupNotFound" {
			return nil, ackerr.NotFound
		}
		return nil, err
	}
	ko := r.ko.DeepCopy()
	found := false
	for _, elem := range resp.UserGroups {
		if elem.ARN != nil {
			if ko.Status.ACKResourceMetadata == nil {
				ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
			}
			tmpARN := ackv1alpha1.AWSResourceName(*elem.ARN)
			ko.Status.ACKResourceMetadata.ARN = &tmpARN
		}
		if elem.Engine != nil {
			ko.Spec.Engine = elem.Engine
		} else {
			ko.Spec.Engine = nil
		}
		if elem.PendingChanges != nil {
			f2 := &svcapitypes.UserGroupPendingChanges{}
			if elem.PendingChanges.UserIdsToAdd != nil {
				f2f0 := []*string{}
				for _, f2f0iter := range elem.PendingChanges.UserIdsToAdd {
					var f2f0elem string
					f2f0elem = *f2f0iter
					f2f0 = append(f2f0, &f2f0elem)
				}
				f2.UserIDsToAdd = f2f0
			}
			if elem.PendingChanges.UserIdsToRemove != nil {
				f2f1 := []*string{}
				for _, f2f1iter := range elem.PendingChanges.UserIdsToRemove {
					var f2f1elem string
					f2f1elem = *f2f1iter
					f2f1 = append(f2f1, &f2f1elem)
				}
				f2.UserIDsToRemove = f2f1
			}
			ko.Status.PendingChanges = f2
		} else {
			ko.Status.PendingChanges = nil
		}
		if elem.ReplicationGroups != nil {
			f3 := []*string{}
			for _, f3iter := range elem.ReplicationGroups {
				var f3elem string
				f3elem = *f3iter
				f3 = append(f3, &f3elem)
			}
			ko.Status.ReplicationGroups = f3
		} else {
			ko.Status.ReplicationGroups = nil
		}
		if elem.Status != nil {
			ko.Status.Status = elem.Status
		} else {
			ko.Status.Status = nil
		}
		if elem.UserGroupId != nil {
			ko.Spec.UserGroupID = elem.UserGroupId
		} else {
			ko.Spec.UserGroupID = nil
		}
		if elem.UserIds != nil {
			f6 := []*string{}
			for _, f6iter := range elem.UserIds {
				var f6elem string
				f6elem = *f6iter
				f6 = append(f6, &f6elem)
			}
			ko.Spec.UserIDs = f6
		} else {
			ko.Spec.UserIDs = nil
		}
		found = true
		break
	}
	if !found {
		return nil, ackerr.NotFound
	}
	rm.setStatusDefaults(ko)
	ko, err = rm.CustomDescribeUserGroupsSetOutput(ctx, r, resp, ko)
	if err != nil {
		return nil, err
	}
	return &resource{ko}, nil
}