Skip to content

Commit

Permalink
updates to APIGateway V2 payloads
Browse files Browse the repository at this point in the history
* Properties of HTTPResponses are now var (#176)
* remove redundant multiValueHeaders
  • Loading branch information
fabianfett committed Oct 13, 2020
1 parent a2b5326 commit edef036
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
12 changes: 6 additions & 6 deletions Sources/AWSLambdaEvents/ALB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public enum ALB {
}

public struct TargetGroupResponse: Codable {
public let statusCode: HTTPResponseStatus
public let statusDescription: String?
public let headers: HTTPHeaders?
public let multiValueHeaders: HTTPMultiValueHeaders?
public let body: String
public let isBase64Encoded: Bool
public var statusCode: HTTPResponseStatus
public var statusDescription: String?
public var headers: HTTPHeaders?
public var multiValueHeaders: HTTPMultiValueHeaders?
public var body: String
public var isBase64Encoded: Bool

public init(
statusCode: HTTPResponseStatus,
Expand Down
13 changes: 5 additions & 8 deletions Sources/AWSLambdaEvents/APIGateway+V2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,21 @@ extension APIGateway.V2 {

extension APIGateway.V2 {
public struct Response: Codable {
public let statusCode: HTTPResponseStatus
public let headers: HTTPHeaders?
public let multiValueHeaders: HTTPMultiValueHeaders?
public let body: String?
public let isBase64Encoded: Bool?
public let cookies: [String]?
public var statusCode: HTTPResponseStatus
public var headers: HTTPHeaders?
public var body: String?
public var isBase64Encoded: Bool?
public var cookies: [String]?

public init(
statusCode: HTTPResponseStatus,
headers: HTTPHeaders? = nil,
multiValueHeaders: HTTPMultiValueHeaders? = nil,
body: String? = nil,
isBase64Encoded: Bool? = nil,
cookies: [String]? = nil
) {
self.statusCode = statusCode
self.headers = headers
self.multiValueHeaders = multiValueHeaders
self.body = body
self.isBase64Encoded = isBase64Encoded
self.cookies = cookies
Expand Down
10 changes: 5 additions & 5 deletions Sources/AWSLambdaEvents/APIGateway.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public enum APIGateway {

extension APIGateway {
public struct Response: Codable {
public let statusCode: HTTPResponseStatus
public let headers: HTTPHeaders?
public let multiValueHeaders: HTTPMultiValueHeaders?
public let body: String?
public let isBase64Encoded: Bool?
public var statusCode: HTTPResponseStatus
public var headers: HTTPHeaders?
public var multiValueHeaders: HTTPMultiValueHeaders?
public var body: String?
public var isBase64Encoded: Bool?

public init(
statusCode: HTTPResponseStatus,
Expand Down

0 comments on commit edef036

Please sign in to comment.