Property Management

Complete guide to working with property data in the Zync SDK.

Table of contents

  1. Getting Property Details

The Zync SDK provides comprehensive property management through the ZyncPropertyManager. Properties represent service locations and follow the offline-first approach where local data is returned immediately and background sync operations keep the data updated.

Getting Property Details

The primary method for accessing detailed property information is getPropertyDetail(), which returns complete property data including related entities:

val result = zync.properties.getPropertyDetail("property_uid_123")

when (result) {
    is GetPropertyResult.Success -> {
        val propertyDetail = result.data
        println("Property Name: ${propertyDetail.propertyName}")
        println("UID: ${propertyDetail.propertyUid}")
    }
    is GetPropertyResult.Failure -> {
        println("Error: ${result.error.message}")
        when (result.error) {
            is ZyncError.Network -> {
                println("Check your internet connection")
            }
            is ZyncError.Error -> {
                result.error.code?.let { code ->
                    println("Error code: $code")
                }
            }
        }
    }
}
let result = try await zync.properties.getPropertyDetail(propertyUid: "property_uid_123")

switch onEnum(of: result) {
case .success(let success):
    let propertyDetail = success.data
    print("Property Name: \(propertyDetail.propertyName)")
    print("UID: \(propertyDetail.propertyUid)")
case .failure(let failure):
    print("Error: \(failure.error.message)")
    switch onEnum(of: failure.error) {
    case .network:
        print("Check your internet connection")
    case .error(let error):
        print("Error: \(error.message)")
        if let code = error.code {
            print("Error code: \(code)")
        }
    }
}

Copyright © 2025 Zuper Inc. All rights reserved. This software is proprietary and confidential.