get method

Future<SmartphoneDeployment> get()

Get the deployment for this DeploymentReference for the specified studyDeploymentId.

Implementation

Future<SmartphoneDeployment> get() async {
  if (status == null) await getStatus();

  // downloading a PrimaryDeviceDeployment
  var downloaded = PrimaryDeviceDeployment.fromJson(
    await _rpc(GetDeviceDeploymentFor(studyDeploymentId, deviceRoleName))
        as Map<String, dynamic>,
  );

  // converting it to a SmartphoneDeployment and saving it
  return _deployment = SmartphoneDeployment.fromPrimaryDeviceDeployment(
    studyDeploymentId: studyDeploymentId,
    deployment: downloaded,
  );
}