google_cloud_bigquery/http/table/
test_iam_permissions.rs

1use reqwest_middleware::{ClientWithMiddleware as Client, RequestBuilder};
2
3#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Default, Debug)]
4#[serde(rename_all = "camelCase")]
5pub struct TestIamPermissionsRequest {
6    /// The set of permissions to check for the resource.
7    /// Permissions with wildcards (such as * or storage.*) are not allowed.
8    /// For more information see IAM Overview.
9    pub permissions: Vec<String>,
10}
11
12#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Default, Debug)]
13#[serde(rename_all = "camelCase")]
14pub struct TestIamPermissionsResponse {
15    /// A subset of TestPermissionsRequest.permissions that the caller is allowed.
16    pub permissions: Vec<String>,
17}
18
19pub(crate) fn build(
20    base_url: &str,
21    client: &Client,
22    project_id: &str,
23    dataset_id: &str,
24    table_id: &str,
25    req: &TestIamPermissionsRequest,
26) -> RequestBuilder {
27    let url = format!(
28        "{}/projects/{}/datasets/{}/tables/{}:testIamPermissions",
29        base_url, project_id, dataset_id, table_id
30    );
31    client.post(url).json(&req)
32}