func (rm *resourceManager) newCreateRequestPayload(
	ctx context.Context,
	r *resource,
) (*svcsdk.CreateCacheParameterGroupInput, error) {
	res := &svcsdk.CreateCacheParameterGroupInput{}
	if r.ko.Spec.CacheParameterGroupFamily != nil {
		res.SetCacheParameterGroupFamily(*r.ko.Spec.CacheParameterGroupFamily)
	}
	if r.ko.Spec.CacheParameterGroupName != nil {
		res.SetCacheParameterGroupName(*r.ko.Spec.CacheParameterGroupName)
	}
	if r.ko.Spec.Description != nil {
		res.SetDescription(*r.ko.Spec.Description)
	}
	if r.ko.Spec.Tags != nil {
		f3 := []*svcsdk.Tag{}
		for _, f3iter := range r.ko.Spec.Tags {
			f3elem := &svcsdk.Tag{}
			if f3iter.Key != nil {
				f3elem.SetKey(*f3iter.Key)
			}
			if f3iter.Value != nil {
				f3elem.SetValue(*f3iter.Value)
			}
			f3 = append(f3, f3elem)
		}
		res.SetTags(f3)
	}
	return res, nil
}
newCreateRequestPayload returns an SDK-specific struct for the HTTP request
payload of the Create API call for the resource
package cache_parameter_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.CacheParameterGroup{}
	_ = 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.DescribeCacheParameterGroupsOutput
	resp, err = rm.sdkapi.DescribeCacheParameterGroupsWithContext(ctx, input)
	rm.metrics.RecordAPICall("READ_MANY", "DescribeCacheParameterGroups", err)
	if err != nil {
		if awsErr, ok := ackerr.AWSError(err); ok && awsErr.Code() == "CacheParameterGroupNotFound" {
			return nil, ackerr.NotFound
		}
		return nil, err
	}
	ko := r.ko.DeepCopy()
	found := false
	for _, elem := range resp.CacheParameterGroups {
		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.CacheParameterGroupFamily != nil {
			ko.Spec.CacheParameterGroupFamily = elem.CacheParameterGroupFamily
		} else {
			ko.Spec.CacheParameterGroupFamily = nil
		}
		if elem.CacheParameterGroupName != nil {
			ko.Spec.CacheParameterGroupName = elem.CacheParameterGroupName
		} else {
			ko.Spec.CacheParameterGroupName = nil
		}
		if elem.Description != nil {
			ko.Spec.Description = elem.Description
		} else {
			ko.Spec.Description = nil
		}
		if elem.IsGlobal != nil {
			ko.Status.IsGlobal = elem.IsGlobal
		} else {
			ko.Status.IsGlobal = nil
		}
		found = true
		break
	}
	if !found {
		return nil, ackerr.NotFound
	}
	rm.setStatusDefaults(ko)
	ko, err = rm.CustomDescribeCacheParameterGroupsSetOutput(ctx, r, resp, ko)
	if err != nil {
		return nil, err
	}
	return &resource{ko}, nil
}
func (rm *resourceManager) requiredFieldsMissingFromReadManyInput(
	r *resource,
) bool {
	return r.ko.Spec.CacheParameterGroupName == nil
}
func (rm *resourceManager) newListRequestPayload(
	r *resource,
) (*svcsdk.DescribeCacheParameterGroupsInput, error) {
	res := &svcsdk.DescribeCacheParameterGroupsInput{}
	if r.ko.Spec.CacheParameterGroupName != nil {
		res.SetCacheParameterGroupName(*r.ko.Spec.CacheParameterGroupName)
	}
	return res, nil
}
func (rm *resourceManager) sdkCreate(
	ctx context.Context,
	desired *resource,
) (created *resource, err error) {
	rlog := ackrtlog.FromContext(ctx)
	exit := rlog.Trace("rm.sdkCreate")
	defer exit(err)
	input, err := rm.newCreateRequestPayload(ctx, desired)
	if err != nil {
		return nil, err
	}
	var resp *svcsdk.CreateCacheParameterGroupOutput
	_ = resp
	resp, err = rm.sdkapi.CreateCacheParameterGroupWithContext(ctx, input)
	rm.metrics.RecordAPICall("CREATE", "CreateCacheParameterGroup", err)
	if err != nil {
		return nil, err
	}
	ko := desired.ko.DeepCopy()
	if ko.Status.ACKResourceMetadata == nil {
		ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
	}
	if resp.CacheParameterGroup.ARN != nil {
		arn := ackv1alpha1.AWSResourceName(*resp.CacheParameterGroup.ARN)
		ko.Status.ACKResourceMetadata.ARN = &arn
	}
	if resp.CacheParameterGroup.CacheParameterGroupFamily != nil {
		ko.Spec.CacheParameterGroupFamily = resp.CacheParameterGroup.CacheParameterGroupFamily
	} else {
		ko.Spec.CacheParameterGroupFamily = nil
	}
	if resp.CacheParameterGroup.CacheParameterGroupName != nil {
		ko.Spec.CacheParameterGroupName = resp.CacheParameterGroup.CacheParameterGroupName
	} else {
		ko.Spec.CacheParameterGroupName = nil
	}
	if resp.CacheParameterGroup.Description != nil {
		ko.Spec.Description = resp.CacheParameterGroup.Description
	} else {
		ko.Spec.Description = nil
	}
	if resp.CacheParameterGroup.IsGlobal != nil {
		ko.Status.IsGlobal = resp.CacheParameterGroup.IsGlobal
	} else {
		ko.Status.IsGlobal = nil
	}
	rm.setStatusDefaults(ko)
	ko, err = rm.CustomCreateCacheParameterGroupSetOutput(ctx, desired, resp, ko)
	if err != nil {
		return nil, err
	}
	return &resource{ko}, nil
}