objc2_open_directory/generated/
ODAttributeMap.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/opendirectory/odattributemap?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct ODAttributeMap;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for ODAttributeMap {}
19);
20
21impl ODAttributeMap {
22    extern_methods!(
23        #[unsafe(method(customQueryFunction))]
24        #[unsafe(method_family = none)]
25        pub unsafe fn customQueryFunction(&self) -> Retained<NSString>;
26
27        /// Setter for [`customQueryFunction`][Self::customQueryFunction].
28        ///
29        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
30        #[unsafe(method(setCustomQueryFunction:))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn setCustomQueryFunction(&self, custom_query_function: Option<&NSString>);
33
34        #[unsafe(method(customTranslationFunction))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn customTranslationFunction(&self) -> Retained<NSString>;
37
38        /// Setter for [`customTranslationFunction`][Self::customTranslationFunction].
39        ///
40        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
41        #[unsafe(method(setCustomTranslationFunction:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn setCustomTranslationFunction(
44            &self,
45            custom_translation_function: Option<&NSString>,
46        );
47
48        #[unsafe(method(customAttributes))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn customAttributes(&self) -> Retained<NSArray>;
51
52        /// Setter for [`customAttributes`][Self::customAttributes].
53        ///
54        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
55        ///
56        /// # Safety
57        ///
58        /// `custom_attributes` generic should be of the correct type.
59        #[unsafe(method(setCustomAttributes:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setCustomAttributes(&self, custom_attributes: Option<&NSArray>);
62
63        #[unsafe(method(value))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn value(&self) -> Retained<NSString>;
66
67        /// Setter for [`value`][Self::value].
68        ///
69        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
70        #[unsafe(method(setValue:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setValue(&self, value: Option<&NSString>);
73
74        /// Returns an initialized and autoreleased ODAttributeMap object with the given value mapped.
75        ///
76        ///
77        /// Returns an initialized and autoreleased ODAttributeMap object with the given value mapped.
78        ///
79        /// # Safety
80        ///
81        /// `value` might not allow `None`.
82        #[unsafe(method(attributeMapWithValue:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn attributeMapWithValue(value: Option<&NSString>) -> Option<Retained<Self>>;
85
86        /// Returns an initialized and autoreleased ODAttributeMap object with the given static value.
87        ///
88        ///
89        /// Returns an initialized and autoreleased ODAttributeMap object with the given static value.
90        ///
91        /// # Safety
92        ///
93        /// `static_value` might not allow `None`.
94        #[unsafe(method(attributeMapWithStaticValue:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn attributeMapWithStaticValue(
97            static_value: Option<&NSString>,
98        ) -> Option<Retained<Self>>;
99
100        /// Sets a static value that will always be returned for this mapping.
101        ///
102        ///
103        /// Sets a static value that will always be returned for this mapping, i.e., "20".
104        ///
105        /// # Safety
106        ///
107        /// `static_value` might not allow `None`.
108        #[unsafe(method(setStaticValue:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setStaticValue(&self, static_value: Option<&NSString>);
111
112        /// Sets a variable substitution-based value.
113        ///
114        ///
115        /// Value should be using the syntax '$native$' for all substited values.  For example,
116        /// to form a home directory using the "cn" of an LDAP record, substitution could be done
117        /// with "/home/$cn$".
118        ///
119        /// # Safety
120        ///
121        /// `variable_substitution` might not allow `None`.
122        #[unsafe(method(setVariableSubstitution:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setVariableSubstitution(&self, variable_substitution: Option<&NSString>);
125    );
126}
127
128/// Methods declared on superclass `NSObject`.
129impl ODAttributeMap {
130    extern_methods!(
131        #[unsafe(method(init))]
132        #[unsafe(method_family = init)]
133        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
134
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new() -> Retained<Self>;
138    );
139}