#![cfg(feature = "cloudflare_devices")]
#![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::TunnelSubnetResponseSingle;
use super::shared::TunnelApiResponseCommon;
use super::shared::TunnelCreatedAt;
use super::shared::TunnelDeletedAt;
use super::shared::TunnelSubnet;
use super::shared::TunnelSubnetComment;
use super::shared::TunnelSubnetId;
use super::shared::TunnelSubnetIpNetwork;
use super::shared::TunnelSubnetIsDefaultNetwork;
use super::shared::TunnelSubnetName;
use super::shared::TunnelSubnetType;
use super::shared::ApiResponse;
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct CreateIpProfileResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: TeamsDevicesIpProfile,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeleteDeviceResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Option<TeamsDevicesEmptyBody>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeleteIpProfileResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: DeleteIpProfileResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeleteIpProfileResponseResult {
pub id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeleteRegistrationResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Option<TeamsDevicesEmptyBody>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeleteRegistrationsResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Option<TeamsDevicesEmptyBody>,
pub result_info: Option<TeamsDevicesCursorResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeviceManagedNetworksCreateDeviceManagedNetworkRequest {
pub config: TeamsDevicesSchemasConfigRequest,
pub name: TeamsDevicesDeviceManagedNetworksComponentsSchemasName,
#[serde(rename = "type")]
pub r#type: TeamsDevicesComponentsSchemasType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DeviceManagedNetworksUpdateDeviceManagedNetworkRequest {
pub config: Option<TeamsDevicesSchemasConfigRequest>,
pub name: Option<TeamsDevicesDeviceManagedNetworksComponentsSchemasName>,
#[serde(rename = "type")]
pub r#type: Option<TeamsDevicesComponentsSchemasType>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicePostureIntegrationsCreateDevicePostureIntegrationRequest {
pub config: TeamsDevicesConfigRequest,
pub interval: TeamsDevicesInterval,
pub name: TeamsDevicesComponentsSchemasName,
#[serde(rename = "type")]
pub r#type: TeamsDevicesSchemasType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicePostureIntegrationsUpdateDevicePostureIntegrationRequest {
pub config: Option<TeamsDevicesConfigRequest>,
pub interval: Option<TeamsDevicesInterval>,
pub name: Option<TeamsDevicesComponentsSchemasName>,
#[serde(rename = "type")]
pub r#type: Option<TeamsDevicesSchemasType>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicePostureRulesCreateDevicePostureRuleRequest {
pub description: Option<TeamsDevicesDescription>,
pub expiration: Option<TeamsDevicesExpiration>,
pub input: Option<TeamsDevicesInput>,
#[serde(rename = "match")]
pub r#match: Option<Vec<TeamsDevicesMatchItem>>,
pub name: TeamsDevicesName,
pub schedule: Option<TeamsDevicesSchedule>,
#[serde(rename = "type")]
pub r#type: TeamsDevicesType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicePostureRulesUpdateDevicePostureRuleRequest {
pub description: Option<TeamsDevicesDescription>,
pub expiration: Option<TeamsDevicesExpiration>,
pub input: Option<TeamsDevicesInput>,
#[serde(rename = "match")]
pub r#match: Option<Vec<TeamsDevicesMatchItem>>,
pub name: TeamsDevicesName,
pub schedule: Option<TeamsDevicesSchedule>,
#[serde(rename = "type")]
pub r#type: TeamsDevicesType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicesCreateDeviceSettingsPolicyRequest {
pub allow_mode_switch: Option<TeamsDevicesAllowModeSwitch>,
pub allow_updates: Option<TeamsDevicesAllowUpdates>,
pub allowed_to_leave: Option<TeamsDevicesAllowedToLeave>,
pub auto_connect: Option<TeamsDevicesAutoConnect>,
pub captive_portal: Option<TeamsDevicesCaptivePortal>,
pub description: Option<serde_json::Value>,
pub disable_auto_fallback: Option<TeamsDevicesDisableAutoFallback>,
pub enabled: Option<bool>,
pub exclude: Option<Vec<TeamsDevicesSplitTunnel>>,
pub exclude_office_ips: Option<TeamsDevicesExcludeOfficeIps>,
pub include: Option<Vec<TeamsDevicesSplitTunnelInclude>>,
pub lan_allow_minutes: Option<TeamsDevicesLanAllowMinutes>,
pub lan_allow_subnet_size: Option<TeamsDevicesLanAllowSubnetSize>,
#[serde(rename = "match")]
pub r#match: TeamsDevicesSchemasMatch,
pub name: String,
pub precedence: TeamsDevicesPrecedence,
pub register_interface_ip_with_dns: Option<TeamsDevicesRegisterInterfaceIpWithDns>,
pub sccm_vpn_boundary_support: Option<TeamsDevicesSccmVpnBoundarySupport>,
pub service_mode_v2: Option<TeamsDevicesServiceModeV2>,
pub support_url: Option<TeamsDevicesSupportUrl>,
pub switch_locked: Option<TeamsDevicesSwitchLocked>,
pub tunnel_protocol: Option<TeamsDevicesTunnelProtocol>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicesUpdateDefaultDeviceSettingsPolicyRequest {
pub allow_mode_switch: Option<TeamsDevicesAllowModeSwitch>,
pub allow_updates: Option<TeamsDevicesAllowUpdates>,
pub allowed_to_leave: Option<TeamsDevicesAllowedToLeave>,
pub auto_connect: Option<TeamsDevicesAutoConnect>,
pub captive_portal: Option<TeamsDevicesCaptivePortal>,
pub disable_auto_fallback: Option<TeamsDevicesDisableAutoFallback>,
pub exclude: Option<Vec<TeamsDevicesSplitTunnel>>,
pub exclude_office_ips: Option<TeamsDevicesExcludeOfficeIps>,
pub include: Option<Vec<TeamsDevicesSplitTunnelInclude>>,
pub lan_allow_minutes: Option<TeamsDevicesLanAllowMinutes>,
pub lan_allow_subnet_size: Option<TeamsDevicesLanAllowSubnetSize>,
pub register_interface_ip_with_dns: Option<TeamsDevicesRegisterInterfaceIpWithDns>,
pub sccm_vpn_boundary_support: Option<TeamsDevicesSccmVpnBoundarySupport>,
pub service_mode_v2: Option<TeamsDevicesServiceModeV2>,
pub support_url: Option<TeamsDevicesSupportUrl>,
pub switch_locked: Option<TeamsDevicesSwitchLocked>,
pub tunnel_protocol: Option<TeamsDevicesTunnelProtocol>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DevicesUpdateDeviceSettingsPolicyRequest {
pub allow_mode_switch: Option<TeamsDevicesAllowModeSwitch>,
pub allow_updates: Option<TeamsDevicesAllowUpdates>,
pub allowed_to_leave: Option<TeamsDevicesAllowedToLeave>,
pub auto_connect: Option<TeamsDevicesAutoConnect>,
pub captive_portal: Option<TeamsDevicesCaptivePortal>,
pub description: Option<TeamsDevicesSchemasDescription>,
pub disable_auto_fallback: Option<TeamsDevicesDisableAutoFallback>,
pub enabled: Option<bool>,
pub exclude: Option<Vec<TeamsDevicesSplitTunnel>>,
pub exclude_office_ips: Option<TeamsDevicesExcludeOfficeIps>,
pub include: Option<Vec<TeamsDevicesSplitTunnelInclude>>,
pub lan_allow_minutes: Option<TeamsDevicesLanAllowMinutes>,
pub lan_allow_subnet_size: Option<TeamsDevicesLanAllowSubnetSize>,
#[serde(rename = "match")]
pub r#match: Option<TeamsDevicesSchemasMatch>,
pub name: Option<String>,
pub precedence: Option<TeamsDevicesPrecedence>,
pub register_interface_ip_with_dns: Option<TeamsDevicesRegisterInterfaceIpWithDns>,
pub sccm_vpn_boundary_support: Option<TeamsDevicesSccmVpnBoundarySupport>,
pub service_mode_v2: Option<TeamsDevicesServiceModeV2>,
pub support_url: Option<TeamsDevicesSupportUrl>,
pub switch_locked: Option<TeamsDevicesSwitchLocked>,
pub tunnel_protocol: Option<TeamsDevicesTunnelProtocol>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpApiResponseCollection {
pub result_info: Option<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 DlpBehaviors {
pub behaviors: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpCreateIntegrationBody {
pub integration_type: DlpRiskScoreIntegrationType,
pub reference_id: Option<String>,
pub tenant_url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpEmpty {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[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 DlpRiskLevel {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskScoreBehaviorsGetResponse {
pub result: Option<DlpBehaviors>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskScoreBehaviorsPutResponse {
pub result: Option<DlpUpdateBehaviors>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskScoreIntegration {
pub account_tag: String,
pub active: bool,
pub created_at: String,
pub id: String,
pub integration_type: DlpRiskScoreIntegrationType,
pub reference_id: String,
pub tenant_url: String,
pub well_known_url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskScoreIntegrationArray {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskScoreIntegrationType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskScoreSummaryGetResponse {
pub result: Option<DlpRiskSummary>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpRiskSummary {
pub users: Vec<DlpUserRiskInfo>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpUpdateBehaviors {
pub behaviors: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpUpdateIntegrationBody {
pub active: bool,
pub reference_id: Option<String>,
pub tenant_url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpUserRiskInfo {
pub email: String,
pub event_count: i64,
pub last_event: String,
pub max_risk_level: DlpRiskLevel,
pub name: String,
pub user_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationCreateResponse {
pub result: Option<DlpRiskScoreIntegration>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationDeleteResponse {
pub result: Option<DlpEmpty>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationGetByReferenceIdResponse {
pub result: Option<DlpRiskScoreIntegration>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationGetResponse {
pub result: Option<DlpRiskScoreIntegration>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationListResponse {
pub result: Option<Vec<DlpRiskScoreIntegration>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationUpdateResponse {
pub result: Option<DlpRiskScoreIntegration>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct GetDeviceResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: TeamsDevicesPhysicalDevice,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct GetIpProfileResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: TeamsDevicesIpProfile,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct GetRegistrationOverrideCodesResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: TeamsDevicesOverrideCodes,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct GetRegistrationResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: TeamsDevicesRegistration,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ListDevicesResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Vec<TeamsDevicesPhysicalDevice>,
pub result_info: Option<TeamsDevicesCursorResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ListIpProfilesResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Vec<TeamsDevicesIpProfile>,
pub result_info: Option<TeamsDevicesPaginationInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ListRegistrationsResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Vec<TeamsDevicesRegistration>,
pub result_info: Option<TeamsDevicesCursorResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RevokeDeviceResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Option<TeamsDevicesEmptyBody>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RevokeRegistrationsResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Option<TeamsDevicesEmptyBody>,
pub result_info: Option<TeamsDevicesCursorResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesAccessSerialNumberListInputRequest {
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesAllowModeSwitch {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesAllowUpdates {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesAllowedToLeave {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesAntivirusInputRequest {
pub update_window_days: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesApiResponseCollection {
pub result: Option<Vec<serde_json::Value>>,
pub result_info: Option<TeamsDevicesResultInfo>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesApiResponseCommon {
pub errors: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub messages: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub result: serde_json::Value,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesApiResponseSingle {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesApplicationInputRequest {
pub operating_system: String,
pub path: String,
pub sha256: Option<String>,
pub thumbprint: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesAutoConnect {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCaptivePortal {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCarbonblackInputRequest {
pub operating_system: String,
pub path: String,
pub sha256: Option<String>,
pub thumbprint: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCheckDisks {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesClientCertificateInputRequest {
pub certificate_id: String,
pub cn: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesClientCertificateV2InputRequest {
pub certificate_id: String,
pub check_private_key: bool,
pub cn: Option<String>,
pub extended_key_usage: Option<Vec<TeamsDevicesExtendedKeyUsageEnum>>,
pub locations: Option<std::collections::HashMap<String, serde_json::Value>>,
pub operating_system: String,
pub subject_alternative_names: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesComponentsSchemasResponseCollection {
pub result: Option<Vec<TeamsDevicesDeviceManagedNetworks>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesComponentsSchemasSingleResponse {
pub result: Option<TeamsDevicesDeviceManagedNetworks>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesComponentsSchemasType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesComponentsSchemasUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesConfigRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesConfigResponse {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCrowdstrikeConfigRequest {
pub api_url: String,
pub client_id: String,
pub client_secret: String,
pub customer_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCrowdstrikeInputRequest {
pub connection_id: String,
pub last_seen: Option<String>,
pub operator: Option<String>,
pub os: Option<String>,
pub overall: Option<String>,
pub sensor_config: Option<String>,
pub state: Option<String>,
pub version: Option<String>,
#[serde(rename = "versionOperator")]
pub version_operator: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCursorResultInfo {
pub count: i64,
pub cursor: String,
pub per_page: i64,
pub total_count: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCustomS2SConfigRequest {
pub access_client_id: String,
pub access_client_secret: String,
pub api_url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesCustomS2SInputRequest {
pub connection_id: String,
pub operator: String,
pub score: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDefault {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDefaultDeviceSettingsPolicy {
pub allow_mode_switch: Option<TeamsDevicesAllowModeSwitch>,
pub allow_updates: Option<TeamsDevicesAllowUpdates>,
pub allowed_to_leave: Option<TeamsDevicesAllowedToLeave>,
pub auto_connect: Option<TeamsDevicesAutoConnect>,
pub captive_portal: Option<TeamsDevicesCaptivePortal>,
pub default: Option<bool>,
pub disable_auto_fallback: Option<TeamsDevicesDisableAutoFallback>,
pub enabled: Option<bool>,
pub exclude: Option<Vec<TeamsDevicesSplitTunnel>>,
pub exclude_office_ips: Option<TeamsDevicesExcludeOfficeIps>,
pub fallback_domains: Option<Vec<TeamsDevicesFallbackDomain>>,
pub gateway_unique_id: Option<TeamsDevicesGatewayUniqueId>,
pub include: Option<Vec<TeamsDevicesSplitTunnelInclude>>,
pub register_interface_ip_with_dns: Option<TeamsDevicesRegisterInterfaceIpWithDns>,
pub sccm_vpn_boundary_support: Option<TeamsDevicesSccmVpnBoundarySupport>,
pub service_mode_v2: Option<TeamsDevicesServiceModeV2>,
pub support_url: Option<TeamsDevicesSupportUrl>,
pub switch_locked: Option<TeamsDevicesSwitchLocked>,
pub tunnel_protocol: Option<TeamsDevicesTunnelProtocol>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDefaultDeviceSettingsResponse {
pub result: Option<TeamsDevicesDefaultDeviceSettingsPolicy>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDeviceManagedNetworks {
pub config: Option<TeamsDevicesSchemasConfigResponse>,
pub name: Option<TeamsDevicesDeviceManagedNetworksComponentsSchemasName>,
pub network_id: Option<TeamsDevicesUuid>,
#[serde(rename = "type")]
pub r#type: Option<TeamsDevicesComponentsSchemasType>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDeviceManagedNetworksComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDevicePostureIntegrations {
pub config: Option<TeamsDevicesConfigResponse>,
pub id: Option<TeamsDevicesUuid>,
pub interval: Option<TeamsDevicesInterval>,
pub name: Option<TeamsDevicesComponentsSchemasName>,
#[serde(rename = "type")]
pub r#type: Option<TeamsDevicesSchemasType>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDevicePostureRules {
pub description: Option<TeamsDevicesDescription>,
pub expiration: Option<TeamsDevicesExpiration>,
pub id: Option<TeamsDevicesUuid>,
pub input: Option<TeamsDevicesInput>,
#[serde(rename = "match")]
pub r#match: Option<Vec<TeamsDevicesMatchItem>>,
pub name: Option<TeamsDevicesName>,
pub schedule: Option<TeamsDevicesSchedule>,
#[serde(rename = "type")]
pub r#type: Option<TeamsDevicesType>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDeviceSettingsPolicy {
pub allow_mode_switch: Option<TeamsDevicesAllowModeSwitch>,
pub allow_updates: Option<TeamsDevicesAllowUpdates>,
pub allowed_to_leave: Option<TeamsDevicesAllowedToLeave>,
pub auto_connect: Option<TeamsDevicesAutoConnect>,
pub captive_portal: Option<TeamsDevicesCaptivePortal>,
pub default: Option<TeamsDevicesDefault>,
pub description: Option<TeamsDevicesSchemasDescription>,
pub disable_auto_fallback: Option<TeamsDevicesDisableAutoFallback>,
pub enabled: Option<bool>,
pub exclude: Option<Vec<TeamsDevicesSplitTunnel>>,
pub exclude_office_ips: Option<TeamsDevicesExcludeOfficeIps>,
pub fallback_domains: Option<Vec<TeamsDevicesFallbackDomain>>,
pub gateway_unique_id: Option<TeamsDevicesGatewayUniqueId>,
pub include: Option<Vec<TeamsDevicesSplitTunnelInclude>>,
pub lan_allow_minutes: Option<TeamsDevicesLanAllowMinutes>,
pub lan_allow_subnet_size: Option<TeamsDevicesLanAllowSubnetSize>,
#[serde(rename = "match")]
pub r#match: Option<TeamsDevicesSchemasMatch>,
pub name: Option<String>,
pub policy_id: Option<TeamsDevicesSchemasUuid>,
pub precedence: Option<TeamsDevicesPrecedence>,
pub register_interface_ip_with_dns: Option<TeamsDevicesRegisterInterfaceIpWithDns>,
pub sccm_vpn_boundary_support: Option<TeamsDevicesSccmVpnBoundarySupport>,
pub service_mode_v2: Option<TeamsDevicesServiceModeV2>,
pub support_url: Option<TeamsDevicesSupportUrl>,
pub switch_locked: Option<TeamsDevicesSwitchLocked>,
pub target_tests: Option<Vec<TeamsDevicesTargetDexTest>>,
pub tunnel_protocol: Option<TeamsDevicesTunnelProtocol>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDeviceSettingsResponse {
pub result: Option<TeamsDevicesDeviceSettingsPolicy>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDeviceSettingsResponseCollection {
pub result: Option<Vec<TeamsDevicesDeviceSettingsPolicy>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDisableAutoFallback {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDiskEncryptionInputRequest {
#[serde(rename = "checkDisks")]
pub check_disks: Option<Vec<String>>,
#[serde(rename = "requireAll")]
pub require_all: Option<TeamsDevicesRequireAll>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesDomainJoinedInputRequest {
pub domain: Option<String>,
pub operating_system: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesEmail {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesEmptyBody {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExclude {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExcludeOfficeIps {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExcludeRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExcludeSplitTunnelWithAddress {
pub address: TeamsDevicesSplitTunnelAddress,
pub description: Option<TeamsDevicesSplitTunnelDescription>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExcludeSplitTunnelWithHost {
pub description: Option<TeamsDevicesSplitTunnelDescription>,
pub host: TeamsDevicesSplitTunnelHost,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExpiration {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesExtendedKeyUsageEnum {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesFallbackDomain {
pub description: Option<String>,
pub dns_server: Option<Vec<TeamsDevicesIp>>,
pub suffix: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesFallbackDomains {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesFileInputRequest {
pub exists: Option<bool>,
pub operating_system: String,
pub path: String,
pub sha256: Option<String>,
pub thumbprint: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesFirewallInputRequest {
pub enabled: bool,
pub operating_system: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesGatewayUniqueId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIdResponse {
pub result: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesInclude {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIncludeRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIncludeSplitTunnelAddress {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIncludeSplitTunnelDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIncludeSplitTunnelHost {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIncludeSplitTunnelWithAddress {
pub address: TeamsDevicesIncludeSplitTunnelAddress,
pub description: Option<TeamsDevicesIncludeSplitTunnelDescription>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIncludeSplitTunnelWithHost {
pub description: Option<TeamsDevicesIncludeSplitTunnelDescription>,
pub host: TeamsDevicesIncludeSplitTunnelHost,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesInput {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesInterval {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIntuneConfigRequest {
pub client_id: String,
pub client_secret: String,
pub customer_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIntuneInputRequest {
pub compliance_status: String,
pub connection_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIp {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfile {
pub created_at: TeamsDevicesIpProfileCreatedAt,
pub description: Option<TeamsDevicesIpProfileDescription>,
pub enabled: TeamsDevicesIpProfileEnabled,
pub id: TeamsDevicesIpProfileId,
#[serde(rename = "match")]
pub r#match: TeamsDevicesIpProfileMatch,
pub name: TeamsDevicesIpProfileName,
pub precedence: TeamsDevicesIpProfilePrecedence,
pub subnet_id: TeamsDevicesIpProfileSubnetId,
pub updated_at: TeamsDevicesIpProfileUpdatedAt,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileCreateRequest {
pub description: Option<String>,
pub enabled: Option<bool>,
#[serde(rename = "match")]
pub r#match: TeamsDevicesIpProfileMatch,
pub name: TeamsDevicesIpProfileName,
pub precedence: TeamsDevicesIpProfilePrecedence,
pub subnet_id: TeamsDevicesIpProfileSubnetId,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileCreatedAt {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileEnabled {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileMatch {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfilePrecedence {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileSubnetId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileUpdateRequest {
pub description: Option<String>,
pub enabled: Option<TeamsDevicesIpProfileEnabled>,
#[serde(rename = "match")]
pub r#match: Option<TeamsDevicesIpProfileMatch>,
pub name: Option<TeamsDevicesIpProfileName>,
pub precedence: Option<TeamsDevicesIpProfilePrecedence>,
pub subnet_id: Option<TeamsDevicesIpProfileSubnetId>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesIpProfileUpdatedAt {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesKolideConfigRequest {
pub client_id: String,
pub client_secret: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesKolideInputRequest {
pub connection_id: String,
#[serde(rename = "countOperator")]
pub count_operator: String,
pub issue_count: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesLanAllowMinutes {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesLanAllowSubnetSize {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesMatch {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesMatchItem {
pub platform: Option<TeamsDevicesPlatform>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesMessages {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesOsVersionInputRequest {
pub operating_system: String,
pub operator: String,
pub os_distro_name: Option<String>,
pub os_distro_revision: Option<String>,
pub os_version_extra: Option<String>,
pub version: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesOverrideCodes {
pub disable_for_time: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesPaginationInfo {
pub count: i64,
pub page: i64,
pub per_page: i64,
pub total_count: i64,
pub total_pages: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesPaths {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesPhysicalDevice {
pub active_registrations: i64,
pub client_version: Option<String>,
pub created_at: String,
pub deleted_at: Option<String>,
pub device_type: Option<String>,
pub hardware_id: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub last_seen_registration: Option<serde_json::Value>,
pub last_seen_user: Option<serde_json::Value>,
pub mac_address: Option<String>,
pub manufacturer: Option<String>,
pub model: Option<String>,
pub name: String,
pub os_version: Option<String>,
pub os_version_extra: Option<String>,
pub public_ip: Option<String>,
pub serial_number: Option<String>,
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesPlatform {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesPolicySummary {
pub default: bool,
pub deleted: bool,
pub id: String,
pub name: String,
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesPrecedence {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesRegisterInterfaceIpWithDns {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesRegistration {
pub created_at: String,
pub deleted_at: Option<String>,
pub device: TeamsDevicesRegistrationDeviceDetails,
pub id: String,
pub key: String,
pub key_type: Option<String>,
pub last_seen_at: String,
pub policy: Option<TeamsDevicesPolicySummary>,
pub revoked_at: Option<String>,
pub tunnel_type: Option<String>,
pub updated_at: String,
pub user: Option<TeamsDevicesUser>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesRegistrationDetails {
pub policy: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesRegistrationDeviceDetails {
pub client_version: Option<String>,
pub id: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesRequireAll {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesResponseCollection {
pub result: Option<Vec<TeamsDevicesDevicePostureRules>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesResultInfo {
pub count: Option<f64>,
pub page: Option<f64>,
pub per_page: Option<f64>,
pub total_count: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSccmVpnBoundarySupport {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchedule {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasConfigRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasConfigResponse {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasIdResponse {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasMatch {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasResponseCollection {
pub result: Option<Vec<TeamsDevicesDevicePostureIntegrations>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasSingleResponse {
pub result: Option<TeamsDevicesDevicePostureIntegrations>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSchemasUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSentineloneInputRequest {
pub operating_system: String,
pub path: String,
pub sha256: Option<String>,
pub thumbprint: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSentineloneS2SConfigRequest {
pub api_url: String,
pub client_secret: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSentineloneS2SInputRequest {
pub active_threats: Option<f64>,
pub connection_id: String,
pub infected: Option<bool>,
pub is_active: Option<bool>,
pub network_status: Option<String>,
pub operational_state: Option<String>,
pub operator: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesServiceModeV2 {
pub mode: Option<String>,
pub port: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSingleResponse {
pub result: Option<TeamsDevicesDevicePostureRules>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnel {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnelAddress {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnelDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnelHost {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnelInclude {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnelIncludeResponseCollection {
pub result: Option<Vec<TeamsDevicesSplitTunnelInclude>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSplitTunnelResponseCollection {
pub result: Option<Vec<TeamsDevicesSplitTunnel>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSupportUrl {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesSwitchLocked {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTaniumConfigRequest {
pub access_client_id: Option<String>,
pub access_client_secret: Option<String>,
pub api_url: String,
pub client_secret: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTaniumInputRequest {
pub connection_id: String,
pub eid_last_seen: Option<String>,
pub operator: Option<String>,
pub risk_level: Option<String>,
#[serde(rename = "scoreOperator")]
pub score_operator: Option<String>,
pub total_score: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTargetDexTest {
pub id: Option<String>,
pub name: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTlsConfigRequest {
pub sha256: Option<String>,
pub tls_sockaddr: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTlsConfigResponse {
pub sha256: Option<String>,
pub tls_sockaddr: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTrustStores {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTrustStoresEnum {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesTunnelProtocol {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesUniqueClientIdInputRequest {
pub id: String,
pub operating_system: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesUptycsConfigRequest {
pub api_url: String,
pub client_key: String,
pub client_secret: String,
pub customer_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesUser {
pub email: Option<TeamsDevicesEmail>,
pub id: Option<TeamsDevicesComponentsSchemasUuid>,
pub name: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesV4ResponseMessage {
pub code: i64,
pub message: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesWorkspaceOneConfigRequest {
pub api_url: String,
pub auth_url: String,
pub client_id: String,
pub client_secret: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesWorkspaceOneConfigResponse {
pub api_url: String,
pub auth_url: String,
pub client_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesWorkspaceOneInputRequest {
pub compliance_status: String,
pub connection_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesZeroTrustAccountDeviceSettings {
pub disable_for_time: Option<f64>,
pub external_emergency_signal_enabled: Option<bool>,
pub external_emergency_signal_fingerprint: Option<String>,
pub external_emergency_signal_interval: Option<String>,
pub external_emergency_signal_url: Option<String>,
pub gateway_proxy_enabled: Option<bool>,
pub gateway_udp_proxy_enabled: Option<bool>,
pub root_certificate_installation_enabled: Option<bool>,
pub use_zt_virtual_ip: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TeamsDevicesZeroTrustAccountDeviceSettingsResponse {
pub result: Option<TeamsDevicesZeroTrustAccountDeviceSettings>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TunnelApiResponseCollection {
pub result: Option<Vec<serde_json::Value>>,
pub result_info: Option<TunnelResultInfo>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TunnelMessages {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TunnelResultInfo {
pub count: Option<f64>,
pub page: Option<f64>,
pub per_page: Option<f64>,
pub total_count: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct TunnelSubnetResponseCollection {
pub result: Option<Vec<TunnelSubnet>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct UnrevokeRegistrationsResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: Option<TeamsDevicesEmptyBody>,
pub result_info: Option<TeamsDevicesCursorResultInfo>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct UpdateIpProfileResponse {
pub errors: Vec<TeamsDevicesV4ResponseMessage>,
pub messages: Vec<TeamsDevicesV4ResponseMessage>,
pub result: TeamsDevicesIpProfile,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustApplicationsReviewStatusUpdateRequest {
pub approved_apps: Vec<i64>,
pub in_review_apps: Vec<i64>,
pub unapproved_apps: Vec<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAction {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayActivityLogSettings {
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAntiVirusSettings {
pub enabled_download_phase: Option<ZeroTrustGatewayEnabledDownloadPhase>,
pub enabled_upload_phase: Option<ZeroTrustGatewayEnabledUploadPhase>,
pub fail_closed: Option<ZeroTrustGatewayFailClosed>,
pub notification_settings: Option<ZeroTrustGatewayNotificationSettings>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApiResponseCollection {
pub result_info: Option<ZeroTrustGatewayResultInfo>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApiResponseCommon {
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 ZeroTrustGatewayApiResponseSingle {
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAppId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAppTypeId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAppTypes {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAppTypesComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAppTypesComponentsSchemasResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayAppTypes>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApplication {
pub application_type_id: Option<ZeroTrustGatewayAppTypeId>,
pub created_at: Option<ZeroTrustGatewayTimestamp>,
pub id: Option<ZeroTrustGatewayAppId>,
pub name: Option<ZeroTrustGatewayAppTypesComponentsSchemasName>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApplicationType {
pub created_at: Option<ZeroTrustGatewayTimestamp>,
pub description: Option<String>,
pub id: Option<ZeroTrustGatewayAppTypeId>,
pub name: Option<ZeroTrustGatewayAppTypesComponentsSchemasName>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApplicationsReviewStatusResponse {
pub result: Option<ZeroTrustGatewayApplicationsReviewStatusResponseContent>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApplicationsReviewStatusResponseContent {
pub approved_apps: Option<Vec<i64>>,
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub in_review_apps: Option<Vec<i64>>,
pub unapproved_apps: Option<Vec<i64>>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayApprovedApps {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse {
pub result: Option<ZeroTrustGatewaySettings>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayAuditSshSettingsComponentsSchemasUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayBeta {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayBindingStatus {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayBlockPageSettings {
pub background_color: Option<String>,
pub enabled: Option<bool>,
pub footer_text: Option<String>,
pub header_text: Option<String>,
pub include_context: Option<bool>,
pub logo_path: Option<String>,
pub mailto_address: Option<String>,
pub mailto_subject: Option<String>,
pub mode: Option<String>,
pub name: Option<String>,
pub read_only: Option<bool>,
pub source_account: Option<String>,
pub suppress_footer: Option<bool>,
pub target_uri: Option<String>,
pub version: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayBodyScanningSettings {
pub inspection_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayBrowserIsolationSettings {
pub non_identity_enabled: Option<bool>,
pub url_browser_isolation_enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCategories {
pub beta: Option<ZeroTrustGatewayBeta>,
pub class: Option<ZeroTrustGatewayClass>,
pub description: Option<ZeroTrustGatewayComponentsSchemasDescription>,
pub id: Option<ZeroTrustGatewayId>,
pub name: Option<ZeroTrustGatewayCategoriesComponentsSchemasName>,
pub subcategories: Option<Vec<ZeroTrustGatewaySubcategory>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCategoriesComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCategoriesComponentsSchemasResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayCategories>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCertificateSettings {
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCertificates {
pub binding_status: Option<ZeroTrustGatewayBindingStatus>,
pub certificate: Option<String>,
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub expires_on: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub fingerprint: Option<String>,
pub id: Option<ZeroTrustGatewayUuid>,
pub in_use: Option<bool>,
pub issuer_org: Option<String>,
pub issuer_raw: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<ZeroTrustGatewayType>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub uploaded_on: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCfAccountId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayClass {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayClientDefault {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayComponentsSchemasDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayComponentsSchemasResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayLocations>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayComponentsSchemasSingleResponse {
pub result: Option<ZeroTrustGatewayRules>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayComponentsSchemasUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayContents {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCount {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayCustomCertificateSettings {
pub binding_status: Option<String>,
pub enabled: Option<bool>,
pub id: Option<String>,
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDeletedAt {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDescriptionItem {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDevicePosture {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDnsDestinationIpsIdRead {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDnsDestinationIpsIdWrite {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDnsDestinationIpv6BlockId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDnsResolverSettingsV4 {
pub ip: String,
pub port: Option<i64>,
pub route_through_private_network: Option<bool>,
pub vnet_id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDnsResolverSettingsV6 {
pub ip: String,
pub port: Option<i64>,
pub route_through_private_network: Option<bool>,
pub vnet_id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDohEndpoint {
pub enabled: Option<bool>,
pub networks: Option<Vec<ZeroTrustGatewayIpNetwork>>,
pub require_token: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayDotEndpoint {
pub enabled: Option<bool>,
pub networks: Option<Vec<ZeroTrustGatewayIpNetwork>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayEcsSupport {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayEmptyResponse {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayEnabled {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayEnabledDownloadPhase {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayEnabledUploadPhase {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayEndpoints {
pub doh: ZeroTrustGatewayDohEndpoint,
pub dot: ZeroTrustGatewayDotEndpoint,
pub ipv4: ZeroTrustGatewayIpv4Endpoint,
pub ipv6: ZeroTrustGatewayIpv6Endpoint,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayExpiration {
pub duration: Option<i64>,
pub expired: Option<bool>,
pub expires_at: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayExtendedEmailMatching {
pub enabled: Option<bool>,
pub read_only: Option<bool>,
pub source_account: Option<String>,
pub version: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayFailClosed {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayFilters {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayFipsSettings {
pub tls: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGatewayAccount {
pub result: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGatewayAccountConfig {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGatewayAccountLoggingSettings {
pub redact_pii: Option<bool>,
pub settings_by_rule_type: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGatewayAccountLoggingSettingsResponse {
pub result: Option<ZeroTrustGatewayGatewayAccountLoggingSettings>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGatewayAccountSettings {
pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGatewayTag {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayGenerateCertRequest {
pub validity_period_days: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayHostSelectorSettings {
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayId {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIdentity {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayInReviewApps {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayInspectionSettings {
pub mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIp {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpNetwork {
pub network: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpNetworks {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIps {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpv4Endpoint {
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpv4Network {
pub network: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpv4Networks {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpv6Endpoint {
pub enabled: Option<bool>,
pub networks: Option<Vec<ZeroTrustGatewayIpv6Network>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpv6Network {
pub network: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayIpv6Networks {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayItems {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayItemsInput {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayListItemResponseCollection {
pub result: Option<Vec<Vec<std::collections::HashMap<String, serde_json::Value>>>>,
pub result_info: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayListSingleResponse {
pub result: Option<ZeroTrustGatewayLists>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayLists {
pub count: Option<ZeroTrustGatewayCount>,
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub description: Option<ZeroTrustGatewayDescription>,
pub id: Option<ZeroTrustGatewaySchemasUuid>,
pub items: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
pub name: Option<ZeroTrustGatewayName>,
#[serde(rename = "type")]
pub r#type: Option<ZeroTrustGatewaySchemasType>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayLocations {
pub client_default: Option<ZeroTrustGatewayClientDefault>,
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub dns_destination_ips_id: Option<ZeroTrustGatewayDnsDestinationIpsIdRead>,
pub dns_destination_ipv6_block_id: Option<ZeroTrustGatewayDnsDestinationIpv6BlockId>,
pub doh_subdomain: Option<ZeroTrustGatewaySubdomain>,
pub ecs_support: Option<ZeroTrustGatewayEcsSupport>,
pub endpoints: Option<ZeroTrustGatewayEndpoints>,
pub id: Option<ZeroTrustGatewayComponentsSchemasUuid>,
pub ip: Option<ZeroTrustGatewayIp>,
pub ipv4_destination: Option<String>,
pub ipv4_destination_backup: Option<String>,
pub name: Option<ZeroTrustGatewaySchemasName>,
pub networks: Option<Vec<ZeroTrustGatewayIpv4Network>>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsCreateZeroTrustGatewayLocationRequest {
pub client_default: Option<ZeroTrustGatewayClientDefault>,
pub dns_destination_ips_id: Option<ZeroTrustGatewayDnsDestinationIpsIdWrite>,
pub ecs_support: Option<ZeroTrustGatewayEcsSupport>,
pub endpoints: Option<ZeroTrustGatewayEndpoints>,
pub name: ZeroTrustGatewaySchemasName,
pub networks: Option<Vec<ZeroTrustGatewayIpv4Network>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsUpdateZeroTrustGatewayLocationRequest {
pub client_default: Option<ZeroTrustGatewayClientDefault>,
pub dns_destination_ips_id: Option<ZeroTrustGatewayDnsDestinationIpsIdWrite>,
pub ecs_support: Option<ZeroTrustGatewayEcsSupport>,
pub endpoints: Option<ZeroTrustGatewayEndpoints>,
pub name: ZeroTrustGatewaySchemasName,
pub networks: Option<Vec<ZeroTrustGatewayIpv4Network>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayMessages {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayNotificationSettings {
pub enabled: Option<bool>,
pub include_context: Option<bool>,
pub msg: Option<String>,
pub support_url: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfile {
pub contents: Option<ZeroTrustGatewayContents>,
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub description: Option<ZeroTrustGatewayPacfilesComponentsSchemasDescription>,
pub id: Option<ZeroTrustGatewayComponentsSchemasUuid>,
pub name: Option<ZeroTrustGatewayPacfilesComponentsSchemasName>,
pub slug: Option<ZeroTrustGatewaySlug>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub url: Option<ZeroTrustGatewayUrl>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesComponentsSchemasDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesComponentsSchemasResponseCollection {
pub result: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse {
pub result: Option<ZeroTrustGatewayPacfile>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesCreatePacfileRequest {
pub contents: ZeroTrustGatewayContents,
pub description: Option<ZeroTrustGatewayPacfilesComponentsSchemasDescription>,
pub name: ZeroTrustGatewayPacfilesComponentsSchemasName,
pub slug: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesUpdateRequest {
pub contents: ZeroTrustGatewayContents,
pub description: ZeroTrustGatewayPacfilesComponentsSchemasDescription,
pub name: ZeroTrustGatewayPacfilesComponentsSchemasName,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPrecedence {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProtocolDetection {
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProviderName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointIdentity {
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub id: Option<ZeroTrustGatewayComponentsSchemasUuid>,
pub kind: String,
pub name: ZeroTrustGatewayProxyEndpointsComponentsSchemasName,
pub subdomain: Option<ZeroTrustGatewaySchemasSubdomain>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointIdentityCreate {
pub kind: String,
pub name: ZeroTrustGatewayProxyEndpointsComponentsSchemasName,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointIp {
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub id: Option<ZeroTrustGatewayComponentsSchemasUuid>,
pub ips: Vec<String>,
pub kind: Option<String>,
pub name: ZeroTrustGatewayProxyEndpointsComponentsSchemasName,
pub subdomain: Option<ZeroTrustGatewaySchemasSubdomain>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointIpCreate {
pub kind: Option<String>,
pub name: ZeroTrustGatewayProxyEndpointsComponentsSchemasName,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpoints {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsComponentsSchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsComponentsSchemasResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayProxyEndpoints>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse {
pub result: Option<ZeroTrustGatewayProxyEndpoints>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsCreateProxyEndpointRequest {
pub kind: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsUpdateProxyEndpointRequest {
pub ips: Option<Vec<String>>,
pub name: Option<ZeroTrustGatewayProxyEndpointsComponentsSchemasName>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayPublicKey {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayReadOnly {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayReadOnlyTimestamp {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayCertificates>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayResultInfo {
pub count: Option<f64>,
pub page: Option<f64>,
pub per_page: Option<f64>,
pub total_count: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayRuleSettings {
pub add_headers: Option<serde_json::Value>,
pub allow_child_bypass: Option<bool>,
pub audit_ssh: Option<std::collections::HashMap<String, serde_json::Value>>,
pub biso_admin_controls: Option<std::collections::HashMap<String, serde_json::Value>>,
pub block_page: Option<std::collections::HashMap<String, serde_json::Value>>,
pub block_page_enabled: Option<bool>,
pub block_reason: Option<String>,
pub bypass_parent_rule: Option<bool>,
pub check_session: Option<std::collections::HashMap<String, serde_json::Value>>,
pub dns_resolvers: Option<std::collections::HashMap<String, serde_json::Value>>,
pub egress: Option<std::collections::HashMap<String, serde_json::Value>>,
pub forensic_copy: Option<std::collections::HashMap<String, serde_json::Value>>,
pub ignore_cname_category_matches: Option<bool>,
pub insecure_disable_dnssec_validation: Option<bool>,
pub ip_categories: Option<bool>,
pub ip_indicator_feeds: Option<bool>,
pub l4override: Option<std::collections::HashMap<String, serde_json::Value>>,
pub notification_settings: Option<std::collections::HashMap<String, serde_json::Value>>,
pub override_host: Option<String>,
pub override_ips: Option<Vec<String>>,
pub payload_log: Option<std::collections::HashMap<String, serde_json::Value>>,
pub quarantine: Option<std::collections::HashMap<String, serde_json::Value>>,
pub redirect: Option<std::collections::HashMap<String, serde_json::Value>>,
pub resolve_dns_internally: Option<std::collections::HashMap<String, serde_json::Value>>,
pub resolve_dns_through_cloudflare: Option<bool>,
pub untrusted_cert: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayRules {
pub action: ZeroTrustGatewayAction,
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub deleted_at: Option<ZeroTrustGatewayDeletedAt>,
pub description: Option<ZeroTrustGatewaySchemasDescription>,
pub device_posture: Option<ZeroTrustGatewayDevicePosture>,
pub enabled: ZeroTrustGatewayEnabled,
pub expiration: Option<ZeroTrustGatewayExpiration>,
pub filters: Vec<String>,
pub id: Option<ZeroTrustGatewaySchemasUuid>,
pub identity: Option<ZeroTrustGatewayIdentity>,
pub name: ZeroTrustGatewayComponentsSchemasName,
pub precedence: ZeroTrustGatewayPrecedence,
pub read_only: Option<ZeroTrustGatewayReadOnly>,
pub rule_settings: Option<ZeroTrustGatewayRuleSettings>,
pub schedule: Option<ZeroTrustGatewaySchedule>,
pub sharable: Option<ZeroTrustGatewaySharable>,
pub source_account: Option<ZeroTrustGatewaySourceAccount>,
pub traffic: ZeroTrustGatewayTraffic,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub version: Option<ZeroTrustGatewayVersion>,
pub warning_status: Option<ZeroTrustGatewayWarningStatus>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayRulesComponentsSchemasResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayRules>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayRulesCreateZeroTrustGatewayRuleRequest {
pub action: ZeroTrustGatewayAction,
pub description: Option<ZeroTrustGatewaySchemasDescription>,
pub device_posture: Option<ZeroTrustGatewayDevicePosture>,
pub enabled: Option<ZeroTrustGatewayEnabled>,
pub expiration: Option<ZeroTrustGatewayExpiration>,
pub filters: Option<Vec<String>>,
pub identity: Option<ZeroTrustGatewayIdentity>,
pub name: ZeroTrustGatewayComponentsSchemasName,
pub precedence: Option<ZeroTrustGatewayPrecedence>,
pub rule_settings: Option<ZeroTrustGatewayRuleSettings>,
pub schedule: Option<ZeroTrustGatewaySchedule>,
pub traffic: Option<ZeroTrustGatewayTraffic>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayRulesUpdateZeroTrustGatewayRuleRequest {
pub action: ZeroTrustGatewayAction,
pub description: Option<ZeroTrustGatewaySchemasDescription>,
pub device_posture: Option<ZeroTrustGatewayDevicePosture>,
pub enabled: Option<ZeroTrustGatewayEnabled>,
pub expiration: Option<ZeroTrustGatewayExpiration>,
pub filters: Option<Vec<String>>,
pub identity: Option<ZeroTrustGatewayIdentity>,
pub name: ZeroTrustGatewayComponentsSchemasName,
pub precedence: Option<ZeroTrustGatewayPrecedence>,
pub rule_settings: Option<ZeroTrustGatewayRuleSettings>,
pub schedule: Option<ZeroTrustGatewaySchedule>,
pub traffic: Option<ZeroTrustGatewayTraffic>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySandbox {
pub enabled: Option<bool>,
pub fallback_action: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchedule {
pub fri: Option<String>,
pub mon: Option<String>,
pub sat: Option<String>,
pub sun: Option<String>,
pub thu: Option<String>,
pub time_zone: Option<String>,
pub tue: Option<String>,
pub wed: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasResponseCollection {
pub result: Option<Vec<ZeroTrustGatewayLists>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasSingleResponse {
pub result: Option<ZeroTrustGatewayLocations>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasSubdomain {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySchemasUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySettings {
pub created_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
pub public_key: Option<ZeroTrustGatewayPublicKey>,
pub seed_id: Option<ZeroTrustGatewayAuditSshSettingsComponentsSchemasUuid>,
pub updated_at: Option<ZeroTrustGatewayReadOnlyTimestamp>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySharable {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySingleResponse {
pub result: Option<ZeroTrustGatewayCertificates>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySingleResponseWithListItems {
pub result: Option<std::collections::HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySlug {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySourceAccount {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySubcategory {
pub beta: Option<ZeroTrustGatewayBeta>,
pub class: Option<ZeroTrustGatewayClass>,
pub description: Option<ZeroTrustGatewayComponentsSchemasDescription>,
pub id: Option<ZeroTrustGatewayId>,
pub name: Option<ZeroTrustGatewayCategoriesComponentsSchemasName>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewaySubdomain {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayTimestamp {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayTlsSettings {
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayTraffic {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayType {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayUnapprovedApps {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayUrl {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayValue {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayVersion {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustGatewayWarningStatus {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustListsCreateZeroTrustListRequest {
pub description: Option<ZeroTrustGatewayDescription>,
pub items: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
pub name: ZeroTrustGatewayName,
#[serde(rename = "type")]
pub r#type: ZeroTrustGatewaySchemasType,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustListsPatchZeroTrustListRequest {
pub append: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
pub remove: Option<Vec<ZeroTrustGatewayValue>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustListsUpdateZeroTrustListRequest {
pub description: Option<ZeroTrustGatewayDescription>,
pub items: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
pub name: ZeroTrustGatewayName,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustNetworksSubnetUpdateCloudflareSourceRequest {
pub comment: Option<TunnelSubnetComment>,
pub name: Option<TunnelSubnetName>,
pub network: Option<TunnelSubnetIpNetwork>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct ZeroTrustUpdateAuditSshSettingsRequest {
pub public_key: ZeroTrustGatewayPublicKey,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ListIpProfilesArgs {
pub account_id: String,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct CreateIpProfileArgs {
pub account_id: String,
pub body: TeamsDevicesIpProfileCreateRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct GetIpProfileArgs {
pub account_id: String,
pub profile_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct UpdateIpProfileArgs {
pub account_id: String,
pub profile_id: String,
pub body: TeamsDevicesIpProfileUpdateRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeleteIpProfileArgs {
pub account_id: String,
pub profile_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeviceManagedNetworksListDeviceManagedNetworksArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeviceManagedNetworksCreateDeviceManagedNetworkArgs {
pub account_id: String,
pub body: DeviceManagedNetworksCreateDeviceManagedNetworkRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeviceManagedNetworksDeviceManagedNetworkDetailsArgs {
pub network_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeviceManagedNetworksUpdateDeviceManagedNetworkArgs {
pub network_id: String,
pub account_id: String,
pub body: DeviceManagedNetworksUpdateDeviceManagedNetworkRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeviceManagedNetworksDeleteDeviceManagedNetworkArgs {
pub network_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ListDevicesArgs {
pub account_id: String,
pub cursor: Option<String>,
pub sort_by: Option<String>,
pub sort_order: Option<String>,
pub last_seen_user_email: Option<String>,
pub seen_after: Option<String>,
pub seen_before: Option<String>,
pub per_page: Option<String>,
pub search: Option<String>,
pub active_registrations: Option<String>,
pub id: Option<String>,
pub include: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct GetDeviceArgs {
pub device_id: String,
pub account_id: String,
pub include: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeleteDeviceArgs {
pub device_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RevokeDeviceArgs {
pub account_id: String,
pub device_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesListDeviceSettingsPoliciesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesGetDefaultDeviceSettingsPolicyArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesCreateDeviceSettingsPolicyArgs {
pub account_id: String,
pub body: DevicesCreateDeviceSettingsPolicyRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesUpdateDefaultDeviceSettingsPolicyArgs {
pub account_id: String,
pub body: DevicesUpdateDefaultDeviceSettingsPolicyRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesGetSplitTunnelExcludeListArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesSetSplitTunnelExcludeListArgs {
pub account_id: String,
pub body: Vec<TeamsDevicesSplitTunnel>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesGetSplitTunnelIncludeListArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesSetSplitTunnelIncludeListArgs {
pub account_id: String,
pub body: Vec<TeamsDevicesSplitTunnelInclude>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesGetDeviceSettingsPolicyByIdArgs {
pub policy_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesUpdateDeviceSettingsPolicyArgs {
pub policy_id: String,
pub account_id: String,
pub body: DevicesUpdateDeviceSettingsPolicyRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesDeleteDeviceSettingsPolicyArgs {
pub policy_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyArgs {
pub policy_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyArgs {
pub policy_id: String,
pub account_id: String,
pub body: Vec<TeamsDevicesSplitTunnel>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyArgs {
pub policy_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyArgs {
pub policy_id: String,
pub account_id: String,
pub body: Vec<TeamsDevicesSplitTunnelInclude>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureRulesListDevicePostureRulesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureRulesCreateDevicePostureRuleArgs {
pub account_id: String,
pub body: DevicePostureRulesCreateDevicePostureRuleRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureIntegrationsListDevicePostureIntegrationsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureIntegrationsCreateDevicePostureIntegrationArgs {
pub account_id: String,
pub body: DevicePostureIntegrationsCreateDevicePostureIntegrationRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureIntegrationsDevicePostureIntegrationDetailsArgs {
pub integration_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureIntegrationsUpdateDevicePostureIntegrationArgs {
pub integration_id: String,
pub account_id: String,
pub body: DevicePostureIntegrationsUpdateDevicePostureIntegrationRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureIntegrationsDeleteDevicePostureIntegrationArgs {
pub integration_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureRulesDevicePostureRulesDetailsArgs {
pub rule_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureRulesUpdateDevicePostureRuleArgs {
pub rule_id: String,
pub account_id: String,
pub body: DevicePostureRulesUpdateDevicePostureRuleRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DevicePostureRulesDeleteDevicePostureRuleArgs {
pub rule_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ListRegistrationsArgs {
pub account_id: String,
pub user_id: Option<String>,
pub seen_after: Option<String>,
pub seen_before: Option<String>,
pub status: Option<String>,
pub per_page: Option<String>,
pub search: Option<String>,
pub sort_by: Option<String>,
pub sort_order: Option<String>,
pub cursor: Option<String>,
pub id: Option<String>,
pub device_id: Option<String>,
pub include: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeleteRegistrationsArgs {
pub account_id: String,
pub id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RevokeRegistrationsArgs {
pub account_id: String,
pub id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct UnrevokeRegistrationsArgs {
pub account_id: String,
pub id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct GetRegistrationArgs {
pub registration_id: String,
pub account_id: String,
pub include: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DeleteRegistrationArgs {
pub registration_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct GetRegistrationOverrideCodesArgs {
pub account_id: String,
pub registration_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountArgs {
pub account_id: String,
pub body: TeamsDevicesZeroTrustAccountDeviceSettings,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsPatchDeviceSettingsForTheZeroTrustAccountArgs {
pub account_id: String,
pub body: TeamsDevicesZeroTrustAccountDeviceSettings,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsDeleteDeviceSettingsForZeroTrustAccountArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsGetZeroTrustAccountInformationArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsCreateZeroTrustAccountArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustApplicationsReviewStatusListArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustApplicationsReviewStatusUpdateArgs {
pub account_id: String,
pub body: ZeroTrustApplicationsReviewStatusUpdateRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGetAuditSshSettingsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustUpdateAuditSshSettingsArgs {
pub account_id: String,
pub body: ZeroTrustUpdateAuditSshSettingsRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustRotateSshAccountSeedArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayCategoriesListCategoriesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustCertificatesListZeroTrustCertificatesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustCertificatesCreateZeroTrustCertificateArgs {
pub account_id: String,
pub body: ZeroTrustGatewayGenerateCertRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustCertificatesZeroTrustCertificateDetailsArgs {
pub certificate_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustCertificatesDeleteZeroTrustCertificateArgs {
pub certificate_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustCertificatesActivateZeroTrustCertificateArgs {
pub certificate_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustCertificatesDeactivateZeroTrustCertificateArgs {
pub certificate_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsGetZeroTrustAccountConfigurationArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsUpdateZeroTrustAccountConfigurationArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsPatchZeroTrustAccountConfigurationArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsListZeroTrustListsArgs {
pub account_id: String,
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsCreateZeroTrustListArgs {
pub account_id: String,
pub body: ZeroTrustListsCreateZeroTrustListRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsZeroTrustListDetailsArgs {
pub list_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsUpdateZeroTrustListArgs {
pub list_id: String,
pub account_id: String,
pub body: ZeroTrustListsUpdateZeroTrustListRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsPatchZeroTrustListArgs {
pub list_id: String,
pub account_id: String,
pub body: ZeroTrustListsPatchZeroTrustListRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsDeleteZeroTrustListArgs {
pub list_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustListsZeroTrustListItemsArgs {
pub list_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsListZeroTrustGatewayLocationsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsCreateZeroTrustGatewayLocationArgs {
pub account_id: String,
pub body: ZeroTrustGatewayLocationsCreateZeroTrustGatewayLocationRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsZeroTrustGatewayLocationDetailsArgs {
pub location_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsUpdateZeroTrustGatewayLocationArgs {
pub location_id: String,
pub account_id: String,
pub body: ZeroTrustGatewayLocationsUpdateZeroTrustGatewayLocationRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayLocationsDeleteZeroTrustGatewayLocationArgs {
pub location_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountArgs {
pub account_id: String,
pub body: ZeroTrustGatewayGatewayAccountLoggingSettings,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesListArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesCreatePacfileArgs {
pub account_id: String,
pub body: ZeroTrustGatewayPacfilesCreatePacfileRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesDetailsArgs {
pub pacfile_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesUpdateArgs {
pub pacfile_id: String,
pub account_id: String,
pub body: ZeroTrustGatewayPacfilesUpdateRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayPacfilesDeleteArgs {
pub pacfile_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsListProxyEndpointsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsCreateProxyEndpointArgs {
pub account_id: String,
pub body: ZeroTrustGatewayProxyEndpointsCreateProxyEndpointRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsProxyEndpointDetailsArgs {
pub proxy_endpoint_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsUpdateProxyEndpointArgs {
pub proxy_endpoint_id: String,
pub account_id: String,
pub body: ZeroTrustGatewayProxyEndpointsUpdateProxyEndpointRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayProxyEndpointsDeleteProxyEndpointArgs {
pub proxy_endpoint_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesListZeroTrustGatewayRulesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesCreateZeroTrustGatewayRuleArgs {
pub account_id: String,
pub body: ZeroTrustGatewayRulesCreateZeroTrustGatewayRuleRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesListZeroTrustGatewayRulesTenantArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesZeroTrustGatewayRuleDetailsArgs {
pub rule_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesUpdateZeroTrustGatewayRuleArgs {
pub rule_id: String,
pub account_id: String,
pub body: ZeroTrustGatewayRulesUpdateZeroTrustGatewayRuleRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesDeleteZeroTrustGatewayRuleArgs {
pub rule_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustGatewayRulesResetExpirationZeroTrustGatewayRuleArgs {
pub rule_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustNetworksSubnetsListArgs {
pub account_id: String,
pub name: Option<String>,
pub comment: Option<String>,
pub network: Option<String>,
pub existed_at: Option<String>,
pub address_family: Option<String>,
pub is_default_network: Option<String>,
pub is_deleted: Option<String>,
pub sort_order: Option<String>,
pub subnet_types: Option<String>,
pub per_page: Option<String>,
pub page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct ZeroTrustNetworksSubnetUpdateCloudflareSourceArgs {
pub account_id: String,
pub address_family: String,
pub body: ZeroTrustNetworksSubnetUpdateCloudflareSourceRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpRiskScoreBehaviorsGetArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpRiskScoreBehaviorsPutArgs {
pub account_id: String,
pub body: DlpUpdateBehaviors,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationListArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationCreateArgs {
pub account_id: String,
pub body: DlpCreateIntegrationBody,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationGetByReferenceIdArgs {
pub account_id: String,
pub reference_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationGetArgs {
pub account_id: String,
pub integration_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationUpdateArgs {
pub account_id: String,
pub integration_id: String,
pub body: DlpUpdateIntegrationBody,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpZtRiskScoreIntegrationDeleteArgs {
pub account_id: String,
pub integration_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct DlpRiskScoreSummaryGetArgs {
pub account_id: String,
}
pub async fn list_ip_profiles_request<F>(
client: DynNetClient,
args: &ListIpProfilesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ListIpProfilesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/ip-profiles",
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("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: ListIpProfilesResponse = 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 create_ip_profile_request<F>(
client: DynNetClient,
args: &CreateIpProfileArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<CreateIpProfileResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/ip-profiles",
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: CreateIpProfileResponse = 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 get_ip_profile_request<F>(
client: DynNetClient,
args: &GetIpProfileArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<GetIpProfileResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/ip-profiles/{}",
args.account_id,
args.profile_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: GetIpProfileResponse = 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 update_ip_profile_request<F>(
client: DynNetClient,
args: &UpdateIpProfileArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<UpdateIpProfileResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/ip-profiles/{}",
args.account_id,
args.profile_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: UpdateIpProfileResponse = 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 delete_ip_profile_request<F>(
client: DynNetClient,
args: &DeleteIpProfileArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DeleteIpProfileResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/ip-profiles/{}",
args.account_id,
args.profile_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: DeleteIpProfileResponse = 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 device_managed_networks_list_device_managed_networks_request<F>(
client: DynNetClient,
args: &DeviceManagedNetworksListDeviceManagedNetworksArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/networks",
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: TeamsDevicesComponentsSchemasResponseCollection = 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 device_managed_networks_create_device_managed_network_request<F>(
client: DynNetClient,
args: &DeviceManagedNetworksCreateDeviceManagedNetworkArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/networks",
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: TeamsDevicesComponentsSchemasSingleResponse = 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 device_managed_networks_device_managed_network_details_request<F>(
client: DynNetClient,
args: &DeviceManagedNetworksDeviceManagedNetworkDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/networks/{}",
args.account_id,
args.network_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: TeamsDevicesComponentsSchemasSingleResponse = 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 device_managed_networks_update_device_managed_network_request<F>(
client: DynNetClient,
args: &DeviceManagedNetworksUpdateDeviceManagedNetworkArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/networks/{}",
args.account_id,
args.network_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: TeamsDevicesComponentsSchemasSingleResponse = 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 device_managed_networks_delete_device_managed_network_request<F>(
client: DynNetClient,
args: &DeviceManagedNetworksDeleteDeviceManagedNetworkArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/networks/{}",
args.account_id,
args.network_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: TeamsDevicesComponentsSchemasResponseCollection = 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 list_devices_request<F>(
client: DynNetClient,
args: &ListDevicesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ListDevicesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/physical-devices",
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("cursor", args.cursor.as_deref());
builder = builder.query("sort_by", args.sort_by.as_deref());
builder = builder.query("sort_order", args.sort_order.as_deref());
builder = builder.query("last_seen_user.email", args.last_seen_user_email.as_deref());
builder = builder.query("seen_after", args.seen_after.as_deref());
builder = builder.query("seen_before", args.seen_before.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("active_registrations", args.active_registrations.as_deref());
builder = builder.query("id", args.id.as_deref());
builder = builder.query("include", args.include.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: ListDevicesResponse = 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 get_device_request<F>(
client: DynNetClient,
args: &GetDeviceArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<GetDeviceResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/physical-devices/{}",
args.account_id,
args.device_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("include", args.include.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: GetDeviceResponse = 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 delete_device_request<F>(
client: DynNetClient,
args: &DeleteDeviceArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DeleteDeviceResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/physical-devices/{}",
args.account_id,
args.device_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: DeleteDeviceResponse = 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 revoke_device_request<F>(
client: DynNetClient,
args: &RevokeDeviceArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RevokeDeviceResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/physical-devices/{}/revoke",
args.account_id,
args.device_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: RevokeDeviceResponse = 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 devices_list_device_settings_policies_request<F>(
client: DynNetClient,
args: &DevicesListDeviceSettingsPoliciesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDeviceSettingsResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/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()))?;
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: TeamsDevicesDeviceSettingsResponseCollection = 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 devices_get_default_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesGetDefaultDeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDefaultDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy",
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: TeamsDevicesDefaultDeviceSettingsResponse = 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 devices_create_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesCreateDeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy",
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: TeamsDevicesDeviceSettingsResponse = 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 devices_update_default_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesUpdateDefaultDeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDefaultDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy",
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: TeamsDevicesDefaultDeviceSettingsResponse = 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 devices_get_split_tunnel_exclude_list_request<F>(
client: DynNetClient,
args: &DevicesGetSplitTunnelExcludeListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/exclude",
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: TeamsDevicesSplitTunnelResponseCollection = 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 devices_set_split_tunnel_exclude_list_request<F>(
client: DynNetClient,
args: &DevicesSetSplitTunnelExcludeListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/exclude",
args.account_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: TeamsDevicesSplitTunnelResponseCollection = 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 devices_get_split_tunnel_include_list_request<F>(
client: DynNetClient,
args: &DevicesGetSplitTunnelIncludeListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelIncludeResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/include",
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: TeamsDevicesSplitTunnelIncludeResponseCollection = 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 devices_set_split_tunnel_include_list_request<F>(
client: DynNetClient,
args: &DevicesSetSplitTunnelIncludeListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelIncludeResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/include",
args.account_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: TeamsDevicesSplitTunnelIncludeResponseCollection = 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 devices_get_device_settings_policy_by_id_request<F>(
client: DynNetClient,
args: &DevicesGetDeviceSettingsPolicyByIdArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}",
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: TeamsDevicesDeviceSettingsResponse = 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 devices_update_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesUpdateDeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}",
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: TeamsDevicesDeviceSettingsResponse = 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 devices_delete_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesDeleteDeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesDeviceSettingsResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}",
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: TeamsDevicesDeviceSettingsResponseCollection = 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 devices_get_split_tunnel_exclude_list_for_a_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}/exclude",
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: TeamsDevicesSplitTunnelResponseCollection = 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 devices_set_split_tunnel_exclude_list_for_a_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}/exclude",
args.account_id,
args.policy_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: TeamsDevicesSplitTunnelResponseCollection = 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 devices_get_split_tunnel_include_list_for_a_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelIncludeResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}/include",
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: TeamsDevicesSplitTunnelIncludeResponseCollection = 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 devices_set_split_tunnel_include_list_for_a_device_settings_policy_request<F>(
client: DynNetClient,
args: &DevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSplitTunnelIncludeResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/policy/{}/include",
args.account_id,
args.policy_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: TeamsDevicesSplitTunnelIncludeResponseCollection = 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 device_posture_rules_list_device_posture_rules_request<F>(
client: DynNetClient,
args: &DevicePostureRulesListDevicePostureRulesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture",
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: TeamsDevicesResponseCollection = 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 device_posture_rules_create_device_posture_rule_request<F>(
client: DynNetClient,
args: &DevicePostureRulesCreateDevicePostureRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture",
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: TeamsDevicesSingleResponse = 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 device_posture_integrations_list_device_posture_integrations_request<F>(
client: DynNetClient,
args: &DevicePostureIntegrationsListDevicePostureIntegrationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/integration",
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: TeamsDevicesSchemasResponseCollection = 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 device_posture_integrations_create_device_posture_integration_request<F>(
client: DynNetClient,
args: &DevicePostureIntegrationsCreateDevicePostureIntegrationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/integration",
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: TeamsDevicesSchemasSingleResponse = 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 device_posture_integrations_device_posture_integration_details_request<F>(
client: DynNetClient,
args: &DevicePostureIntegrationsDevicePostureIntegrationDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/integration/{}",
args.account_id,
args.integration_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: TeamsDevicesSchemasSingleResponse = 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 device_posture_integrations_update_device_posture_integration_request<F>(
client: DynNetClient,
args: &DevicePostureIntegrationsUpdateDevicePostureIntegrationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/integration/{}",
args.account_id,
args.integration_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: TeamsDevicesSchemasSingleResponse = 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 device_posture_integrations_delete_device_posture_integration_request<F>(
client: DynNetClient,
args: &DevicePostureIntegrationsDeleteDevicePostureIntegrationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSchemasIdResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/integration/{}",
args.account_id,
args.integration_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: TeamsDevicesSchemasIdResponse = 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 device_posture_rules_device_posture_rules_details_request<F>(
client: DynNetClient,
args: &DevicePostureRulesDevicePostureRulesDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/{}",
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: TeamsDevicesSingleResponse = 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 device_posture_rules_update_device_posture_rule_request<F>(
client: DynNetClient,
args: &DevicePostureRulesUpdateDevicePostureRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/{}",
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: TeamsDevicesSingleResponse = 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 device_posture_rules_delete_device_posture_rule_request<F>(
client: DynNetClient,
args: &DevicePostureRulesDeleteDevicePostureRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesIdResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/posture/{}",
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: TeamsDevicesIdResponse = 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 list_registrations_request<F>(
client: DynNetClient,
args: &ListRegistrationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ListRegistrationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations",
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("user.id", args.user_id.as_deref());
builder = builder.query("seen_after", args.seen_after.as_deref());
builder = builder.query("seen_before", args.seen_before.as_deref());
builder = builder.query("status", args.status.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("sort_by", args.sort_by.as_deref());
builder = builder.query("sort_order", args.sort_order.as_deref());
builder = builder.query("cursor", args.cursor.as_deref());
builder = builder.query("id", args.id.as_deref());
builder = builder.query("device.id", args.device_id.as_deref());
builder = builder.query("include", args.include.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: ListRegistrationsResponse = 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 delete_registrations_request<F>(
client: DynNetClient,
args: &DeleteRegistrationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DeleteRegistrationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations",
args.account_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()))?;
builder = builder.query("id", args.id.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: DeleteRegistrationsResponse = 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 revoke_registrations_request<F>(
client: DynNetClient,
args: &RevokeRegistrationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RevokeRegistrationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations/revoke",
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.query("id", args.id.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: RevokeRegistrationsResponse = 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 unrevoke_registrations_request<F>(
client: DynNetClient,
args: &UnrevokeRegistrationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<UnrevokeRegistrationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations/unrevoke",
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.query("id", args.id.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: UnrevokeRegistrationsResponse = 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 get_registration_request<F>(
client: DynNetClient,
args: &GetRegistrationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<GetRegistrationResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations/{}",
args.account_id,
args.registration_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("include", args.include.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: GetRegistrationResponse = 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 delete_registration_request<F>(
client: DynNetClient,
args: &DeleteRegistrationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DeleteRegistrationResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations/{}",
args.account_id,
args.registration_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: DeleteRegistrationResponse = 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 get_registration_override_codes_request<F>(
client: DynNetClient,
args: &GetRegistrationOverrideCodesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<GetRegistrationOverrideCodesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/registrations/{}/override_codes",
args.account_id,
args.registration_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: GetRegistrationOverrideCodesResponse = 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 zero_trust_accounts_get_device_settings_for_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesZeroTrustAccountDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/settings",
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: TeamsDevicesZeroTrustAccountDeviceSettingsResponse = 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 zero_trust_accounts_update_device_settings_for_the_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesZeroTrustAccountDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/settings",
args.account_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: TeamsDevicesZeroTrustAccountDeviceSettingsResponse = 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 zero_trust_accounts_patch_device_settings_for_the_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsPatchDeviceSettingsForTheZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesZeroTrustAccountDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/settings",
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: TeamsDevicesZeroTrustAccountDeviceSettingsResponse = 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 zero_trust_accounts_delete_device_settings_for_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsDeleteDeviceSettingsForZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TeamsDevicesZeroTrustAccountDeviceSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/devices/settings",
args.account_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: TeamsDevicesZeroTrustAccountDeviceSettingsResponse = 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 zero_trust_accounts_get_zero_trust_account_information_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsGetZeroTrustAccountInformationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccount>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway",
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: ZeroTrustGatewayGatewayAccount = 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 zero_trust_accounts_create_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsCreateZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccount>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway",
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: ZeroTrustGatewayGatewayAccount = 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 zero_trust_gateway_application_and_application_type_mappings_list_application_and_application_type_mappings_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayAppTypesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/app_types",
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: ZeroTrustGatewayAppTypesComponentsSchemasResponseCollection = 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 zero_trust_applications_review_status_list_request<F>(
client: DynNetClient,
args: &ZeroTrustApplicationsReviewStatusListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayApplicationsReviewStatusResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/apps/review_status",
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: ZeroTrustGatewayApplicationsReviewStatusResponse = 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 zero_trust_applications_review_status_update_request<F>(
client: DynNetClient,
args: &ZeroTrustApplicationsReviewStatusUpdateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayApplicationsReviewStatusResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/apps/review_status",
args.account_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: ZeroTrustGatewayApplicationsReviewStatusResponse = 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 zero_trust_get_audit_ssh_settings_request<F>(
client: DynNetClient,
args: &ZeroTrustGetAuditSshSettingsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/audit_ssh_settings",
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: ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse = 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 zero_trust_update_audit_ssh_settings_request<F>(
client: DynNetClient,
args: &ZeroTrustUpdateAuditSshSettingsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/audit_ssh_settings",
args.account_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: ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse = 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 zero_trust_rotate_ssh_account_seed_request<F>(
client: DynNetClient,
args: &ZeroTrustRotateSshAccountSeedArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/audit_ssh_settings/rotate_seed",
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: ZeroTrustGatewayAuditSshSettingsComponentsSchemasSingleResponse = 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 zero_trust_gateway_categories_list_categories_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayCategoriesListCategoriesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayCategoriesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/categories",
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: ZeroTrustGatewayCategoriesComponentsSchemasResponseCollection = 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 zero_trust_certificates_list_zero_trust_certificates_request<F>(
client: DynNetClient,
args: &ZeroTrustCertificatesListZeroTrustCertificatesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/certificates",
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: ZeroTrustGatewayResponseCollection = 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 zero_trust_certificates_create_zero_trust_certificate_request<F>(
client: DynNetClient,
args: &ZeroTrustCertificatesCreateZeroTrustCertificateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/certificates",
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: ZeroTrustGatewaySingleResponse = 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 zero_trust_certificates_zero_trust_certificate_details_request<F>(
client: DynNetClient,
args: &ZeroTrustCertificatesZeroTrustCertificateDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/certificates/{}",
args.account_id,
args.certificate_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: ZeroTrustGatewaySingleResponse = 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 zero_trust_certificates_delete_zero_trust_certificate_request<F>(
client: DynNetClient,
args: &ZeroTrustCertificatesDeleteZeroTrustCertificateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/certificates/{}",
args.account_id,
args.certificate_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: ZeroTrustGatewaySingleResponse = 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 zero_trust_certificates_activate_zero_trust_certificate_request<F>(
client: DynNetClient,
args: &ZeroTrustCertificatesActivateZeroTrustCertificateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/certificates/{}/activate",
args.account_id,
args.certificate_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: ZeroTrustGatewaySingleResponse = 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 zero_trust_certificates_deactivate_zero_trust_certificate_request<F>(
client: DynNetClient,
args: &ZeroTrustCertificatesDeactivateZeroTrustCertificateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/certificates/{}/deactivate",
args.account_id,
args.certificate_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: ZeroTrustGatewaySingleResponse = 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 zero_trust_accounts_get_zero_trust_account_configuration_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsGetZeroTrustAccountConfigurationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccountConfig>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/configuration",
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: ZeroTrustGatewayGatewayAccountConfig = 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 zero_trust_accounts_update_zero_trust_account_configuration_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsUpdateZeroTrustAccountConfigurationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccountConfig>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/configuration",
args.account_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()))?;
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: ZeroTrustGatewayGatewayAccountConfig = 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 zero_trust_accounts_patch_zero_trust_account_configuration_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsPatchZeroTrustAccountConfigurationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccountConfig>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/configuration",
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()))?;
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: ZeroTrustGatewayGatewayAccountConfig = 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 zero_trust_lists_list_zero_trust_lists_request<F>(
client: DynNetClient,
args: &ZeroTrustListsListZeroTrustListsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists",
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("type", args.r#type.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: ZeroTrustGatewaySchemasResponseCollection = 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 zero_trust_lists_create_zero_trust_list_request<F>(
client: DynNetClient,
args: &ZeroTrustListsCreateZeroTrustListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySingleResponseWithListItems>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists",
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: ZeroTrustGatewaySingleResponseWithListItems = 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 zero_trust_lists_zero_trust_list_details_request<F>(
client: DynNetClient,
args: &ZeroTrustListsZeroTrustListDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayListSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists/{}",
args.account_id,
args.list_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: ZeroTrustGatewayListSingleResponse = 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 zero_trust_lists_update_zero_trust_list_request<F>(
client: DynNetClient,
args: &ZeroTrustListsUpdateZeroTrustListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayListSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists/{}",
args.account_id,
args.list_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: ZeroTrustGatewayListSingleResponse = 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 zero_trust_lists_patch_zero_trust_list_request<F>(
client: DynNetClient,
args: &ZeroTrustListsPatchZeroTrustListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayListSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists/{}",
args.account_id,
args.list_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: ZeroTrustGatewayListSingleResponse = 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 zero_trust_lists_delete_zero_trust_list_request<F>(
client: DynNetClient,
args: &ZeroTrustListsDeleteZeroTrustListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayEmptyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists/{}",
args.account_id,
args.list_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: ZeroTrustGatewayEmptyResponse = 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 zero_trust_lists_zero_trust_list_items_request<F>(
client: DynNetClient,
args: &ZeroTrustListsZeroTrustListItemsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayListItemResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/lists/{}/items",
args.account_id,
args.list_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: ZeroTrustGatewayListItemResponseCollection = 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 zero_trust_gateway_locations_list_zero_trust_gateway_locations_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayLocationsListZeroTrustGatewayLocationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/locations",
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: ZeroTrustGatewayComponentsSchemasResponseCollection = 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 zero_trust_gateway_locations_create_zero_trust_gateway_location_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayLocationsCreateZeroTrustGatewayLocationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/locations",
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: ZeroTrustGatewaySchemasSingleResponse = 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 zero_trust_gateway_locations_zero_trust_gateway_location_details_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayLocationsZeroTrustGatewayLocationDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/locations/{}",
args.account_id,
args.location_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: ZeroTrustGatewaySchemasSingleResponse = 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 zero_trust_gateway_locations_update_zero_trust_gateway_location_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayLocationsUpdateZeroTrustGatewayLocationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewaySchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/locations/{}",
args.account_id,
args.location_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: ZeroTrustGatewaySchemasSingleResponse = 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 zero_trust_gateway_locations_delete_zero_trust_gateway_location_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayLocationsDeleteZeroTrustGatewayLocationArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayEmptyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/locations/{}",
args.account_id,
args.location_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: ZeroTrustGatewayEmptyResponse = 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 zero_trust_accounts_get_logging_settings_for_the_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccountLoggingSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/logging",
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: ZeroTrustGatewayGatewayAccountLoggingSettingsResponse = 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 zero_trust_accounts_update_logging_settings_for_the_zero_trust_account_request<F>(
client: DynNetClient,
args: &ZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayGatewayAccountLoggingSettingsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/logging",
args.account_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: ZeroTrustGatewayGatewayAccountLoggingSettingsResponse = 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 zero_trust_gateway_pacfiles_list_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayPacfilesListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayPacfilesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/pacfiles",
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: ZeroTrustGatewayPacfilesComponentsSchemasResponseCollection = 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 zero_trust_gateway_pacfiles_create_pacfile_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayPacfilesCreatePacfileArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/pacfiles",
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: ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse = 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 zero_trust_gateway_pacfiles_details_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayPacfilesDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/pacfiles/{}",
args.account_id,
args.pacfile_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: ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse = 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 zero_trust_gateway_pacfiles_update_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayPacfilesUpdateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/pacfiles/{}",
args.account_id,
args.pacfile_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: ZeroTrustGatewayPacfilesComponentsSchemasSingleResponse = 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 zero_trust_gateway_pacfiles_delete_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayPacfilesDeleteArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayEmptyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/pacfiles/{}",
args.account_id,
args.pacfile_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: ZeroTrustGatewayEmptyResponse = 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 zero_trust_gateway_proxy_endpoints_list_proxy_endpoints_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayProxyEndpointsListProxyEndpointsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayProxyEndpointsComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/proxy_endpoints",
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: ZeroTrustGatewayProxyEndpointsComponentsSchemasResponseCollection = 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 zero_trust_gateway_proxy_endpoints_create_proxy_endpoint_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayProxyEndpointsCreateProxyEndpointArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/proxy_endpoints",
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: ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse = 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 zero_trust_gateway_proxy_endpoints_proxy_endpoint_details_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayProxyEndpointsProxyEndpointDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/proxy_endpoints/{}",
args.account_id,
args.proxy_endpoint_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: ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse = 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 zero_trust_gateway_proxy_endpoints_update_proxy_endpoint_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayProxyEndpointsUpdateProxyEndpointArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/proxy_endpoints/{}",
args.account_id,
args.proxy_endpoint_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: ZeroTrustGatewayProxyEndpointsComponentsSchemasSingleResponse = 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 zero_trust_gateway_proxy_endpoints_delete_proxy_endpoint_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayProxyEndpointsDeleteProxyEndpointArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayEmptyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/proxy_endpoints/{}",
args.account_id,
args.proxy_endpoint_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: ZeroTrustGatewayEmptyResponse = 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 zero_trust_gateway_rules_list_zero_trust_gateway_rules_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesListZeroTrustGatewayRulesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayRulesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/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: ZeroTrustGatewayRulesComponentsSchemasResponseCollection = 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 zero_trust_gateway_rules_create_zero_trust_gateway_rule_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesCreateZeroTrustGatewayRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/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: ZeroTrustGatewayComponentsSchemasSingleResponse = 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 zero_trust_gateway_rules_list_zero_trust_gateway_rules_tenant_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesListZeroTrustGatewayRulesTenantArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayRulesComponentsSchemasResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/rules/tenant",
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: ZeroTrustGatewayRulesComponentsSchemasResponseCollection = 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 zero_trust_gateway_rules_zero_trust_gateway_rule_details_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesZeroTrustGatewayRuleDetailsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/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: ZeroTrustGatewayComponentsSchemasSingleResponse = 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 zero_trust_gateway_rules_update_zero_trust_gateway_rule_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesUpdateZeroTrustGatewayRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/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: ZeroTrustGatewayComponentsSchemasSingleResponse = 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 zero_trust_gateway_rules_delete_zero_trust_gateway_rule_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesDeleteZeroTrustGatewayRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayEmptyResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/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: ZeroTrustGatewayEmptyResponse = 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 zero_trust_gateway_rules_reset_expiration_zero_trust_gateway_rule_request<F>(
client: DynNetClient,
args: &ZeroTrustGatewayRulesResetExpirationZeroTrustGatewayRuleArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<ZeroTrustGatewayComponentsSchemasSingleResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/gateway/rules/{}/reset_expiration",
args.account_id,
args.rule_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: ZeroTrustGatewayComponentsSchemasSingleResponse = 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 zero_trust_networks_subnets_list_request<F>(
client: DynNetClient,
args: &ZeroTrustNetworksSubnetsListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TunnelSubnetResponseCollection>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zerotrust/subnets",
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("name", args.name.as_deref());
builder = builder.query("comment", args.comment.as_deref());
builder = builder.query("network", args.network.as_deref());
builder = builder.query("existed_at", args.existed_at.as_deref());
builder = builder.query("address_family", args.address_family.as_deref());
builder = builder.query("is_default_network", args.is_default_network.as_deref());
builder = builder.query("is_deleted", args.is_deleted.as_deref());
builder = builder.query("sort_order", args.sort_order.as_deref());
builder = builder.query("subnet_types", args.subnet_types.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: TunnelSubnetResponseCollection = 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 zero_trust_networks_subnet_update_cloudflare_source_request<F>(
client: DynNetClient,
args: &ZeroTrustNetworksSubnetUpdateCloudflareSourceArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<TunnelSubnetResponseSingle>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zerotrust/subnets/cloudflare_source/{}",
args.account_id,
args.address_family,
);
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: TunnelSubnetResponseSingle = 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_risk_score_behaviors_get_request<F>(
client: DynNetClient,
args: &DlpRiskScoreBehaviorsGetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpRiskScoreBehaviorsGetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/behaviors",
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: DlpRiskScoreBehaviorsGetResponse = 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_risk_score_behaviors_put_request<F>(
client: DynNetClient,
args: &DlpRiskScoreBehaviorsPutArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpRiskScoreBehaviorsPutResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/behaviors",
args.account_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: DlpRiskScoreBehaviorsPutResponse = 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_zt_risk_score_integration_list_request<F>(
client: DynNetClient,
args: &DlpZtRiskScoreIntegrationListArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpZtRiskScoreIntegrationListResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/integrations",
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: DlpZtRiskScoreIntegrationListResponse = 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_zt_risk_score_integration_create_request<F>(
client: DynNetClient,
args: &DlpZtRiskScoreIntegrationCreateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpZtRiskScoreIntegrationCreateResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/integrations",
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: DlpZtRiskScoreIntegrationCreateResponse = 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_zt_risk_score_integration_get_by_reference_id_request<F>(
client: DynNetClient,
args: &DlpZtRiskScoreIntegrationGetByReferenceIdArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpZtRiskScoreIntegrationGetByReferenceIdResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/integrations/reference_id/{}",
args.account_id,
args.reference_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: DlpZtRiskScoreIntegrationGetByReferenceIdResponse = 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_zt_risk_score_integration_get_request<F>(
client: DynNetClient,
args: &DlpZtRiskScoreIntegrationGetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpZtRiskScoreIntegrationGetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/integrations/{}",
args.account_id,
args.integration_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: DlpZtRiskScoreIntegrationGetResponse = 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_zt_risk_score_integration_update_request<F>(
client: DynNetClient,
args: &DlpZtRiskScoreIntegrationUpdateArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpZtRiskScoreIntegrationUpdateResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/integrations/{}",
args.account_id,
args.integration_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: DlpZtRiskScoreIntegrationUpdateResponse = 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_zt_risk_score_integration_delete_request<F>(
client: DynNetClient,
args: &DlpZtRiskScoreIntegrationDeleteArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpZtRiskScoreIntegrationDeleteResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/integrations/{}",
args.account_id,
args.integration_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: DlpZtRiskScoreIntegrationDeleteResponse = 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_risk_score_summary_get_request<F>(
client: DynNetClient,
args: &DlpRiskScoreSummaryGetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<DlpRiskScoreSummaryGetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/zt_risk_scoring/summary",
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: DlpRiskScoreSummaryGetResponse = 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 })
}