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

package ec2

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

// Modifies the billing account for VPC endpoint usage/charges.
func (c *Client) ModifyVpcEndpointPayerResponsibility(ctx context.Context, params *ModifyVpcEndpointPayerResponsibilityInput, optFns ...func(*Options)) (*ModifyVpcEndpointPayerResponsibilityOutput, error) {
	if params == nil {
		params = &ModifyVpcEndpointPayerResponsibilityInput{}
	}

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

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

type ModifyVpcEndpointPayerResponsibilityInput struct {

	// The Amazon Web Services account to which the usage of VPC endpoint is charged.
	//
	// This member is required.
	PayerResponsibility types.PayerResponsibilityType

	// The scope of usage/charges for which the billing account is being modified.
	//
	// This member is required.
	Scope types.PayerResponsibilityScope

	// The ID of the VPC endpoint.
	//
	// This member is required.
	VpcEndpointId *string

	// Checks whether you have the required permissions for the action, without
	// actually making the request, and provides an error response. If you have the
	// required permissions, the error response is DryRunOperation . Otherwise, it is
	// UnauthorizedOperation .
	DryRun *bool

	// The ID of the VPC endpoint service.
	ServiceId *string

	noSmithyDocumentSerde
}

type ModifyVpcEndpointPayerResponsibilityOutput struct {

	// The payer responsibility settings for the VPC endpoint.
	PayerResponsibilities []types.PayerResponsibilityEntry

	// The ID of the VPC endpoint.
	VpcEndpointId *string

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

	noSmithyDocumentSerde
}

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

	if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpModifyVpcEndpointPayerResponsibilityValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ModifyVpcEndpointPayerResponsibility"), middleware.Before); 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
}
