objc2_home_kit/generated/
HMAccessorySetupPayload.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmaccessoryownershiptoken?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct HMAccessoryOwnershipToken;
14);
15
16unsafe impl Send for HMAccessoryOwnershipToken {}
17
18unsafe impl Sync for HMAccessoryOwnershipToken {}
19
20unsafe impl NSObjectProtocol for HMAccessoryOwnershipToken {}
21
22impl HMAccessoryOwnershipToken {
23    extern_methods!(
24        #[unsafe(method(init))]
25        #[unsafe(method_family = init)]
26        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
27
28        #[unsafe(method(new))]
29        #[unsafe(method_family = new)]
30        pub unsafe fn new() -> Retained<Self>;
31
32        /// Creates a new accessory ownership token to add an accessory to the home.
33        ///
34        ///
35        /// Parameter `data`: Data to be sent to prove ownership of this accessory.
36        ///
37        ///
38        /// This initializer may return nil if the data provided is not a valid ownership token
39        /// (e.g. if it's too short or determined to be insufficient for some other reason).
40        ///
41        ///
42        /// Returns: Returns an ownership token object.
43        #[unsafe(method(initWithData:))]
44        #[unsafe(method_family = init)]
45        pub unsafe fn initWithData(this: Allocated<Self>, data: &NSData) -> Option<Retained<Self>>;
46    );
47}
48
49extern_class!(
50    /// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmaccessorysetuppayload?language=objc)
51    #[unsafe(super(NSObject))]
52    #[derive(Debug, PartialEq, Eq, Hash)]
53    pub struct HMAccessorySetupPayload;
54);
55
56unsafe impl Send for HMAccessorySetupPayload {}
57
58unsafe impl Sync for HMAccessorySetupPayload {}
59
60unsafe impl NSObjectProtocol for HMAccessorySetupPayload {}
61
62impl HMAccessorySetupPayload {
63    extern_methods!(
64        #[unsafe(method(init))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68        #[unsafe(method(new))]
69        #[unsafe(method_family = new)]
70        pub unsafe fn new() -> Retained<Self>;
71
72        /// Creates a new accessory setup payload to add an accessory to the home.
73        ///
74        ///
75        /// Parameter `setupPayloadURL`: The HomeKit setup payload for the accessory being added to the home.
76        ///
77        ///
78        /// Returns: Returns an accessory setup payload object if successful or nil on error.
79        #[unsafe(method(initWithURL:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithURL(
82            this: Allocated<Self>,
83            setup_payload_url: Option<&NSURL>,
84        ) -> Option<Retained<Self>>;
85
86        /// Creates a new accessory setup payload to add an accessory to the home.
87        ///
88        ///
89        /// Parameter `setupPayloadURL`: The HomeKit setup payload URL for the accessory being added to the home.`
90        ///
91        ///
92        /// Parameter `ownershipToken`: The token proving ownership of the accessory being added to the home.
93        ///
94        ///
95        /// Returns: Returns an accessory setup payload object if successful or nil on error.
96        #[unsafe(method(initWithURL:ownershipToken:))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithURL_ownershipToken(
99            this: Allocated<Self>,
100            setup_payload_url: &NSURL,
101            ownership_token: Option<&HMAccessoryOwnershipToken>,
102        ) -> Option<Retained<Self>>;
103    );
104}