Security Profile Management
Pre-requisite
- The user has to be signed in to perform the following operations.
- The user should have an active pro-monitoring plan activated on the space.
Create Security Profile
To create a new security profile, The following method can be used:
spaceId(required): The space id of the User.request(required): The request object containing the users profile details.
val address = SecurityAddress(
lineOne = "123 Main St", // The street address
city = "San Francisco", // The city
state = "CA", // The state
zipCpde = "94105", // The postal code
country = "US" // The country
)
val request = SecurityProfileRequest(
address = address,
timezone = "TimeZone"
)
InstaVision.securityServices.createProfile(
spaceId = "spaceId",
request = request,
onSuccess = {
// Security Profile created successfully
},
onError = { error ->
// The error object contains the error code and message
}
)
Get Security Profile
To get a users security profile, The following method can be used:
spaceId(required): The space id of the User.
InstaVision.securityServices.getProfile(
spaceId = "spaceId",
onSuccess = { profile ->
// Returns the user profile object that contains the details of the Security profile
},
onError = { error ->
// The error object contains the error code and message
}
)
Update Security Profile
To update a security profile, The following method can be used:
spaceId(required): The space id of the User.request(required): The request object containing the updated profile details.
val address = SecurityAddress(
lineOne = "123 Main St", // The street address
city = "San Francisco", // The city
state = "CA", // The state
zipCpde = "94105", // The postal code
country = "US" // The country
)
val request = SecurityProfileRequest(
address = address,
timezone = "TimeZone"
)
InstaVision.securityServices.updateProfile(
spaceId = "spaceId",
request = request,
onSuccess = { profile ->
// Returns the updated security profie object
},
onError = { error ->
// The error object contains the error code and message
}
)
Update Security Settings
To update a security settings, The following method can be used:
spaceId(required): The space id of the User.request(required): The request object containing the updating settings.
val address = SecurityAddress(
lineOne = "123 Main St", // The street address
city = "San Francisco", // The city
state = "CA", // The state
zipCpde = "94105", // The postal code
country = "US" // The country
)
val request = SecurityProfileRequest(
address = address,
timezone = "TimeZone"
)
InstaVision.securityServices.updateSettings(
spaceId = "spaceId",
request = request,
onSuccess = { profile ->
// Returns the updated security profie object
},
onError = { error ->
// The error object contains the error code and message
}
)
Update Security Devices
To update the devices to the security profile, The following method can be used:
spaceId(required): The space id of the User.request(required): The request object containing the list of devices.
val request = SecurityDeviceRequest(
deviceIds = listOf("deviceId1", "deviceId2")
)
InstaVision.securityServices.updateSettings(
spaceId = "spaceId",
request = request,
onSuccess = { devices ->
// Returns the list of security enabled devices
},
onError = { error ->
// The error object contains the error code and message
}
)