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::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>;
    );
}