AppsFlyer / pronto

Clojure support for protocol buffers
108 stars 7 forks source link

java.lang.ClassNotFoundException when trying to define mapper #7

Closed alexisvincent closed 2 years ago

alexisvincent commented 2 years ago

Hi there - so cool to see this being worked on!

Appologies ahead of time for the super long issue, however I thought it would probably be useful to have as much info as possible.

I'm trying to build a library for GRPC lib for Authzed's GRPC endpoint https://buf.build/authzed/api/tree/main/authzed/api/v1.

They have a library which generates the java client, currently against this branch

When I try to define a mapper using pronto for the generated Java Lib:

(ns k16.authzed.core
  (:require [pronto.core :as pronto])
  (:import [com.authzed.api.v1 Core$Relationship])
  (:gen-class))

(pronto/defmapper mapper [Core$Relationship])

I get a java.lang.ClassNotFoundException pronto.protos.IObjectId_java_lang_Object.

Reproduce

  1. Clone and checkout samkim fork @ api-v1
  2. Add buf build tools - on mac - brew install bufbuild/buf/buf - im not sure if this is actually required for the build
  3. ./gradlew build
  4. Setup clojure project pointing to either jar or adding compiled classes to path (pick one)

deps.edn

{:paths ["src" "authzed-java/build/classes/java/main"]
 :deps {org.clojure/clojure {:mvn/version "1.10.3"}
             com.authzed.api/authzed {:local/root "authzed-java/build/libs/authzed-0.0.0-SNAPSHOT.jar"}
             com.appsflyer/pronto {:mvn/version "2.0.10"}}}

src/authzed.clj

(ns authzed
  (:require [pronto.core :as pronto])
  (:import [com.authzed.api.v1 Core$Relationship])
  (:gen-class))

(pronto/defmapper mapper [Core$Relationship])

Full Exception

   Error compiling src/k16/authzed/core.clj at (19:7)
   #:clojure.error{:phase :compile-syntax-check,
                   :line 19,
                   :column 7,
                   :source
                   "/Users/alexisvincent/Code/kepler/libs/authzed/src/k16/authzed/core.clj",
                   :symbol deftype*}
             Compiler.java: 7119  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 6440  clojure.lang.Compiler$LetExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java:   38  clojure.lang.Compiler/access$300
             Compiler.java: 6388  clojure.lang.Compiler$LetExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6124  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 5471  clojure.lang.Compiler$FnMethod/parse
             Compiler.java: 4033  clojure.lang.Compiler$FnExpr/parse
             Compiler.java: 7109  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7178  clojure.lang.Compiler/eval
             Compiler.java: 7136  clojure.lang.Compiler/eval
                  core.clj: 3202  clojure.core/eval
                  core.clj: 3198  clojure.core/eval
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  667  clojure.core/apply
                  core.clj: 1977  clojure.core/with-bindings*
                  core.clj: 1977  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn
                  main.clj:  437  clojure.main/repl/read-eval-print/fn
                  main.clj:  437  clojure.main/repl/read-eval-print
                  main.clj:  458  clojure.main/repl/fn
                  main.clj:  458  clojure.main/repl
                  main.clj:  368  clojure.main/repl
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   84  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   56  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  152  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  218  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  217  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  829  java.lang.Thread/run

1. Caused by java.lang.ClassNotFoundException
   pronto.protos.IObjectId_java_lang_Object

       URLClassLoader.java:  476  java.net.URLClassLoader/findClass
   DynamicClassLoader.java:   69  clojure.lang.DynamicClassLoader/findClass
          ClassLoader.java:  589  java.lang.ClassLoader/loadClass
   DynamicClassLoader.java:   77  clojure.lang.DynamicClassLoader/loadClass
          ClassLoader.java:  522  java.lang.ClassLoader/loadClass
                Class.java:   -2  java.lang.Class/forName0
                Class.java:  398  java.lang.Class/forName
                   RT.java: 2212  clojure.lang.RT/classForName
                   RT.java: 2221  clojure.lang.RT/classForName
             Compiler.java: 7399  clojure.lang.Compiler/resolveIn
             Compiler.java: 7362  clojure.lang.Compiler/resolve
             Compiler.java: 8019  clojure.lang.Compiler$NewInstanceExpr/build
             Compiler.java: 7939  clojure.lang.Compiler$NewInstanceExpr$DeftypeParser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 6440  clojure.lang.Compiler$LetExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6122  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7099  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java:   38  clojure.lang.Compiler/access$300
             Compiler.java: 6388  clojure.lang.Compiler$LetExpr$Parser/parse
             Compiler.java: 7111  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 6749  clojure.lang.Compiler/analyze
             Compiler.java: 6124  clojure.lang.Compiler$BodyExpr$Parser/parse
             Compiler.java: 5471  clojure.lang.Compiler$FnMethod/parse
             Compiler.java: 4033  clojure.lang.Compiler$FnExpr/parse
             Compiler.java: 7109  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6793  clojure.lang.Compiler/analyze
             Compiler.java: 7178  clojure.lang.Compiler/eval
             Compiler.java: 7136  clojure.lang.Compiler/eval
                  core.clj: 3202  clojure.core/eval
                  core.clj: 3198  clojure.core/eval
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  667  clojure.core/apply
                  core.clj: 1977  clojure.core/with-bindings*
                  core.clj: 1977  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn
                  main.clj:  437  clojure.main/repl/read-eval-print/fn
                  main.clj:  437  clojure.main/repl/read-eval-print
                  main.clj:  458  clojure.main/repl/fn
                  main.clj:  458  clojure.main/repl
                  main.clj:  368  clojure.main/repl
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   84  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   56  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  152  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  218  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  217  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  829  java.lang.Thread/run

Macro expansion of (pronto/defmapper mapper [Core$Relationship])

(do
  (pronto.utils/with-ns
    "pronto.protos.k16.authzed.core.mapper"
    (do
      (deftype
        com_authzed_api_v1_Core__ObjectReferenceProtoMap
        [G__13251 G__13252])
      (deftype
        transient_com_authzed_api_v1_Core__ObjectReference
        [G__13253 G__13254 G__13255])
      (declare __EMPTY_com_authzed_api_v1_Core__ObjectReference)
      (deftype
        com_authzed_api_v1_Core__SubjectReferenceProtoMap
        [G__13256 G__13257])
      (deftype
        transient_com_authzed_api_v1_Core__SubjectReference
        [G__13258 G__13259 G__13260])
      (declare __EMPTY_com_authzed_api_v1_Core__SubjectReference)
      (deftype
        com_authzed_api_v1_Core__RelationshipProtoMap
        [G__13261 G__13262])
      (deftype
        transient_com_authzed_api_v1_Core__Relationship
        [G__13263 G__13264 G__13265])
      (declare __EMPTY_com_authzed_api_v1_Core__Relationship))
    (do
      (pronto.utils/with-ns
        "pronto.protos"
        (do
          (definterface
            IObjectType_java_lang_Object
            (assocObjectType_Object [builder val])
            (valAtObjectType_Object [])
            (emptyObjectType [])
            (clearObjectType [builder]))
          (definterface
            IObjectId_java_lang_Object
            (assocObjectId_Object [builder val])
            (valAtObjectId_Object [])
            (emptyObjectId [])
            (clearObjectId [builder]))))
      (pronto.utils/with-ns
        "pronto.protos"
        (do
          (definterface
            Builder_com_authzed_api_v1_Core__ObjectReference
            (getProto_com_authzed_api_v1_Core__ObjectReference [])
            (fromProto_com_authzed_api_v1_Core__ObjectReference
              [proto-obj])
            (getTransient_com_authzed_api_v1_Core__ObjectReference [])
            (fromBytes_com_authzed_api_v1_Core__ObjectReference
              [bytea]))))
      (deftype
        com_authzed_api_v1_Core__ObjectReferenceProtoMap
        [pojo11480 md13271]
        clojure.lang.IPersistentMap
        (pronto.emitters/without
          [this__11484__auto__ k__11485__auto__]
          (throw
            (java.lang.UnsupportedOperationException.
              "cannot dissoc from a proto map")))
        clojure.lang.Associative
        (assoc
          [this13277 k13278 v13279]
          (let [builder13273 (.pmap_getBuilder this13277)]
            (condp identical? k13278
              :object_type (.assocObjectType_Object
                             this13277
                             builder13273
                             v13279)
              :object_id (.assocObjectId_Object
                           this13277
                           builder13273
                           v13279)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13278))))
            (.copy this13277 builder13273)))
        pronto.ProtoMap
        (pronto.emitters/isMutable [this__11484__auto__] false)
        (pronto.emitters/pmap_getBuilder
          [this__11484__auto__]
          (.toBuilder pojo11480))
        (pronto.emitters/copy
          [this__11484__auto__ builder__11486__auto__]
          (new
            com_authzed_api_v1_Core__ObjectReferenceProtoMap
            (.build builder__11486__auto__)
            md13271))
        (pronto.emitters/remap
          [this__11484__auto__ mapper13272]
          (. mapper13272
           fromProto_com_authzed_api_v1_Core__ObjectReference
           pojo11480))
        (pronto.emitters/pmap_getProto [this__11484__auto__] pojo11480)
        (pronto.emitters/clearField
          [this__11481__auto__ k13280]
          (let [builder13273 (.pmap_getBuilder this__11481__auto__)]
            (condp identical? k13280
              :object_type (.clearObjectType builder13273)
              :object_id (.clearObjectId builder13273)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13280))))
            (.copy this__11481__auto__ builder13273)))
        (pronto.emitters/pmap_hasField
          [this__11482__auto__ k13281]
          (condp identical? k13281
            :object_type (throw
                           (java.lang.IllegalArgumentException.
                             (str
                               "field "
                               k13281
                               " cannot be checked for field existence")))
            :object_id (throw
                         (java.lang.IllegalArgumentException.
                           (str
                             "field "
                             k13281
                             " cannot be checked for field existence")))
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13281)))))
        (pronto.emitters/whichOneOf
          [this__11483__auto__ k13282]
          (throw
            (java.lang.IllegalArgumentException.
              (str "Cannot check which one-of for " k13282))))
        (pronto.emitters/containsKey
          [this__11484__auto__ k__11485__auto__]
          (boolean (get #{:object_id :object_type} k__11485__auto__)))
        (pronto.emitters/entryAt
          [this__11484__auto__ k__11485__auto__]
          (clojure.lang.MapEntry/create
            k__11485__auto__
            (.valAt this__11484__auto__ k__11485__auto__)))
        clojure.lang.MapEquivalence
        clojure.lang.ILookup
        (pronto.emitters/valAt
          [this13284 k13283]
          (condp identical? k13283
            :object_type (.valAtObjectType_Object this13284)
            :object_id (.valAtObjectId_Object this13284)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13283)))))
        (pronto.emitters/valAt
          [this__11484__auto__
           k__11485__auto__
           not-found__11487__auto__]
          (.valAt this__11484__auto__ k__11485__auto__))
        pronto.DefaultingFn
        (pronto.emitters/invoke
          [this__11484__auto__ arg1__11488__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11484__auto__
            arg1__11488__auto__))
        (pronto.emitters/invoke
          [this__11484__auto__
           arg1__11488__auto__
           not-found__11487__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11484__auto__
            arg1__11488__auto__
            not-found__11487__auto__))
        com.authzed.api.v1.Core$ObjectReferenceOrBuilder
        (getObjectType
          [this__11414__auto__]
          (. pojo11480 getObjectType))
        (getObjectTypeBytes
          [this__11414__auto__]
          (. pojo11480 getObjectTypeBytes))
        (getObjectId [this__11414__auto__] (. pojo11480 getObjectId))
        (getObjectIdBytes
          [this__11414__auto__]
          (. pojo11480 getObjectIdBytes))
        pronto.protos.IObjectType_java_lang_Object
        (assocObjectType_Object
          [this13276 builder13274 val13275]
          (try
            (if (nil? val13275)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field "object_type",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13287 val13275]
                (.setObjectType builder13274 res13287)))
            (catch
              java.lang.ClassCastException
              ex13285
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field :object_type,
                   :expected-type java.lang.String,
                   :value val13275}
                  ex13285)))))
        (valAtObjectType_Object
          [this13276]
          (let [v13288 (.getObjectType this13276)] v13288))
        (emptyObjectType
          [this13276]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearObjectType
          [this13276 builder13274]
          (.clearObjectType builder13274))
        pronto.protos.IObjectId_java_lang_Object
        (assocObjectId_Object
          [this13276 builder13274 val13275]
          (try
            (if (nil? val13275)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field "object_id",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13291 val13275]
                (.setObjectId builder13274 res13291)))
            (catch
              java.lang.ClassCastException
              ex13289
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field :object_id,
                   :expected-type java.lang.String,
                   :value val13275}
                  ex13289)))))
        (valAtObjectId_Object
          [this13276]
          (let [v13292 (.getObjectId this13276)] v13292))
        (emptyObjectId
          [this13276]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearObjectId
          [this13276 builder13274]
          (.clearObjectId builder13274))
        java.io.Serializable
        clojure.lang.IObj
        (pronto.emitters/withMeta
          [this__11484__auto__ meta-map__11489__auto__]
          (if (nil? meta-map__11489__auto__)
            this__11484__auto__
            (new
              com_authzed_api_v1_Core__ObjectReferenceProtoMap
              pojo11480
              meta-map__11489__auto__)))
        (meta [this__11484__auto__] md13271)
        clojure.lang.IPersistentCollection
        (cons
          [this__11484__auto__ o__11490__auto__]
          (pronto.PersistentMapHelpers/cons
            this__11484__auto__
            o__11490__auto__))
        (empty
          [this__11484__auto__]
          __EMPTY_com_authzed_api_v1_Core__ObjectReference)
        (count [this__11484__auto__] 2)
        (pronto.emitters/equiv
          [this__11484__auto__ other__11491__auto__]
          (pronto.PersistentMapHelpers/equiv
            this__11484__auto__
            (if (instance?
                  com.authzed.api.v1.Core$ObjectReference
                  other__11491__auto__)
              (new
                com_authzed_api_v1_Core__ObjectReferenceProtoMap
                other__11491__auto__
                nil)
              other__11491__auto__)))
        clojure.lang.Seqable
        (seq
          [this13293]
          (clojure.lang.RT/seq
            [(clojure.lang.MapEntry/create
               :object_type
               (.valAtObjectType_Object this13293))
             (clojure.lang.MapEntry/create
               :object_id
               (.valAtObjectId_Object this13293))]))
        clojure.lang.IEditableCollection
        (pronto.emitters/asTransient
          [this__11484__auto__]
          (new
            transient_com_authzed_api_v1_Core__ObjectReference
            (.toBuilder pojo11480)
            true
            false))
        java.lang.Iterable
        (pronto.emitters/iterator
          [this13294]
          (clojure.lang.RT/iter
            [(clojure.lang.MapEntry/create
               :object_type
               (.valAtObjectType_Object this13294))
             (clojure.lang.MapEntry/create
               :object_id
               (.valAtObjectId_Object this13294))]))
        java.util.Map
        (pronto.emitters/clear
          [this__11484__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/containsValue
          [this__11484__auto__ value__11492__auto__]
          (pronto.PersistentMapHelpers/containsValue
            this__11484__auto__
            value__11492__auto__))
        (pronto.emitters/entrySet
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/entrySet this__11484__auto__))
        (pronto.emitters/keySet
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/keySet this__11484__auto__))
        (pronto.emitters/values
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/values this__11484__auto__))
        (get
          [this__11484__auto__ key__11493__auto__]
          (pronto.PersistentMapHelpers/get
            this__11484__auto__
            key__11493__auto__))
        (pronto.emitters/isEmpty
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/isEmpty this__11484__auto__))
        (pronto.emitters/put
          [this__11484__auto__ k__11485__auto__ v__11494__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/putAll
          [this__11484__auto__ m__11495__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (remove
          [this__11484__auto__ k__11485__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/size
          [this__11484__auto__]
          (.count this__11484__auto__))
        java.lang.Object
        (pronto.emitters/toString
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/toString this__11484__auto__))
        (pronto.emitters/equals
          [this__11484__auto__ obj__11496__auto__]
          (pronto.PersistentMapHelpers/equals
            this__11484__auto__
            obj__11496__auto__))
        (pronto.emitters/hashCode
          [this__11484__auto__]
          (.hashCode pojo11480)))
      (deftype
        transient_com_authzed_api_v1_Core__ObjectReference
        [pojo11480 editable? in-transaction?]
        pronto.ProtoMap
        (pronto.emitters/isMutable [this__11511__auto__] true)
        (pronto.emitters/pmap_getBuilder
          [this__11511__auto__]
          pojo11480)
        (pronto.emitters/copy
          [this__11511__auto__ builder__11512__auto__]
          (set! pojo11480 builder__11512__auto__)
          this__11511__auto__)
        (pronto.emitters/pmap_getProto [this__11511__auto__] pojo11480)
        (pronto.emitters/clearField
          [this__11507__auto__ k13299]
          (let [builder13295 (.pmap_getBuilder this__11507__auto__)]
            (condp identical? k13299
              :object_type (.clearObjectType builder13295)
              :object_id (.clearObjectId builder13295)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13299))))
            (.copy this__11507__auto__ builder13295)))
        (pronto.emitters/pmap_hasField
          [this__11508__auto__ k13300]
          (condp identical? k13300
            :object_type (throw
                           (java.lang.IllegalArgumentException.
                             (str
                               "field "
                               k13300
                               " cannot be checked for field existence")))
            :object_id (throw
                         (java.lang.IllegalArgumentException.
                           (str
                             "field "
                             k13300
                             " cannot be checked for field existence")))
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13300)))))
        (pronto.emitters/whichOneOf
          [this__11509__auto__ k13301]
          (throw
            (java.lang.IllegalArgumentException.
              (str "Cannot check which one-of for " k13301))))
        (empty
          [this__11510__auto__ k13302]
          (condp identical? k13302
            :object_type nil
            :object_id nil
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13302)))))
        clojure.lang.MapEquivalence
        clojure.lang.ILookup
        (pronto.emitters/valAt
          [this13304 k13303]
          (condp identical? k13303
            :object_type (.valAtObjectType_Object this13304)
            :object_id (.valAtObjectId_Object this13304)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13303)))))
        (pronto.emitters/valAt
          [this__11511__auto__
           k__11513__auto__
           not-found__11514__auto__]
          (.valAt this__11511__auto__ k__11513__auto__))
        pronto.DefaultingFn
        (pronto.emitters/invoke
          [this__11511__auto__ arg1__11515__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11511__auto__
            arg1__11515__auto__))
        (pronto.emitters/invoke
          [this__11511__auto__
           arg1__11515__auto__
           not-found__11514__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11511__auto__
            arg1__11515__auto__
            not-found__11514__auto__))
        com.authzed.api.v1.Core$ObjectReferenceOrBuilder
        (getObjectType
          [this__11414__auto__]
          (. pojo11480 getObjectType))
        (getObjectTypeBytes
          [this__11414__auto__]
          (. pojo11480 getObjectTypeBytes))
        (getObjectId [this__11414__auto__] (. pojo11480 getObjectId))
        (getObjectIdBytes
          [this__11414__auto__]
          (. pojo11480 getObjectIdBytes))
        pronto.protos.IObjectType_java_lang_Object
        (assocObjectType_Object
          [this13298 builder13296 val13297]
          (try
            (if (nil? val13297)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field "object_type",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13307 val13297]
                (.setObjectType builder13296 res13307)))
            (catch
              java.lang.ClassCastException
              ex13305
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field :object_type,
                   :expected-type java.lang.String,
                   :value val13297}
                  ex13305)))))
        (valAtObjectType_Object
          [this13298]
          (let [v13308 (.getObjectType this13298)] v13308))
        (emptyObjectType
          [this13298]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearObjectType
          [this13298 builder13296]
          (.clearObjectType builder13296))
        pronto.protos.IObjectId_java_lang_Object
        (assocObjectId_Object
          [this13298 builder13296 val13297]
          (try
            (if (nil? val13297)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field "object_id",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13311 val13297]
                (.setObjectId builder13296 res13311)))
            (catch
              java.lang.ClassCastException
              ex13309
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$ObjectReference,
                   :field :object_id,
                   :expected-type java.lang.String,
                   :value val13297}
                  ex13309)))))
        (valAtObjectId_Object
          [this13298]
          (let [v13312 (.getObjectId this13298)] v13312))
        (emptyObjectId
          [this13298]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearObjectId
          [this13298 builder13296]
          (.clearObjectId builder13296))
        pronto.TransientProtoMap
        (pronto.emitters/setInTransaction
          [this__11511__auto__ v__11516__auto__]
          (set! in-transaction? v__11516__auto__))
        (pronto.emitters/isInTransaction
          [this__11511__auto__]
          in-transaction?)
        clojure.lang.ITransientMap
        (assoc
          [this13313 k13314 v13315]
          (pronto.emitters/check-editable! editable?)
          (condp identical? k13314
            :object_type (.assocObjectType_Object
                           this13313
                           pojo11480
                           v13315)
            :object_id (.assocObjectId_Object
                         this13313
                         pojo11480
                         v13315)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13314))))
          this13313)
        (pronto.emitters/persistent
          [this__11511__auto__]
          (set! editable? false)
          (new
            com_authzed_api_v1_Core__ObjectReferenceProtoMap
            (.build pojo11480)
            nil))
        (count [this__11511__auto__] 2)
        clojure.lang.ITransientAssociative2
        (pronto.emitters/containsKey
          [this__11511__auto__ k__11513__auto__]
          (pronto.emitters/check-editable! editable?)
          (boolean (get #{:object_id :object_type} k__11513__auto__)))
        (pronto.emitters/entryAt
          [this__11511__auto__ k__11513__auto__]
          (clojure.lang.MapEntry/create
            k__11513__auto__
            (.valAt this__11511__auto__ k__11513__auto__)))
        clojure.lang.ITransientCollection
        (conj
          [this__11511__auto__ val__11517__auto__]
          (pronto.emitters/check-editable! editable?)
          (pronto.TransientMapHelpers/conj
            this__11511__auto__
            val__11517__auto__)))
      (def __EMPTY_com_authzed_api_v1_Core__ObjectReference
       (new
         com_authzed_api_v1_Core__ObjectReferenceProtoMap
         (.build (com.authzed.api.v1.Core$ObjectReference/newBuilder))
         nil))
      (extend-type
        com.authzed.api.v1.Core$ObjectReference
        pronto.emitters/ProtoMapBuilder
        (pronto.emitters/proto->proto-map
          [this__11523__auto__ mapper]
          (. mapper
           fromProto_com_authzed_api_v1_Core__ObjectReference
           this__11523__auto__))))
    (do
      (pronto.utils/with-ns
        "pronto.protos"
        (do
          (definterface
            IObject_java_lang_Object
            (assocObject_Object [builder val])
            (valAtObject_Object [])
            (emptyObject [])
            (clearObject [builder]))
          (definterface
            IOptionalRelation_java_lang_Object
            (assocOptionalRelation_Object [builder val])
            (valAtOptionalRelation_Object [])
            (emptyOptionalRelation [])
            (clearOptionalRelation [builder]))))
      (pronto.utils/with-ns
        "pronto.protos"
        (do
          (definterface
            Builder_com_authzed_api_v1_Core__SubjectReference
            (getProto_com_authzed_api_v1_Core__SubjectReference [])
            (fromProto_com_authzed_api_v1_Core__SubjectReference
              [proto-obj])
            (getTransient_com_authzed_api_v1_Core__SubjectReference [])
            (fromBytes_com_authzed_api_v1_Core__SubjectReference
              [bytea]))))
      (deftype
        com_authzed_api_v1_Core__SubjectReferenceProtoMap
        [pojo11480 md13321]
        clojure.lang.IPersistentMap
        (pronto.emitters/without
          [this__11484__auto__ k__11485__auto__]
          (throw
            (java.lang.UnsupportedOperationException.
              "cannot dissoc from a proto map")))
        clojure.lang.Associative
        (assoc
          [this13327 k13328 v13329]
          (let [builder13323 (.pmap_getBuilder this13327)]
            (condp identical? k13328
              :object (.assocObject_Object
                        this13327
                        builder13323
                        v13329)
              :optional_relation (.assocOptionalRelation_Object
                                   this13327
                                   builder13323
                                   v13329)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13328))))
            (.copy this13327 builder13323)))
        pronto.ProtoMap
        (pronto.emitters/isMutable [this__11484__auto__] false)
        (pronto.emitters/pmap_getBuilder
          [this__11484__auto__]
          (.toBuilder pojo11480))
        (pronto.emitters/copy
          [this__11484__auto__ builder__11486__auto__]
          (new
            com_authzed_api_v1_Core__SubjectReferenceProtoMap
            (.build builder__11486__auto__)
            md13321))
        (pronto.emitters/remap
          [this__11484__auto__ mapper13322]
          (. mapper13322
           fromProto_com_authzed_api_v1_Core__SubjectReference
           pojo11480))
        (pronto.emitters/pmap_getProto [this__11484__auto__] pojo11480)
        (pronto.emitters/clearField
          [this__11481__auto__ k13330]
          (let [builder13323 (.pmap_getBuilder this__11481__auto__)]
            (condp identical? k13330
              :object (.clearObject builder13323)
              :optional_relation (.clearOptionalRelation builder13323)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13330))))
            (.copy this__11481__auto__ builder13323)))
        (pronto.emitters/pmap_hasField
          [this__11482__auto__ k13331]
          (condp identical? k13331
            :object (.hasObject pojo11480)
            :optional_relation (throw
                                 (java.lang.IllegalArgumentException.
                                   (str
                                     "field "
                                     k13331
                                     " cannot be checked for field existence")))
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13331)))))
        (pronto.emitters/whichOneOf
          [this__11483__auto__ k13332]
          (throw
            (java.lang.IllegalArgumentException.
              (str "Cannot check which one-of for " k13332))))
        (pronto.emitters/containsKey
          [this__11484__auto__ k__11485__auto__]
          (boolean
            (get #{:optional_relation :object} k__11485__auto__)))
        (pronto.emitters/entryAt
          [this__11484__auto__ k__11485__auto__]
          (clojure.lang.MapEntry/create
            k__11485__auto__
            (.valAt this__11484__auto__ k__11485__auto__)))
        clojure.lang.MapEquivalence
        clojure.lang.ILookup
        (pronto.emitters/valAt
          [this13334 k13333]
          (condp identical? k13333
            :object (.valAtObject_Object this13334)
            :optional_relation (.valAtOptionalRelation_Object
                                 this13334)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13333)))))
        (pronto.emitters/valAt
          [this__11484__auto__
           k__11485__auto__
           not-found__11487__auto__]
          (.valAt this__11484__auto__ k__11485__auto__))
        pronto.DefaultingFn
        (pronto.emitters/invoke
          [this__11484__auto__ arg1__11488__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11484__auto__
            arg1__11488__auto__))
        (pronto.emitters/invoke
          [this__11484__auto__
           arg1__11488__auto__
           not-found__11487__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11484__auto__
            arg1__11488__auto__
            not-found__11487__auto__))
        com.authzed.api.v1.Core$SubjectReferenceOrBuilder
        (hasObject [this__11414__auto__] (. pojo11480 hasObject))
        (getObjectOrBuilder
          [this__11414__auto__]
          (. pojo11480 getObjectOrBuilder))
        (getOptionalRelation
          [this__11414__auto__]
          (. pojo11480 getOptionalRelation))
        (getOptionalRelationBytes
          [this__11414__auto__]
          (. pojo11480 getOptionalRelationBytes))
        (getObject [this__11414__auto__] (. pojo11480 getObject))
        pronto.protos.IObject_java_lang_Object
        (assocObject_Object
          [this13326 builder13324 val13325]
          (try
            (if (nil? val13325)
              (.clearObject builder13324)
              (let [res13337 (cond
                               (identical?
                                 (class val13325)
                                 com_authzed_api_v1_Core__ObjectReferenceProtoMap) (let 
                                                                                     [u13338
                                                                                      val13325]
                                                                                     (pronto.RT/getProto
                                                                                       u13338))
                               (identical?
                                 (class val13325)
                                 com.authzed.api.v1.Core$ObjectReference) val13325
                               (instance? pronto.ProtoMap val13325) (let 
                                                                      [u13339
                                                                       val13325]
                                                                      (pronto.RT/getProto
                                                                        u13339))
                               (map? val13325) (let 
                                                 [u13340
                                                  (pronto.transformations/map->proto-map
                                                    (new
                                                      transient_com_authzed_api_v1_Core__ObjectReference
                                                      (com.authzed.api.v1.Core$ObjectReference/newBuilder)
                                                      true
                                                      false)
                                                    val13325)]
                                                 (pronto.RT/getProto
                                                   u13340))
                               :else (throw
                                       (ex-info
                                         "Invalid type"
                                         {:class
                                          com.authzed.api.v1.Core$SubjectReference,
                                          :field "object",
                                          :expected-type
                                          com.authzed.api.v1.Core$ObjectReference,
                                          :value val13325}
                                         nil)))]
                (.setObject builder13324 res13337)))
            (catch
              java.lang.ClassCastException
              ex13335
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$SubjectReference,
                   :field :object,
                   :expected-type
                   com.authzed.api.v1.Core$ObjectReference,
                   :value val13325}
                  ex13335)))))
        (valAtObject_Object
          [this13326]
          (when (.hasObject this13326)
            (let [v13341 (.getObject this13326)]
              (new
                com_authzed_api_v1_Core__ObjectReferenceProtoMap
                v13341
                (meta v13341)))))
        (emptyObject
          [this13326]
          __EMPTY_com_authzed_api_v1_Core__ObjectReference)
        (clearObject
          [this13326 builder13324]
          (.clearObject builder13324))
        pronto.protos.IOptionalRelation_java_lang_Object
        (assocOptionalRelation_Object
          [this13326 builder13324 val13325]
          (try
            (if (nil? val13325)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$SubjectReference,
                   :field "optional_relation",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13344 val13325]
                (.setOptionalRelation builder13324 res13344)))
            (catch
              java.lang.ClassCastException
              ex13342
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$SubjectReference,
                   :field :optional_relation,
                   :expected-type java.lang.String,
                   :value val13325}
                  ex13342)))))
        (valAtOptionalRelation_Object
          [this13326]
          (let [v13345 (.getOptionalRelation this13326)] v13345))
        (emptyOptionalRelation
          [this13326]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearOptionalRelation
          [this13326 builder13324]
          (.clearOptionalRelation builder13324))
        java.io.Serializable
        clojure.lang.IObj
        (pronto.emitters/withMeta
          [this__11484__auto__ meta-map__11489__auto__]
          (if (nil? meta-map__11489__auto__)
            this__11484__auto__
            (new
              com_authzed_api_v1_Core__SubjectReferenceProtoMap
              pojo11480
              meta-map__11489__auto__)))
        (meta [this__11484__auto__] md13321)
        clojure.lang.IPersistentCollection
        (cons
          [this__11484__auto__ o__11490__auto__]
          (pronto.PersistentMapHelpers/cons
            this__11484__auto__
            o__11490__auto__))
        (empty
          [this__11484__auto__]
          __EMPTY_com_authzed_api_v1_Core__SubjectReference)
        (count [this__11484__auto__] 2)
        (pronto.emitters/equiv
          [this__11484__auto__ other__11491__auto__]
          (pronto.PersistentMapHelpers/equiv
            this__11484__auto__
            (if (instance?
                  com.authzed.api.v1.Core$SubjectReference
                  other__11491__auto__)
              (new
                com_authzed_api_v1_Core__SubjectReferenceProtoMap
                other__11491__auto__
                nil)
              other__11491__auto__)))
        clojure.lang.Seqable
        (seq
          [this13346]
          (clojure.lang.RT/seq
            [(clojure.lang.MapEntry/create
               :object
               (.valAtObject_Object this13346))
             (clojure.lang.MapEntry/create
               :optional_relation
               (.valAtOptionalRelation_Object this13346))]))
        clojure.lang.IEditableCollection
        (pronto.emitters/asTransient
          [this__11484__auto__]
          (new
            transient_com_authzed_api_v1_Core__SubjectReference
            (.toBuilder pojo11480)
            true
            false))
        java.lang.Iterable
        (pronto.emitters/iterator
          [this13347]
          (clojure.lang.RT/iter
            [(clojure.lang.MapEntry/create
               :object
               (.valAtObject_Object this13347))
             (clojure.lang.MapEntry/create
               :optional_relation
               (.valAtOptionalRelation_Object this13347))]))
        java.util.Map
        (pronto.emitters/clear
          [this__11484__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/containsValue
          [this__11484__auto__ value__11492__auto__]
          (pronto.PersistentMapHelpers/containsValue
            this__11484__auto__
            value__11492__auto__))
        (pronto.emitters/entrySet
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/entrySet this__11484__auto__))
        (pronto.emitters/keySet
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/keySet this__11484__auto__))
        (pronto.emitters/values
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/values this__11484__auto__))
        (get
          [this__11484__auto__ key__11493__auto__]
          (pronto.PersistentMapHelpers/get
            this__11484__auto__
            key__11493__auto__))
        (pronto.emitters/isEmpty
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/isEmpty this__11484__auto__))
        (pronto.emitters/put
          [this__11484__auto__ k__11485__auto__ v__11494__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/putAll
          [this__11484__auto__ m__11495__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (remove
          [this__11484__auto__ k__11485__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/size
          [this__11484__auto__]
          (.count this__11484__auto__))
        java.lang.Object
        (pronto.emitters/toString
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/toString this__11484__auto__))
        (pronto.emitters/equals
          [this__11484__auto__ obj__11496__auto__]
          (pronto.PersistentMapHelpers/equals
            this__11484__auto__
            obj__11496__auto__))
        (pronto.emitters/hashCode
          [this__11484__auto__]
          (.hashCode pojo11480)))
      (deftype
        transient_com_authzed_api_v1_Core__SubjectReference
        [pojo11480 editable? in-transaction?]
        pronto.ProtoMap
        (pronto.emitters/isMutable [this__11511__auto__] true)
        (pronto.emitters/pmap_getBuilder
          [this__11511__auto__]
          pojo11480)
        (pronto.emitters/copy
          [this__11511__auto__ builder__11512__auto__]
          (set! pojo11480 builder__11512__auto__)
          this__11511__auto__)
        (pronto.emitters/pmap_getProto [this__11511__auto__] pojo11480)
        (pronto.emitters/clearField
          [this__11507__auto__ k13352]
          (let [builder13348 (.pmap_getBuilder this__11507__auto__)]
            (condp identical? k13352
              :object (.clearObject builder13348)
              :optional_relation (.clearOptionalRelation builder13348)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13352))))
            (.copy this__11507__auto__ builder13348)))
        (pronto.emitters/pmap_hasField
          [this__11508__auto__ k13353]
          (condp identical? k13353
            :object (.hasObject pojo11480)
            :optional_relation (throw
                                 (java.lang.IllegalArgumentException.
                                   (str
                                     "field "
                                     k13353
                                     " cannot be checked for field existence")))
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13353)))))
        (pronto.emitters/whichOneOf
          [this__11509__auto__ k13354]
          (throw
            (java.lang.IllegalArgumentException.
              (str "Cannot check which one-of for " k13354))))
        (empty
          [this__11510__auto__ k13355]
          (condp identical? k13355
            :object __EMPTY_com_authzed_api_v1_Core__ObjectReference
            :optional_relation nil
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13355)))))
        clojure.lang.MapEquivalence
        clojure.lang.ILookup
        (pronto.emitters/valAt
          [this13357 k13356]
          (condp identical? k13356
            :object (.valAtObject_Object this13357)
            :optional_relation (.valAtOptionalRelation_Object
                                 this13357)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13356)))))
        (pronto.emitters/valAt
          [this__11511__auto__
           k__11513__auto__
           not-found__11514__auto__]
          (.valAt this__11511__auto__ k__11513__auto__))
        pronto.DefaultingFn
        (pronto.emitters/invoke
          [this__11511__auto__ arg1__11515__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11511__auto__
            arg1__11515__auto__))
        (pronto.emitters/invoke
          [this__11511__auto__
           arg1__11515__auto__
           not-found__11514__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11511__auto__
            arg1__11515__auto__
            not-found__11514__auto__))
        com.authzed.api.v1.Core$SubjectReferenceOrBuilder
        (hasObject [this__11414__auto__] (. pojo11480 hasObject))
        (getObjectOrBuilder
          [this__11414__auto__]
          (. pojo11480 getObjectOrBuilder))
        (getOptionalRelation
          [this__11414__auto__]
          (. pojo11480 getOptionalRelation))
        (getOptionalRelationBytes
          [this__11414__auto__]
          (. pojo11480 getOptionalRelationBytes))
        (getObject [this__11414__auto__] (. pojo11480 getObject))
        pronto.protos.IObject_java_lang_Object
        (assocObject_Object
          [this13351 builder13349 val13350]
          (try
            (if (nil? val13350)
              (.clearObject builder13349)
              (let [res13360 (cond
                               (identical?
                                 (class val13350)
                                 com_authzed_api_v1_Core__ObjectReferenceProtoMap) (let 
                                                                                     [u13361
                                                                                      val13350]
                                                                                     (pronto.RT/getProto
                                                                                       u13361))
                               (identical?
                                 (class val13350)
                                 com.authzed.api.v1.Core$ObjectReference) val13350
                               (instance? pronto.ProtoMap val13350) (let 
                                                                      [u13362
                                                                       val13350]
                                                                      (pronto.RT/getProto
                                                                        u13362))
                               (map? val13350) (let 
                                                 [u13363
                                                  (pronto.transformations/map->proto-map
                                                    (new
                                                      transient_com_authzed_api_v1_Core__ObjectReference
                                                      (com.authzed.api.v1.Core$ObjectReference/newBuilder)
                                                      true
                                                      false)
                                                    val13350)]
                                                 (pronto.RT/getProto
                                                   u13363))
                               :else (throw
                                       (ex-info
                                         "Invalid type"
                                         {:class
                                          com.authzed.api.v1.Core$SubjectReference,
                                          :field "object",
                                          :expected-type
                                          com.authzed.api.v1.Core$ObjectReference,
                                          :value val13350}
                                         nil)))]
                (.setObject builder13349 res13360)))
            (catch
              java.lang.ClassCastException
              ex13358
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$SubjectReference,
                   :field :object,
                   :expected-type
                   com.authzed.api.v1.Core$ObjectReference,
                   :value val13350}
                  ex13358)))))
        (valAtObject_Object
          [this13351]
          (when (.hasObject this13351)
            (let [v13364 (.getObject this13351)]
              (new
                com_authzed_api_v1_Core__ObjectReferenceProtoMap
                v13364
                (meta v13364)))))
        (emptyObject
          [this13351]
          __EMPTY_com_authzed_api_v1_Core__ObjectReference)
        (clearObject
          [this13351 builder13349]
          (.clearObject builder13349))
        pronto.protos.IOptionalRelation_java_lang_Object
        (assocOptionalRelation_Object
          [this13351 builder13349 val13350]
          (try
            (if (nil? val13350)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$SubjectReference,
                   :field "optional_relation",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13367 val13350]
                (.setOptionalRelation builder13349 res13367)))
            (catch
              java.lang.ClassCastException
              ex13365
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$SubjectReference,
                   :field :optional_relation,
                   :expected-type java.lang.String,
                   :value val13350}
                  ex13365)))))
        (valAtOptionalRelation_Object
          [this13351]
          (let [v13368 (.getOptionalRelation this13351)] v13368))
        (emptyOptionalRelation
          [this13351]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearOptionalRelation
          [this13351 builder13349]
          (.clearOptionalRelation builder13349))
        pronto.TransientProtoMap
        (pronto.emitters/setInTransaction
          [this__11511__auto__ v__11516__auto__]
          (set! in-transaction? v__11516__auto__))
        (pronto.emitters/isInTransaction
          [this__11511__auto__]
          in-transaction?)
        clojure.lang.ITransientMap
        (assoc
          [this13369 k13370 v13371]
          (pronto.emitters/check-editable! editable?)
          (condp identical? k13370
            :object (.assocObject_Object this13369 pojo11480 v13371)
            :optional_relation (.assocOptionalRelation_Object
                                 this13369
                                 pojo11480
                                 v13371)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13370))))
          this13369)
        (pronto.emitters/persistent
          [this__11511__auto__]
          (set! editable? false)
          (new
            com_authzed_api_v1_Core__SubjectReferenceProtoMap
            (.build pojo11480)
            nil))
        (count [this__11511__auto__] 2)
        clojure.lang.ITransientAssociative2
        (pronto.emitters/containsKey
          [this__11511__auto__ k__11513__auto__]
          (pronto.emitters/check-editable! editable?)
          (boolean
            (get #{:optional_relation :object} k__11513__auto__)))
        (pronto.emitters/entryAt
          [this__11511__auto__ k__11513__auto__]
          (clojure.lang.MapEntry/create
            k__11513__auto__
            (.valAt this__11511__auto__ k__11513__auto__)))
        clojure.lang.ITransientCollection
        (conj
          [this__11511__auto__ val__11517__auto__]
          (pronto.emitters/check-editable! editable?)
          (pronto.TransientMapHelpers/conj
            this__11511__auto__
            val__11517__auto__)))
      (def __EMPTY_com_authzed_api_v1_Core__SubjectReference
       (new
         com_authzed_api_v1_Core__SubjectReferenceProtoMap
         (.build (com.authzed.api.v1.Core$SubjectReference/newBuilder))
         nil))
      (extend-type
        com.authzed.api.v1.Core$SubjectReference
        pronto.emitters/ProtoMapBuilder
        (pronto.emitters/proto->proto-map
          [this__11523__auto__ mapper]
          (. mapper
           fromProto_com_authzed_api_v1_Core__SubjectReference
           this__11523__auto__))))
    (do
      (pronto.utils/with-ns
        "pronto.protos"
        (do
          (definterface
            IResource_java_lang_Object
            (assocResource_Object [builder val])
            (valAtResource_Object [])
            (emptyResource [])
            (clearResource [builder]))
          (definterface
            IRelation_java_lang_Object
            (assocRelation_Object [builder val])
            (valAtRelation_Object [])
            (emptyRelation [])
            (clearRelation [builder]))
          (definterface
            ISubject_java_lang_Object
            (assocSubject_Object [builder val])
            (valAtSubject_Object [])
            (emptySubject [])
            (clearSubject [builder]))))
      (pronto.utils/with-ns
        "pronto.protos"
        (do
          (definterface
            Builder_com_authzed_api_v1_Core__Relationship
            (getProto_com_authzed_api_v1_Core__Relationship [])
            (fromProto_com_authzed_api_v1_Core__Relationship
              [proto-obj])
            (getTransient_com_authzed_api_v1_Core__Relationship [])
            (fromBytes_com_authzed_api_v1_Core__Relationship
              [bytea]))))
      (deftype
        com_authzed_api_v1_Core__RelationshipProtoMap
        [pojo11480 md13377]
        clojure.lang.IPersistentMap
        (pronto.emitters/without
          [this__11484__auto__ k__11485__auto__]
          (throw
            (java.lang.UnsupportedOperationException.
              "cannot dissoc from a proto map")))
        clojure.lang.Associative
        (assoc
          [this13383 k13384 v13385]
          (let [builder13379 (.pmap_getBuilder this13383)]
            (condp identical? k13384
              :resource (.assocResource_Object
                          this13383
                          builder13379
                          v13385)
              :relation (.assocRelation_Object
                          this13383
                          builder13379
                          v13385)
              :subject (.assocSubject_Object
                         this13383
                         builder13379
                         v13385)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13384))))
            (.copy this13383 builder13379)))
        pronto.ProtoMap
        (pronto.emitters/isMutable [this__11484__auto__] false)
        (pronto.emitters/pmap_getBuilder
          [this__11484__auto__]
          (.toBuilder pojo11480))
        (pronto.emitters/copy
          [this__11484__auto__ builder__11486__auto__]
          (new
            com_authzed_api_v1_Core__RelationshipProtoMap
            (.build builder__11486__auto__)
            md13377))
        (pronto.emitters/remap
          [this__11484__auto__ mapper13378]
          (. mapper13378
           fromProto_com_authzed_api_v1_Core__Relationship
           pojo11480))
        (pronto.emitters/pmap_getProto [this__11484__auto__] pojo11480)
        (pronto.emitters/clearField
          [this__11481__auto__ k13386]
          (let [builder13379 (.pmap_getBuilder this__11481__auto__)]
            (condp identical? k13386
              :resource (.clearResource builder13379)
              :relation (.clearRelation builder13379)
              :subject (.clearSubject builder13379)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13386))))
            (.copy this__11481__auto__ builder13379)))
        (pronto.emitters/pmap_hasField
          [this__11482__auto__ k13387]
          (condp identical? k13387
            :resource (.hasResource pojo11480)
            :relation (throw
                        (java.lang.IllegalArgumentException.
                          (str
                            "field "
                            k13387
                            " cannot be checked for field existence")))
            :subject (.hasSubject pojo11480)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13387)))))
        (pronto.emitters/whichOneOf
          [this__11483__auto__ k13388]
          (throw
            (java.lang.IllegalArgumentException.
              (str "Cannot check which one-of for " k13388))))
        (pronto.emitters/containsKey
          [this__11484__auto__ k__11485__auto__]
          (boolean
            (get #{:resource :relation :subject} k__11485__auto__)))
        (pronto.emitters/entryAt
          [this__11484__auto__ k__11485__auto__]
          (clojure.lang.MapEntry/create
            k__11485__auto__
            (.valAt this__11484__auto__ k__11485__auto__)))
        clojure.lang.MapEquivalence
        clojure.lang.ILookup
        (pronto.emitters/valAt
          [this13390 k13389]
          (condp identical? k13389
            :resource (.valAtResource_Object this13390)
            :relation (.valAtRelation_Object this13390)
            :subject (.valAtSubject_Object this13390)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13389)))))
        (pronto.emitters/valAt
          [this__11484__auto__
           k__11485__auto__
           not-found__11487__auto__]
          (.valAt this__11484__auto__ k__11485__auto__))
        pronto.DefaultingFn
        (pronto.emitters/invoke
          [this__11484__auto__ arg1__11488__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11484__auto__
            arg1__11488__auto__))
        (pronto.emitters/invoke
          [this__11484__auto__
           arg1__11488__auto__
           not-found__11487__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11484__auto__
            arg1__11488__auto__
            not-found__11487__auto__))
        com.authzed.api.v1.Core$RelationshipOrBuilder
        (hasSubject [this__11414__auto__] (. pojo11480 hasSubject))
        (getSubject [this__11414__auto__] (. pojo11480 getSubject))
        (hasResource [this__11414__auto__] (. pojo11480 hasResource))
        (getResourceOrBuilder
          [this__11414__auto__]
          (. pojo11480 getResourceOrBuilder))
        (getRelation [this__11414__auto__] (. pojo11480 getRelation))
        (getRelationBytes
          [this__11414__auto__]
          (. pojo11480 getRelationBytes))
        (getSubjectOrBuilder
          [this__11414__auto__]
          (. pojo11480 getSubjectOrBuilder))
        (getResource [this__11414__auto__] (. pojo11480 getResource))
        pronto.protos.IResource_java_lang_Object
        (assocResource_Object
          [this13382 builder13380 val13381]
          (try
            (if (nil? val13381)
              (.clearResource builder13380)
              (let [res13393 (cond
                               (identical?
                                 (class val13381)
                                 com_authzed_api_v1_Core__ObjectReferenceProtoMap) (let 
                                                                                     [u13394
                                                                                      val13381]
                                                                                     (pronto.RT/getProto
                                                                                       u13394))
                               (identical?
                                 (class val13381)
                                 com.authzed.api.v1.Core$ObjectReference) val13381
                               (instance? pronto.ProtoMap val13381) (let 
                                                                      [u13395
                                                                       val13381]
                                                                      (pronto.RT/getProto
                                                                        u13395))
                               (map? val13381) (let 
                                                 [u13396
                                                  (pronto.transformations/map->proto-map
                                                    (new
                                                      transient_com_authzed_api_v1_Core__ObjectReference
                                                      (com.authzed.api.v1.Core$ObjectReference/newBuilder)
                                                      true
                                                      false)
                                                    val13381)]
                                                 (pronto.RT/getProto
                                                   u13396))
                               :else (throw
                                       (ex-info
                                         "Invalid type"
                                         {:class
                                          com.authzed.api.v1.Core$Relationship,
                                          :field "resource",
                                          :expected-type
                                          com.authzed.api.v1.Core$ObjectReference,
                                          :value val13381}
                                         nil)))]
                (.setResource builder13380 res13393)))
            (catch
              java.lang.ClassCastException
              ex13391
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field :resource,
                   :expected-type
                   com.authzed.api.v1.Core$ObjectReference,
                   :value val13381}
                  ex13391)))))
        (valAtResource_Object
          [this13382]
          (when (.hasResource this13382)
            (let [v13397 (.getResource this13382)]
              (new
                com_authzed_api_v1_Core__ObjectReferenceProtoMap
                v13397
                (meta v13397)))))
        (emptyResource
          [this13382]
          __EMPTY_com_authzed_api_v1_Core__ObjectReference)
        (clearResource
          [this13382 builder13380]
          (.clearResource builder13380))
        pronto.protos.IRelation_java_lang_Object
        (assocRelation_Object
          [this13382 builder13380 val13381]
          (try
            (if (nil? val13381)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field "relation",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13400 val13381]
                (.setRelation builder13380 res13400)))
            (catch
              java.lang.ClassCastException
              ex13398
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field :relation,
                   :expected-type java.lang.String,
                   :value val13381}
                  ex13398)))))
        (valAtRelation_Object
          [this13382]
          (let [v13401 (.getRelation this13382)] v13401))
        (emptyRelation
          [this13382]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearRelation
          [this13382 builder13380]
          (.clearRelation builder13380))
        pronto.protos.ISubject_java_lang_Object
        (assocSubject_Object
          [this13382 builder13380 val13381]
          (try
            (if (nil? val13381)
              (.clearSubject builder13380)
              (let [res13404 (cond
                               (identical?
                                 (class val13381)
                                 com_authzed_api_v1_Core__SubjectReferenceProtoMap) (let 
                                                                                      [u13405
                                                                                       val13381]
                                                                                      (pronto.RT/getProto
                                                                                        u13405))
                               (identical?
                                 (class val13381)
                                 com.authzed.api.v1.Core$SubjectReference) val13381
                               (instance? pronto.ProtoMap val13381) (let 
                                                                      [u13406
                                                                       val13381]
                                                                      (pronto.RT/getProto
                                                                        u13406))
                               (map? val13381) (let 
                                                 [u13407
                                                  (pronto.transformations/map->proto-map
                                                    (new
                                                      transient_com_authzed_api_v1_Core__SubjectReference
                                                      (com.authzed.api.v1.Core$SubjectReference/newBuilder)
                                                      true
                                                      false)
                                                    val13381)]
                                                 (pronto.RT/getProto
                                                   u13407))
                               :else (throw
                                       (ex-info
                                         "Invalid type"
                                         {:class
                                          com.authzed.api.v1.Core$Relationship,
                                          :field "subject",
                                          :expected-type
                                          com.authzed.api.v1.Core$SubjectReference,
                                          :value val13381}
                                         nil)))]
                (.setSubject builder13380 res13404)))
            (catch
              java.lang.ClassCastException
              ex13402
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field :subject,
                   :expected-type
                   com.authzed.api.v1.Core$SubjectReference,
                   :value val13381}
                  ex13402)))))
        (valAtSubject_Object
          [this13382]
          (when (.hasSubject this13382)
            (let [v13408 (.getSubject this13382)]
              (new
                com_authzed_api_v1_Core__SubjectReferenceProtoMap
                v13408
                (meta v13408)))))
        (emptySubject
          [this13382]
          __EMPTY_com_authzed_api_v1_Core__SubjectReference)
        (clearSubject
          [this13382 builder13380]
          (.clearSubject builder13380))
        java.io.Serializable
        clojure.lang.IObj
        (pronto.emitters/withMeta
          [this__11484__auto__ meta-map__11489__auto__]
          (if (nil? meta-map__11489__auto__)
            this__11484__auto__
            (new
              com_authzed_api_v1_Core__RelationshipProtoMap
              pojo11480
              meta-map__11489__auto__)))
        (meta [this__11484__auto__] md13377)
        clojure.lang.IPersistentCollection
        (cons
          [this__11484__auto__ o__11490__auto__]
          (pronto.PersistentMapHelpers/cons
            this__11484__auto__
            o__11490__auto__))
        (empty
          [this__11484__auto__]
          __EMPTY_com_authzed_api_v1_Core__Relationship)
        (count [this__11484__auto__] 3)
        (pronto.emitters/equiv
          [this__11484__auto__ other__11491__auto__]
          (pronto.PersistentMapHelpers/equiv
            this__11484__auto__
            (if (instance?
                  com.authzed.api.v1.Core$Relationship
                  other__11491__auto__)
              (new
                com_authzed_api_v1_Core__RelationshipProtoMap
                other__11491__auto__
                nil)
              other__11491__auto__)))
        clojure.lang.Seqable
        (seq
          [this13409]
          (clojure.lang.RT/seq
            [(clojure.lang.MapEntry/create
               :resource
               (.valAtResource_Object this13409))
             (clojure.lang.MapEntry/create
               :relation
               (.valAtRelation_Object this13409))
             (clojure.lang.MapEntry/create
               :subject
               (.valAtSubject_Object this13409))]))
        clojure.lang.IEditableCollection
        (pronto.emitters/asTransient
          [this__11484__auto__]
          (new
            transient_com_authzed_api_v1_Core__Relationship
            (.toBuilder pojo11480)
            true
            false))
        java.lang.Iterable
        (pronto.emitters/iterator
          [this13410]
          (clojure.lang.RT/iter
            [(clojure.lang.MapEntry/create
               :resource
               (.valAtResource_Object this13410))
             (clojure.lang.MapEntry/create
               :relation
               (.valAtRelation_Object this13410))
             (clojure.lang.MapEntry/create
               :subject
               (.valAtSubject_Object this13410))]))
        java.util.Map
        (pronto.emitters/clear
          [this__11484__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/containsValue
          [this__11484__auto__ value__11492__auto__]
          (pronto.PersistentMapHelpers/containsValue
            this__11484__auto__
            value__11492__auto__))
        (pronto.emitters/entrySet
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/entrySet this__11484__auto__))
        (pronto.emitters/keySet
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/keySet this__11484__auto__))
        (pronto.emitters/values
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/values this__11484__auto__))
        (get
          [this__11484__auto__ key__11493__auto__]
          (pronto.PersistentMapHelpers/get
            this__11484__auto__
            key__11493__auto__))
        (pronto.emitters/isEmpty
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/isEmpty this__11484__auto__))
        (pronto.emitters/put
          [this__11484__auto__ k__11485__auto__ v__11494__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/putAll
          [this__11484__auto__ m__11495__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (remove
          [this__11484__auto__ k__11485__auto__]
          (throw (java.lang.UnsupportedOperationException.)))
        (pronto.emitters/size
          [this__11484__auto__]
          (.count this__11484__auto__))
        java.lang.Object
        (pronto.emitters/toString
          [this__11484__auto__]
          (pronto.PersistentMapHelpers/toString this__11484__auto__))
        (pronto.emitters/equals
          [this__11484__auto__ obj__11496__auto__]
          (pronto.PersistentMapHelpers/equals
            this__11484__auto__
            obj__11496__auto__))
        (pronto.emitters/hashCode
          [this__11484__auto__]
          (.hashCode pojo11480)))
      (deftype
        transient_com_authzed_api_v1_Core__Relationship
        [pojo11480 editable? in-transaction?]
        pronto.ProtoMap
        (pronto.emitters/isMutable [this__11511__auto__] true)
        (pronto.emitters/pmap_getBuilder
          [this__11511__auto__]
          pojo11480)
        (pronto.emitters/copy
          [this__11511__auto__ builder__11512__auto__]
          (set! pojo11480 builder__11512__auto__)
          this__11511__auto__)
        (pronto.emitters/pmap_getProto [this__11511__auto__] pojo11480)
        (pronto.emitters/clearField
          [this__11507__auto__ k13415]
          (let [builder13411 (.pmap_getBuilder this__11507__auto__)]
            (condp identical? k13415
              :resource (.clearResource builder13411)
              :relation (.clearRelation builder13411)
              :subject (.clearSubject builder13411)
              (throw
                (java.lang.IllegalArgumentException.
                  (str "No such field " k13415))))
            (.copy this__11507__auto__ builder13411)))
        (pronto.emitters/pmap_hasField
          [this__11508__auto__ k13416]
          (condp identical? k13416
            :resource (.hasResource pojo11480)
            :relation (throw
                        (java.lang.IllegalArgumentException.
                          (str
                            "field "
                            k13416
                            " cannot be checked for field existence")))
            :subject (.hasSubject pojo11480)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13416)))))
        (pronto.emitters/whichOneOf
          [this__11509__auto__ k13417]
          (throw
            (java.lang.IllegalArgumentException.
              (str "Cannot check which one-of for " k13417))))
        (empty
          [this__11510__auto__ k13418]
          (condp identical? k13418
            :resource __EMPTY_com_authzed_api_v1_Core__ObjectReference
            :relation nil
            :subject __EMPTY_com_authzed_api_v1_Core__SubjectReference
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13418)))))
        clojure.lang.MapEquivalence
        clojure.lang.ILookup
        (pronto.emitters/valAt
          [this13420 k13419]
          (condp identical? k13419
            :resource (.valAtResource_Object this13420)
            :relation (.valAtRelation_Object this13420)
            :subject (.valAtSubject_Object this13420)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13419)))))
        (pronto.emitters/valAt
          [this__11511__auto__
           k__11513__auto__
           not-found__11514__auto__]
          (.valAt this__11511__auto__ k__11513__auto__))
        pronto.DefaultingFn
        (pronto.emitters/invoke
          [this__11511__auto__ arg1__11515__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11511__auto__
            arg1__11515__auto__))
        (pronto.emitters/invoke
          [this__11511__auto__
           arg1__11515__auto__
           not-found__11514__auto__]
          (pronto.PersistentMapHelpers/invoke
            this__11511__auto__
            arg1__11515__auto__
            not-found__11514__auto__))
        com.authzed.api.v1.Core$RelationshipOrBuilder
        (hasSubject [this__11414__auto__] (. pojo11480 hasSubject))
        (getSubject [this__11414__auto__] (. pojo11480 getSubject))
        (hasResource [this__11414__auto__] (. pojo11480 hasResource))
        (getResourceOrBuilder
          [this__11414__auto__]
          (. pojo11480 getResourceOrBuilder))
        (getRelation [this__11414__auto__] (. pojo11480 getRelation))
        (getRelationBytes
          [this__11414__auto__]
          (. pojo11480 getRelationBytes))
        (getSubjectOrBuilder
          [this__11414__auto__]
          (. pojo11480 getSubjectOrBuilder))
        (getResource [this__11414__auto__] (. pojo11480 getResource))
        pronto.protos.IResource_java_lang_Object
        (assocResource_Object
          [this13414 builder13412 val13413]
          (try
            (if (nil? val13413)
              (.clearResource builder13412)
              (let [res13423 (cond
                               (identical?
                                 (class val13413)
                                 com_authzed_api_v1_Core__ObjectReferenceProtoMap) (let 
                                                                                     [u13424
                                                                                      val13413]
                                                                                     (pronto.RT/getProto
                                                                                       u13424))
                               (identical?
                                 (class val13413)
                                 com.authzed.api.v1.Core$ObjectReference) val13413
                               (instance? pronto.ProtoMap val13413) (let 
                                                                      [u13425
                                                                       val13413]
                                                                      (pronto.RT/getProto
                                                                        u13425))
                               (map? val13413) (let 
                                                 [u13426
                                                  (pronto.transformations/map->proto-map
                                                    (new
                                                      transient_com_authzed_api_v1_Core__ObjectReference
                                                      (com.authzed.api.v1.Core$ObjectReference/newBuilder)
                                                      true
                                                      false)
                                                    val13413)]
                                                 (pronto.RT/getProto
                                                   u13426))
                               :else (throw
                                       (ex-info
                                         "Invalid type"
                                         {:class
                                          com.authzed.api.v1.Core$Relationship,
                                          :field "resource",
                                          :expected-type
                                          com.authzed.api.v1.Core$ObjectReference,
                                          :value val13413}
                                         nil)))]
                (.setResource builder13412 res13423)))
            (catch
              java.lang.ClassCastException
              ex13421
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field :resource,
                   :expected-type
                   com.authzed.api.v1.Core$ObjectReference,
                   :value val13413}
                  ex13421)))))
        (valAtResource_Object
          [this13414]
          (when (.hasResource this13414)
            (let [v13427 (.getResource this13414)]
              (new
                com_authzed_api_v1_Core__ObjectReferenceProtoMap
                v13427
                (meta v13427)))))
        (emptyResource
          [this13414]
          __EMPTY_com_authzed_api_v1_Core__ObjectReference)
        (clearResource
          [this13414 builder13412]
          (.clearResource builder13412))
        pronto.protos.IRelation_java_lang_Object
        (assocRelation_Object
          [this13414 builder13412 val13413]
          (try
            (if (nil? val13413)
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field "relation",
                   :expected-type java.lang.String,
                   :value nil}
                  nil))
              (let [res13430 val13413]
                (.setRelation builder13412 res13430)))
            (catch
              java.lang.ClassCastException
              ex13428
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field :relation,
                   :expected-type java.lang.String,
                   :value val13413}
                  ex13428)))))
        (valAtRelation_Object
          [this13414]
          (let [v13431 (.getRelation this13414)] v13431))
        (emptyRelation
          [this13414]
          (throw
            (new
              java.lang.UnsupportedOperationException
              "Cannot call empty")))
        (clearRelation
          [this13414 builder13412]
          (.clearRelation builder13412))
        pronto.protos.ISubject_java_lang_Object
        (assocSubject_Object
          [this13414 builder13412 val13413]
          (try
            (if (nil? val13413)
              (.clearSubject builder13412)
              (let [res13434 (cond
                               (identical?
                                 (class val13413)
                                 com_authzed_api_v1_Core__SubjectReferenceProtoMap) (let 
                                                                                      [u13435
                                                                                       val13413]
                                                                                      (pronto.RT/getProto
                                                                                        u13435))
                               (identical?
                                 (class val13413)
                                 com.authzed.api.v1.Core$SubjectReference) val13413
                               (instance? pronto.ProtoMap val13413) (let 
                                                                      [u13436
                                                                       val13413]
                                                                      (pronto.RT/getProto
                                                                        u13436))
                               (map? val13413) (let 
                                                 [u13437
                                                  (pronto.transformations/map->proto-map
                                                    (new
                                                      transient_com_authzed_api_v1_Core__SubjectReference
                                                      (com.authzed.api.v1.Core$SubjectReference/newBuilder)
                                                      true
                                                      false)
                                                    val13413)]
                                                 (pronto.RT/getProto
                                                   u13437))
                               :else (throw
                                       (ex-info
                                         "Invalid type"
                                         {:class
                                          com.authzed.api.v1.Core$Relationship,
                                          :field "subject",
                                          :expected-type
                                          com.authzed.api.v1.Core$SubjectReference,
                                          :value val13413}
                                         nil)))]
                (.setSubject builder13412 res13434)))
            (catch
              java.lang.ClassCastException
              ex13432
              (throw
                (ex-info
                  "Invalid type"
                  {:class com.authzed.api.v1.Core$Relationship,
                   :field :subject,
                   :expected-type
                   com.authzed.api.v1.Core$SubjectReference,
                   :value val13413}
                  ex13432)))))
        (valAtSubject_Object
          [this13414]
          (when (.hasSubject this13414)
            (let [v13438 (.getSubject this13414)]
              (new
                com_authzed_api_v1_Core__SubjectReferenceProtoMap
                v13438
                (meta v13438)))))
        (emptySubject
          [this13414]
          __EMPTY_com_authzed_api_v1_Core__SubjectReference)
        (clearSubject
          [this13414 builder13412]
          (.clearSubject builder13412))
        pronto.TransientProtoMap
        (pronto.emitters/setInTransaction
          [this__11511__auto__ v__11516__auto__]
          (set! in-transaction? v__11516__auto__))
        (pronto.emitters/isInTransaction
          [this__11511__auto__]
          in-transaction?)
        clojure.lang.ITransientMap
        (assoc
          [this13439 k13440 v13441]
          (pronto.emitters/check-editable! editable?)
          (condp identical? k13440
            :resource (.assocResource_Object
                        this13439
                        pojo11480
                        v13441)
            :relation (.assocRelation_Object
                        this13439
                        pojo11480
                        v13441)
            :subject (.assocSubject_Object this13439 pojo11480 v13441)
            (throw
              (java.lang.IllegalArgumentException.
                (str "No such field " k13440))))
          this13439)
        (pronto.emitters/persistent
          [this__11511__auto__]
          (set! editable? false)
          (new
            com_authzed_api_v1_Core__RelationshipProtoMap
            (.build pojo11480)
            nil))
        (count [this__11511__auto__] 3)
        clojure.lang.ITransientAssociative2
        (pronto.emitters/containsKey
          [this__11511__auto__ k__11513__auto__]
          (pronto.emitters/check-editable! editable?)
          (boolean
            (get #{:resource :relation :subject} k__11513__auto__)))
        (pronto.emitters/entryAt
          [this__11511__auto__ k__11513__auto__]
          (clojure.lang.MapEntry/create
            k__11513__auto__
            (.valAt this__11511__auto__ k__11513__auto__)))
        clojure.lang.ITransientCollection
        (conj
          [this__11511__auto__ val__11517__auto__]
          (pronto.emitters/check-editable! editable?)
          (pronto.TransientMapHelpers/conj
            this__11511__auto__
            val__11517__auto__)))
      (def __EMPTY_com_authzed_api_v1_Core__Relationship
       (new
         com_authzed_api_v1_Core__RelationshipProtoMap
         (.build (com.authzed.api.v1.Core$Relationship/newBuilder))
         nil))
      (extend-type
        com.authzed.api.v1.Core$Relationship
        pronto.emitters/ProtoMapBuilder
        (pronto.emitters/proto->proto-map
          [this__11523__auto__ mapper]
          (. mapper
           fromProto_com_authzed_api_v1_Core__Relationship
           this__11523__auto__)))))
  (do
    (defrecord
      ProtoMapper_k16_authzed_core_mapper
      []
      pronto.ProtoMapper
      (pronto.emitters/getNamespace
        [this__11533__auto__]
        "pronto.protos.k16.authzed.core.mapper")
      (pronto.emitters/getClasses
        [this__11533__auto__]
        #{com.authzed.api.v1.Core$SubjectReference
          com.authzed.api.v1.Core$Relationship
          com.authzed.api.v1.Core$ObjectReference})
      pronto.protos.Builder_com_authzed_api_v1_Core__ObjectReference
      (getProto_com_authzed_api_v1_Core__ObjectReference
        [_]
        pronto.protos.k16.authzed.core.mapper/__EMPTY_com_authzed_api_v1_Core__ObjectReference)
      (fromProto_com_authzed_api_v1_Core__ObjectReference
        [_ pos13445]
        (new
          pronto.protos.k16.authzed.core.mapper.com_authzed_api_v1_Core__ObjectReferenceProtoMap
          pos13445
          nil))
      (getTransient_com_authzed_api_v1_Core__ObjectReference
        [_]
        (pronto.protos.k16.authzed.core.mapper/->transient_com_authzed_api_v1_Core__ObjectReference
          (com.authzed.api.v1.Core$ObjectReference/newBuilder)
          true
          false))
      (fromBytes_com_authzed_api_v1_Core__ObjectReference
        [this__11411__auto__ bytea13446]
        (. this__11411__auto__
         fromProto_com_authzed_api_v1_Core__ObjectReference
         (com.authzed.api.v1.Core$ObjectReference/parseFrom
           bytea13446)))
      pronto.protos.Builder_com_authzed_api_v1_Core__SubjectReference
      (getProto_com_authzed_api_v1_Core__SubjectReference
        [_]
        pronto.protos.k16.authzed.core.mapper/__EMPTY_com_authzed_api_v1_Core__SubjectReference)
      (fromProto_com_authzed_api_v1_Core__SubjectReference
        [_ pos13447]
        (new
          pronto.protos.k16.authzed.core.mapper.com_authzed_api_v1_Core__SubjectReferenceProtoMap
          pos13447
          nil))
      (getTransient_com_authzed_api_v1_Core__SubjectReference
        [_]
        (pronto.protos.k16.authzed.core.mapper/->transient_com_authzed_api_v1_Core__SubjectReference
          (com.authzed.api.v1.Core$SubjectReference/newBuilder)
          true
          false))
      (fromBytes_com_authzed_api_v1_Core__SubjectReference
        [this__11411__auto__ bytea13448]
        (. this__11411__auto__
         fromProto_com_authzed_api_v1_Core__SubjectReference
         (com.authzed.api.v1.Core$SubjectReference/parseFrom
           bytea13448)))
      pronto.protos.Builder_com_authzed_api_v1_Core__Relationship
      (getProto_com_authzed_api_v1_Core__Relationship
        [_]
        pronto.protos.k16.authzed.core.mapper/__EMPTY_com_authzed_api_v1_Core__Relationship)
      (fromProto_com_authzed_api_v1_Core__Relationship
        [_ pos13449]
        (new
          pronto.protos.k16.authzed.core.mapper.com_authzed_api_v1_Core__RelationshipProtoMap
          pos13449
          nil))
      (getTransient_com_authzed_api_v1_Core__Relationship
        [_]
        (pronto.protos.k16.authzed.core.mapper/->transient_com_authzed_api_v1_Core__Relationship
          (com.authzed.api.v1.Core$Relationship/newBuilder)
          true
          false))
      (fromBytes_com_authzed_api_v1_Core__Relationship
        [this__11411__auto__ bytea13450]
        (. this__11411__auto__
         fromProto_com_authzed_api_v1_Core__Relationship
         (com.authzed.api.v1.Core$Relationship/parseFrom bytea13450)))
      (fromBytes
        [this13443 clazz13442 bytea13444]
        (condp identical? clazz13442
          com.authzed.api.v1.Core$ObjectReference (.
                                                   this13443
                                                   fromBytes_com_authzed_api_v1_Core__ObjectReference
                                                   bytea13444)
          com.authzed.api.v1.Core$SubjectReference (.
                                                    this13443
                                                    fromBytes_com_authzed_api_v1_Core__SubjectReference
                                                    bytea13444)
          com.authzed.api.v1.Core$Relationship (.
                                                this13443
                                                fromBytes_com_authzed_api_v1_Core__Relationship
                                                bytea13444)
          (throw
            (new
              java.lang.IllegalArgumentException
              (str "unknown " clazz13442)))))
      (getTransient
        [this13443 clazz13442]
        (condp identical? clazz13442
          com.authzed.api.v1.Core$ObjectReference (.
                                                   this13443
                                                   getTransient_com_authzed_api_v1_Core__ObjectReference)
          com.authzed.api.v1.Core$SubjectReference (.
                                                    this13443
                                                    getTransient_com_authzed_api_v1_Core__SubjectReference)
          com.authzed.api.v1.Core$Relationship (.
                                                this13443
                                                getTransient_com_authzed_api_v1_Core__Relationship)
          (throw
            (new
              java.lang.IllegalArgumentException
              (str "unknown " clazz13442)))))
      (getProto
        [this13443 clazz13442]
        (condp identical? clazz13442
          com.authzed.api.v1.Core$ObjectReference (.
                                                   this13443
                                                   getProto_com_authzed_api_v1_Core__ObjectReference)
          com.authzed.api.v1.Core$SubjectReference (.
                                                    this13443
                                                    getProto_com_authzed_api_v1_Core__SubjectReference)
          com.authzed.api.v1.Core$Relationship (.
                                                this13443
                                                getProto_com_authzed_api_v1_Core__Relationship)
          (throw
            (new
              java.lang.IllegalArgumentException
              (str "unknown " clazz13442))))))
    (def mapper (new ProtoMapper_k16_authzed_core_mapper))))
nenorbot commented 2 years ago

Hi @alexisvincent,

Thank you for the detailed report, and apologies for the long delay.

Unfortunately your example works locally and I'm unable to reproduce it, so I'm still trying to understand the issue and have a few more questions :)

When is the ClassNotFoundException thrown? When loading the code at the REPL or while trying to AOT compile the project? Both?

Also, are you able to define a mapper for other classes in your schema, for example: (pronto/defmapper m2 [com.authzed.api.v1.Core$SubjectReference])?