use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-security-foundation")]
use objc2_security_foundation::*;
use crate::*;
pub const ODPacketSigningDisabled: c_uint = 0;
pub const ODPacketSigningAllow: c_uint = 1;
pub const ODPacketSigningRequired: c_uint = 2;
pub const ODPacketEncryptionDisabled: c_uint = 0;
pub const ODPacketEncryptionAllow: c_uint = 1;
pub const ODPacketEncryptionRequired: c_uint = 2;
pub const ODPacketEncryptionSSL: c_uint = 3;
extern "C" {
pub static ODTrustTypeJoined: Option<&'static NSString>;
}
extern "C" {
pub static ODTrustTypeUsingCredentials: Option<&'static NSString>;
}
extern "C" {
pub static ODTrustTypeAnonymous: Option<&'static NSString>;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ODConfiguration;
);
extern_conformance!(
unsafe impl NSObjectProtocol for ODConfiguration {}
);
impl ODConfiguration {
extern_methods!(
#[unsafe(method(nodeName))]
#[unsafe(method_family = none)]
pub unsafe fn nodeName(&self) -> Retained<NSString>;
#[unsafe(method(setNodeName:))]
#[unsafe(method_family = none)]
pub unsafe fn setNodeName(&self, node_name: Option<&NSString>);
#[unsafe(method(comment))]
#[unsafe(method_family = none)]
pub unsafe fn comment(&self) -> Retained<NSString>;
#[unsafe(method(setComment:))]
#[unsafe(method_family = none)]
pub unsafe fn setComment(&self, comment: Option<&NSString>);
#[cfg(feature = "ODMappings")]
#[unsafe(method(defaultMappings))]
#[unsafe(method_family = none)]
pub unsafe fn defaultMappings(&self) -> Option<Retained<ODMappings>>;
#[cfg(feature = "ODMappings")]
#[unsafe(method(setDefaultMappings:))]
#[unsafe(method_family = none)]
pub unsafe fn setDefaultMappings(&self, default_mappings: Option<&ODMappings>);
#[unsafe(method(templateName))]
#[unsafe(method_family = none)]
pub unsafe fn templateName(&self) -> Retained<NSString>;
#[unsafe(method(setTemplateName:))]
#[unsafe(method_family = none)]
pub unsafe fn setTemplateName(&self, template_name: Option<&NSString>);
#[unsafe(method(virtualSubnodes))]
#[unsafe(method_family = none)]
pub unsafe fn virtualSubnodes(&self) -> Retained<NSArray>;
#[unsafe(method(setVirtualSubnodes:))]
#[unsafe(method_family = none)]
pub unsafe fn setVirtualSubnodes(&self, virtual_subnodes: Option<&NSArray>);
#[unsafe(method(hideRegistration))]
#[unsafe(method_family = none)]
pub unsafe fn hideRegistration(&self) -> bool;
#[unsafe(method(setHideRegistration:))]
#[unsafe(method_family = none)]
pub unsafe fn setHideRegistration(&self, hide_registration: bool);
#[unsafe(method(preferredDestinationHostName))]
#[unsafe(method_family = none)]
pub unsafe fn preferredDestinationHostName(&self) -> Retained<NSString>;
#[unsafe(method(setPreferredDestinationHostName:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreferredDestinationHostName(
&self,
preferred_destination_host_name: Option<&NSString>,
);
#[unsafe(method(preferredDestinationHostPort))]
#[unsafe(method_family = none)]
pub unsafe fn preferredDestinationHostPort(&self) -> u16;
#[unsafe(method(setPreferredDestinationHostPort:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreferredDestinationHostPort(&self, preferred_destination_host_port: u16);
#[unsafe(method(trustAccount))]
#[unsafe(method_family = none)]
pub unsafe fn trustAccount(&self) -> Retained<NSString>;
#[unsafe(method(trustMetaAccount))]
#[unsafe(method_family = none)]
pub unsafe fn trustMetaAccount(&self) -> Retained<NSString>;
#[unsafe(method(trustKerberosPrincipal))]
#[unsafe(method_family = none)]
pub unsafe fn trustKerberosPrincipal(&self) -> Retained<NSString>;
#[unsafe(method(trustType))]
#[unsafe(method_family = none)]
pub unsafe fn trustType(&self) -> Retained<NSString>;
#[unsafe(method(trustUsesMutualAuthentication))]
#[unsafe(method_family = none)]
pub unsafe fn trustUsesMutualAuthentication(&self) -> bool;
#[unsafe(method(trustUsesKerberosKeytab))]
#[unsafe(method_family = none)]
pub unsafe fn trustUsesKerberosKeytab(&self) -> bool;
#[unsafe(method(trustUsesSystemKeychain))]
#[unsafe(method_family = none)]
pub unsafe fn trustUsesSystemKeychain(&self) -> bool;
#[unsafe(method(packetSigning))]
#[unsafe(method_family = none)]
pub unsafe fn packetSigning(&self) -> NSInteger;
#[unsafe(method(setPacketSigning:))]
#[unsafe(method_family = none)]
pub unsafe fn setPacketSigning(&self, packet_signing: NSInteger);
#[unsafe(method(packetEncryption))]
#[unsafe(method_family = none)]
pub unsafe fn packetEncryption(&self) -> NSInteger;
#[unsafe(method(setPacketEncryption:))]
#[unsafe(method_family = none)]
pub unsafe fn setPacketEncryption(&self, packet_encryption: NSInteger);
#[unsafe(method(manInTheMiddleProtection))]
#[unsafe(method_family = none)]
pub unsafe fn manInTheMiddleProtection(&self) -> bool;
#[unsafe(method(setManInTheMiddleProtection:))]
#[unsafe(method_family = none)]
pub unsafe fn setManInTheMiddleProtection(&self, man_in_the_middle_protection: bool);
#[unsafe(method(queryTimeoutInSeconds))]
#[unsafe(method_family = none)]
pub unsafe fn queryTimeoutInSeconds(&self) -> NSInteger;
#[unsafe(method(setQueryTimeoutInSeconds:))]
#[unsafe(method_family = none)]
pub unsafe fn setQueryTimeoutInSeconds(&self, query_timeout_in_seconds: NSInteger);
#[unsafe(method(connectionSetupTimeoutInSeconds))]
#[unsafe(method_family = none)]
pub unsafe fn connectionSetupTimeoutInSeconds(&self) -> NSInteger;
#[unsafe(method(setConnectionSetupTimeoutInSeconds:))]
#[unsafe(method_family = none)]
pub unsafe fn setConnectionSetupTimeoutInSeconds(
&self,
connection_setup_timeout_in_seconds: NSInteger,
);
#[unsafe(method(connectionIdleTimeoutInSeconds))]
#[unsafe(method_family = none)]
pub unsafe fn connectionIdleTimeoutInSeconds(&self) -> NSInteger;
#[unsafe(method(setConnectionIdleTimeoutInSeconds:))]
#[unsafe(method_family = none)]
pub unsafe fn setConnectionIdleTimeoutInSeconds(
&self,
connection_idle_timeout_in_seconds: NSInteger,
);
#[unsafe(method(defaultModuleEntries))]
#[unsafe(method_family = none)]
pub unsafe fn defaultModuleEntries(&self) -> Retained<NSArray>;
#[unsafe(method(setDefaultModuleEntries:))]
#[unsafe(method_family = none)]
pub unsafe fn setDefaultModuleEntries(&self, default_module_entries: Option<&NSArray>);
#[unsafe(method(authenticationModuleEntries))]
#[unsafe(method_family = none)]
pub unsafe fn authenticationModuleEntries(&self) -> Retained<NSArray>;
#[unsafe(method(setAuthenticationModuleEntries:))]
#[unsafe(method_family = none)]
pub unsafe fn setAuthenticationModuleEntries(
&self,
authentication_module_entries: Option<&NSArray>,
);
#[unsafe(method(discoveryModuleEntries))]
#[unsafe(method_family = none)]
pub unsafe fn discoveryModuleEntries(&self) -> Retained<NSArray>;
#[unsafe(method(setDiscoveryModuleEntries:))]
#[unsafe(method_family = none)]
pub unsafe fn setDiscoveryModuleEntries(&self, discovery_module_entries: Option<&NSArray>);
#[unsafe(method(generalModuleEntries))]
#[unsafe(method_family = none)]
pub unsafe fn generalModuleEntries(&self) -> Retained<NSArray>;
#[unsafe(method(setGeneralModuleEntries:))]
#[unsafe(method_family = none)]
pub unsafe fn setGeneralModuleEntries(&self, general_module_entries: Option<&NSArray>);
#[unsafe(method(configuration))]
#[unsafe(method_family = none)]
pub unsafe fn configuration() -> Option<Retained<Self>>;
#[unsafe(method(suggestedTrustAccount:))]
#[unsafe(method_family = none)]
pub unsafe fn suggestedTrustAccount(
hostname: Option<&NSString>,
) -> Option<Retained<NSString>>;
#[unsafe(method(suggestedTrustPassword:))]
#[unsafe(method_family = none)]
pub unsafe fn suggestedTrustPassword(length: usize) -> Option<Retained<NSString>>;
#[cfg(feature = "objc2-security-foundation")]
#[unsafe(method(saveUsingAuthorization:error:))]
#[unsafe(method_family = none)]
pub unsafe fn saveUsingAuthorization_error(
&self,
authorization: Option<&SFAuthorization>,
error: Option<&mut Option<Retained<NSError>>>,
) -> bool;
#[unsafe(method(addTrustType:trustAccount:trustPassword:username:password:joinExisting:error:))]
#[unsafe(method_family = none)]
pub unsafe fn addTrustType_trustAccount_trustPassword_username_password_joinExisting_error(
&self,
trust_type: Option<&NSString>,
account: Option<&NSString>,
account_password: Option<&NSString>,
username: Option<&NSString>,
password: Option<&NSString>,
join: bool,
error: Option<&mut Option<Retained<NSError>>>,
) -> bool;
#[unsafe(method(removeTrustUsingUsername:password:deleteTrustAccount:error:))]
#[unsafe(method_family = none)]
pub unsafe fn removeTrustUsingUsername_password_deleteTrustAccount_error(
&self,
username: Option<&NSString>,
password: Option<&NSString>,
delete_account: bool,
error: Option<&mut Option<Retained<NSError>>>,
) -> bool;
);
}
impl ODConfiguration {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}