1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
use crate::Client;
use crate::ClientResult;
pub struct Customer {
pub client: Client,
}
impl Customer {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
Customer { client }
}
/**
* This function performs a `GET` to the `/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}` endpoint.
*
* Gets command data a specific command issued to the device.
*
* **Parameters:**
*
* * `customer_id: &str` -- Immutable. Immutable ID of the Google Workspace account.
* * `device_id: &str` -- Immutable. Immutable ID of Chrome OS Device.
* * `command_id: &str` -- Immutable. Immutable ID of Chrome OS Device Command.
*/
pub async fn admin_devices_chromeos_commands_get(
&self,
customer_id: &str,
device_id: &str,
command_id: &str,
) -> ClientResult<crate::Response<crate::types::DirectoryChromeosdevicesCommand>> {
let url = self.client.url(
&format!(
"/admin/directory/v1/customer/{}/devices/chromeos/{}/commands/{}",
crate::progenitor_support::encode_path(customer_id),
crate::progenitor_support::encode_path(device_id),
crate::progenitor_support::encode_path(command_id),
),
None,
);
self.client
.get(
&url,
crate::Message {
body: None,
content_type: None,
},
)
.await
}
/**
* This function performs a `POST` to the `/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand` endpoint.
*
* Issues a command for the device to execute.
*
* **Parameters:**
*
* * `customer_id: &str` -- Immutable. Immutable ID of the Google Workspace account.
* * `device_id: &str` -- Immutable. Immutable ID of Chrome OS Device.
*/
pub async fn admin_devices_chromeos_issue_command(
&self,
customer_id: &str,
device_id: &str,
body: &crate::types::DirectoryChromeosdevicesIssueCommandRequest,
) -> ClientResult<crate::Response<crate::types::DirectoryChromeosdevicesIssueCommandResponse>>
{
let url = self.client.url(
&format!(
"/admin/directory/v1/customer/{}/devices/chromeos/{}:issueCommand",
crate::progenitor_support::encode_path(customer_id),
crate::progenitor_support::encode_path(device_id),
),
None,
);
self.client
.post(
&url,
crate::Message {
body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
content_type: Some("application/json".to_string()),
},
)
.await
}
}