guys
i'm coding some datastore interop
I'm having some trouble with Entity/newBuilder
(let [kind "Channel"
item {:channel-sid "CH52d777cf775a449988563cb42b92cc5d"
:user-id 25523386059076410
:contact-user-id 39593488156767110
:contact-name "Ingrid"
:contact-category ""
:contact-title ""
:contact-photo-path ""
:channel-type "private"
:channel-friendly-name "avocado"
:last-consumed-message-index 0
:last-consumed-timestamp #inst"2019-12-31"
;; :unread-messages-count 0
;; :created-by 25523386059076410
;; :date-created #inst"2019-12-31"
;; :channel-status "joined"
;; :muted #inst"2019-12-31"
:fav true
:archived false}
kind-key (-> kind clojure.string/lower-case (str "-id") keyword)
key-built (.build (Key/newBuilder (.newKey (keyFac kind) (epoch-now))))
id (.getId key-built)
kind-id (.getId (.allocateId dataStore (.newKey (keyFac kind))))
properties (dissoc item kind-key)
new-properties (merge properties {kind-key kind-id})
entity (Entity/newBuilder key-built)
transaction (.newTransaction dataStore)]
(doseq [[prop-name value] new-properties]
(cond (inst? value) (.set ^Entity$Builder entity ^String (name prop-name) ^java.util.Date value)
(string? value) (.set ^Entity$Builder entity ^String (name prop-name) ^String value)
(number? value) (.set ^Entity$Builder entity ^String (name prop-name) ^Number value)
(boolean? value) (.set ^Entity$Builder entity ^String (name prop-name) ^Boolean value)
:else (throw (ex-info (str "There is no implementation to insert "
(pr-str [prop-name value]) " because there are no implementations on this function for :"
(pr-str (class value)))
{:prop-name prop-name :value value})))))
This are giving me: Syntax error (IllegalArgumentException) compiling at (datastore.clj:118:1). No matching method set found taking 2 args for class com.google.cloud.datastore.Entity$Builder
=/ Anyone could help me?