This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-11
Channels
- # announcements (15)
- # aws (11)
- # babashka (13)
- # babashka-sci-dev (2)
- # beginners (63)
- # calva (20)
- # cider (9)
- # clj-kondo (27)
- # clojars (3)
- # clojure (34)
- # clojure-art (4)
- # clojure-europe (21)
- # clojure-filipino (1)
- # clojure-indonesia (1)
- # clojure-my (1)
- # clojure-nl (11)
- # clojure-norway (10)
- # clojure-sg (1)
- # clojure-spec (4)
- # clojure-uk (4)
- # clojurescript (5)
- # cursive (8)
- # deps-new (2)
- # events (1)
- # exercism (2)
- # fulcro (44)
- # graphql (6)
- # gratitude (1)
- # introduce-yourself (1)
- # jobs (3)
- # leiningen (5)
- # lsp (26)
- # membrane (18)
- # missionary (9)
- # off-topic (1)
- # pedestal (4)
- # portal (1)
- # quil (24)
- # re-frame (17)
- # reagent (5)
- # remote-jobs (2)
- # reveal (3)
- # spacemacs (4)
- # tools-build (1)
- # tools-deps (12)
hey, i was wondering if I could do a list of operations on api.
(aws/doc s3-client)
without providing :op name, like (aws/doc s3-client :ListBuckets)
hmmm cool, thanks, but I would still consider adding arity for (aws/doc s3-client)
It seems intuitive. If you see it somewhere in git repo, you try and reach for it -at least I did -> probably doc is supported generically, so I might be dreaming 🙂
One last thing, is there some easy path to "paged" results? or do I have to come up with mine?
if anybody needs, tested with s3
(defn paged-invoke
([client
{:keys [op results is-truncated marker next-marker request]
:or {results :Contents is-truncated :IsTruncated marker :Marker next-marker :Marker}
:as options}]
(let [response (aws/invoke client {:op op :request request})]
(when (contains? response :cognitect.anomalies/category)
(throw (ex-info "aws/invoke error" {:op op :request request :response response})))
(if (is-truncated response)
(lazy-cat (results response)
(paged-invoke client (assoc options marker (next-marker response))))
(results response)))))
Another example https://gist.github.com/kennyjwilli/65dfbc30c75d76ba2e22cb044c3f8d1f
Isn't this what iteration was added for? https://github.com/clojure/clojure/blob/master/changes.md
How each api paginates still must be manually written. There are some libs that try to specify where the req/resp pagination tokens are stored. It's not included in the all smithy files.
I agree. I think a bunch of new libs will address similar problems using Iteration https://www.juxt.pro/blog/new-clojure-iteration