objc2_home_kit/generated/
HMAccessorySetupRequest.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/homekit/hmaccessorysetuprequest?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct HMAccessorySetupRequest;
15);
16
17unsafe impl Send for HMAccessorySetupRequest {}
18
19unsafe impl Sync for HMAccessorySetupRequest {}
20
21extern_conformance!(
22    unsafe impl NSCopying for HMAccessorySetupRequest {}
23);
24
25unsafe impl CopyingHelper for HMAccessorySetupRequest {
26    type Result = Self;
27}
28
29extern_conformance!(
30    unsafe impl NSObjectProtocol for HMAccessorySetupRequest {}
31);
32
33impl HMAccessorySetupRequest {
34    extern_methods!(
35        #[unsafe(method(init))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39        #[cfg(feature = "HMAccessorySetupPayload")]
40        /// The payload to use for accessory setup
41        ///
42        /// Note: When this is non-nil, the following entitlement is required:
43        /// com.apple.developer.homekit.allow-setup-payload
44        #[unsafe(method(payload))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn payload(&self) -> Option<Retained<HMAccessorySetupPayload>>;
47
48        #[cfg(feature = "HMAccessorySetupPayload")]
49        /// Setter for [`payload`][Self::payload].
50        ///
51        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
52        #[unsafe(method(setPayload:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setPayload(&self, payload: Option<&HMAccessorySetupPayload>);
55
56        /// The -[HMHome uniqueIdentifier] that corresponds to the HMHome that the accessory should be
57        /// added to when being set up. If nil, then the user will be prompted to choose a home
58        #[unsafe(method(homeUniqueIdentifier))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn homeUniqueIdentifier(&self) -> Option<Retained<NSUUID>>;
61
62        /// Setter for [`homeUniqueIdentifier`][Self::homeUniqueIdentifier].
63        ///
64        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
65        #[unsafe(method(setHomeUniqueIdentifier:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setHomeUniqueIdentifier(&self, home_unique_identifier: Option<&NSUUID>);
68
69        /// The -[HMRoom uniqueIdentifier] that corresponds to the existing HMRoom that should be
70        /// suggested when the user is prompted to choose a room to add the accessory to. If nil, then any
71        /// room may be suggested
72        ///
73        /// Note: This value will be ignored if homeUniqueIdentifier is nil
74        #[unsafe(method(suggestedRoomUniqueIdentifier))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn suggestedRoomUniqueIdentifier(&self) -> Option<Retained<NSUUID>>;
77
78        /// Setter for [`suggestedRoomUniqueIdentifier`][Self::suggestedRoomUniqueIdentifier].
79        ///
80        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
81        #[unsafe(method(setSuggestedRoomUniqueIdentifier:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setSuggestedRoomUniqueIdentifier(
84            &self,
85            suggested_room_unique_identifier: Option<&NSUUID>,
86        );
87
88        /// The name that will be suggested when the user is prompted to name the accessory being set up.
89        /// If nil, then the suggested name will be taken from the accessory itself
90        ///
91        /// Note: If an accessory bridge is being set up, then this value only applies to the accessory bridge
92        /// and not any accessories behind the bridge
93        #[unsafe(method(suggestedAccessoryName))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn suggestedAccessoryName(&self) -> Option<Retained<NSString>>;
96
97        /// Setter for [`suggestedAccessoryName`][Self::suggestedAccessoryName].
98        ///
99        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
100        #[unsafe(method(setSuggestedAccessoryName:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setSuggestedAccessoryName(&self, suggested_accessory_name: Option<&NSString>);
103    );
104}
105
106/// Methods declared on superclass `NSObject`.
107impl HMAccessorySetupRequest {
108    extern_methods!(
109        #[unsafe(method(new))]
110        #[unsafe(method_family = new)]
111        pub unsafe fn new() -> Retained<Self>;
112    );
113}