slack_web_api/api/
admin_audit.rs1#![allow(unused_imports)]
4
5use crate::objects::*;
6use crate::{
7 CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
8};
9use serde::{Deserialize, Serialize};
10
11#[doc(alias = "admin.audit.anomaly.allow.getItem")]
15#[derive(Debug, Clone, PartialEq, Serialize, Default)]
16#[non_exhaustive]
17pub struct AdminAuditAnomalyAllowGetItemRequest {}
18
19impl AdminAuditAnomalyAllowGetItemRequest {
20 pub fn new() -> Self {
21 Self {}
22 }
23}
24
25impl SlackApiMethod for AdminAuditAnomalyAllowGetItemRequest {
26 const METHOD: &'static str = "admin.audit.anomaly.allow.getItem";
27 type Response = AdminAuditAnomalyAllowGetItemResponse;
28}
29
30#[doc(alias = "admin.audit.anomaly.allow.getItem")]
32#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
33pub struct AdminAuditAnomalyAllowGetItemResponse {
34 #[serde(flatten)]
36 pub extra: serde_json::Map<String, serde_json::Value>,
37 #[serde(
38 default,
39 deserialize_with = "crate::de::opt_object",
40 skip_serializing_if = "Option::is_none"
41 )]
42 pub response_metadata: Option<ResponseMetadata>,
43 #[serde(
44 default,
45 deserialize_with = "crate::de::opt_string",
46 skip_serializing_if = "Option::is_none"
47 )]
48 pub warning: Option<String>,
49}
50
51#[doc(alias = "admin.audit.anomaly.allow.updateItem")]
55#[derive(Debug, Clone, PartialEq, Serialize, Default)]
56#[non_exhaustive]
57pub struct AdminAuditAnomalyAllowUpdateItemRequest {
58 #[serde(
60 skip_serializing_if = "Option::is_none",
61 serialize_with = "crate::form::as_json"
62 )]
63 pub trusted_cidr: Option<Vec<serde_json::Value>>,
64 #[serde(
66 skip_serializing_if = "Option::is_none",
67 serialize_with = "crate::form::as_json"
68 )]
69 pub trusted_asns: Option<Vec<serde_json::Value>>,
70}
71
72impl AdminAuditAnomalyAllowUpdateItemRequest {
73 pub fn new() -> Self {
74 Self {
75 trusted_cidr: None,
76 trusted_asns: None,
77 }
78 }
79
80 pub fn trusted_cidr(mut self, trusted_cidr: Vec<serde_json::Value>) -> Self {
81 self.trusted_cidr = Some(trusted_cidr);
82 self
83 }
84
85 pub fn trusted_asns(mut self, trusted_asns: Vec<serde_json::Value>) -> Self {
86 self.trusted_asns = Some(trusted_asns);
87 self
88 }
89}
90
91impl SlackApiMethod for AdminAuditAnomalyAllowUpdateItemRequest {
92 const METHOD: &'static str = "admin.audit.anomaly.allow.updateItem";
93 type Response = AdminAuditAnomalyAllowUpdateItemResponse;
94}
95
96#[doc(alias = "admin.audit.anomaly.allow.updateItem")]
98#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
99pub struct AdminAuditAnomalyAllowUpdateItemResponse {
100 #[serde(flatten)]
102 pub extra: serde_json::Map<String, serde_json::Value>,
103 #[serde(
104 default,
105 deserialize_with = "crate::de::opt_object",
106 skip_serializing_if = "Option::is_none"
107 )]
108 pub response_metadata: Option<ResponseMetadata>,
109 #[serde(
110 default,
111 deserialize_with = "crate::de::opt_string",
112 skip_serializing_if = "Option::is_none"
113 )]
114 pub warning: Option<String>,
115}
116
117impl SlackClient {
118 #[doc(alias = "admin.audit.anomaly.allow.getItem")]
130 pub async fn admin_audit_anomaly_allow_get_item(
131 &self,
132 request: &AdminAuditAnomalyAllowGetItemRequest,
133 ) -> Result<AdminAuditAnomalyAllowGetItemResponse, SlackError> {
134 self.call(request).await
135 }
136
137 #[doc(alias = "admin.audit.anomaly.allow.updateItem")]
149 pub async fn admin_audit_anomaly_allow_update_item(
150 &self,
151 request: &AdminAuditAnomalyAllowUpdateItemRequest,
152 ) -> Result<AdminAuditAnomalyAllowUpdateItemResponse, SlackError> {
153 self.call(request).await
154 }
155}