objc2_open_directory/generated/CFOpenDirectory/
CFODNode.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2-core-foundation")]
5use objc2_core_foundation::*;
6
7use crate::*;
8
9#[cfg(feature = "objc2-core-foundation")]
10unsafe impl ConcreteType for ODNodeRef {
11    /// Standard GetTypeID function support for CF-based objects
12    ///
13    /// Returns the typeID for the ODNode objects
14    ///
15    /// Returns: a valid CFTypeID for the ODNode object
16    #[doc(alias = "ODNodeGetTypeID")]
17    #[inline]
18    fn type_id() -> CFTypeID {
19        extern "C-unwind" {
20            fn ODNodeGetTypeID() -> CFTypeID;
21        }
22        unsafe { ODNodeGetTypeID() }
23    }
24}
25
26impl ODNodeRef {
27    /// Creates an ODNodeRef based on a specific node type
28    ///
29    /// Creates an ODNodeRef based on a specific node type
30    ///
31    /// Parameter `allocator`: a memory allocator to use for this object
32    ///
33    /// Parameter `session`: an ODSessionRef, either kODSessionDefault or a valid ODSessionRef can be passed
34    ///
35    /// Parameter `nodeType`: an ODNodeType of the node to open
36    ///
37    /// Parameter `error`: an optional CFErrorRef reference for error details
38    ///
39    /// Returns: a valid ODNodeRef if successful, otherwise returns NULL.  outError can be checked for details upon
40    /// failure.
41    ///
42    /// # Safety
43    ///
44    /// - `allocator` might not allow `None`.
45    /// - `session` might not allow `None`.
46    /// - `error` must be a valid pointer.
47    #[doc(alias = "ODNodeCreateWithNodeType")]
48    #[cfg(all(
49        feature = "CFOpenDirectoryConstants",
50        feature = "objc2-core-foundation"
51    ))]
52    #[inline]
53    pub unsafe fn with_node_type(
54        allocator: Option<&CFAllocator>,
55        session: Option<&ODSessionRef>,
56        node_type: ODNodeType,
57        error: *mut *mut CFError,
58    ) -> Option<CFRetained<ODNodeRef>> {
59        extern "C-unwind" {
60            fn ODNodeCreateWithNodeType(
61                allocator: Option<&CFAllocator>,
62                session: Option<&ODSessionRef>,
63                node_type: ODNodeType,
64                error: *mut *mut CFError,
65            ) -> Option<NonNull<ODNodeRef>>;
66        }
67        let ret = unsafe { ODNodeCreateWithNodeType(allocator, session, node_type, error) };
68        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
69    }
70
71    /// Creates an ODNodeRef based on a partciular node name
72    ///
73    /// Creates an ODNodeRef based on a particular node name
74    ///
75    /// Parameter `allocator`: a memory allocator to use for this object
76    ///
77    /// Parameter `session`: an ODSessionRef, either kODSessionDefault or a valid ODSessionRef can be passed
78    ///
79    /// Parameter `nodeName`: a CFStringRef of the name of the node to open
80    ///
81    /// Parameter `error`: an optional CFErrorRef reference for error details
82    ///
83    /// Returns: a valid ODNodeRef if successful, otherwise returns NULL. outError can be checked for specific
84    /// error
85    ///
86    /// # Safety
87    ///
88    /// - `allocator` might not allow `None`.
89    /// - `session` might not allow `None`.
90    /// - `node_name` might not allow `None`.
91    /// - `error` must be a valid pointer.
92    #[doc(alias = "ODNodeCreateWithName")]
93    #[cfg(feature = "objc2-core-foundation")]
94    #[inline]
95    pub unsafe fn with_name(
96        allocator: Option<&CFAllocator>,
97        session: Option<&ODSessionRef>,
98        node_name: Option<&CFString>,
99        error: *mut *mut CFError,
100    ) -> Option<CFRetained<ODNodeRef>> {
101        extern "C-unwind" {
102            fn ODNodeCreateWithName(
103                allocator: Option<&CFAllocator>,
104                session: Option<&ODSessionRef>,
105                node_name: Option<&CFString>,
106                error: *mut *mut CFError,
107            ) -> Option<NonNull<ODNodeRef>>;
108        }
109        let ret = unsafe { ODNodeCreateWithName(allocator, session, node_name, error) };
110        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
111    }
112
113    /// Creates a copy, including any remote credentials used for Proxy and/or Node authentication
114    ///
115    /// Creates a copy of the object including all credentials used for the original.  Can be used for future
116    /// references to the same node setup.
117    ///
118    /// Parameter `allocator`: a memory allocator to use for this object
119    ///
120    /// Parameter `node`: an ODNodeRef to make a copy of
121    ///
122    /// Parameter `error`: an optional CFErrorRef reference for error details
123    ///
124    /// Returns: a valid ODNodeRef if successful, otherwise returns NULL, with outError set to a CFErrorRef
125    ///
126    /// # Safety
127    ///
128    /// - `allocator` might not allow `None`.
129    /// - `node` might not allow `None`.
130    /// - `error` must be a valid pointer.
131    #[doc(alias = "ODNodeCreateCopy")]
132    #[cfg(feature = "objc2-core-foundation")]
133    #[inline]
134    pub unsafe fn new_copy(
135        allocator: Option<&CFAllocator>,
136        node: Option<&ODNodeRef>,
137        error: *mut *mut CFError,
138    ) -> Option<CFRetained<ODNodeRef>> {
139        extern "C-unwind" {
140            fn ODNodeCreateCopy(
141                allocator: Option<&CFAllocator>,
142                node: Option<&ODNodeRef>,
143                error: *mut *mut CFError,
144            ) -> Option<NonNull<ODNodeRef>>;
145        }
146        let ret = unsafe { ODNodeCreateCopy(allocator, node, error) };
147        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
148    }
149
150    /// Returns a CFArray of subnode names for this node, which may contain sub-nodes or search policy nodes
151    ///
152    /// Returns a CFArray of subnode names for this node, which may contain sub-nodes or search policy nodes.
153    /// Commonly used with Search policy nodes.
154    ///
155    /// Parameter `node`: an ODNodeRef to use
156    ///
157    /// Parameter `error`: an optional CFErrorRef reference for error details
158    ///
159    /// Returns: a CFArrayRef with the list of nodes, otherwise NULL, with outError set to a CFErrorRef
160    ///
161    /// # Safety
162    ///
163    /// `error` must be a valid pointer.
164    #[doc(alias = "ODNodeCopySubnodeNames")]
165    #[cfg(feature = "objc2-core-foundation")]
166    #[inline]
167    pub unsafe fn subnode_names(&self, error: *mut *mut CFError) -> Option<CFRetained<CFArray>> {
168        extern "C-unwind" {
169            fn ODNodeCopySubnodeNames(
170                node: &ODNodeRef,
171                error: *mut *mut CFError,
172            ) -> Option<NonNull<CFArray>>;
173        }
174        let ret = unsafe { ODNodeCopySubnodeNames(self, error) };
175        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
176    }
177
178    /// Will return names of subnodes that are not currently reachable.
179    ///
180    /// Will return names of subnodes that are not currently reachable.  Commonly used with Search policy nodes
181    /// to determine if any nodes are currently unreachable, but may also return other subnodes if the
182    /// Open Directory plugin supports.
183    ///
184    /// Parameter `node`: an ODNodeRef to use
185    ///
186    /// Parameter `error`: an optional CFErrorRef reference for error details
187    ///
188    /// Returns: a CFArrayRef with the list of unreachable nodes or NULL if no bad nodes
189    ///
190    /// # Safety
191    ///
192    /// `error` must be a valid pointer.
193    #[doc(alias = "ODNodeCopyUnreachableSubnodeNames")]
194    #[cfg(feature = "objc2-core-foundation")]
195    #[inline]
196    pub unsafe fn unreachable_subnode_names(
197        &self,
198        error: *mut *mut CFError,
199    ) -> Option<CFRetained<CFArray>> {
200        extern "C-unwind" {
201            fn ODNodeCopyUnreachableSubnodeNames(
202                node: &ODNodeRef,
203                error: *mut *mut CFError,
204            ) -> Option<NonNull<CFArray>>;
205        }
206        let ret = unsafe { ODNodeCopyUnreachableSubnodeNames(self, error) };
207        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
208    }
209
210    /// Returns the node name of the node that was opened
211    ///
212    /// Returns the node name of the node that was opened
213    ///
214    /// Parameter `node`: an ODNodeRef to use
215    ///
216    /// Returns: a CFStringRef of the node name that is current or NULL if no open node
217    #[doc(alias = "ODNodeGetName")]
218    #[cfg(feature = "objc2-core-foundation")]
219    #[inline]
220    pub unsafe fn name(&self) -> Option<CFRetained<CFString>> {
221        extern "C-unwind" {
222            fn ODNodeGetName(node: &ODNodeRef) -> Option<NonNull<CFString>>;
223        }
224        let ret = unsafe { ODNodeGetName(self) };
225        ret.map(|ret| unsafe { CFRetained::retain(ret) })
226    }
227
228    /// Returns a dictionary with details about the node in dictionary form
229    ///
230    /// Returns a dictionary with details about the node in dictionary form.
231    ///
232    /// Parameter `node`: an ODNodeRef to use
233    ///
234    /// Parameter `keys`: a CFArrayRef listing the keys the user wants returned, such as
235    /// kODAttributeTypeStreet
236    ///
237    /// Parameter `error`: an optional CFErrorRef reference for error details
238    ///
239    /// Returns: a CFDictionaryRef containing the requested key and values in form of a CFArray
240    ///
241    /// # Safety
242    ///
243    /// - `keys` generic must be of the correct type.
244    /// - `keys` might not allow `None`.
245    /// - `error` must be a valid pointer.
246    #[doc(alias = "ODNodeCopyDetails")]
247    #[cfg(feature = "objc2-core-foundation")]
248    #[inline]
249    pub unsafe fn details(
250        &self,
251        keys: Option<&CFArray>,
252        error: *mut *mut CFError,
253    ) -> Option<CFRetained<CFDictionary>> {
254        extern "C-unwind" {
255            fn ODNodeCopyDetails(
256                node: &ODNodeRef,
257                keys: Option<&CFArray>,
258                error: *mut *mut CFError,
259            ) -> Option<NonNull<CFDictionary>>;
260        }
261        let ret = unsafe { ODNodeCopyDetails(self, keys, error) };
262        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
263    }
264
265    /// Returns a CFArrayRef of the record types supported by this node.
266    ///
267    /// Returns a CFArrayRef of the record types supported by this node.  If node does not support the check
268    /// then all possible types will be returned.
269    ///
270    /// Parameter `node`: an ODNodeRef to use
271    ///
272    /// Parameter `error`: an optional CFErrorRef reference for error details
273    ///
274    /// Returns: a valid CFArrayRef of CFStrings listing the supported Record types on this node.
275    ///
276    /// # Safety
277    ///
278    /// `error` must be a valid pointer.
279    #[doc(alias = "ODNodeCopySupportedRecordTypes")]
280    #[cfg(feature = "objc2-core-foundation")]
281    #[inline]
282    pub unsafe fn supported_record_types(
283        &self,
284        error: *mut *mut CFError,
285    ) -> Option<CFRetained<CFArray>> {
286        extern "C-unwind" {
287            fn ODNodeCopySupportedRecordTypes(
288                node: &ODNodeRef,
289                error: *mut *mut CFError,
290            ) -> Option<NonNull<CFArray>>;
291        }
292        let ret = unsafe { ODNodeCopySupportedRecordTypes(self, error) };
293        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
294    }
295
296    /// Will return a list of attribute types supported for that attribute if possible
297    ///
298    /// Will return a list of attribute types supported for that attribute if possible.  If no specific
299    /// types are available, then all possible values will be returned instead.
300    ///
301    /// Parameter `node`: an ODNodeRef to use
302    ///
303    /// Parameter `recordType`: a ODRecordTypeRef with the type of record to check attribute types.  If NULL is passed it will
304    /// return all possible attributes that are available.
305    ///
306    /// Parameter `error`: an optional CFErrorRef reference for error details
307    ///
308    /// Returns: a valid CFArrayRef of CFStrings listing the attributes supported for the requested record type
309    ///
310    /// # Safety
311    ///
312    /// - `record_type` might not allow `None`.
313    /// - `error` must be a valid pointer.
314    #[doc(alias = "ODNodeCopySupportedAttributes")]
315    #[cfg(all(
316        feature = "CFOpenDirectoryConstants",
317        feature = "objc2-core-foundation"
318    ))]
319    #[inline]
320    pub unsafe fn supported_attributes(
321        &self,
322        record_type: Option<&ODRecordType>,
323        error: *mut *mut CFError,
324    ) -> Option<CFRetained<CFArray>> {
325        extern "C-unwind" {
326            fn ODNodeCopySupportedAttributes(
327                node: &ODNodeRef,
328                record_type: Option<&ODRecordType>,
329                error: *mut *mut CFError,
330            ) -> Option<NonNull<CFArray>>;
331        }
332        let ret = unsafe { ODNodeCopySupportedAttributes(self, record_type, error) };
333        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
334    }
335
336    /// Sets the credentials for interaction with the ODNode
337    ///
338    /// Sets the credentials for interaction with the ODNode.  Record references, etc. will use these credentials
339    /// to query or change data.  Setting the credentials on a node referenced by other OD object types will
340    /// change the credentials for all for all references.
341    ///
342    /// Parameter `node`: an ODNodeRef to use
343    ///
344    /// Parameter `recordType`: a ODRecordTypeRef of the Record Type to use, if NULL is passed, defaults to a
345    /// kODRecordTypeUsers
346    ///
347    /// Parameter `recordName`: a CFString of the username to be used for this node authentication
348    ///
349    /// Parameter `password`: a CFString of the password to be used for this node authentication
350    ///
351    /// Parameter `error`: an optional CFErrorRef reference for error details
352    ///
353    /// Returns: returns true on success, otherwise outError can be checked for details.  If the authentication failed,
354    /// the previous credentials are used.
355    ///
356    /// # Safety
357    ///
358    /// - `record_type` might not allow `None`.
359    /// - `record_name` might not allow `None`.
360    /// - `password` might not allow `None`.
361    /// - `error` must be a valid pointer.
362    #[doc(alias = "ODNodeSetCredentials")]
363    #[cfg(all(
364        feature = "CFOpenDirectoryConstants",
365        feature = "objc2-core-foundation"
366    ))]
367    #[inline]
368    pub unsafe fn set_credentials(
369        &self,
370        record_type: Option<&ODRecordType>,
371        record_name: Option<&CFString>,
372        password: Option<&CFString>,
373        error: *mut *mut CFError,
374    ) -> bool {
375        extern "C-unwind" {
376            fn ODNodeSetCredentials(
377                node: &ODNodeRef,
378                record_type: Option<&ODRecordType>,
379                record_name: Option<&CFString>,
380                password: Option<&CFString>,
381                error: *mut *mut CFError,
382            ) -> bool;
383        }
384        unsafe { ODNodeSetCredentials(self, record_type, record_name, password, error) }
385    }
386
387    /// Allows use of other Open Directory types of authentications to set the credentials for an ODNode
388    ///
389    /// Allows the caller to use other types of authentications that are available in Open Directory, that may
390    /// require response-request loops, etc.  Not all OD plugins will support this call, look for
391    /// kODErrorCredentialsMethodNotSupported in outError.
392    ///
393    /// Parameter `node`: an ODNodeRef to use
394    ///
395    /// Parameter `recordType`: a ODRecordType of the type of record to do the authentication with
396    ///
397    /// Parameter `authType`: a ODAuthenticationType of the type of authentication to be used (e.g., kDSStdAuthNTLMv2)
398    ///
399    /// Parameter `authItems`: a CFArray of CFData or CFString items that will be sent in order to the auth process
400    ///
401    /// Parameter `outAuthItems`: will be assigned to a pointer of a CFArray of CFData items if there are returned values
402    ///
403    /// Parameter `outContext`: will return a pointer to a context if caller supplies a container, and the call requires a
404    /// context.  If a non-NULL value is returned, then more calls must be made with the Context to continue
405    /// the authorization.
406    ///
407    /// Parameter `error`: an optional CFErrorRef reference for error details
408    ///
409    /// Returns: a bool will be returned with the result of the operation and outAuthItems set with response items
410    /// and outContext set for any needed continuation.
411    ///
412    /// # Safety
413    ///
414    /// - `record_type` might not allow `None`.
415    /// - `auth_type` might not allow `None`.
416    /// - `auth_items` generic must be of the correct type.
417    /// - `auth_items` might not allow `None`.
418    /// - `out_auth_items` must be a valid pointer.
419    /// - `out_context` must be a valid pointer.
420    /// - `error` must be a valid pointer.
421    #[doc(alias = "ODNodeSetCredentialsExtended")]
422    #[cfg(all(
423        feature = "CFOpenDirectoryConstants",
424        feature = "objc2-core-foundation"
425    ))]
426    #[inline]
427    pub unsafe fn set_credentials_extended(
428        &self,
429        record_type: Option<&ODRecordType>,
430        auth_type: Option<&ODAuthenticationType>,
431        auth_items: Option<&CFArray>,
432        out_auth_items: *mut *const CFArray,
433        out_context: *mut *const ODContextRef,
434        error: *mut *mut CFError,
435    ) -> bool {
436        extern "C-unwind" {
437            fn ODNodeSetCredentialsExtended(
438                node: &ODNodeRef,
439                record_type: Option<&ODRecordType>,
440                auth_type: Option<&ODAuthenticationType>,
441                auth_items: Option<&CFArray>,
442                out_auth_items: *mut *const CFArray,
443                out_context: *mut *const ODContextRef,
444                error: *mut *mut CFError,
445            ) -> bool;
446        }
447        unsafe {
448            ODNodeSetCredentialsExtended(
449                self,
450                record_type,
451                auth_type,
452                auth_items,
453                out_auth_items,
454                out_context,
455                error,
456            )
457        }
458    }
459
460    /// Unsupported function.
461    ///
462    /// Unsupported function.
463    ///
464    /// # Safety
465    ///
466    /// - `cache_name` might not allow `None`.
467    /// - `error` must be a valid pointer.
468    #[doc(alias = "ODNodeSetCredentialsUsingKerberosCache")]
469    #[cfg(feature = "objc2-core-foundation")]
470    #[deprecated]
471    #[inline]
472    pub unsafe fn set_credentials_using_kerberos_cache(
473        &self,
474        cache_name: Option<&CFString>,
475        error: *mut *mut CFError,
476    ) -> bool {
477        extern "C-unwind" {
478            fn ODNodeSetCredentialsUsingKerberosCache(
479                node: &ODNodeRef,
480                cache_name: Option<&CFString>,
481                error: *mut *mut CFError,
482            ) -> bool;
483        }
484        unsafe { ODNodeSetCredentialsUsingKerberosCache(self, cache_name, error) }
485    }
486
487    /// Takes a record and all of the provided attributes and creates the record in the node
488    ///
489    /// Takes all the provided attributes and type to create an entire record.  The function will assign a
490    /// UUID to the record automatically.  This UUID can be overwritten by the client by passing with the
491    /// other attributes.
492    ///
493    /// Parameter `node`: an ODNodeRef to use
494    ///
495    /// Parameter `recordType`: a ODRecordTypeRef of the type of record (e.g., kODRecordTypeUsers, etc.)
496    ///
497    /// Parameter `recordName`: a CFStringRef of the name of record
498    ///
499    /// Parameter `attributeDict`: a CFDictionaryRef of key-value pairs for attribute values.  The key is a CFStringRef of the
500    /// attribute name or ODRecordType constant such as kODAttributeTypeRecordName.  The value must be a CFArrayRef of
501    /// CFDataRef or CFStringRef.  If additional kODAttributeTypeRecordName are to be set, they can be passed in the
502    /// inAttributes list.  This parameter is optional and can be NULL.  If any of the attributes passed
503    /// fail to be set, the record will be deleted and outError will be set with the appropriate error.
504    ///
505    /// Parameter `error`: an optional CFErrorRef reference for error details
506    ///
507    /// Returns: returns a valid ODRecordRef.  If the add fails, outError can be checked for details.
508    ///
509    /// # Safety
510    ///
511    /// - `record_type` might not allow `None`.
512    /// - `record_name` might not allow `None`.
513    /// - `attribute_dict` generics must be of the correct type.
514    /// - `attribute_dict` might not allow `None`.
515    /// - `error` must be a valid pointer.
516    #[doc(alias = "ODNodeCreateRecord")]
517    #[cfg(all(
518        feature = "CFOpenDirectoryConstants",
519        feature = "objc2-core-foundation"
520    ))]
521    #[inline]
522    pub unsafe fn create_record(
523        &self,
524        record_type: Option<&ODRecordType>,
525        record_name: Option<&CFString>,
526        attribute_dict: Option<&CFDictionary>,
527        error: *mut *mut CFError,
528    ) -> Option<CFRetained<ODRecordRef>> {
529        extern "C-unwind" {
530            fn ODNodeCreateRecord(
531                node: &ODNodeRef,
532                record_type: Option<&ODRecordType>,
533                record_name: Option<&CFString>,
534                attribute_dict: Option<&CFDictionary>,
535                error: *mut *mut CFError,
536            ) -> Option<NonNull<ODRecordRef>>;
537        }
538        let ret =
539            unsafe { ODNodeCreateRecord(self, record_type, record_name, attribute_dict, error) };
540        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
541    }
542
543    /// Simple API to open / create a references to a particular record on a Node
544    ///
545    /// Simple API to open / create a references to a particular record on a Node
546    ///
547    /// Parameter `node`: an ODNodeRef to use
548    ///
549    /// Parameter `recordType`: a ODRecordTypeRef of the record type to copy
550    ///
551    /// Parameter `recordName`: a CFStringRef of the record name to copy
552    ///
553    /// Parameter `attributes`: (optional) a CFArrayRef (or single ODAttributeType) of the attributes to copy from the directory.  Can be NULL when no
554    /// attributes are needed.  Any standard types can be passed, for example
555    /// kODAttributeTypeAllAttributes will fetch all attributes up front.  If just standard attributes are needed, then
556    /// kODAttributeTypeStandardOnly can be passed.
557    ///
558    /// Parameter `error`: an optional CFErrorRef reference for error details
559    ///
560    /// Returns: returns a valid ODRecordRef.  If the record copy fails, the error can be checked for details.
561    /// If the record is not found, will return NULL with a NULL error.
562    ///
563    /// # Safety
564    ///
565    /// - `record_type` might not allow `None`.
566    /// - `record_name` might not allow `None`.
567    /// - `attributes` should be of the correct type.
568    /// - `attributes` might not allow `None`.
569    /// - `error` must be a valid pointer.
570    #[doc(alias = "ODNodeCopyRecord")]
571    #[cfg(all(
572        feature = "CFOpenDirectoryConstants",
573        feature = "objc2-core-foundation"
574    ))]
575    #[inline]
576    pub unsafe fn copy_record(
577        &self,
578        record_type: Option<&ODRecordType>,
579        record_name: Option<&CFString>,
580        attributes: Option<&CFType>,
581        error: *mut *mut CFError,
582    ) -> Option<CFRetained<ODRecordRef>> {
583        extern "C-unwind" {
584            fn ODNodeCopyRecord(
585                node: &ODNodeRef,
586                record_type: Option<&ODRecordType>,
587                record_name: Option<&CFString>,
588                attributes: Option<&CFType>,
589                error: *mut *mut CFError,
590            ) -> Option<NonNull<ODRecordRef>>;
591        }
592        let ret = unsafe { ODNodeCopyRecord(self, record_type, record_name, attributes, error) };
593        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
594    }
595
596    /// Sends a custom call to a node.
597    ///
598    /// This will send a custom call to a node along with the specified data, returning the result.
599    ///
600    /// Parameter `node`: an ODNodeRef to use
601    ///
602    /// Parameter `customCode`: the custom code to be sent to the node
603    ///
604    /// Parameter `data`: a data blob expected by the custom code, can be NULL of no send data
605    ///
606    /// Parameter `error`: an optional CFErrorRef reference for error details
607    ///
608    /// Returns: a CFDataRef with the result of the operation, otherwise outError can be checked for specific details
609    ///
610    /// # Safety
611    ///
612    /// - `data` might not allow `None`.
613    /// - `error` must be a valid pointer.
614    #[doc(alias = "ODNodeCustomCall")]
615    #[cfg(feature = "objc2-core-foundation")]
616    #[inline]
617    pub unsafe fn custom_call(
618        &self,
619        custom_code: CFIndex,
620        data: Option<&CFData>,
621        error: *mut *mut CFError,
622    ) -> Option<CFRetained<CFData>> {
623        extern "C-unwind" {
624            fn ODNodeCustomCall(
625                node: &ODNodeRef,
626                custom_code: CFIndex,
627                data: Option<&CFData>,
628                error: *mut *mut CFError,
629            ) -> Option<NonNull<CFData>>;
630        }
631        let ret = unsafe { ODNodeCustomCall(self, custom_code, data, error) };
632        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
633    }
634
635    /// Sends a named custom function call to a node.
636    ///
637    ///
638    /// Sends a named custom function call to a node.  Custom functions are defined by the modules that implement them
639    /// and the parameter is defined by the module.
640    ///
641    ///
642    /// Parameter `node`: An ODNodeRef to use
643    ///
644    ///
645    /// Parameter `function`: A CFStringRef that specifies the name of the function
646    ///
647    ///
648    /// Parameter `payload`: A CFType appropriate for the custom function.  The type is dictated by the module implementing the function.
649    ///
650    ///
651    /// Parameter `error`: An optional CFErrorRef reference to receive any errors from the custom function call.
652    ///
653    ///
654    /// Returns: Returns a CFType appropriate for the function.
655    ///
656    /// # Safety
657    ///
658    /// - `function` might not allow `None`.
659    /// - `payload` should be of the correct type.
660    /// - `payload` might not allow `None`.
661    /// - `error` must be a valid pointer.
662    #[doc(alias = "ODNodeCustomFunction")]
663    #[cfg(feature = "objc2-core-foundation")]
664    #[inline]
665    pub unsafe fn custom_function(
666        &self,
667        function: Option<&CFString>,
668        payload: Option<&CFType>,
669        error: *mut *mut CFError,
670    ) -> Option<CFRetained<CFType>> {
671        extern "C-unwind" {
672            fn ODNodeCustomFunction(
673                node: &ODNodeRef,
674                function: Option<&CFString>,
675                payload: Option<&CFType>,
676                error: *mut *mut CFError,
677            ) -> Option<NonNull<CFType>>;
678        }
679        let ret = unsafe { ODNodeCustomFunction(self, function, payload, error) };
680        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
681    }
682
683    /// This will copy any policies configured for the node.
684    ///
685    /// This will copy any policies configured for the node.
686    ///
687    /// Parameter `node`: an ODNodeRef to use
688    ///
689    /// Parameter `error`: an optional CFErrorRef reference for error details
690    ///
691    /// Returns: a CFDictionaryRef containing all currently set policies
692    ///
693    /// # Safety
694    ///
695    /// `error` must be a valid pointer.
696    #[doc(alias = "ODNodeCopyPolicies")]
697    #[cfg(feature = "objc2-core-foundation")]
698    #[deprecated = "use ODNodeCopyAccountPolicies"]
699    #[inline]
700    pub unsafe fn policies(&self, error: *mut *mut CFError) -> Option<CFRetained<CFDictionary>> {
701        extern "C-unwind" {
702            fn ODNodeCopyPolicies(
703                node: &ODNodeRef,
704                error: *mut *mut CFError,
705            ) -> Option<NonNull<CFDictionary>>;
706        }
707        let ret = unsafe { ODNodeCopyPolicies(self, error) };
708        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
709    }
710
711    /// This will return a dictionary of supported policies.
712    ///
713    /// This will return a dictionary of supported policies, if appropriate, the value will be the maximum value allowed
714    /// for the policy in question.  For example, if password history is available, it will state how much history is
715    /// supported.
716    ///
717    /// Parameter `node`: an ODNodeRef to use
718    ///
719    /// Parameter `error`: an optional CFErrorRef reference for error details
720    ///
721    /// Returns: a CFDictionaryRef containing all currently supported policies.  The values will be the maximum value allowed.
722    ///
723    /// # Safety
724    ///
725    /// `error` must be a valid pointer.
726    #[doc(alias = "ODNodeCopySupportedPolicies")]
727    #[cfg(feature = "objc2-core-foundation")]
728    #[deprecated]
729    #[inline]
730    pub unsafe fn supported_policies(
731        &self,
732        error: *mut *mut CFError,
733    ) -> Option<CFRetained<CFDictionary>> {
734        extern "C-unwind" {
735            fn ODNodeCopySupportedPolicies(
736                node: &ODNodeRef,
737                error: *mut *mut CFError,
738            ) -> Option<NonNull<CFDictionary>>;
739        }
740        let ret = unsafe { ODNodeCopySupportedPolicies(self, error) };
741        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
742    }
743
744    /// This will set the policy for the node.
745    ///
746    /// This will set the policy for the node.  Policies are evaluated in combination with record-level policies.
747    ///
748    /// Parameter `node`: an ODNodeRef to use
749    ///
750    /// Parameter `policies`: a CFDictionary of policies to be set
751    ///
752    /// Parameter `error`: an optional CFErrorRef reference for error details
753    ///
754    /// Returns: a bool which signifies if the policy set succeeded, otherwise error is set.
755    ///
756    /// # Safety
757    ///
758    /// - `policies` generics must be of the correct type.
759    /// - `policies` might not allow `None`.
760    /// - `error` must be a valid pointer.
761    #[doc(alias = "ODNodeSetPolicies")]
762    #[cfg(feature = "objc2-core-foundation")]
763    #[deprecated = "use ODNodeSetAccountPolicies"]
764    #[inline]
765    pub unsafe fn set_policies(
766        &self,
767        policies: Option<&CFDictionary>,
768        error: *mut *mut CFError,
769    ) -> bool {
770        extern "C-unwind" {
771            fn ODNodeSetPolicies(
772                node: &ODNodeRef,
773                policies: Option<&CFDictionary>,
774                error: *mut *mut CFError,
775            ) -> bool;
776        }
777        unsafe { ODNodeSetPolicies(self, policies, error) }
778    }
779
780    /// This will set a specific policy setting for the node.
781    ///
782    /// This will set a specific policy setting for the node.
783    ///
784    /// Parameter `node`: an ODNodeRef to use
785    ///
786    /// Parameter `policy`: a valid ODPolicyType
787    ///
788    /// Parameter `value`: a CFTypeRef to be set (should be of appropriate type for the policy)
789    ///
790    /// Parameter `error`: an optional CFErrorRef reference for error details
791    ///
792    /// Returns: a bool which signifies if the policy set succeeded, otherwise error is set.
793    ///
794    /// # Safety
795    ///
796    /// - `policy_type` might not allow `None`.
797    /// - `value` should be of the correct type.
798    /// - `value` might not allow `None`.
799    /// - `error` must be a valid pointer.
800    #[doc(alias = "ODNodeSetPolicy")]
801    #[cfg(all(
802        feature = "CFOpenDirectoryConstants",
803        feature = "objc2-core-foundation"
804    ))]
805    #[deprecated = "use ODNodeAddAccountPolicy"]
806    #[inline]
807    pub unsafe fn set_policy(
808        &self,
809        policy_type: Option<&ODPolicyType>,
810        value: Option<&CFType>,
811        error: *mut *mut CFError,
812    ) -> bool {
813        extern "C-unwind" {
814            fn ODNodeSetPolicy(
815                node: &ODNodeRef,
816                policy_type: Option<&ODPolicyType>,
817                value: Option<&CFType>,
818                error: *mut *mut CFError,
819            ) -> bool;
820        }
821        unsafe { ODNodeSetPolicy(self, policy_type, value, error) }
822    }
823
824    /// This will remove a specific policy setting from the node.
825    ///
826    /// This will remove a specific policy setting from the node.
827    ///
828    /// Parameter `node`: an ODNodeRef to use
829    ///
830    /// Parameter `policy`: a valid ODPolicyType
831    ///
832    /// Parameter `error`: an optional CFErrorRef reference for error details
833    ///
834    /// Returns: a bool which signifies if the policy removal succeeded, otherwise error is set.
835    ///
836    /// # Safety
837    ///
838    /// - `policy_type` might not allow `None`.
839    /// - `error` must be a valid pointer.
840    #[doc(alias = "ODNodeRemovePolicy")]
841    #[cfg(all(
842        feature = "CFOpenDirectoryConstants",
843        feature = "objc2-core-foundation"
844    ))]
845    #[deprecated = "use ODNodeRemoveAccountPolicy"]
846    #[inline]
847    pub unsafe fn remove_policy(
848        &self,
849        policy_type: Option<&ODPolicyType>,
850        error: *mut *mut CFError,
851    ) -> bool {
852        extern "C-unwind" {
853            fn ODNodeRemovePolicy(
854                node: &ODNodeRef,
855                policy_type: Option<&ODPolicyType>,
856                error: *mut *mut CFError,
857            ) -> bool;
858        }
859        unsafe { ODNodeRemovePolicy(self, policy_type, error) }
860    }
861
862    /// This will add an account policy to the node for the specified category.
863    ///
864    /// This will add an account policy to the node for the specified category.
865    /// The specified policy will be applied to all users in the
866    /// specified node when policies are evaluated.
867    ///
868    /// Parameter `node`: an ODNodeRef to use.
869    ///
870    /// Parameter `policy`: a dictionary containing the specific policy to be added.
871    /// The dictionary may contain the following keys:
872    /// kODPolicyKeyIdentifier a required key identifying the policy.
873    /// kODPolicyKeyParameters an optional key containing a dictionary of
874    /// parameters that can be used for informational purposes or in
875    /// the policy format string.
876    /// kODPolicyKeyContent a required key specifying the policy,
877    /// from which a predicate will be created for evaluating
878    /// the policy.
879    ///
880    /// Parameter `category`: a valid ODPolicyCategoryType to which the specified policy will be added.
881    ///
882    /// Parameter `error`: an optional CFErrorRef reference for error details.
883    ///
884    /// Returns: a bool which signifies if the policy addition succeeded, otherwise error is set.
885    ///
886    /// # Safety
887    ///
888    /// - `policy` generics must be of the correct type.
889    /// - `policy` might not allow `None`.
890    /// - `category` might not allow `None`.
891    /// - `error` must be a valid pointer.
892    #[doc(alias = "ODNodeAddAccountPolicy")]
893    #[cfg(all(
894        feature = "CFOpenDirectoryConstants",
895        feature = "objc2-core-foundation"
896    ))]
897    #[inline]
898    pub unsafe fn add_account_policy(
899        &self,
900        policy: Option<&CFDictionary>,
901        category: Option<&ODPolicyCategoryType>,
902        error: *mut *mut CFError,
903    ) -> bool {
904        extern "C-unwind" {
905            fn ODNodeAddAccountPolicy(
906                node: &ODNodeRef,
907                policy: Option<&CFDictionary>,
908                category: Option<&ODPolicyCategoryType>,
909                error: *mut *mut CFError,
910            ) -> bool;
911        }
912        unsafe { ODNodeAddAccountPolicy(self, policy, category, error) }
913    }
914
915    /// This will remove an account policy from the node for the specified category.
916    ///
917    /// This will remove an account policy from the node for the specified category.
918    ///
919    /// Parameter `node`: an ODNodeRef to use.
920    ///
921    /// Parameter `policy`: a dictionary containing the specific policy to be
922    /// removed, with the same format as described in ODNodeAddAccountPolicy.
923    ///
924    /// Parameter `category`: a valid ODPolicyCategoryType from which the specified policy will be removed.
925    ///
926    /// Parameter `error`: an optional CFErrorRef reference for error details.
927    ///
928    /// Returns: a bool which signifies if the policy removal succeeded, otherwise error is set.
929    ///
930    /// # Safety
931    ///
932    /// - `policy` generics must be of the correct type.
933    /// - `policy` might not allow `None`.
934    /// - `category` might not allow `None`.
935    /// - `error` must be a valid pointer.
936    #[doc(alias = "ODNodeRemoveAccountPolicy")]
937    #[cfg(all(
938        feature = "CFOpenDirectoryConstants",
939        feature = "objc2-core-foundation"
940    ))]
941    #[inline]
942    pub unsafe fn remove_account_policy(
943        &self,
944        policy: Option<&CFDictionary>,
945        category: Option<&ODPolicyCategoryType>,
946        error: *mut *mut CFError,
947    ) -> bool {
948        extern "C-unwind" {
949            fn ODNodeRemoveAccountPolicy(
950                node: &ODNodeRef,
951                policy: Option<&CFDictionary>,
952                category: Option<&ODPolicyCategoryType>,
953                error: *mut *mut CFError,
954            ) -> bool;
955        }
956        unsafe { ODNodeRemoveAccountPolicy(self, policy, category, error) }
957    }
958
959    /// This will set the policies for the node.
960    ///
961    /// This will set the policies for the node, replacing any existing
962    /// policies.
963    ///
964    /// Parameter `node`: an ODNodeRef to use.
965    ///
966    /// Parameter `policies`: a dictionary containing all of the policies to be set
967    /// for the node.  The dictionary may contain the following keys:
968    /// kODPolicyCategoryAuthentication an optional key with a value
969    /// of an array of policy dictionaries that specify when
970    /// authentications should be allowed.
971    /// kODPolicyCategoryPasswordContent an optional key with a
972    /// value of an array of policy dictionaries the specify the
973    /// required content of passwords.
974    /// kODPolicyCategoryPasswordChange an optional key with a value
975    /// of an array of policy dictionaries that specify when
976    /// passwords are required to be changed.
977    ///
978    /// Parameter `error`: an optional CFErrorRef reference for error details.
979    ///
980    /// Returns: a bool which signifies if the policy set succeeded, otherwise error is set.
981    ///
982    /// # Safety
983    ///
984    /// - `policies` generics must be of the correct type.
985    /// - `policies` might not allow `None`.
986    /// - `error` must be a valid pointer.
987    #[doc(alias = "ODNodeSetAccountPolicies")]
988    #[cfg(feature = "objc2-core-foundation")]
989    #[inline]
990    pub unsafe fn set_account_policies(
991        &self,
992        policies: Option<&CFDictionary>,
993        error: *mut *mut CFError,
994    ) -> bool {
995        extern "C-unwind" {
996            fn ODNodeSetAccountPolicies(
997                node: &ODNodeRef,
998                policies: Option<&CFDictionary>,
999                error: *mut *mut CFError,
1000            ) -> bool;
1001        }
1002        unsafe { ODNodeSetAccountPolicies(self, policies, error) }
1003    }
1004
1005    /// This will copy any policies configured for the node.
1006    ///
1007    /// This will copy any policies configured for the node.
1008    ///
1009    /// Parameter `node`: an ODNodeRef to use.
1010    ///
1011    /// Parameter `error`: an optional CFErrorRef reference for error details.
1012    ///
1013    /// Returns: a CFDictionaryRef containing all currently set policies.  The
1014    /// format of the dictionary is the same as described in
1015    /// ODNodeSetAccountPolicies().
1016    ///
1017    /// # Safety
1018    ///
1019    /// `error` must be a valid pointer.
1020    #[doc(alias = "ODNodeCopyAccountPolicies")]
1021    #[cfg(feature = "objc2-core-foundation")]
1022    #[inline]
1023    pub unsafe fn account_policies(
1024        &self,
1025        error: *mut *mut CFError,
1026    ) -> Option<CFRetained<CFDictionary>> {
1027        extern "C-unwind" {
1028            fn ODNodeCopyAccountPolicies(
1029                node: &ODNodeRef,
1030                error: *mut *mut CFError,
1031            ) -> Option<NonNull<CFDictionary>>;
1032        }
1033        let ret = unsafe { ODNodeCopyAccountPolicies(self, error) };
1034        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1035    }
1036
1037    /// Validates a password against the node's password content policies.
1038    ///
1039    /// Validates a password against the node's password content policies.
1040    /// The node's password content policies will be evaluated to
1041    /// determine if the password is acceptable.  May be used prior to
1042    /// creating the record.
1043    ///
1044    /// This check is only definitive at the time it was requested. The
1045    /// policy or the environment could change before the password change
1046    /// is actually requested.  Errors from the password change request
1047    /// should be consulted.
1048    ///
1049    ///
1050    /// Parameter `node`: an ODNodeRef to use.
1051    ///
1052    /// Parameter `password`: the password to be evaluated against the content policies.
1053    ///
1054    /// Parameter `recordName`: the name of the record.
1055    ///
1056    /// Parameter `error`: an optional CFErrorRef reference for error details.
1057    ///
1058    /// Returns: a bool which signifies if the password passes all content policies, otherwise error is set.
1059    ///
1060    /// # Safety
1061    ///
1062    /// - `password` might not allow `None`.
1063    /// - `record_name` might not allow `None`.
1064    /// - `error` must be a valid pointer.
1065    #[doc(alias = "ODNodePasswordContentCheck")]
1066    #[cfg(feature = "objc2-core-foundation")]
1067    #[inline]
1068    pub unsafe fn password_content_check(
1069        &self,
1070        password: Option<&CFString>,
1071        record_name: Option<&CFString>,
1072        error: *mut *mut CFError,
1073    ) -> bool {
1074        extern "C-unwind" {
1075            fn ODNodePasswordContentCheck(
1076                node: &ODNodeRef,
1077                password: Option<&CFString>,
1078                record_name: Option<&CFString>,
1079                error: *mut *mut CFError,
1080            ) -> bool;
1081        }
1082        unsafe { ODNodePasswordContentCheck(self, password, record_name, error) }
1083    }
1084}
1085
1086#[cfg(all(
1087    feature = "CFOpenDirectoryConstants",
1088    feature = "objc2-core-foundation"
1089))]
1090#[deprecated = "renamed to `ODNodeRef::with_node_type`"]
1091#[inline]
1092pub unsafe extern "C-unwind" fn ODNodeCreateWithNodeType(
1093    allocator: Option<&CFAllocator>,
1094    session: Option<&ODSessionRef>,
1095    node_type: ODNodeType,
1096    error: *mut *mut CFError,
1097) -> Option<CFRetained<ODNodeRef>> {
1098    extern "C-unwind" {
1099        fn ODNodeCreateWithNodeType(
1100            allocator: Option<&CFAllocator>,
1101            session: Option<&ODSessionRef>,
1102            node_type: ODNodeType,
1103            error: *mut *mut CFError,
1104        ) -> Option<NonNull<ODNodeRef>>;
1105    }
1106    let ret = unsafe { ODNodeCreateWithNodeType(allocator, session, node_type, error) };
1107    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1108}
1109
1110#[cfg(feature = "objc2-core-foundation")]
1111#[deprecated = "renamed to `ODNodeRef::with_name`"]
1112#[inline]
1113pub unsafe extern "C-unwind" fn ODNodeCreateWithName(
1114    allocator: Option<&CFAllocator>,
1115    session: Option<&ODSessionRef>,
1116    node_name: Option<&CFString>,
1117    error: *mut *mut CFError,
1118) -> Option<CFRetained<ODNodeRef>> {
1119    extern "C-unwind" {
1120        fn ODNodeCreateWithName(
1121            allocator: Option<&CFAllocator>,
1122            session: Option<&ODSessionRef>,
1123            node_name: Option<&CFString>,
1124            error: *mut *mut CFError,
1125        ) -> Option<NonNull<ODNodeRef>>;
1126    }
1127    let ret = unsafe { ODNodeCreateWithName(allocator, session, node_name, error) };
1128    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1129}
1130
1131#[cfg(feature = "objc2-core-foundation")]
1132#[deprecated = "renamed to `ODNodeRef::new_copy`"]
1133#[inline]
1134pub unsafe extern "C-unwind" fn ODNodeCreateCopy(
1135    allocator: Option<&CFAllocator>,
1136    node: Option<&ODNodeRef>,
1137    error: *mut *mut CFError,
1138) -> Option<CFRetained<ODNodeRef>> {
1139    extern "C-unwind" {
1140        fn ODNodeCreateCopy(
1141            allocator: Option<&CFAllocator>,
1142            node: Option<&ODNodeRef>,
1143            error: *mut *mut CFError,
1144        ) -> Option<NonNull<ODNodeRef>>;
1145    }
1146    let ret = unsafe { ODNodeCreateCopy(allocator, node, error) };
1147    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1148}
1149
1150#[cfg(feature = "objc2-core-foundation")]
1151#[deprecated = "renamed to `ODNodeRef::subnode_names`"]
1152#[inline]
1153pub unsafe extern "C-unwind" fn ODNodeCopySubnodeNames(
1154    node: &ODNodeRef,
1155    error: *mut *mut CFError,
1156) -> Option<CFRetained<CFArray>> {
1157    extern "C-unwind" {
1158        fn ODNodeCopySubnodeNames(
1159            node: &ODNodeRef,
1160            error: *mut *mut CFError,
1161        ) -> Option<NonNull<CFArray>>;
1162    }
1163    let ret = unsafe { ODNodeCopySubnodeNames(node, error) };
1164    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1165}
1166
1167#[cfg(feature = "objc2-core-foundation")]
1168#[deprecated = "renamed to `ODNodeRef::unreachable_subnode_names`"]
1169#[inline]
1170pub unsafe extern "C-unwind" fn ODNodeCopyUnreachableSubnodeNames(
1171    node: &ODNodeRef,
1172    error: *mut *mut CFError,
1173) -> Option<CFRetained<CFArray>> {
1174    extern "C-unwind" {
1175        fn ODNodeCopyUnreachableSubnodeNames(
1176            node: &ODNodeRef,
1177            error: *mut *mut CFError,
1178        ) -> Option<NonNull<CFArray>>;
1179    }
1180    let ret = unsafe { ODNodeCopyUnreachableSubnodeNames(node, error) };
1181    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1182}
1183
1184#[cfg(feature = "objc2-core-foundation")]
1185#[deprecated = "renamed to `ODNodeRef::name`"]
1186#[inline]
1187pub unsafe extern "C-unwind" fn ODNodeGetName(node: &ODNodeRef) -> Option<CFRetained<CFString>> {
1188    extern "C-unwind" {
1189        fn ODNodeGetName(node: &ODNodeRef) -> Option<NonNull<CFString>>;
1190    }
1191    let ret = unsafe { ODNodeGetName(node) };
1192    ret.map(|ret| unsafe { CFRetained::retain(ret) })
1193}
1194
1195#[cfg(feature = "objc2-core-foundation")]
1196#[deprecated = "renamed to `ODNodeRef::details`"]
1197#[inline]
1198pub unsafe extern "C-unwind" fn ODNodeCopyDetails(
1199    node: &ODNodeRef,
1200    keys: Option<&CFArray>,
1201    error: *mut *mut CFError,
1202) -> Option<CFRetained<CFDictionary>> {
1203    extern "C-unwind" {
1204        fn ODNodeCopyDetails(
1205            node: &ODNodeRef,
1206            keys: Option<&CFArray>,
1207            error: *mut *mut CFError,
1208        ) -> Option<NonNull<CFDictionary>>;
1209    }
1210    let ret = unsafe { ODNodeCopyDetails(node, keys, error) };
1211    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1212}
1213
1214#[cfg(feature = "objc2-core-foundation")]
1215#[deprecated = "renamed to `ODNodeRef::supported_record_types`"]
1216#[inline]
1217pub unsafe extern "C-unwind" fn ODNodeCopySupportedRecordTypes(
1218    node: &ODNodeRef,
1219    error: *mut *mut CFError,
1220) -> Option<CFRetained<CFArray>> {
1221    extern "C-unwind" {
1222        fn ODNodeCopySupportedRecordTypes(
1223            node: &ODNodeRef,
1224            error: *mut *mut CFError,
1225        ) -> Option<NonNull<CFArray>>;
1226    }
1227    let ret = unsafe { ODNodeCopySupportedRecordTypes(node, error) };
1228    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1229}
1230
1231#[cfg(all(
1232    feature = "CFOpenDirectoryConstants",
1233    feature = "objc2-core-foundation"
1234))]
1235#[deprecated = "renamed to `ODNodeRef::supported_attributes`"]
1236#[inline]
1237pub unsafe extern "C-unwind" fn ODNodeCopySupportedAttributes(
1238    node: &ODNodeRef,
1239    record_type: Option<&ODRecordType>,
1240    error: *mut *mut CFError,
1241) -> Option<CFRetained<CFArray>> {
1242    extern "C-unwind" {
1243        fn ODNodeCopySupportedAttributes(
1244            node: &ODNodeRef,
1245            record_type: Option<&ODRecordType>,
1246            error: *mut *mut CFError,
1247        ) -> Option<NonNull<CFArray>>;
1248    }
1249    let ret = unsafe { ODNodeCopySupportedAttributes(node, record_type, error) };
1250    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1251}
1252
1253extern "C-unwind" {
1254    #[cfg(all(
1255        feature = "CFOpenDirectoryConstants",
1256        feature = "objc2-core-foundation"
1257    ))]
1258    #[deprecated = "renamed to `ODNodeRef::set_credentials`"]
1259    pub fn ODNodeSetCredentials(
1260        node: &ODNodeRef,
1261        record_type: Option<&ODRecordType>,
1262        record_name: Option<&CFString>,
1263        password: Option<&CFString>,
1264        error: *mut *mut CFError,
1265    ) -> bool;
1266}
1267
1268extern "C-unwind" {
1269    #[cfg(all(
1270        feature = "CFOpenDirectoryConstants",
1271        feature = "objc2-core-foundation"
1272    ))]
1273    #[deprecated = "renamed to `ODNodeRef::set_credentials_extended`"]
1274    pub fn ODNodeSetCredentialsExtended(
1275        node: &ODNodeRef,
1276        record_type: Option<&ODRecordType>,
1277        auth_type: Option<&ODAuthenticationType>,
1278        auth_items: Option<&CFArray>,
1279        out_auth_items: *mut *const CFArray,
1280        out_context: *mut *const ODContextRef,
1281        error: *mut *mut CFError,
1282    ) -> bool;
1283}
1284
1285extern "C-unwind" {
1286    #[cfg(feature = "objc2-core-foundation")]
1287    #[deprecated = "renamed to `ODNodeRef::set_credentials_using_kerberos_cache`"]
1288    pub fn ODNodeSetCredentialsUsingKerberosCache(
1289        node: &ODNodeRef,
1290        cache_name: Option<&CFString>,
1291        error: *mut *mut CFError,
1292    ) -> bool;
1293}
1294
1295#[cfg(all(
1296    feature = "CFOpenDirectoryConstants",
1297    feature = "objc2-core-foundation"
1298))]
1299#[deprecated = "renamed to `ODNodeRef::create_record`"]
1300#[inline]
1301pub unsafe extern "C-unwind" fn ODNodeCreateRecord(
1302    node: &ODNodeRef,
1303    record_type: Option<&ODRecordType>,
1304    record_name: Option<&CFString>,
1305    attribute_dict: Option<&CFDictionary>,
1306    error: *mut *mut CFError,
1307) -> Option<CFRetained<ODRecordRef>> {
1308    extern "C-unwind" {
1309        fn ODNodeCreateRecord(
1310            node: &ODNodeRef,
1311            record_type: Option<&ODRecordType>,
1312            record_name: Option<&CFString>,
1313            attribute_dict: Option<&CFDictionary>,
1314            error: *mut *mut CFError,
1315        ) -> Option<NonNull<ODRecordRef>>;
1316    }
1317    let ret = unsafe { ODNodeCreateRecord(node, record_type, record_name, attribute_dict, error) };
1318    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1319}
1320
1321#[cfg(all(
1322    feature = "CFOpenDirectoryConstants",
1323    feature = "objc2-core-foundation"
1324))]
1325#[deprecated = "renamed to `ODNodeRef::copy_record`"]
1326#[inline]
1327pub unsafe extern "C-unwind" fn ODNodeCopyRecord(
1328    node: &ODNodeRef,
1329    record_type: Option<&ODRecordType>,
1330    record_name: Option<&CFString>,
1331    attributes: Option<&CFType>,
1332    error: *mut *mut CFError,
1333) -> Option<CFRetained<ODRecordRef>> {
1334    extern "C-unwind" {
1335        fn ODNodeCopyRecord(
1336            node: &ODNodeRef,
1337            record_type: Option<&ODRecordType>,
1338            record_name: Option<&CFString>,
1339            attributes: Option<&CFType>,
1340            error: *mut *mut CFError,
1341        ) -> Option<NonNull<ODRecordRef>>;
1342    }
1343    let ret = unsafe { ODNodeCopyRecord(node, record_type, record_name, attributes, error) };
1344    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1345}
1346
1347#[cfg(feature = "objc2-core-foundation")]
1348#[deprecated = "renamed to `ODNodeRef::custom_call`"]
1349#[inline]
1350pub unsafe extern "C-unwind" fn ODNodeCustomCall(
1351    node: &ODNodeRef,
1352    custom_code: CFIndex,
1353    data: Option<&CFData>,
1354    error: *mut *mut CFError,
1355) -> Option<CFRetained<CFData>> {
1356    extern "C-unwind" {
1357        fn ODNodeCustomCall(
1358            node: &ODNodeRef,
1359            custom_code: CFIndex,
1360            data: Option<&CFData>,
1361            error: *mut *mut CFError,
1362        ) -> Option<NonNull<CFData>>;
1363    }
1364    let ret = unsafe { ODNodeCustomCall(node, custom_code, data, error) };
1365    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1366}
1367
1368#[cfg(feature = "objc2-core-foundation")]
1369#[deprecated = "renamed to `ODNodeRef::custom_function`"]
1370#[inline]
1371pub unsafe extern "C-unwind" fn ODNodeCustomFunction(
1372    node: &ODNodeRef,
1373    function: Option<&CFString>,
1374    payload: Option<&CFType>,
1375    error: *mut *mut CFError,
1376) -> Option<CFRetained<CFType>> {
1377    extern "C-unwind" {
1378        fn ODNodeCustomFunction(
1379            node: &ODNodeRef,
1380            function: Option<&CFString>,
1381            payload: Option<&CFType>,
1382            error: *mut *mut CFError,
1383        ) -> Option<NonNull<CFType>>;
1384    }
1385    let ret = unsafe { ODNodeCustomFunction(node, function, payload, error) };
1386    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1387}
1388
1389#[cfg(feature = "objc2-core-foundation")]
1390#[deprecated = "renamed to `ODNodeRef::policies`"]
1391#[inline]
1392pub unsafe extern "C-unwind" fn ODNodeCopyPolicies(
1393    node: &ODNodeRef,
1394    error: *mut *mut CFError,
1395) -> Option<CFRetained<CFDictionary>> {
1396    extern "C-unwind" {
1397        fn ODNodeCopyPolicies(
1398            node: &ODNodeRef,
1399            error: *mut *mut CFError,
1400        ) -> Option<NonNull<CFDictionary>>;
1401    }
1402    let ret = unsafe { ODNodeCopyPolicies(node, error) };
1403    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1404}
1405
1406#[cfg(feature = "objc2-core-foundation")]
1407#[deprecated = "renamed to `ODNodeRef::supported_policies`"]
1408#[inline]
1409pub unsafe extern "C-unwind" fn ODNodeCopySupportedPolicies(
1410    node: &ODNodeRef,
1411    error: *mut *mut CFError,
1412) -> Option<CFRetained<CFDictionary>> {
1413    extern "C-unwind" {
1414        fn ODNodeCopySupportedPolicies(
1415            node: &ODNodeRef,
1416            error: *mut *mut CFError,
1417        ) -> Option<NonNull<CFDictionary>>;
1418    }
1419    let ret = unsafe { ODNodeCopySupportedPolicies(node, error) };
1420    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1421}
1422
1423extern "C-unwind" {
1424    #[cfg(feature = "objc2-core-foundation")]
1425    #[deprecated = "renamed to `ODNodeRef::set_policies`"]
1426    pub fn ODNodeSetPolicies(
1427        node: &ODNodeRef,
1428        policies: Option<&CFDictionary>,
1429        error: *mut *mut CFError,
1430    ) -> bool;
1431}
1432
1433extern "C-unwind" {
1434    #[cfg(all(
1435        feature = "CFOpenDirectoryConstants",
1436        feature = "objc2-core-foundation"
1437    ))]
1438    #[deprecated = "renamed to `ODNodeRef::set_policy`"]
1439    pub fn ODNodeSetPolicy(
1440        node: &ODNodeRef,
1441        policy_type: Option<&ODPolicyType>,
1442        value: Option<&CFType>,
1443        error: *mut *mut CFError,
1444    ) -> bool;
1445}
1446
1447extern "C-unwind" {
1448    #[cfg(all(
1449        feature = "CFOpenDirectoryConstants",
1450        feature = "objc2-core-foundation"
1451    ))]
1452    #[deprecated = "renamed to `ODNodeRef::remove_policy`"]
1453    pub fn ODNodeRemovePolicy(
1454        node: &ODNodeRef,
1455        policy_type: Option<&ODPolicyType>,
1456        error: *mut *mut CFError,
1457    ) -> bool;
1458}
1459
1460extern "C-unwind" {
1461    #[cfg(all(
1462        feature = "CFOpenDirectoryConstants",
1463        feature = "objc2-core-foundation"
1464    ))]
1465    #[deprecated = "renamed to `ODNodeRef::add_account_policy`"]
1466    pub fn ODNodeAddAccountPolicy(
1467        node: &ODNodeRef,
1468        policy: Option<&CFDictionary>,
1469        category: Option<&ODPolicyCategoryType>,
1470        error: *mut *mut CFError,
1471    ) -> bool;
1472}
1473
1474extern "C-unwind" {
1475    #[cfg(all(
1476        feature = "CFOpenDirectoryConstants",
1477        feature = "objc2-core-foundation"
1478    ))]
1479    #[deprecated = "renamed to `ODNodeRef::remove_account_policy`"]
1480    pub fn ODNodeRemoveAccountPolicy(
1481        node: &ODNodeRef,
1482        policy: Option<&CFDictionary>,
1483        category: Option<&ODPolicyCategoryType>,
1484        error: *mut *mut CFError,
1485    ) -> bool;
1486}
1487
1488extern "C-unwind" {
1489    #[cfg(feature = "objc2-core-foundation")]
1490    #[deprecated = "renamed to `ODNodeRef::set_account_policies`"]
1491    pub fn ODNodeSetAccountPolicies(
1492        node: &ODNodeRef,
1493        policies: Option<&CFDictionary>,
1494        error: *mut *mut CFError,
1495    ) -> bool;
1496}
1497
1498#[cfg(feature = "objc2-core-foundation")]
1499#[deprecated = "renamed to `ODNodeRef::account_policies`"]
1500#[inline]
1501pub unsafe extern "C-unwind" fn ODNodeCopyAccountPolicies(
1502    node: &ODNodeRef,
1503    error: *mut *mut CFError,
1504) -> Option<CFRetained<CFDictionary>> {
1505    extern "C-unwind" {
1506        fn ODNodeCopyAccountPolicies(
1507            node: &ODNodeRef,
1508            error: *mut *mut CFError,
1509        ) -> Option<NonNull<CFDictionary>>;
1510    }
1511    let ret = unsafe { ODNodeCopyAccountPolicies(node, error) };
1512    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1513}
1514
1515extern "C-unwind" {
1516    #[cfg(feature = "objc2-core-foundation")]
1517    #[deprecated = "renamed to `ODNodeRef::password_content_check`"]
1518    pub fn ODNodePasswordContentCheck(
1519        node: &ODNodeRef,
1520        password: Option<&CFString>,
1521        record_name: Option<&CFString>,
1522        error: *mut *mut CFError,
1523    ) -> bool;
1524}