libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
device_management.h
Go to the documentation of this file.
1// THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
2
3#pragma once
4
5#include <Quotient/csapi/definitions/auth_data.h>
6#include <Quotient/csapi/definitions/client_device.h>
7
8#include <Quotient/jobs/basejob.h>
9
10namespace Quotient {
11
12//! \brief List registered devices for the current user
13//!
14//! Gets information about all devices for the current user.
16public:
17 explicit GetDevicesJob();
18
19 //! \brief Construct a URL without creating a full-fledged job object
20 //!
21 //! This function can be used when a URL for GetDevicesJob
22 //! is necessary but the job itself isn't.
24
25 // Result properties
26
27 //! A list of all registered devices for this user.
28 QVector<Device> devices() const { return loadFromJson<QVector<Device>>("devices"_L1); }
29};
30
31inline auto collectResponse(const GetDevicesJob* job) { return job->devices(); }
32
33//! \brief Get a single device
34//!
35//! Gets information on a single device, by device id.
37public:
38 //! \param deviceId
39 //! The device to retrieve.
40 explicit GetDeviceJob(const QString& deviceId);
41
42 //! \brief Construct a URL without creating a full-fledged job object
43 //!
44 //! This function can be used when a URL for GetDeviceJob
45 //! is necessary but the job itself isn't.
47
48 // Result properties
49
50 //! Device information
51 Device device() const { return fromJson<Device>(jsonData()); }
52};
53
54inline auto collectResponse(const GetDeviceJob* job) { return job->device(); }
55
56//! \brief Update a device
57//!
58//! Updates the metadata on the given device.
60public:
61 //! \param deviceId
62 //! The device to update.
63 //!
64 //! \param displayName
65 //! The new display name for this device. If not given, the
66 //! display name is unchanged.
67 explicit UpdateDeviceJob(const QString& deviceId, const QString& displayName = {});
68};
69
70//! \brief Delete a device
71//!
72//! This API endpoint uses the [User-Interactive Authentication
73//! API](/client-server-api/#user-interactive-authentication-api).
74//!
75//! Deletes the given device, and invalidates any access token associated with it.
77public:
78 //! \param deviceId
79 //! The device to delete.
80 //!
81 //! \param auth
82 //! Additional authentication information for the
83 //! user-interactive authentication API.
86};
87
88//! \brief Bulk deletion of devices
89//!
90//! This API endpoint uses the [User-Interactive Authentication
91//! API](/client-server-api/#user-interactive-authentication-api).
92//!
93//! Deletes the given devices, and invalidates any access token associated with them.
95public:
96 //! \param devices
97 //! The list of device IDs to delete.
98 //!
99 //! \param auth
100 //! Additional authentication information for the
101 //! user-interactive authentication API.
104};
105
106} // namespace Quotient
Bulk deletion of devices.
Get a single device.
List registered devices for the current user.
auto collectResponse(const GetAccountDataJob *job)
#define QUOTIENT_API