internal static CustomMetadata FromSWIG(SWIG.UplinkObject obj) { CustomMetadata ret = new CustomMetadata(); ret.Entries = new List <CustomMetadataEntry>(); if (mut.WaitOne(1000)) { try { SWIG.storj_uplink.prepare_get_custommetadata(obj); for (int i = 0; i < obj.custom.count; i++) { using (var entry = SWIG.storj_uplink.get_next_custommetadata()) { ret.Entries.Add(new CustomMetadataEntry { Key = entry.key, Value = entry.value }); } } } finally { mut.ReleaseMutex(); } } return(ret); }
internal static Object FromSWIG(SWIG.UplinkObject original, bool disposeObjectInfo = true) { Object ret = new Object(); ret.Key = original.key; ret.IsPrefix = original.is_prefix; ret.SystemMetadata = SystemMetadata.FromSWIG(original.system); ret.CustomMetadata = CustomMetadata.FromSWIG(original); if (disposeObjectInfo) { original.Dispose(); } return(ret); }