sendLockUnlockAction static method

Future<void> sendLockUnlockAction(
  1. Request request,
  2. String id,
  3. bool lockUnlock
)

Implementation

static Future<void> sendLockUnlockAction(
    Request request, String id, bool lockUnlock) async {
  Link client = GraphLinkCreator.create(request);
  final req = GmakeLockUnlockActionRequest((b) {
    b..vars.deviceId = id;
    b..vars.lock = lockUnlock;
  });
  final res = await client
      .request(
          gql.Request(operation: req.operation, variables: req.vars.toJson()))
      .first;
  final errors = res.errors;
  if (errors != null && errors.isNotEmpty) {
    throw errors.first;
  }
}