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