You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: api_op_ListAttributeGroupsForApplication.go
    path of file: ./repos/aws-sdk-go-v2/service/servicecatalogappregistry
    
    the code of the file until where you have to start completion: // Code generated by smithy-go-codegen DO NOT EDIT.

package servicecatalogappregistry

import (
	"context"
	"fmt"
	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
	"github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// Lists the details of all attribute groups associated with a specific
// application. The results display in pages.
func (c *Client) ListAttributeGroupsForApplication(ctx context.Context, params *ListAttributeGroupsForApplicationInput, optFns ...func(*Options)) (*ListAttributeGroupsForApplicationOutput, error) {
	if params == nil {
		params = &ListAttributeGroupsForApplicationInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "ListAttributeGroupsForApplication", params, optFns, c.addOperationListAttributeGroupsForApplicationMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*ListAttributeGroupsForApplicationOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type ListAttributeGroupsForApplicationInput struct {

	// The name or ID of the application.
	//
	// This member is required.
	Application *string

	// The upper bound of the number of results to return. The value cannot exceed 25.
	// If you omit this parameter, it defaults to 25. This value is optional.
	MaxResults *int32

	// This token retrieves the next page of results after a previous API call.
	NextToken *string

	noSmithyDocumentSerde
}

type ListAttributeGroupsForApplicationOutput struct {

	// The details related to a specific attribute group.
	AttributeGroupsDetails []types.AttributeGroupDetails

	// The token to use to get the next page of results after a previous API call.
	NextToken *string

	// Metadata pertaining to the operatio
    
func (c *Client) addOperationListAttributeGroupsForApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
		return err
	}
	err = stack.Serialize.Add(&awsRestjson1_serializeOpListAttributeGroupsForApplication{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAttributeGroupsForApplication{}, middleware.After)
	if err != nil {
		return err
	}
	if err := addProtocolFinalizerMiddlewares(stack, options, "ListAttributeGroupsForApplication"); err != nil {
		return fmt.Errorf("add protocol finalizers: %v", err)
	}

	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
		return err
	}
	if err = addSetLoggerMiddleware(stack, options); err != nil {
		return err
	}
	if err = addClientRequestID(stack); err != nil {
		return err
	}
	if err = addComputeContentLength(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRetry(stack, options); err != nil {
		return err
	}
	if err = addRawResponseToMetadata(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = addClientUserAgent(stack, options); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
		return err
	}
	if err = addOpListAttributeGroupsForApplicationValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAttributeGroupsForApplication(options.Region), middleware.Before); err != nil {
		return err
	}
	if err = addRecursionDetection(stack); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
		return err
	}
	return nil
}