Help with setting metadata for object upload in Google Cloud Storage
iAmMrinal0 opened this issue · 1 comments
iAmMrinal0 commented
This is a minimal snippet that I'm trying to use to upload an object and set its metadata:
void $ do
lgr <- Google.newLogger Google.Debug stdout
googleEnv <- Google.newEnv <&> (Google.envLogger .~ lgr) . (envScopes .~ storageReadWriteScope)
runResourceT $
runGoogle googleEnv $
upload
(objectsInsert bkt $
object'
& objMetadata._Just.omAddtional.at "foo" ?~ "bar"
& objName ?~ "test.json") "true"
In the response, the value is Nothing
for metadata and just to be sure I verified on the object on GCS and it did not have them set too. Have I missed something in the code or should I do use objects patch to update it somehow?
iAmMrinal0 commented
Used the lenses incorrectly. The correct usage was:
& objMetadata ?~ objectMetadata (HM.singleton "foo" "bar")