File tree Expand file tree Collapse file tree 2 files changed +21
-17
lines changed Expand file tree Collapse file tree 2 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,19 @@ derive newtype instance showEndpoint :: Show Endpoint
7878
7979derive newtype instance encodeEndpoint :: EncodeJson Endpoint
8080
81- newtype Tags = Tags (Map.Map String String )
81+ newtype Tags
82+ = Tags (Map.Map String String )
83+
8284derive newtype instance showTags :: Show Tags
85+
8386derive instance ntTags :: Newtype Tags _
8487
85- instance tagsDecoder :: DecodeJson Tags where
86- decodeJson = decodeAsMap >>> map Tags
88+ instance tagsDecoder :: DecodeJson Tags where
89+ decodeJson = decodeAsMap >>> map Tags
8790 where
88- decodeAsMap str = do
89- obj <- decodeJson str
90- pure $ Map .fromFoldable $ (F .toUnfoldable obj :: Array _ )
91+ decodeAsMap str = do
92+ obj <- decodeJson str
93+ pure $ Map .fromFoldable $ (F .toUnfoldable obj :: Array _ )
9194
9295type BasicClientPropsR r
9396 = ( accessKeyId :: Maybe AccessKeyId
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ type GetObjectResponse
9494 , contentLength :: Int
9595 , contentEncoding :: String
9696 , contentType :: String
97- , tags :: Tags
97+ , tags :: Tags
9898 }
9999
100100getObject :: S3 -> GetObjectParams -> Aff GetObjectResponse
@@ -110,16 +110,17 @@ getObject client { bucket: BucketName name, key: BucketKey key } =
110110
111111 convert :: InternalGetObjectResponse -> Either JsonDecodeError GetObjectResponse
112112 convert internalResponse = parse internalResponse." Metadata" <#> addTags
113- where
114- addTags tags = { body: internalResponse." Body"
115- , contentLength: internalResponse." ContentLength"
116- , contentEncoding: internalResponse." ContentEncoding"
117- , contentType: internalResponse." ContentType"
118- , tags : tags
119- }
120- parse :: Json -> Either JsonDecodeError Tags
121- parse = decodeJson
122-
113+ where
114+ addTags tags =
115+ { body: internalResponse." Body"
116+ , contentLength: internalResponse." ContentLength"
117+ , contentEncoding: internalResponse." ContentEncoding"
118+ , contentType: internalResponse." ContentType"
119+ , tags: tags
120+ }
121+
122+ parse :: Json -> Either JsonDecodeError Tags
123+ parse = decodeJson
123124
124125type InternalGetSignedUrlParams
125126 = { "Bucket" :: String
You can’t perform that action at this time.
0 commit comments