1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package servicediscovery 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Submits a request to perform the following operations: 15// 16// * Update the TTL setting 17// for existing DnsRecords configurations 18// 19// * Add, update, or delete 20// HealthCheckConfig for a specified service You can't add, update, or delete a 21// HealthCheckCustomConfig configuration. 22// 23// For public and private DNS namespaces, 24// note the following: 25// 26// * If you omit any existing DnsRecords or HealthCheckConfig 27// configurations from an UpdateService request, the configurations are deleted 28// from the service. 29// 30// * If you omit an existing HealthCheckCustomConfig 31// configuration from an UpdateService request, the configuration is not deleted 32// from the service. 33// 34// When you update settings for a service, AWS Cloud Map also 35// updates the corresponding settings in all the records and health checks that 36// were created by using the specified service. 37func (c *Client) UpdateService(ctx context.Context, params *UpdateServiceInput, optFns ...func(*Options)) (*UpdateServiceOutput, error) { 38 if params == nil { 39 params = &UpdateServiceInput{} 40 } 41 42 result, metadata, err := c.invokeOperation(ctx, "UpdateService", params, optFns, addOperationUpdateServiceMiddlewares) 43 if err != nil { 44 return nil, err 45 } 46 47 out := result.(*UpdateServiceOutput) 48 out.ResultMetadata = metadata 49 return out, nil 50} 51 52type UpdateServiceInput struct { 53 54 // The ID of the service that you want to update. 55 // 56 // This member is required. 57 Id *string 58 59 // A complex type that contains the new settings for the service. 60 // 61 // This member is required. 62 Service *types.ServiceChange 63} 64 65type UpdateServiceOutput struct { 66 67 // A value that you can use to determine whether the request completed 68 // successfully. To get the status of the operation, see GetOperation 69 // (https://docs.aws.amazon.com/cloud-map/latest/api/API_GetOperation.html). 70 OperationId *string 71 72 // Metadata pertaining to the operation's result. 73 ResultMetadata middleware.Metadata 74} 75 76func addOperationUpdateServiceMiddlewares(stack *middleware.Stack, options Options) (err error) { 77 err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateService{}, middleware.After) 78 if err != nil { 79 return err 80 } 81 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateService{}, middleware.After) 82 if err != nil { 83 return err 84 } 85 if err = addSetLoggerMiddleware(stack, options); err != nil { 86 return err 87 } 88 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 89 return err 90 } 91 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 92 return err 93 } 94 if err = addResolveEndpointMiddleware(stack, options); err != nil { 95 return err 96 } 97 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 98 return err 99 } 100 if err = addRetryMiddlewares(stack, options); err != nil { 101 return err 102 } 103 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 104 return err 105 } 106 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 107 return err 108 } 109 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 110 return err 111 } 112 if err = addClientUserAgent(stack); err != nil { 113 return err 114 } 115 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 116 return err 117 } 118 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 119 return err 120 } 121 if err = addOpUpdateServiceValidationMiddleware(stack); err != nil { 122 return err 123 } 124 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateService(options.Region), middleware.Before); err != nil { 125 return err 126 } 127 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 128 return err 129 } 130 if err = addResponseErrorMiddleware(stack); err != nil { 131 return err 132 } 133 if err = addRequestResponseLogging(stack, options); err != nil { 134 return err 135 } 136 return nil 137} 138 139func newServiceMetadataMiddleware_opUpdateService(region string) *awsmiddleware.RegisterServiceMetadata { 140 return &awsmiddleware.RegisterServiceMetadata{ 141 Region: region, 142 ServiceID: ServiceID, 143 SigningName: "servicediscovery", 144 OperationName: "UpdateService", 145 } 146} 147