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

package lightsail

import (
	"context"
	"github.com/aws/smithy-go/middleware"
)

// Returns a Boolean value indicating whether your Lightsail VPC is peered.
func (c *Client) IsVpcPeered(ctx context.Context, params *IsVpcPeeredInput, optFns ...func(*Options)) (*IsVpcPeeredOutput, error) {
	if params == nil {
		params = &IsVpcPeeredInput{}
	}

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

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

type IsVpcPeeredInput struct {
	noSmithyDocumentSerde
}

type IsVpcPeeredOutput struct {

	// Returns true if the Lightsail VPC is peered; otherwise, false .
	IsPeered *bool

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationIsVpcPeeredMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsAwsjson11_serializeOpIsVpcPeered{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpIsVpcPeered{}, 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
}
