objc2-home-kit 0.3.2

Bindings to the HomeKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmaccessorysetuprequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HMAccessorySetupRequest;
);

unsafe impl Send for HMAccessorySetupRequest {}

unsafe impl Sync for HMAccessorySetupRequest {}

extern_conformance!(
    unsafe impl NSCopying for HMAccessorySetupRequest {}
);

unsafe impl CopyingHelper for HMAccessorySetupRequest {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for HMAccessorySetupRequest {}
);

impl HMAccessorySetupRequest {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "HMAccessorySetupPayload")]
        /// The payload to use for accessory setup
        ///
        /// Note: When this is non-nil, the following entitlement is required:
        /// com.apple.developer.homekit.allow-setup-payload
        #[unsafe(method(payload))]
        #[unsafe(method_family = none)]
        pub unsafe fn payload(&self) -> Option<Retained<HMAccessorySetupPayload>>;

        #[cfg(feature = "HMAccessorySetupPayload")]
        /// Setter for [`payload`][Self::payload].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPayload:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPayload(&self, payload: Option<&HMAccessorySetupPayload>);

        /// The -[HMHome uniqueIdentifier] that corresponds to the HMHome that the accessory should be
        /// added to when being set up. If nil, then the user will be prompted to choose a home
        #[unsafe(method(homeUniqueIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn homeUniqueIdentifier(&self) -> Option<Retained<NSUUID>>;

        /// Setter for [`homeUniqueIdentifier`][Self::homeUniqueIdentifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setHomeUniqueIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHomeUniqueIdentifier(&self, home_unique_identifier: Option<&NSUUID>);

        /// The -[HMRoom uniqueIdentifier] that corresponds to the existing HMRoom that should be
        /// suggested when the user is prompted to choose a room to add the accessory to. If nil, then any
        /// room may be suggested
        ///
        /// Note: This value will be ignored if homeUniqueIdentifier is nil
        #[unsafe(method(suggestedRoomUniqueIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn suggestedRoomUniqueIdentifier(&self) -> Option<Retained<NSUUID>>;

        /// Setter for [`suggestedRoomUniqueIdentifier`][Self::suggestedRoomUniqueIdentifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSuggestedRoomUniqueIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSuggestedRoomUniqueIdentifier(
            &self,
            suggested_room_unique_identifier: Option<&NSUUID>,
        );

        /// The name that will be suggested when the user is prompted to name the accessory being set up.
        /// If nil, then the suggested name will be taken from the accessory itself
        ///
        /// Note: If an accessory bridge is being set up, then this value only applies to the accessory bridge
        /// and not any accessories behind the bridge
        #[unsafe(method(suggestedAccessoryName))]
        #[unsafe(method_family = none)]
        pub unsafe fn suggestedAccessoryName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`suggestedAccessoryName`][Self::suggestedAccessoryName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSuggestedAccessoryName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSuggestedAccessoryName(&self, suggested_accessory_name: Option<&NSString>);
    );
}

/// Methods declared on superclass `NSObject`.
impl HMAccessorySetupRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}