device_attributes.mojom 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module crosapi.mojom;
  5. // Returned by methods that either return a string or an error.
  6. [Stable]
  7. union DeviceAttributesStringResult {
  8. // Implies failure.
  9. string error_message;
  10. // Implies success.
  11. string contents;
  12. };
  13. // This API provides Lacros with access to device attributes. These methods will
  14. // all return an error if the user is not affiliated with the device, which is
  15. // an enterprise policy concept.
  16. [Stable, Uuid="117591ac-5d9e-481c-936f-842b64e790c0"]
  17. interface DeviceAttributes {
  18. // Fetches the value of the device identifier of the directory API that is
  19. // generated by the server and identifies the cloud record of the device for
  20. // querying in the cloud directory API. See
  21. // https://developers.google.com/admin-sdk/directory/v1/guides/manage-chrome-devices.
  22. GetDirectoryDeviceId@0() => (DeviceAttributesStringResult result);
  23. // Fetches the device's serial number.
  24. GetDeviceSerialNumber@1() => (DeviceAttributesStringResult result);
  25. // Fetches the administrator-annotated Asset Id.
  26. GetDeviceAssetId@2() => (DeviceAttributesStringResult result);
  27. // Fetches the administrator-annotated Location.
  28. GetDeviceAnnotatedLocation@3() => (DeviceAttributesStringResult result);
  29. // Fetches the device's hostname as set by DeviceHostnameTemplate policy.
  30. GetDeviceHostname@4() => (DeviceAttributesStringResult result);
  31. };