#![cfg(feature = "cloudflare_email")]
#![allow(clippy::too_many_arguments, clippy::type_complexity)]
#![allow(clippy::missing_errors_doc, clippy::doc_markdown, clippy::useless_format)]
#![allow(unused_imports)]
use foundation_netio::{DynNetClient, PreparedRequestBuilder};
use foundation_netio::shared::client::http_client::HttpClient;
use serde::{Deserialize, Serialize};
use foundation_macros::JsonHash;
use super::shared::ApiResponse;
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpAddinAccountMapping {
pub addin_identifier_token: String,
pub auth_requirements: DlpAddinAuth,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpAddinAuth {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpApiResponseCommon {
pub errors: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub messages: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpApiResponseSingle {
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpCreateEmailRule {
pub action: DlpEmailRuleAction,
pub conditions: Vec<DlpEmailRuleCondition>,
pub description: Option<String>,
pub enabled: bool,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRule {
pub action: DlpEmailRuleAction,
pub conditions: Vec<DlpEmailRuleCondition>,
pub created_at: String,
pub description: Option<String>,
pub enabled: bool,
pub name: String,
pub priority: i64,
pub rule_id: String,
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRuleAction {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRuleArray {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRuleCondition {
pub operator: DlpEmailRuleOperator,
pub selector: DlpEmailRuleSelector,
pub value: DlpEmailRuleValue,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRuleOperator {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRuleSelector {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailRuleValue {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerCreateAccountMappingResponse {
pub result: Option<DlpAddinAccountMapping>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerCreateRuleResponse {
pub result: Option<DlpEmailRule>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerDeleteRuleResponse {
pub result: Option<DlpEmailRule>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerGetAccountMappingResponse {
pub result: Option<DlpAddinAccountMapping>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerGetRuleResponse {
pub result: Option<DlpEmailRule>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerListAllRulesResponse {
pub result: Option<Vec<DlpEmailRule>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerUpdateRulePrioritiesResponse {
pub result: Option<DlpEmailRule>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmailScannerUpdateRuleResponse {
pub result: Option<DlpEmailRule>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpMessages {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpUpdateAddinAccountMapping {
pub auth_requirements: DlpAddinAuth,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpUpdateEmailRulePriorities {
pub new_priorities: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailAddresses {
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailApiResponseCollection {
pub result_info: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailApiResponseCommon {
pub errors: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub messages: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailApiResponseSingle {
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailCreateDestinationAddressProperties {
pub email: EmailEmail,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailCreated {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailDestinationAddressIdentifier {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailDestinationAddressProperties {
pub created: Option<EmailCreated>,
pub email: Option<EmailEmail>,
pub id: Option<EmailDestinationAddressIdentifier>,
pub modified: Option<EmailModified>,
pub tag: Option<EmailDestinationAddressTag>,
pub verified: Option<EmailVerified>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailDestinationAddressResponseSingle {
pub result: Option<EmailAddresses>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailDestinationAddressTag {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailDestinationAddressesResponseCollection {
pub result: Option<Vec<EmailAddresses>>,
pub result_info: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailEmail {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailMessages {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailModified {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityAllowPolicy {
pub comments: Option<String>,
pub created_at: String,
pub id: EmailSecurityAllowPolicyId,
pub is_acceptable_sender: bool,
pub is_exempt_recipient: bool,
pub is_recipient: Option<bool>,
pub is_regex: bool,
pub is_sender: Option<bool>,
pub is_spoof: Option<bool>,
pub is_trusted_sender: bool,
pub last_modified: String,
pub pattern: String,
pub pattern_type: EmailSecurityPatternType,
pub verify_sender: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityAllowPolicyId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityApiResponseCommon {
pub errors: Vec<EmailSecurityMessage>,
pub messages: Vec<EmailSecurityMessage>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityAttachment {
pub content_type: Option<String>,
pub detection: Option<serde_json::Value>,
pub encrypted: Option<bool>,
pub name: Option<String>,
pub size: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBatchAllowPoliciesRequest {
pub deletes: Vec<EmailSecurityBatchAllowPoliciesRequestDeletesItem>,
pub patches: Vec<serde_json::Value>,
pub posts: Vec<EmailSecurityCreateAllowPolicy>,
pub puts: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBatchAllowPoliciesRequestDeletesItem {
pub id: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBatchAllowPoliciesResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBatchBlockedSendersRequest {
pub deletes: Vec<EmailSecurityBatchBlockedSendersRequestDeletesItem>,
pub patches: Vec<serde_json::Value>,
pub posts: Vec<EmailSecurityCreateBlockedSender>,
pub puts: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBatchBlockedSendersRequestDeletesItem {
pub id: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBatchBlockedSendersResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBlockedSender {
pub comments: Option<String>,
pub created_at: String,
pub id: EmailSecurityBlockedSenderId,
pub is_regex: bool,
pub last_modified: String,
pub pattern: String,
pub pattern_type: EmailSecurityPatternType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityBlockedSenderId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCreateAllowPolicy {
pub comments: Option<String>,
pub is_acceptable_sender: bool,
pub is_exempt_recipient: bool,
pub is_recipient: Option<bool>,
pub is_regex: bool,
pub is_sender: Option<bool>,
pub is_spoof: Option<bool>,
pub is_trusted_sender: bool,
pub pattern: String,
pub pattern_type: EmailSecurityPatternType,
pub verify_sender: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCreateAllowPolicyResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCreateBlockedSender {
pub comments: Option<String>,
pub is_regex: bool,
pub pattern: String,
pub pattern_type: EmailSecurityPatternType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCreateBlockedSenderResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCreateDisplayName {
pub email: String,
pub is_email_regex: bool,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCreateDisplayNameResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityCursorWithLegacyResultInfo {
pub count: i64,
pub next: Option<String>,
pub page: i64,
pub per_page: i64,
pub previous: Option<String>,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityDeleteAllowPolicyResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityDeleteBlockedSenderResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityDeleteDisplayNameResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityDisplayName {
pub comments: Option<String>,
pub created_at: String,
pub directory_id: Option<serde_json::Value>,
pub directory_node_id: Option<serde_json::Value>,
pub email: String,
pub external_directory_node_id: Option<String>,
pub id: i64,
pub is_email_regex: bool,
pub last_modified: String,
pub name: String,
pub provenance: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityDispositionLabel {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetAllowPolicyResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetBlockedSenderResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetDisplayNameResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetMessageDetectionsResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetMessagePreviewResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetMessageRawResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetMessageResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetMessageTraceResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityGetPhishguardReportsResponse {
pub result: Vec<EmailSecurityPhishGuardReport>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityInvestigateMessage {
pub action_log: serde_json::Value,
pub alert_id: Option<String>,
pub client_recipients: Vec<String>,
pub delivery_mode: Option<serde_json::Value>,
pub detection_reasons: Vec<String>,
pub edf_hash: Option<String>,
pub envelope_from: Option<String>,
pub envelope_to: Option<Vec<String>>,
pub final_disposition: Option<serde_json::Value>,
pub findings: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
pub from: Option<String>,
pub from_name: Option<String>,
pub htmltext_structure_hash: Option<String>,
pub id: String,
pub is_phish_submission: bool,
pub is_quarantined: bool,
pub message_id: Option<String>,
pub post_delivery_operations: Option<Vec<String>>,
pub postfix_id: EmailSecurityPostfixId,
pub postfix_id_outbound: Option<String>,
pub properties: std::collections::HashMap<String, serde_json::Value>,
pub replyto: Option<String>,
pub scanned_at: Option<String>,
pub sent_at: Option<String>,
pub sent_date: Option<String>,
pub subject: Option<String>,
pub threat_categories: Option<Vec<String>>,
pub to: Option<Vec<String>>,
pub to_name: Option<Vec<String>>,
pub ts: String,
pub validation: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityInvestigateResponse {
pub result: Vec<EmailSecurityInvestigateMessage>,
pub result_info: EmailSecurityCursorWithLegacyResultInfo,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityLink {
pub href: String,
pub text: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityListAllowPoliciesResponse {
pub result: Vec<EmailSecurityAllowPolicy>,
pub result_info: EmailSecurityResultInfo,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityListBlockedSendersResponse {
pub result: Vec<EmailSecurityBlockedSender>,
pub result_info: EmailSecurityResultInfo,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityListDisplayNamesResponse {
pub result: Vec<EmailSecurityDisplayName>,
pub result_info: EmailSecurityResultInfo,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityMessage {
pub code: i64,
pub message: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityMessageHeader {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityMoveResponseItem {
pub completed_at: Option<String>,
pub completed_timestamp: String,
pub destination: Option<String>,
pub item_count: i64,
pub message_id: Option<String>,
pub operation: Option<String>,
pub recipient: Option<String>,
pub status: Option<String>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPatternType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPhishGuardReport {
pub content: String,
pub created_at: String,
pub disposition: EmailSecurityDispositionLabel,
pub fields: std::collections::HashMap<String, serde_json::Value>,
pub id: i64,
pub priority: String,
pub tags: Option<Vec<EmailSecurityPhishGuardReportTag>>,
pub title: String,
pub ts: String,
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPhishGuardReportTag {
pub category: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostBulkMessageMoveRequest {
pub destination: String,
pub ids: Option<Vec<String>>,
pub postfix_ids: Option<Vec<EmailSecurityPostfixId>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostBulkMessageMoveResponse {
pub result: Vec<EmailSecurityMoveResponseItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostMessageMoveRequest {
pub destination: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostMessageMoveResponse {
pub result: Vec<EmailSecurityMoveResponseItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostPreviewRequest {
pub postfix_id: EmailSecurityPostfixId,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostPreviewResponse {
pub result: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostReclassifyRequest {
pub eml_content: Option<String>,
pub escalated_submission_id: Option<String>,
pub expected_disposition: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostReclassifyResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostReleaseResponse {
pub result: Vec<EmailSecurityReleaseResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityPostfixId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityReleaseResponse {
pub delivered: Option<Vec<String>>,
pub failed: Option<Vec<String>>,
pub id: String,
pub postfix_id: EmailSecurityPostfixId,
pub undelivered: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityResultInfo {
pub count: i64,
pub page: i64,
pub per_page: i64,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecuritySubmission {
pub customer_status: Option<serde_json::Value>,
pub escalated_as: Option<serde_json::Value>,
pub escalated_at: Option<String>,
pub escalated_by: Option<String>,
pub escalated_submission_id: Option<String>,
pub original_disposition: Option<serde_json::Value>,
pub original_edf_hash: Option<String>,
pub original_postfix_id: Option<String>,
pub outcome: Option<String>,
pub outcome_disposition: Option<serde_json::Value>,
pub requested_at: Option<String>,
pub requested_by: Option<String>,
pub requested_disposition: Option<serde_json::Value>,
pub requested_ts: String,
pub status: Option<String>,
pub subject: Option<String>,
pub submission_id: String,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecuritySubmissionsResponse {
pub result: Vec<EmailSecuritySubmission>,
pub result_info: EmailSecurityResultInfo,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityThreatCategory {
pub description: Option<String>,
pub id: i64,
pub name: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityTraceLine {
pub lineno: i64,
pub message: String,
pub ts: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityUpdateAllowPolicy {
pub comments: Option<String>,
pub is_acceptable_sender: Option<bool>,
pub is_exempt_recipient: Option<bool>,
pub is_regex: Option<bool>,
pub is_trusted_sender: Option<bool>,
pub pattern: Option<String>,
pub pattern_type: Option<serde_json::Value>,
pub verify_sender: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityUpdateAllowPolicyResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityUpdateBlockedSender {
pub comments: Option<String>,
pub is_regex: Option<bool>,
pub pattern: Option<String>,
pub pattern_type: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityUpdateBlockedSenderResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityUpdateDisplayNameRequest {
pub email: Option<String>,
pub is_email_regex: Option<bool>,
pub name: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSecurityUpdateDisplayNameResponse {
pub result: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendBuilderResponse {
pub errors: Vec<EmailSendingAccountSendBuilderResponseErrorsItem>,
pub messages: Vec<EmailSendingAccountSendBuilderResponseMessagesItem>,
pub result: EmailSendingEmailSendResponse,
pub result_info: Option<EmailSendingAccountSendBuilderResponseResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendBuilderResponseErrorsItem {
pub code: f64,
pub message: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendBuilderResponseMessagesItem {
pub code: f64,
pub message: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendBuilderResponseResultInfo {
pub count: f64,
pub cursor: Option<String>,
pub page: Option<f64>,
pub per_page: f64,
pub total_count: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendRawMessageResponse {
pub errors: Vec<EmailSendingAccountSendRawMessageResponseErrorsItem>,
pub messages: Vec<EmailSendingAccountSendRawMessageResponseMessagesItem>,
pub result: EmailSendingEmailSendResponse,
pub result_info: Option<EmailSendingAccountSendRawMessageResponseResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendRawMessageResponseErrorsItem {
pub code: f64,
pub message: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendRawMessageResponseMessagesItem {
pub code: f64,
pub message: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingAccountSendRawMessageResponseResultInfo {
pub count: f64,
pub cursor: Option<String>,
pub page: Option<f64>,
pub per_page: f64,
pub total_count: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingEmailAttachment {
pub content: String,
pub disposition: String,
pub filename: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingEmailBuilder {
pub attachments: Option<Vec<serde_json::Value>>,
pub bcc: Option<serde_json::Value>,
pub cc: Option<serde_json::Value>,
pub from: serde_json::Value,
pub headers: Option<serde_json::Value>,
pub html: Option<String>,
pub reply_to: Option<serde_json::Value>,
pub subject: String,
pub text: Option<String>,
pub to: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingEmailInlineAttachment {
pub content: String,
pub content_id: String,
pub disposition: String,
pub filename: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingEmailSendResponse {
pub delivered: Vec<String>,
pub permanent_bounces: Vec<String>,
pub queued: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailSendingSendRawRequest {
pub from: String,
pub mime_message: String,
pub recipients: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct EmailVerified {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponse {
pub result: RadarGetEmailRoutingSummaryResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponseResult {
pub meta: RadarGetEmailRoutingSummaryResponseResultMeta,
pub summary_0: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponseResultMeta {
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetEmailRoutingSummaryResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetEmailRoutingSummaryResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetEmailRoutingSummaryResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetEmailRoutingSummaryResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponse {
pub result: RadarGetEmailRoutingTimeseriesGroupResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResult {
pub meta: RadarGetEmailRoutingTimeseriesGroupResponseResultMeta,
pub serie_0: RadarGetEmailRoutingTimeseriesGroupResponseResultSerie0,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResultMeta {
#[serde(rename = "aggInterval")]
pub agg_interval: String,
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetEmailRoutingTimeseriesGroupResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetEmailRoutingTimeseriesGroupResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetEmailRoutingTimeseriesGroupResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetEmailRoutingTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupResponseResultSerie0 {
pub timestamps: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponse {
pub result: RadarGetEmailSecuritySummaryResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponseResult {
pub meta: RadarGetEmailSecuritySummaryResponseResultMeta,
pub summary_0: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponseResultMeta {
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetEmailSecuritySummaryResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetEmailSecuritySummaryResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetEmailSecuritySummaryResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetEmailSecuritySummaryResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponse {
pub result: RadarGetEmailSecurityTimeseriesGroupResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResult {
pub meta: RadarGetEmailSecurityTimeseriesGroupResponseResultMeta,
pub serie_0: RadarGetEmailSecurityTimeseriesGroupResponseResultSerie0,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResultMeta {
#[serde(rename = "aggInterval")]
pub agg_interval: String,
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetEmailSecurityTimeseriesGroupResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetEmailSecurityTimeseriesGroupResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetEmailSecurityTimeseriesGroupResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetEmailSecurityTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupResponseResultSerie0 {
pub timestamps: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerGetAccountMappingArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerCreateAccountMappingArgs {
pub account_id: String,
pub body: DlpUpdateAddinAccountMapping,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerListAllRulesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerCreateRuleArgs {
pub account_id: String,
pub body: DlpCreateEmailRule,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerUpdateRulePrioritiesArgs {
pub account_id: String,
pub body: DlpUpdateEmailRulePriorities,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerGetRuleArgs {
pub account_id: String,
pub rule_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerUpdateRuleArgs {
pub account_id: String,
pub rule_id: String,
pub body: DlpCreateEmailRule,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpEmailScannerDeleteRuleArgs {
pub account_id: String,
pub rule_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityInvestigateArgs {
pub account_id: String,
pub start: Option<String>,
pub end: Option<String>,
pub query: Option<String>,
pub detections_only: Option<String>,
pub action_log: Option<String>,
pub final_disposition: Option<String>,
pub metric: Option<String>,
pub message_action: Option<String>,
pub recipient: Option<String>,
pub sender: Option<String>,
pub alert_id: Option<String>,
pub domain: Option<String>,
pub message_id: Option<String>,
pub subject: Option<String>,
pub exact_subject: Option<String>,
pub submissions: Option<String>,
pub cursor: Option<String>,
pub per_page: Option<String>,
pub page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityPostBulkMessageMoveArgs {
pub account_id: String,
pub body: EmailSecurityPostBulkMessageMoveRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityPostPreviewArgs {
pub account_id: String,
pub body: EmailSecurityPostPreviewRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityPostReleaseArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetMessageArgs {
pub account_id: String,
pub postfix_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetMessageDetectionsArgs {
pub account_id: String,
pub postfix_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityPostMessageMoveArgs {
pub account_id: String,
pub postfix_id: String,
pub body: EmailSecurityPostMessageMoveRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetMessagePreviewArgs {
pub account_id: String,
pub postfix_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetMessageRawArgs {
pub account_id: String,
pub postfix_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityPostReclassifyArgs {
pub account_id: String,
pub postfix_id: String,
pub body: EmailSecurityPostReclassifyRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetMessageTraceArgs {
pub account_id: String,
pub postfix_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetPhishguardReportsArgs {
pub account_id: String,
pub from_date: Option<String>,
pub to_date: Option<String>,
pub start: Option<String>,
pub end: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityListAllowPoliciesArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub order: Option<String>,
pub direction: Option<String>,
pub search: Option<String>,
pub is_sender: Option<String>,
pub is_trusted_sender: Option<String>,
pub is_recipient: Option<String>,
pub is_exempt_recipient: Option<String>,
pub is_spoof: Option<String>,
pub is_acceptable_sender: Option<String>,
pub verify_sender: Option<String>,
pub pattern_type: Option<String>,
pub pattern: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityCreateAllowPolicyArgs {
pub account_id: String,
pub body: EmailSecurityCreateAllowPolicy,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityBatchAllowPoliciesArgs {
pub account_id: String,
pub body: EmailSecurityBatchAllowPoliciesRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetAllowPolicyArgs {
pub account_id: String,
pub policy_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityUpdateAllowPolicyArgs {
pub account_id: String,
pub policy_id: String,
pub body: EmailSecurityUpdateAllowPolicy,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityDeleteAllowPolicyArgs {
pub account_id: String,
pub policy_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityListBlockedSendersArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub order: Option<String>,
pub direction: Option<String>,
pub search: Option<String>,
pub pattern_type: Option<String>,
pub pattern: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityCreateBlockedSenderArgs {
pub account_id: String,
pub body: EmailSecurityCreateBlockedSender,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityBatchBlockedSendersArgs {
pub account_id: String,
pub body: EmailSecurityBatchBlockedSendersRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetBlockedSenderArgs {
pub account_id: String,
pub pattern_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityUpdateBlockedSenderArgs {
pub account_id: String,
pub pattern_id: String,
pub body: EmailSecurityUpdateBlockedSender,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityDeleteBlockedSenderArgs {
pub account_id: String,
pub pattern_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityListDisplayNamesArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub order: Option<String>,
pub direction: Option<String>,
pub search: Option<String>,
pub provenance: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityCreateDisplayNameArgs {
pub account_id: String,
pub body: EmailSecurityCreateDisplayName,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityGetDisplayNameArgs {
pub account_id: String,
pub display_name_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityUpdateDisplayNameArgs {
pub account_id: String,
pub display_name_id: String,
pub body: EmailSecurityUpdateDisplayNameRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecurityDeleteDisplayNameArgs {
pub account_id: String,
pub display_name_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSecuritySubmissionsArgs {
pub account_id: String,
pub start: Option<String>,
pub end: Option<String>,
pub r#type: Option<String>,
pub submission_id: Option<String>,
pub original_disposition: Option<String>,
pub requested_disposition: Option<String>,
pub outcome_disposition: Option<String>,
pub status: Option<String>,
pub query: Option<String>,
pub customer_status: Option<String>,
pub page: Option<String>,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailRoutingDestinationAddressesListDestinationAddressesArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub direction: Option<String>,
pub verified: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailRoutingDestinationAddressesCreateADestinationAddressArgs {
pub account_id: String,
pub body: EmailCreateDestinationAddressProperties,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailRoutingDestinationAddressesGetADestinationAddressArgs {
pub destination_address_identifier: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailRoutingDestinationAddressesDeleteDestinationAddressArgs {
pub destination_address_identifier: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSendingAccountSendBuilderArgs {
pub account_id: String,
pub body: EmailSendingEmailBuilder,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct EmailSendingAccountSendRawMessageArgs {
pub account_id: String,
pub body: EmailSendingSendRawRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetEmailRoutingSummaryArgs {
pub dimension: String,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub arc: Option<String>,
pub dkim: Option<String>,
pub dmarc: Option<String>,
pub spf: Option<String>,
pub ip_version: Option<String>,
pub encrypted: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetEmailRoutingTimeseriesGroupArgs {
pub dimension: String,
pub agg_interval: Option<String>,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub arc: Option<String>,
pub dkim: Option<String>,
pub dmarc: Option<String>,
pub spf: Option<String>,
pub ip_version: Option<String>,
pub encrypted: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetEmailSecuritySummaryArgs {
pub dimension: String,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub arc: Option<String>,
pub dkim: Option<String>,
pub dmarc: Option<String>,
pub spf: Option<String>,
pub tls_version: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetEmailSecurityTimeseriesGroupArgs {
pub dimension: String,
pub agg_interval: Option<String>,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub arc: Option<String>,
pub dkim: Option<String>,
pub dmarc: Option<String>,
pub spf: Option<String>,
pub tls_version: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
pub async fn dlp_email_scanner_get_account_mapping_request<F>(
client: DynNetClient,
args: &DlpEmailScannerGetAccountMappingArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerGetAccountMappingResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/account_mapping",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerGetAccountMappingResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_create_account_mapping_request<F>(
client: DynNetClient,
args: &DlpEmailScannerCreateAccountMappingArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerCreateAccountMappingResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/account_mapping",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerCreateAccountMappingResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_list_all_rules_request<F>(
client: DynNetClient,
args: &DlpEmailScannerListAllRulesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerListAllRulesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/rules",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerListAllRulesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_create_rule_request<F>(
client: DynNetClient,
args: &DlpEmailScannerCreateRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerCreateRuleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/rules",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerCreateRuleResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_update_rule_priorities_request<F>(
client: DynNetClient,
args: &DlpEmailScannerUpdateRulePrioritiesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerUpdateRulePrioritiesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/rules",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerUpdateRulePrioritiesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_get_rule_request<F>(
client: DynNetClient,
args: &DlpEmailScannerGetRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerGetRuleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/rules/{}",
args.account_id,
args.rule_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerGetRuleResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_update_rule_request<F>(
client: DynNetClient,
args: &DlpEmailScannerUpdateRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerUpdateRuleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/rules/{}",
args.account_id,
args.rule_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::put(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerUpdateRuleResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn dlp_email_scanner_delete_rule_request<F>(
client: DynNetClient,
args: &DlpEmailScannerDeleteRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpEmailScannerDeleteRuleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/dlp/email/rules/{}",
args.account_id,
args.rule_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: DlpEmailScannerDeleteRuleResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_investigate_request<F>(
client: DynNetClient,
args: &EmailSecurityInvestigateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityInvestigateResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("start", args.start.as_deref());
builder = builder.query("end", args.end.as_deref());
builder = builder.query("query", args.query.as_deref());
builder = builder.query("detections_only", args.detections_only.as_deref());
builder = builder.query("action_log", args.action_log.as_deref());
builder = builder.query("final_disposition", args.final_disposition.as_deref());
builder = builder.query("metric", args.metric.as_deref());
builder = builder.query("message_action", args.message_action.as_deref());
builder = builder.query("recipient", args.recipient.as_deref());
builder = builder.query("sender", args.sender.as_deref());
builder = builder.query("alert_id", args.alert_id.as_deref());
builder = builder.query("domain", args.domain.as_deref());
builder = builder.query("message_id", args.message_id.as_deref());
builder = builder.query("subject", args.subject.as_deref());
builder = builder.query("exact_subject", args.exact_subject.as_deref());
builder = builder.query("submissions", args.submissions.as_deref());
builder = builder.query("cursor", args.cursor.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("page", args.page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityInvestigateResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_post_bulk_message_move_request<F>(
client: DynNetClient,
args: &EmailSecurityPostBulkMessageMoveArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityPostBulkMessageMoveResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/move",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityPostBulkMessageMoveResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_post_preview_request<F>(
client: DynNetClient,
args: &EmailSecurityPostPreviewArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityPostPreviewResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/preview",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityPostPreviewResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_post_release_request<F>(
client: DynNetClient,
args: &EmailSecurityPostReleaseArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityPostReleaseResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/release",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityPostReleaseResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_message_request<F>(
client: DynNetClient,
args: &EmailSecurityGetMessageArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetMessageResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetMessageResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_message_detections_request<F>(
client: DynNetClient,
args: &EmailSecurityGetMessageDetectionsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetMessageDetectionsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}/detections",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetMessageDetectionsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_post_message_move_request<F>(
client: DynNetClient,
args: &EmailSecurityPostMessageMoveArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityPostMessageMoveResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}/move",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityPostMessageMoveResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_message_preview_request<F>(
client: DynNetClient,
args: &EmailSecurityGetMessagePreviewArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetMessagePreviewResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}/preview",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetMessagePreviewResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_message_raw_request<F>(
client: DynNetClient,
args: &EmailSecurityGetMessageRawArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetMessageRawResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}/raw",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetMessageRawResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_post_reclassify_request<F>(
client: DynNetClient,
args: &EmailSecurityPostReclassifyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityPostReclassifyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}/reclassify",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityPostReclassifyResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_message_trace_request<F>(
client: DynNetClient,
args: &EmailSecurityGetMessageTraceArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetMessageTraceResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/investigate/{}/trace",
args.account_id,
args.postfix_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetMessageTraceResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_phishguard_reports_request<F>(
client: DynNetClient,
args: &EmailSecurityGetPhishguardReportsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetPhishguardReportsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/phishguard/reports",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("from_date", args.from_date.as_deref());
builder = builder.query("to_date", args.to_date.as_deref());
builder = builder.query("start", args.start.as_deref());
builder = builder.query("end", args.end.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetPhishguardReportsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_list_allow_policies_request<F>(
client: DynNetClient,
args: &EmailSecurityListAllowPoliciesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityListAllowPoliciesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/allow_policies",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("order", args.order.as_deref());
builder = builder.query("direction", args.direction.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("is_sender", args.is_sender.as_deref());
builder = builder.query("is_trusted_sender", args.is_trusted_sender.as_deref());
builder = builder.query("is_recipient", args.is_recipient.as_deref());
builder = builder.query("is_exempt_recipient", args.is_exempt_recipient.as_deref());
builder = builder.query("is_spoof", args.is_spoof.as_deref());
builder = builder.query("is_acceptable_sender", args.is_acceptable_sender.as_deref());
builder = builder.query("verify_sender", args.verify_sender.as_deref());
builder = builder.query("pattern_type", args.pattern_type.as_deref());
builder = builder.query("pattern", args.pattern.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityListAllowPoliciesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_create_allow_policy_request<F>(
client: DynNetClient,
args: &EmailSecurityCreateAllowPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityCreateAllowPolicyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/allow_policies",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityCreateAllowPolicyResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_batch_allow_policies_request<F>(
client: DynNetClient,
args: &EmailSecurityBatchAllowPoliciesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityBatchAllowPoliciesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/allow_policies/batch",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityBatchAllowPoliciesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_allow_policy_request<F>(
client: DynNetClient,
args: &EmailSecurityGetAllowPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetAllowPolicyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/allow_policies/{}",
args.account_id,
args.policy_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetAllowPolicyResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_update_allow_policy_request<F>(
client: DynNetClient,
args: &EmailSecurityUpdateAllowPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityUpdateAllowPolicyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/allow_policies/{}",
args.account_id,
args.policy_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityUpdateAllowPolicyResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_delete_allow_policy_request<F>(
client: DynNetClient,
args: &EmailSecurityDeleteAllowPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityDeleteAllowPolicyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/allow_policies/{}",
args.account_id,
args.policy_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityDeleteAllowPolicyResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_list_blocked_senders_request<F>(
client: DynNetClient,
args: &EmailSecurityListBlockedSendersArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityListBlockedSendersResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/block_senders",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("order", args.order.as_deref());
builder = builder.query("direction", args.direction.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("pattern_type", args.pattern_type.as_deref());
builder = builder.query("pattern", args.pattern.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityListBlockedSendersResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_create_blocked_sender_request<F>(
client: DynNetClient,
args: &EmailSecurityCreateBlockedSenderArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityCreateBlockedSenderResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/block_senders",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityCreateBlockedSenderResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_batch_blocked_senders_request<F>(
client: DynNetClient,
args: &EmailSecurityBatchBlockedSendersArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityBatchBlockedSendersResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/block_senders/batch",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityBatchBlockedSendersResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_blocked_sender_request<F>(
client: DynNetClient,
args: &EmailSecurityGetBlockedSenderArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetBlockedSenderResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/block_senders/{}",
args.account_id,
args.pattern_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetBlockedSenderResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_update_blocked_sender_request<F>(
client: DynNetClient,
args: &EmailSecurityUpdateBlockedSenderArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityUpdateBlockedSenderResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/block_senders/{}",
args.account_id,
args.pattern_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityUpdateBlockedSenderResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_delete_blocked_sender_request<F>(
client: DynNetClient,
args: &EmailSecurityDeleteBlockedSenderArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityDeleteBlockedSenderResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/block_senders/{}",
args.account_id,
args.pattern_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityDeleteBlockedSenderResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_list_display_names_request<F>(
client: DynNetClient,
args: &EmailSecurityListDisplayNamesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityListDisplayNamesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/impersonation_registry",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("order", args.order.as_deref());
builder = builder.query("direction", args.direction.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("provenance", args.provenance.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityListDisplayNamesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_create_display_name_request<F>(
client: DynNetClient,
args: &EmailSecurityCreateDisplayNameArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityCreateDisplayNameResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/impersonation_registry",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityCreateDisplayNameResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_get_display_name_request<F>(
client: DynNetClient,
args: &EmailSecurityGetDisplayNameArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityGetDisplayNameResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/impersonation_registry/{}",
args.account_id,
args.display_name_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityGetDisplayNameResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_update_display_name_request<F>(
client: DynNetClient,
args: &EmailSecurityUpdateDisplayNameArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityUpdateDisplayNameResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/impersonation_registry/{}",
args.account_id,
args.display_name_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityUpdateDisplayNameResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_delete_display_name_request<F>(
client: DynNetClient,
args: &EmailSecurityDeleteDisplayNameArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecurityDeleteDisplayNameResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/settings/impersonation_registry/{}",
args.account_id,
args.display_name_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecurityDeleteDisplayNameResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_security_submissions_request<F>(
client: DynNetClient,
args: &EmailSecuritySubmissionsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSecuritySubmissionsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email-security/submissions",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("start", args.start.as_deref());
builder = builder.query("end", args.end.as_deref());
builder = builder.query("type", args.r#type.as_deref());
builder = builder.query("submission_id", args.submission_id.as_deref());
builder = builder.query("original_disposition", args.original_disposition.as_deref());
builder = builder.query("requested_disposition", args.requested_disposition.as_deref());
builder = builder.query("outcome_disposition", args.outcome_disposition.as_deref());
builder = builder.query("status", args.status.as_deref());
builder = builder.query("query", args.query.as_deref());
builder = builder.query("customer_status", args.customer_status.as_deref());
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSecuritySubmissionsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_routing_destination_addresses_list_destination_addresses_request<F>(
client: DynNetClient,
args: &EmailRoutingDestinationAddressesListDestinationAddressesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailDestinationAddressesResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email/routing/addresses",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("direction", args.direction.as_deref());
builder = builder.query("verified", args.verified.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailDestinationAddressesResponseCollection = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_routing_destination_addresses_create_a_destination_address_request<F>(
client: DynNetClient,
args: &EmailRoutingDestinationAddressesCreateADestinationAddressArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailDestinationAddressResponseSingle>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email/routing/addresses",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailDestinationAddressResponseSingle = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_routing_destination_addresses_get_a_destination_address_request<F>(
client: DynNetClient,
args: &EmailRoutingDestinationAddressesGetADestinationAddressArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailDestinationAddressResponseSingle>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email/routing/addresses/{}",
args.account_id,
args.destination_address_identifier,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailDestinationAddressResponseSingle = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_routing_destination_addresses_delete_destination_address_request<F>(
client: DynNetClient,
args: &EmailRoutingDestinationAddressesDeleteDestinationAddressArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailDestinationAddressResponseSingle>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email/routing/addresses/{}",
args.account_id,
args.destination_address_identifier,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailDestinationAddressResponseSingle = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_sending_account_send_builder_request<F>(
client: DynNetClient,
args: &EmailSendingAccountSendBuilderArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSendingAccountSendBuilderResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email/sending/send",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSendingAccountSendBuilderResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn email_sending_account_send_raw_message_request<F>(
client: DynNetClient,
args: &EmailSendingAccountSendRawMessageArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<EmailSendingAccountSendRawMessageResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/email/sending/send_raw",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: EmailSendingAccountSendRawMessageResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_email_routing_summary_request<F>(
client: DynNetClient,
args: &RadarGetEmailRoutingSummaryArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetEmailRoutingSummaryResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/email/routing/summary/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("arc", args.arc.as_deref());
builder = builder.query("dkim", args.dkim.as_deref());
builder = builder.query("dmarc", args.dmarc.as_deref());
builder = builder.query("spf", args.spf.as_deref());
builder = builder.query("ipVersion", args.ip_version.as_deref());
builder = builder.query("encrypted", args.encrypted.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetEmailRoutingSummaryResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_email_routing_timeseries_group_request<F>(
client: DynNetClient,
args: &RadarGetEmailRoutingTimeseriesGroupArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetEmailRoutingTimeseriesGroupResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/email/routing/timeseries_groups/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("aggInterval", args.agg_interval.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("arc", args.arc.as_deref());
builder = builder.query("dkim", args.dkim.as_deref());
builder = builder.query("dmarc", args.dmarc.as_deref());
builder = builder.query("spf", args.spf.as_deref());
builder = builder.query("ipVersion", args.ip_version.as_deref());
builder = builder.query("encrypted", args.encrypted.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetEmailRoutingTimeseriesGroupResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_email_security_summary_request<F>(
client: DynNetClient,
args: &RadarGetEmailSecuritySummaryArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetEmailSecuritySummaryResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/email/security/summary/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("arc", args.arc.as_deref());
builder = builder.query("dkim", args.dkim.as_deref());
builder = builder.query("dmarc", args.dmarc.as_deref());
builder = builder.query("spf", args.spf.as_deref());
builder = builder.query("tlsVersion", args.tls_version.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetEmailSecuritySummaryResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_email_security_timeseries_group_request<F>(
client: DynNetClient,
args: &RadarGetEmailSecurityTimeseriesGroupArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetEmailSecurityTimeseriesGroupResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/email/security/timeseries_groups/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("aggInterval", args.agg_interval.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("arc", args.arc.as_deref());
builder = builder.query("dkim", args.dkim.as_deref());
builder = builder.query("dmarc", args.dmarc.as_deref());
builder = builder.query("spf", args.spf.as_deref());
builder = builder.query("tlsVersion", args.tls_version.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetEmailSecurityTimeseriesGroupResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}