]> gitweb.factorcode.org Git - factor.git/commitdiff
backblaze: fun naming convention maybe
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 30 Oct 2023 03:15:33 +0000 (22:15 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 30 Oct 2023 03:15:33 +0000 (22:15 -0500)
extra/backblaze/backblaze.factor

index feba87a1c927e6d007bf9b507089a005abfe08b2..78e4106c42347873f0bfbc5dc092a7b531dc3bab 100644 (file)
@@ -96,6 +96,16 @@ SYMBOL: b2-authorized-account
     "/b2api/v2/b2_create_bucket" b2-post-request-with-account-id ;
 : b2-create-bucket ( assoc -- json' ) [ b2-create-bucket* ] with-b2 ;
 
+: vaka ( value assoc key -- assoc ) swapd swap set-of ; inline
+: kava ( key assoc value -- assoc ) swapd set-of ; inline
+
+: b2-create-bucket-by-name-type ( bucket-name bucket-type -- json' )
+    "bucketType" associate
+    "bucketName" vaka b2-create-bucket ;
+
+: b2-create-private-bucket-by-name ( bucket-name -- json' )
+    "allPrivate" b2-create-bucket-by-name-type ;
+
 : b2-list-buckets* ( -- json )
     "/b2api/v2/b2_list_buckets" b2-get-request-with-account-id ;
 : b2-list-buckets ( -- json ) [ b2-list-buckets* ] with-b2 ;