1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package apigateway 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/apigateway/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 "time" 13) 14 15// Changes information about the DomainName resource. 16func (c *Client) UpdateDomainName(ctx context.Context, params *UpdateDomainNameInput, optFns ...func(*Options)) (*UpdateDomainNameOutput, error) { 17 if params == nil { 18 params = &UpdateDomainNameInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "UpdateDomainName", params, optFns, addOperationUpdateDomainNameMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*UpdateDomainNameOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31// A request to change information about the DomainName resource. 32type UpdateDomainNameInput struct { 33 34 // [Required] The name of the DomainName resource to be changed. 35 // 36 // This member is required. 37 DomainName *string 38 39 // A list of update operations to be applied to the specified resource and in the 40 // order specified in this list. 41 PatchOperations []types.PatchOperation 42} 43 44// Represents a custom domain name as a user-friendly host name of an API 45// (RestApi). When you deploy an API, API Gateway creates a default host name for 46// the API. This default API host name is of the 47// {restapi-id}.execute-api.{region}.amazonaws.com format. With the default host 48// name, you can access the API's root resource with the URL of 49// https://{restapi-id}.execute-api.{region}.amazonaws.com/{stage}/. When you set 50// up a custom domain name of apis.example.com for this API, you can then access 51// the same resource using the URL of the https://apis.examples.com/myApi, where 52// myApi is the base path mapping (BasePathMapping) of your API under the custom 53// domain name. Set a Custom Host Name for an API 54// (https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html) 55type UpdateDomainNameOutput struct { 56 57 // The reference to an AWS-managed certificate that will be used by edge-optimized 58 // endpoint for this domain name. AWS Certificate Manager is the only supported 59 // source. 60 CertificateArn *string 61 62 // The name of the certificate that will be used by edge-optimized endpoint for 63 // this domain name. 64 CertificateName *string 65 66 // The timestamp when the certificate that was used by edge-optimized endpoint for 67 // this domain name was uploaded. 68 CertificateUploadDate *time.Time 69 70 // The domain name of the Amazon CloudFront distribution associated with this 71 // custom domain name for an edge-optimized endpoint. You set up this association 72 // when adding a DNS record pointing the custom domain name to this distribution 73 // name. For more information about CloudFront distributions, see the Amazon 74 // CloudFront documentation (https://aws.amazon.com/documentation/cloudfront/). 75 DistributionDomainName *string 76 77 // The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized 78 // endpoint. The valid value is Z2FDTNDATAQYW2 for all the regions. For more 79 // information, see Set up a Regional Custom Domain Name 80 // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-regional-api-custom-domain-create.html) 81 // and AWS Regions and Endpoints for API Gateway 82 // (https://docs.aws.amazon.com/general/latest/gr/rande.html#apigateway_region). 83 DistributionHostedZoneId *string 84 85 // The custom domain name as an API host name, for example, my-api.example.com. 86 DomainName *string 87 88 // The status of the DomainName migration. The valid values are AVAILABLE and 89 // UPDATING. If the status is UPDATING, the domain cannot be modified further until 90 // the existing operation is complete. If it is AVAILABLE, the domain can be 91 // updated. 92 DomainNameStatus types.DomainNameStatus 93 94 // An optional text message containing detailed information about status of the 95 // DomainName migration. 96 DomainNameStatusMessage *string 97 98 // The endpoint configuration of this DomainName showing the endpoint types of the 99 // domain name. 100 EndpointConfiguration *types.EndpointConfiguration 101 102 // The mutual TLS authentication configuration for a custom domain name. If 103 // specified, API Gateway performs two-way authentication between the client and 104 // the server. Clients must present a trusted certificate to access your API. 105 MutualTlsAuthentication *types.MutualTlsAuthentication 106 107 // The reference to an AWS-managed certificate that will be used for validating the 108 // regional domain name. AWS Certificate Manager is the only supported source. 109 RegionalCertificateArn *string 110 111 // The name of the certificate that will be used for validating the regional domain 112 // name. 113 RegionalCertificateName *string 114 115 // The domain name associated with the regional endpoint for this custom domain 116 // name. You set up this association by adding a DNS record that points the custom 117 // domain name to this regional domain name. The regional domain name is returned 118 // by API Gateway when you create a regional endpoint. 119 RegionalDomainName *string 120 121 // The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For 122 // more information, see Set up a Regional Custom Domain Name 123 // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-regional-api-custom-domain-create.html) 124 // and AWS Regions and Endpoints for API Gateway 125 // (https://docs.aws.amazon.com/general/latest/gr/rande.html#apigateway_region). 126 RegionalHostedZoneId *string 127 128 // The Transport Layer Security (TLS) version + cipher suite for this DomainName. 129 // The valid values are TLS_1_0 and TLS_1_2. 130 SecurityPolicy types.SecurityPolicy 131 132 // The collection of tags. Each tag element is associated with a given resource. 133 Tags map[string]string 134 135 // Metadata pertaining to the operation's result. 136 ResultMetadata middleware.Metadata 137} 138 139func addOperationUpdateDomainNameMiddlewares(stack *middleware.Stack, options Options) (err error) { 140 err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDomainName{}, middleware.After) 141 if err != nil { 142 return err 143 } 144 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDomainName{}, middleware.After) 145 if err != nil { 146 return err 147 } 148 if err = addSetLoggerMiddleware(stack, options); err != nil { 149 return err 150 } 151 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 152 return err 153 } 154 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 155 return err 156 } 157 if err = addResolveEndpointMiddleware(stack, options); err != nil { 158 return err 159 } 160 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 161 return err 162 } 163 if err = addRetryMiddlewares(stack, options); err != nil { 164 return err 165 } 166 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 167 return err 168 } 169 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 170 return err 171 } 172 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 173 return err 174 } 175 if err = addClientUserAgent(stack); err != nil { 176 return err 177 } 178 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 179 return err 180 } 181 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 182 return err 183 } 184 if err = addOpUpdateDomainNameValidationMiddleware(stack); err != nil { 185 return err 186 } 187 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomainName(options.Region), middleware.Before); err != nil { 188 return err 189 } 190 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 191 return err 192 } 193 if err = addResponseErrorMiddleware(stack); err != nil { 194 return err 195 } 196 if err = addAcceptHeader(stack); err != nil { 197 return err 198 } 199 if err = addRequestResponseLogging(stack, options); err != nil { 200 return err 201 } 202 return nil 203} 204 205func newServiceMetadataMiddleware_opUpdateDomainName(region string) *awsmiddleware.RegisterServiceMetadata { 206 return &awsmiddleware.RegisterServiceMetadata{ 207 Region: region, 208 ServiceID: ServiceID, 209 SigningName: "apigateway", 210 OperationName: "UpdateDomainName", 211 } 212} 213