objc2_media_setup/generated/
MSServiceAccount.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// Account details for accessing a streaming media service.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediasetup/msserviceaccount?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct MSServiceAccount;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for MSServiceAccount {}
21);
22
23impl MSServiceAccount {
24    extern_methods!(
25        /// Creates a new account.
26        ///
27        /// - Parameters:
28        /// - serviceName: The name of the streaming media service.
29        ///
30        /// - accountName: The user’s display name in the streaming media service.
31        #[unsafe(method(initWithServiceName:accountName:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithServiceName_accountName(
34            this: Allocated<Self>,
35            service_name: &NSString,
36            account_name: &NSString,
37        ) -> Retained<Self>;
38
39        /// The localized name of the streaming media service.
40        #[unsafe(method(serviceName))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn serviceName(&self) -> Retained<NSString>;
43
44        /// The user’s display name, email address, or other identifier in a streaming media service.
45        #[unsafe(method(accountName))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn accountName(&self) -> Retained<NSString>;
48
49        /// A user identifier for the token request.
50        ///
51        /// The Media Setup framework uses the ``MSServiceAccount/clientID`` to create a
52        /// token request. You can choose the identifier format, but the identifier must
53        /// be unique to the current account. You can provide a new identifier each time
54        /// the user begins the home setup.
55        #[unsafe(method(clientID))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn clientID(&self) -> Option<Retained<NSString>>;
58
59        /// Setter for [`clientID`][Self::clientID].
60        ///
61        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
62        #[unsafe(method(setClientID:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setClientID(&self, client_id: Option<&NSString>);
65
66        /// A string that authenticates the user’s setup request.
67        ///
68        /// The Media Setup framework uses the `clientSecret` to create a token request.
69        /// Hashed passwords are acceptable, but plaintext passwords aren't.
70        #[unsafe(method(clientSecret))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn clientSecret(&self) -> Option<Retained<NSString>>;
73
74        /// Setter for [`clientSecret`][Self::clientSecret].
75        ///
76        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
77        #[unsafe(method(setClientSecret:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setClientSecret(&self, client_secret: Option<&NSString>);
80
81        /// The path to access the configuration endpoint of your streaming media
82        /// service for the home.
83        ///
84        /// The device retrieves the configuration with the OAuth 2.0 Bearer token.
85        #[unsafe(method(configurationURL))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn configurationURL(&self) -> Option<Retained<NSURL>>;
88
89        /// Setter for [`configurationURL`][Self::configurationURL].
90        ///
91        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
92        #[unsafe(method(setConfigurationURL:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setConfigurationURL(&self, configuration_url: Option<&NSURL>);
95
96        /// A URL that provides a token for the user’s HomePod speakers.
97        ///
98        /// The authorization token URL is an OAuth 2.0 token service endpoint that provides a
99        /// Bearer Token for retrieving configuration.
100        #[unsafe(method(authorizationTokenURL))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn authorizationTokenURL(&self) -> Option<Retained<NSURL>>;
103
104        /// Setter for [`authorizationTokenURL`][Self::authorizationTokenURL].
105        ///
106        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
107        #[unsafe(method(setAuthorizationTokenURL:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setAuthorizationTokenURL(&self, authorization_token_url: Option<&NSURL>);
110
111        /// A list of permissions for the token request.
112        ///
113        /// The authorization scope is an optional OAuth 2.0 scope parameter the system provides
114        /// when requesting a token.
115        #[unsafe(method(authorizationScope))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn authorizationScope(&self) -> Option<Retained<NSString>>;
118
119        /// Setter for [`authorizationScope`][Self::authorizationScope].
120        ///
121        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
122        #[unsafe(method(setAuthorizationScope:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setAuthorizationScope(&self, authorization_scope: Option<&NSString>);
125
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new() -> Retained<Self>;
133    );
134}