From 72ca738d97fecaefd8da6796683c660363e8a04a Mon Sep 17 00:00:00 2001 From: Dennis Gosnell Date: Sun, 8 May 2022 01:44:52 +0900 Subject: [PATCH] Make some APIGateway fields optional. --- src/Aws/Lambda/Runtime/APIGateway/Types.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Aws/Lambda/Runtime/APIGateway/Types.hs b/src/Aws/Lambda/Runtime/APIGateway/Types.hs index 4c3acb9..1200e99 100644 --- a/src/Aws/Lambda/Runtime/APIGateway/Types.hs +++ b/src/Aws/Lambda/Runtime/APIGateway/Types.hs @@ -100,15 +100,15 @@ data ApiGatewayRequestContext = ApiGatewayRequestContext { apiGatewayRequestContextResourceId :: !Text, apiGatewayRequestContextResourcePath :: !Text, apiGatewayRequestContextHttpMethod :: !Text, - apiGatewayRequestContextExtendedRequestId :: !Text, + apiGatewayRequestContextExtendedRequestId :: !(Maybe Text), apiGatewayRequestContextRequestTime :: !Text, apiGatewayRequestContextPath :: !Text, apiGatewayRequestContextAccountId :: !Text, apiGatewayRequestContextProtocol :: !Text, apiGatewayRequestContextStage :: !Text, - apiGatewayRequestContextDomainPrefix :: !Text, + apiGatewayRequestContextDomainPrefix :: !(Maybe Text), apiGatewayRequestContextRequestId :: !Text, - apiGatewayRequestContextDomainName :: !Text, + apiGatewayRequestContextDomainName :: !(Maybe Text), apiGatewayRequestContextApiId :: !Text, apiGatewayRequestContextIdentity :: !ApiGatewayRequestContextIdentity, apiGatewayRequestContextAuthorizer :: !(Maybe Value) @@ -121,15 +121,15 @@ instance FromJSON ApiGatewayRequestContext where <$> v .: "resourceId" <*> v .: "path" <*> v .: "httpMethod" - <*> v .: "extendedRequestId" + <*> v .:? "extendedRequestId" <*> v .: "requestTime" <*> v .: "path" <*> v .: "accountId" <*> v .: "protocol" <*> v .: "stage" - <*> v .: "domainPrefix" + <*> v .:? "domainPrefix" <*> v .: "requestId" - <*> v .: "domainName" + <*> v .:? "domainName" <*> v .: "apiId" <*> v .: "identity" <*> v .:? "authorizer" @@ -156,11 +156,11 @@ instance FromJSON ApiGatewayRequestContextIdentity where ApiGatewayRequestContextIdentity <$> v .: "cognitoIdentityPoolId" <*> v .: "accountId" - <*> v .: "cognitoIdentityId" + <*> v .:? "cognitoIdentityId" <*> v .: "caller" <*> v .: "sourceIp" - <*> v .: "principalOrgId" - <*> v .: "accessKey" + <*> v .:? "principalOrgId" + <*> v .:? "accessKey" <*> v .: "cognitoAuthenticationType" <*> v .: "cognitoAuthenticationProvider" <*> v .: "userArn"