// Code generated by smithy-go-codegen DO NOT EDIT.

package lightsail

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/service/lightsail/types"
	"github.com/aws/smithy-go/middleware"
)

// Unpeers the Lightsail VPC from the user's default VPC.
func (c *Client) UnpeerVpc(ctx context.Context, params *UnpeerVpcInput, optFns ...func(*Options)) (*UnpeerVpcOutput, error) {
	if params == nil {
		params = &UnpeerVpcInput{}
	}

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

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

type UnpeerVpcInput struct {
	noSmithyDocumentSerde
}

type UnpeerVpcOutput struct {

	// An array of objects that describe the result of the action, such as the status
	// of the request, the timestamp of the request, and the resources affected by the
	// request.
	Operation *types.Operation

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationUnpeerVpcMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUnpeerVpc{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUnpeerVpc{}, middleware.After)
	if err != nil {
		return err
	}

	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack, options); err != nil {
		return err
	}
	if err = addCredentialSource(stack, options); 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
	}
	if err = addInterceptors(stack, options); err != nil {
		return err
	}
	return nil
}
