// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package apigatewayv2 import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) type UpdateIntegrationResponseInput struct { _ struct{} `type:"structure"` // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` // Specifies how to handle response payload content type conversions. Supported // only for WebSocket APIs. ContentHandlingStrategy ContentHandlingStrategy `locationName:"contentHandlingStrategy" type:"string" enum:"true"` // IntegrationId is a required field IntegrationId *string `location:"uri" locationName:"integrationId" type:"string" required:"true"` // IntegrationResponseId is a required field IntegrationResponseId *string `location:"uri" locationName:"integrationResponseId" type:"string" required:"true"` // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key // type. IntegrationResponseKey *string `locationName:"integrationResponseKey" type:"string"` // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static // value enclosed within a pair of single quotes, or a JSON expression from // the integration response body. The mapping key must match the pattern of // method.response.header.{name}, where name is a valid and unique header name. // The mapped non-static value must match the pattern of integration.response.header.{name} // or integration.response.body.{JSON-expression}, where name is a valid and // unique response header name and JSON-expression is a valid JSON expression // without the $ prefix. ResponseParameters map[string]string `locationName:"responseParameters" type:"map"` // A mapping of identifier keys to templates. The value is an actual template // script. The key is typically a SelectionKey which is chosen based on evaluating // a selection expression. ResponseTemplates map[string]string `locationName:"responseTemplates" type:"map"` // An expression used to extract information at runtime. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for more information. TemplateSelectionExpression *string `locationName:"templateSelectionExpression" type:"string"` } // String returns the string representation func (s UpdateIntegrationResponseInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateIntegrationResponseInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "UpdateIntegrationResponseInput"} if s.ApiId == nil { invalidParams.Add(aws.NewErrParamRequired("ApiId")) } if s.IntegrationId == nil { invalidParams.Add(aws.NewErrParamRequired("IntegrationId")) } if s.IntegrationResponseId == nil { invalidParams.Add(aws.NewErrParamRequired("IntegrationResponseId")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s UpdateIntegrationResponseInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if len(s.ContentHandlingStrategy) > 0 { v := s.ContentHandlingStrategy metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "contentHandlingStrategy", protocol.QuotedValue{ValueMarshaler: v}, metadata) } if s.IntegrationResponseKey != nil { v := *s.IntegrationResponseKey metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "integrationResponseKey", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.ResponseParameters != nil { v := s.ResponseParameters metadata := protocol.Metadata{} ms0 := e.Map(protocol.BodyTarget, "responseParameters", metadata) ms0.Start() for k1, v1 := range v { ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)}) } ms0.End() } if s.ResponseTemplates != nil { v := s.ResponseTemplates metadata := protocol.Metadata{} ms0 := e.Map(protocol.BodyTarget, "responseTemplates", metadata) ms0.Start() for k1, v1 := range v { ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)}) } ms0.End() } if s.TemplateSelectionExpression != nil { v := *s.TemplateSelectionExpression metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "templateSelectionExpression", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.ApiId != nil { v := *s.ApiId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "apiId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.IntegrationId != nil { v := *s.IntegrationId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "integrationId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.IntegrationResponseId != nil { v := *s.IntegrationResponseId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "integrationResponseId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } return nil } type UpdateIntegrationResponseOutput struct { _ struct{} `type:"structure"` // Specifies how to handle response payload content type conversions. Supported // only for WebSocket APIs. ContentHandlingStrategy ContentHandlingStrategy `locationName:"contentHandlingStrategy" type:"string" enum:"true"` // The identifier. IntegrationResponseId *string `locationName:"integrationResponseId" type:"string"` // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key // type. IntegrationResponseKey *string `locationName:"integrationResponseKey" type:"string"` // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static // value enclosed within a pair of single quotes, or a JSON expression from // the integration response body. The mapping key must match the pattern of // method.response.header.{name}, where name is a valid and unique header name. // The mapped non-static value must match the pattern of integration.response.header.{name} // or integration.response.body.{JSON-expression}, where name is a valid and // unique response header name and JSON-expression is a valid JSON expression // without the $ prefix. ResponseParameters map[string]string `locationName:"responseParameters" type:"map"` // A mapping of identifier keys to templates. The value is an actual template // script. The key is typically a SelectionKey which is chosen based on evaluating // a selection expression. ResponseTemplates map[string]string `locationName:"responseTemplates" type:"map"` // An expression used to extract information at runtime. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for more information. TemplateSelectionExpression *string `locationName:"templateSelectionExpression" type:"string"` } // String returns the string representation func (s UpdateIntegrationResponseOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s UpdateIntegrationResponseOutput) MarshalFields(e protocol.FieldEncoder) error { if len(s.ContentHandlingStrategy) > 0 { v := s.ContentHandlingStrategy metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "contentHandlingStrategy", protocol.QuotedValue{ValueMarshaler: v}, metadata) } if s.IntegrationResponseId != nil { v := *s.IntegrationResponseId metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "integrationResponseId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.IntegrationResponseKey != nil { v := *s.IntegrationResponseKey metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "integrationResponseKey", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.ResponseParameters != nil { v := s.ResponseParameters metadata := protocol.Metadata{} ms0 := e.Map(protocol.BodyTarget, "responseParameters", metadata) ms0.Start() for k1, v1 := range v { ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)}) } ms0.End() } if s.ResponseTemplates != nil { v := s.ResponseTemplates metadata := protocol.Metadata{} ms0 := e.Map(protocol.BodyTarget, "responseTemplates", metadata) ms0.Start() for k1, v1 := range v { ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)}) } ms0.End() } if s.TemplateSelectionExpression != nil { v := *s.TemplateSelectionExpression metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "templateSelectionExpression", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } return nil } const opUpdateIntegrationResponse = "UpdateIntegrationResponse" // UpdateIntegrationResponseRequest returns a request value for making API operation for // AmazonApiGatewayV2. // // Updates an IntegrationResponses. // // // Example sending a request using UpdateIntegrationResponseRequest. // req := client.UpdateIntegrationResponseRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/UpdateIntegrationResponse func (c *Client) UpdateIntegrationResponseRequest(input *UpdateIntegrationResponseInput) UpdateIntegrationResponseRequest { op := &aws.Operation{ Name: opUpdateIntegrationResponse, HTTPMethod: "PATCH", HTTPPath: "/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses/{integrationResponseId}", } if input == nil { input = &UpdateIntegrationResponseInput{} } req := c.newRequest(op, input, &UpdateIntegrationResponseOutput{}) return UpdateIntegrationResponseRequest{Request: req, Input: input, Copy: c.UpdateIntegrationResponseRequest} } // UpdateIntegrationResponseRequest is the request type for the // UpdateIntegrationResponse API operation. type UpdateIntegrationResponseRequest struct { *aws.Request Input *UpdateIntegrationResponseInput Copy func(*UpdateIntegrationResponseInput) UpdateIntegrationResponseRequest } // Send marshals and sends the UpdateIntegrationResponse API request. func (r UpdateIntegrationResponseRequest) Send(ctx context.Context) (*UpdateIntegrationResponseResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &UpdateIntegrationResponseResponse{ UpdateIntegrationResponseOutput: r.Request.Data.(*UpdateIntegrationResponseOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // UpdateIntegrationResponseResponse is the response type for the // UpdateIntegrationResponse API operation. type UpdateIntegrationResponseResponse struct { *UpdateIntegrationResponseOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // UpdateIntegrationResponse request. func (r *UpdateIntegrationResponseResponse) SDKResponseMetdata() *aws.Response { return r.response }