objc2_home_kit/generated/
HMAddAccessoryRequest.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/hmaddaccessoryrequest?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct HMAddAccessoryRequest;
14);
15
16unsafe impl NSObjectProtocol for HMAddAccessoryRequest {}
17
18impl HMAddAccessoryRequest {
19    extern_methods!(
20        #[cfg(feature = "HMHome")]
21        /// Home that the accessory is to be added to.
22        #[unsafe(method(home))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn home(&self) -> Retained<HMHome>;
25
26        /// Name of the accessory to be added.
27        #[unsafe(method(accessoryName))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn accessoryName(&self) -> Retained<NSString>;
30
31        #[cfg(feature = "HMAccessoryCategory")]
32        /// The category of the accessory to be added.
33        #[unsafe(method(accessoryCategory))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn accessoryCategory(&self) -> Retained<HMAccessoryCategory>;
36
37        /// Indication if the setup URL needs to be updated for this request. If this is true,
38        /// payloadWithURL:ownershipToken: must be used to create the HMAccessorySetupPayload.
39        #[unsafe(method(requiresSetupPayloadURL))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn requiresSetupPayloadURL(&self) -> bool;
42
43        /// Indication if the ownership token needs to be updated for this request.
44        #[deprecated = "No longer supported"]
45        #[unsafe(method(requiresOwnershipToken))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn requiresOwnershipToken(&self) -> bool;
48
49        #[cfg(feature = "HMAccessorySetupPayload")]
50        /// Creates an accessory setup payload with ownership token
51        ///
52        ///
53        /// Parameter `ownershipToken`: The token proving ownership of the accessory being added to the home.
54        ///
55        ///
56        /// Returns: Returns an accessory setup payload object if successful or nil on error.
57        ///
58        ///
59        /// This method may fail if this request requires a setup payload URL.
60        #[unsafe(method(payloadWithOwnershipToken:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn payloadWithOwnershipToken(
63            &self,
64            ownership_token: &HMAccessoryOwnershipToken,
65        ) -> Option<Retained<HMAccessorySetupPayload>>;
66
67        #[cfg(feature = "HMAccessorySetupPayload")]
68        /// Creates an accessory setup payload with URL and ownership token
69        ///
70        ///
71        /// Parameter `setupPayloadURL`: The HomeKit setup payload for the accessory being added to the home.
72        ///
73        ///
74        /// Parameter `ownershipToken`: The token proving ownership of the accessory being added to the home.
75        ///
76        ///
77        /// Returns: Returns an accessory setup payload object if successful or nil on error.
78        ///
79        ///
80        /// This method may fail if the setup payload URL is not a valid payload URL.
81        #[unsafe(method(payloadWithURL:ownershipToken:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn payloadWithURL_ownershipToken(
84            &self,
85            setup_payload_url: &NSURL,
86            ownership_token: &HMAccessoryOwnershipToken,
87        ) -> Option<Retained<HMAccessorySetupPayload>>;
88
89        #[deprecated = "HMAddAccessoryRequest objects are created by their associated objects. Directly creating them is not supported."]
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93    );
94}
95
96/// Methods declared on superclass `NSObject`.
97impl HMAddAccessoryRequest {
98    extern_methods!(
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new() -> Retained<Self>;
102    );
103}