All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ironcorelabs.sdk.DeviceAddResult Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
// Automatically generated by rust_swig
package com.ironcorelabs.sdk;

/**
 * Result from adding a new device
 */
public final class DeviceAddResult {

    private DeviceAddResult() {}
    /**
     * The user's given id, which uniquely identifies them inside the segment.
     */
    public final UserId getAccountId() {
        long ret = do_getAccountId(mNativeObj);
        UserId convRet = new UserId(InternalPointerMarker.RAW_PTR, ret);

        return convRet;
    }
    private static native long do_getAccountId(long self);
    /**
     * The user's segment id
     */
    public final long getSegmentId() {
        long ret = do_getSegmentId(mNativeObj);

        return ret;
    }
    private static native long do_getSegmentId(long self);
    /**
     * The private key which was generated for a particular device for the user. Not the user's master private key.
     */
    public final PrivateKey getDevicePrivateKey() {
        long ret = do_getDevicePrivateKey(mNativeObj);
        PrivateKey convRet = new PrivateKey(InternalPointerMarker.RAW_PTR, ret);

        return convRet;
    }
    private static native long do_getDevicePrivateKey(long self);
    /**
     * The signing key which was generated for the device
     */
    public final DeviceSigningKeyPair getSigningPrivateKey() {
        long ret = do_getSigningPrivateKey(mNativeObj);
        DeviceSigningKeyPair convRet = new DeviceSigningKeyPair(InternalPointerMarker.RAW_PTR, ret);

        return convRet;
    }
    private static native long do_getSigningPrivateKey(long self);
    /**
     * The id of the device that was added
     */
    public final DeviceId getDeviceId() {
        long ret = do_getDeviceId(mNativeObj);
        DeviceId convRet = new DeviceId(InternalPointerMarker.RAW_PTR, ret);

        return convRet;
    }
    private static native long do_getDeviceId(long self);
    /**
     * The name of the device that was added
     */
    public final java.util.Optional getName() {
        long ret = do_getName(mNativeObj);
        java.util.Optional convRet;
        if (ret != 0) {
            convRet = java.util.Optional.of(new DeviceName(InternalPointerMarker.RAW_PTR, ret));
        } else {
            convRet = java.util.Optional.empty();
        }

        return convRet;
    }
    private static native long do_getName(long self);
    /**
     * The date and time that the device was created
     */
    public final java.util.Date getCreated() {
        long ret = do_getCreated(mNativeObj);
        java.util.Date convRet = new java.util.Date(ret);

        return convRet;
    }
    private static native long do_getCreated(long self);
    /**
     * The date and time that the device was last updated
     */
    public final java.util.Date getLastUpdated() {
        long ret = do_getLastUpdated(mNativeObj);
        java.util.Date convRet = new java.util.Date(ret);

        return convRet;
    }
    private static native long do_getLastUpdated(long self);

    public synchronized void delete() {
        if (mNativeObj != 0) {
            do_delete(mNativeObj);
            mNativeObj = 0;
       }
    }
    @Override
    protected void finalize() throws Throwable {
        try {
            delete();
        }
        finally {
             super.finalize();
        }
    }
    private static native void do_delete(long me);
    /*package*/ DeviceAddResult(InternalPointerMarker marker, long ptr) {
        assert marker == InternalPointerMarker.RAW_PTR;
        this.mNativeObj = ptr;
    }
    /*package*/ long mNativeObj;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy