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        #[unsafe(method(setPayload:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setPayload(&self, payload: Option<&HMAccessorySetupPayload>);
53
54        /// The -[HMHome uniqueIdentifier] that corresponds to the HMHome that the accessory should be
55        /// added to when being set up. If nil, then the user will be prompted to choose a home
56        #[unsafe(method(homeUniqueIdentifier))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn homeUniqueIdentifier(&self) -> Option<Retained<NSUUID>>;
59
60        /// Setter for [`homeUniqueIdentifier`][Self::homeUniqueIdentifier].
61        #[unsafe(method(setHomeUniqueIdentifier:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setHomeUniqueIdentifier(&self, home_unique_identifier: Option<&NSUUID>);
64
65        /// The -[HMRoom uniqueIdentifier] that corresponds to the existing HMRoom that should be
66        /// suggested when the user is prompted to choose a room to add the accessory to. If nil, then any
67        /// room may be suggested
68        ///
69        /// Note: This value will be ignored if homeUniqueIdentifier is nil
70        #[unsafe(method(suggestedRoomUniqueIdentifier))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn suggestedRoomUniqueIdentifier(&self) -> Option<Retained<NSUUID>>;
73
74        /// Setter for [`suggestedRoomUniqueIdentifier`][Self::suggestedRoomUniqueIdentifier].
75        #[unsafe(method(setSuggestedRoomUniqueIdentifier:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setSuggestedRoomUniqueIdentifier(
78            &self,
79            suggested_room_unique_identifier: Option<&NSUUID>,
80        );
81
82        /// The name that will be suggested when the user is prompted to name the accessory being set up.
83        /// If nil, then the suggested name will be taken from the accessory itself
84        ///
85        /// Note: If an accessory bridge is being set up, then this value only applies to the accessory bridge
86        /// and not any accessories behind the bridge
87        #[unsafe(method(suggestedAccessoryName))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn suggestedAccessoryName(&self) -> Option<Retained<NSString>>;
90
91        /// Setter for [`suggestedAccessoryName`][Self::suggestedAccessoryName].
92        #[unsafe(method(setSuggestedAccessoryName:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setSuggestedAccessoryName(&self, suggested_accessory_name: Option<&NSString>);
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl HMAccessorySetupRequest {
100    extern_methods!(
101        #[unsafe(method(new))]
102        #[unsafe(method_family = new)]
103        pub unsafe fn new() -> Retained<Self>;
104    );
105}