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