objc2_collaboration/generated/CBIdentityAuthority.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-services")]
6use objc2_core_services::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12 /// An identity authority is a database that stores information about
13 /// identities. The `CBIdentityAuthority` class defines one or more identity
14 /// authorities. This database can be searched for identities in conjunction
15 /// with the `CBIdentity` class factory methods.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/collaboration/cbidentityauthority?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct CBIdentityAuthority;
21);
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for CBIdentityAuthority {}
25);
26
27impl CBIdentityAuthority {
28 extern_methods!(
29 /// Returns the identity authority on the local system.
30 ///
31 /// Any identities stored on the local system are contained within this identity
32 /// authority.
33 ///
34 /// - Returns: The identity authority on the local system.
35 #[unsafe(method(localIdentityAuthority))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn localIdentityAuthority() -> Retained<CBIdentityAuthority>;
38
39 /// Returns the identity authority that contains all the identities in bound
40 /// network directory servers.
41 ///
42 /// If you are bound to a network directory server (such as an LDAP server) that
43 /// has an identity authority, use this method to search those authorities.
44 ///
45 /// - Returns: The identity authorities in bound network directory servers.
46 #[unsafe(method(managedIdentityAuthority))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn managedIdentityAuthority() -> Retained<CBIdentityAuthority>;
49
50 /// Returns an identity authority that contains the identities in both the local
51 /// and the network-bound authorities.
52 ///
53 /// The default identity authority is the logical union of the identities in the
54 /// local and managed authorities.
55 ///
56 /// - Returns: The local and network-bound identity authorities.
57 #[unsafe(method(defaultIdentityAuthority))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn defaultIdentityAuthority() -> Retained<CBIdentityAuthority>;
60
61 #[cfg(feature = "objc2-core-services")]
62 /// Returns an identity authority specified by a given Core Services Identity
63 /// authority object.
64 ///
65 /// This method, along with ``CBIdentityAuthority/CSIdentityAuthority``, is used
66 /// for interoperability with the Core Services Identity API.
67 ///
68 /// - Parameters:
69 /// - CSIdentityAuthority: The Core Services Identity opaque object.
70 ///
71 /// - Returns: The identity authority object for use with the Collaboration
72 /// framework.
73 #[unsafe(method(identityAuthorityWithCSIdentityAuthority:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn identityAuthorityWithCSIdentityAuthority(
76 cs_identity_authority: &CSIdentityAuthority,
77 ) -> Retained<CBIdentityAuthority>;
78
79 #[cfg(feature = "objc2-core-services")]
80 /// Returns an identity authority for use with the Core Services Identity API.
81 ///
82 /// This method, along with
83 /// ``CBIdentityAuthority/identityAuthorityWithCSIdentityAuthority:``, is used
84 /// for interoperability with the Core Services Identity API.
85 ///
86 /// - Returns: The opaque authority object for use with the Core Services
87 /// Identity API.
88 #[unsafe(method(CSIdentityAuthority))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn CSIdentityAuthority(&self) -> Retained<CSIdentityAuthority>;
91
92 /// Returns the localized name of the identity authority.
93 ///
94 /// - Returns: The computer’s name if the authority is local, or Managed Network
95 /// Directory if the authority is managed.
96 #[unsafe(method(localizedName))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn localizedName(&self) -> Retained<NSString>;
99 );
100}
101
102/// Methods declared on superclass `NSObject`.
103impl CBIdentityAuthority {
104 extern_methods!(
105 #[unsafe(method(init))]
106 #[unsafe(method_family = init)]
107 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108
109 #[unsafe(method(new))]
110 #[unsafe(method_family = new)]
111 pub unsafe fn new() -> Retained<Self>;
112 );
113}