objc2-media-setup 0.3.2

Bindings to the MediaSetup 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!(
    /// Account details for accessing a streaming media service.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediasetup/msserviceaccount?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MSServiceAccount;
);

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

impl MSServiceAccount {
    extern_methods!(
        /// Creates a new account.
        ///
        /// - Parameters:
        /// - serviceName: The name of the streaming media service.
        ///
        /// - accountName: The user’s display name in the streaming media service.
        #[unsafe(method(initWithServiceName:accountName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithServiceName_accountName(
            this: Allocated<Self>,
            service_name: &NSString,
            account_name: &NSString,
        ) -> Retained<Self>;

        /// The localized name of the streaming media service.
        #[unsafe(method(serviceName))]
        #[unsafe(method_family = none)]
        pub unsafe fn serviceName(&self) -> Retained<NSString>;

        /// The user’s display name, email address, or other identifier in a streaming media service.
        #[unsafe(method(accountName))]
        #[unsafe(method_family = none)]
        pub unsafe fn accountName(&self) -> Retained<NSString>;

        /// A user identifier for the token request.
        ///
        /// The Media Setup framework uses the ``MSServiceAccount/clientID`` to create a
        /// token request. You can choose the identifier format, but the identifier must
        /// be unique to the current account. You can provide a new identifier each time
        /// the user begins the home setup.
        #[unsafe(method(clientID))]
        #[unsafe(method_family = none)]
        pub unsafe fn clientID(&self) -> Option<Retained<NSString>>;

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

        /// A string that authenticates the user’s setup request.
        ///
        /// The Media Setup framework uses the `clientSecret` to create a token request.
        /// Hashed passwords are acceptable, but plaintext passwords aren't.
        #[unsafe(method(clientSecret))]
        #[unsafe(method_family = none)]
        pub unsafe fn clientSecret(&self) -> Option<Retained<NSString>>;

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

        /// The path to access the configuration endpoint of your streaming media
        /// service for the home.
        ///
        /// The device retrieves the configuration with the OAuth 2.0 Bearer token.
        #[unsafe(method(configurationURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn configurationURL(&self) -> Option<Retained<NSURL>>;

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

        /// A URL that provides a token for the user’s HomePod speakers.
        ///
        /// The authorization token URL is an OAuth 2.0 token service endpoint that provides a
        /// Bearer Token for retrieving configuration.
        #[unsafe(method(authorizationTokenURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationTokenURL(&self) -> Option<Retained<NSURL>>;

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

        /// A list of permissions for the token request.
        ///
        /// The authorization scope is an optional OAuth 2.0 scope parameter the system provides
        /// when requesting a token.
        #[unsafe(method(authorizationScope))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationScope(&self) -> Option<Retained<NSString>>;

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

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

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}