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)
13
14// Represents an update integration response.
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// Represents an update integration response request.
31type UpdateIntegrationResponseInput struct {
32
33	// [Required] Specifies an update integration response request's HTTP method.
34	//
35	// This member is required.
36	HttpMethod *string
37
38	// [Required] Specifies an update integration response request's resource
39	// identifier.
40	//
41	// This member is required.
42	ResourceId *string
43
44	// [Required] The string identifier of the associated RestApi.
45	//
46	// This member is required.
47	RestApiId *string
48
49	// [Required] Specifies an update integration response request's status code.
50	//
51	// This member is required.
52	StatusCode *string
53
54	// A list of update operations to be applied to the specified resource and in the
55	// order specified in this list.
56	PatchOperations []types.PatchOperation
57}
58
59// Represents an integration response. The status code must map to an existing
60// MethodResponse, and parameters and templates can be used to transform the
61// back-end response. Creating an API
62// (https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html)
63type UpdateIntegrationResponseOutput struct {
64
65	// Specifies how to handle response payload content type conversions. Supported
66	// values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following
67	// behaviors:
68	//
69	// * CONVERT_TO_BINARY: Converts a response payload from a
70	// Base64-encoded string to the corresponding binary blob.
71	//
72	// * CONVERT_TO_TEXT:
73	// Converts a response payload from a binary blob to a Base64-encoded string.
74	//
75	// If
76	// this property is not defined, the response payload will be passed through from
77	// the integration response to the method response without modification.
78	ContentHandling types.ContentHandlingStrategy
79
80	// A key-value map specifying response parameters that are passed to the method
81	// response from the back end. The key is a method response header parameter name
82	// and the mapped value is an integration response header value, a static value
83	// enclosed within a pair of single quotes, or a JSON expression from the
84	// integration response body. The mapping key must match the pattern of
85	// method.response.header.{name}, where name is a valid and unique header name. The
86	// mapped non-static value must match the pattern of
87	// integration.response.header.{name} or
88	// integration.response.body.{JSON-expression}, where name is a valid and unique
89	// response header name and JSON-expression is a valid JSON expression without the
90	// $ prefix.
91	ResponseParameters map[string]string
92
93	// Specifies the templates used to transform the integration response body.
94	// Response templates are represented as a key/value map, with a content-type as
95	// the key and a template as the value.
96	ResponseTemplates map[string]string
97
98	// Specifies the regular expression (regex) pattern used to choose an integration
99	// response based on the response from the back end. For example, if the success
100	// response returns nothing and the error response returns some string, you could
101	// use the .+ regex to match error response. However, make sure that the error
102	// response does not contain any newline (\n) character in such cases. If the back
103	// end is an AWS Lambda function, the AWS Lambda function error header is matched.
104	// For all other HTTP and AWS back ends, the HTTP status code is matched.
105	SelectionPattern *string
106
107	// Specifies the status code that is used to map the integration response to an
108	// existing MethodResponse.
109	StatusCode *string
110
111	// Metadata pertaining to the operation's result.
112	ResultMetadata middleware.Metadata
113}
114
115func addOperationUpdateIntegrationResponseMiddlewares(stack *middleware.Stack, options Options) (err error) {
116	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIntegrationResponse{}, middleware.After)
117	if err != nil {
118		return err
119	}
120	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIntegrationResponse{}, middleware.After)
121	if err != nil {
122		return err
123	}
124	if err = addSetLoggerMiddleware(stack, options); err != nil {
125		return err
126	}
127	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
128		return err
129	}
130	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
131		return err
132	}
133	if err = addResolveEndpointMiddleware(stack, options); err != nil {
134		return err
135	}
136	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
137		return err
138	}
139	if err = addRetryMiddlewares(stack, options); err != nil {
140		return err
141	}
142	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
143		return err
144	}
145	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
146		return err
147	}
148	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
149		return err
150	}
151	if err = addClientUserAgent(stack); err != nil {
152		return err
153	}
154	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
155		return err
156	}
157	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
158		return err
159	}
160	if err = addOpUpdateIntegrationResponseValidationMiddleware(stack); err != nil {
161		return err
162	}
163	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIntegrationResponse(options.Region), middleware.Before); err != nil {
164		return err
165	}
166	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
167		return err
168	}
169	if err = addResponseErrorMiddleware(stack); err != nil {
170		return err
171	}
172	if err = addAcceptHeader(stack); err != nil {
173		return err
174	}
175	if err = addRequestResponseLogging(stack, options); err != nil {
176		return err
177	}
178	return nil
179}
180
181func newServiceMetadataMiddleware_opUpdateIntegrationResponse(region string) *awsmiddleware.RegisterServiceMetadata {
182	return &awsmiddleware.RegisterServiceMetadata{
183		Region:        region,
184		ServiceID:     ServiceID,
185		SigningName:   "apigateway",
186		OperationName: "UpdateIntegrationResponse",
187	}
188}
189