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