1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package apigatewayv2
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/apigatewayv2/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates an IntegrationResponses.
15func (c *Client) UpdateIntegrationResponse(ctx context.Context, params *UpdateIntegrationResponseInput, optFns ...func(*Options)) (*UpdateIntegrationResponseOutput, error) {
16	if params == nil {
17		params = &UpdateIntegrationResponseInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "UpdateIntegrationResponse", params, optFns, addOperationUpdateIntegrationResponseMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*UpdateIntegrationResponseOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30// Updates an IntegrationResponses.
31type UpdateIntegrationResponseInput struct {
32
33	// The API identifier.
34	//
35	// This member is required.
36	ApiId *string
37
38	// The integration ID.
39	//
40	// This member is required.
41	IntegrationId *string
42
43	// The integration response ID.
44	//
45	// This member is required.
46	IntegrationResponseId *string
47
48	// Supported only for WebSocket APIs. Specifies how to handle response payload
49	// content type conversions. Supported values are CONVERT_TO_BINARY and
50	// CONVERT_TO_TEXT, with the following behaviors: CONVERT_TO_BINARY: Converts a
51	// response payload from a Base64-encoded string to the corresponding binary blob.
52	// CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
53	// Base64-encoded string. If this property is not defined, the response payload
54	// will be passed through from the integration response to the route response or
55	// method response without modification.
56	ContentHandlingStrategy types.ContentHandlingStrategy
57
58	// The integration response key.
59	IntegrationResponseKey *string
60
61	// A key-value map specifying response parameters that are passed to the method
62	// response from the backend. The key is a method response header parameter name
63	// and the mapped value is an integration response header value, a static value
64	// enclosed within a pair of single quotes, or a JSON expression from the
65	// integration response body. The mapping key must match the pattern of
66	// method.response.header.{name} , where name is a valid and unique header name.
67	// The mapped non-static value must match the pattern of
68	// integration.response.header.{name} or
69	// integration.response.body.{JSON-expression} , where {name} is a valid and unique
70	// response header name and {JSON-expression} is a valid JSON expression without
71	// the $ prefix.
72	ResponseParameters map[string]string
73
74	// The collection of response templates for the integration response as a
75	// string-to-string map of key-value pairs. Response templates are represented as a
76	// key/value map, with a content-type as the key and a template as the value.
77	ResponseTemplates map[string]string
78
79	// The template selection expression for the integration response. Supported only
80	// for WebSocket APIs.
81	TemplateSelectionExpression *string
82}
83
84type UpdateIntegrationResponseOutput struct {
85
86	// Supported only for WebSocket APIs. Specifies how to handle response payload
87	// content type conversions. Supported values are CONVERT_TO_BINARY and
88	// CONVERT_TO_TEXT, with the following behaviors: CONVERT_TO_BINARY: Converts a
89	// response payload from a Base64-encoded string to the corresponding binary blob.
90	// CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
91	// Base64-encoded string. If this property is not defined, the response payload
92	// will be passed through from the integration response to the route response or
93	// method response without modification.
94	ContentHandlingStrategy types.ContentHandlingStrategy
95
96	// The integration response ID.
97	IntegrationResponseId *string
98
99	// The integration response key.
100	IntegrationResponseKey *string
101
102	// A key-value map specifying response parameters that are passed to the method
103	// response from the backend. The key is a method response header parameter name
104	// and the mapped value is an integration response header value, a static value
105	// enclosed within a pair of single quotes, or a JSON expression from the
106	// integration response body. The mapping key must match the pattern of
107	// method.response.header.{name}, where name is a valid and unique header name. The
108	// mapped non-static value must match the pattern of
109	// integration.response.header.{name} or
110	// integration.response.body.{JSON-expression}, where name is a valid and unique
111	// response header name and JSON-expression is a valid JSON expression without the
112	// $ prefix.
113	ResponseParameters map[string]string
114
115	// The collection of response templates for the integration response as a
116	// string-to-string map of key-value pairs. Response templates are represented as a
117	// key/value map, with a content-type as the key and a template as the value.
118	ResponseTemplates map[string]string
119
120	// The template selection expressions for the integration response.
121	TemplateSelectionExpression *string
122
123	// Metadata pertaining to the operation's result.
124	ResultMetadata middleware.Metadata
125}
126
127func addOperationUpdateIntegrationResponseMiddlewares(stack *middleware.Stack, options Options) (err error) {
128	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIntegrationResponse{}, middleware.After)
129	if err != nil {
130		return err
131	}
132	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIntegrationResponse{}, middleware.After)
133	if err != nil {
134		return err
135	}
136	if err = addSetLoggerMiddleware(stack, options); err != nil {
137		return err
138	}
139	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
140		return err
141	}
142	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
143		return err
144	}
145	if err = addResolveEndpointMiddleware(stack, options); err != nil {
146		return err
147	}
148	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
149		return err
150	}
151	if err = addRetryMiddlewares(stack, options); err != nil {
152		return err
153	}
154	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
155		return err
156	}
157	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
158		return err
159	}
160	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
161		return err
162	}
163	if err = addClientUserAgent(stack); err != nil {
164		return err
165	}
166	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
167		return err
168	}
169	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
170		return err
171	}
172	if err = addOpUpdateIntegrationResponseValidationMiddleware(stack); err != nil {
173		return err
174	}
175	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIntegrationResponse(options.Region), middleware.Before); err != nil {
176		return err
177	}
178	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
179		return err
180	}
181	if err = addResponseErrorMiddleware(stack); err != nil {
182		return err
183	}
184	if err = addRequestResponseLogging(stack, options); err != nil {
185		return err
186	}
187	return nil
188}
189
190func newServiceMetadataMiddleware_opUpdateIntegrationResponse(region string) *awsmiddleware.RegisterServiceMetadata {
191	return &awsmiddleware.RegisterServiceMetadata{
192		Region:        region,
193		ServiceID:     ServiceID,
194		SigningName:   "apigateway",
195		OperationName: "UpdateIntegrationResponse",
196	}
197}
198