// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni

#import "DBClientInterface+Private.h"
#import "DBClientInterface.h"
#import "DBClientReturnedRecord+Private.h"
#import "DJIMarshal+Private.h"
#import "DJIObjcWrapperCache+Private.h"

static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");

namespace djinni_generated {

class ClientInterface::ObjcProxy final
: public ::ClientInterface
, public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle
{
public:
    using Handle::Handle;
    ::ClientReturnedRecord get_record(int64_t record_id, const std::string & utf8string, const std::experimental::optional<std::string> & misc) override
    {
        @autoreleasepool {
            auto r = [(id<DBClientInterface>)Handle::get() getRecord:(::djinni::I64::fromCpp(record_id))
                                                          utf8string:(::djinni::String::fromCpp(utf8string))
                                                                misc:(::djinni::Optional<std::experimental::optional, ::djinni::String>::fromCpp(misc))];
            return ::djinni_generated::ClientReturnedRecord::toCpp(r);
        }
    }
    std::string return_str() override
    {
        @autoreleasepool {
            auto r = [(id<DBClientInterface>)Handle::get() returnStr];
            return ::djinni::String::toCpp(r);
        }
    }
};

}  // namespace djinni_generated

namespace djinni_generated {

auto ClientInterface::toCpp(ObjcType objc) -> CppType
{
    if (!objc) {
        return nullptr;
    }
    return ::djinni::DbxObjcWrapperCache<ObjcProxy>::getInstance()->get(objc);
}

auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType
{
    if (!cpp) {
        return nil;
    }
    return dynamic_cast<ObjcProxy&>(*cpp).Handle::get();
}

}  // namespace djinni_generated
