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 #[unsafe(method(setClientID:))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn setClientID(&self, client_id: Option<&NSString>);
63
64 /// A string that authenticates the user’s setup request.
65 ///
66 /// The Media Setup framework uses the `clientSecret` to create a token request.
67 /// Hashed passwords are acceptable, but plaintext passwords aren't.
68 #[unsafe(method(clientSecret))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn clientSecret(&self) -> Option<Retained<NSString>>;
71
72 /// Setter for [`clientSecret`][Self::clientSecret].
73 #[unsafe(method(setClientSecret:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setClientSecret(&self, client_secret: Option<&NSString>);
76
77 /// The path to access the configuration endpoint of your streaming media
78 /// service for the home.
79 ///
80 /// The device retrieves the configuration with the OAuth 2.0 Bearer token.
81 #[unsafe(method(configurationURL))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn configurationURL(&self) -> Option<Retained<NSURL>>;
84
85 /// Setter for [`configurationURL`][Self::configurationURL].
86 #[unsafe(method(setConfigurationURL:))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn setConfigurationURL(&self, configuration_url: Option<&NSURL>);
89
90 /// A URL that provides a token for the user’s HomePod speakers.
91 ///
92 /// The authorization token URL is an OAuth 2.0 token service endpoint that provides a
93 /// Bearer Token for retrieving configuration.
94 #[unsafe(method(authorizationTokenURL))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn authorizationTokenURL(&self) -> Option<Retained<NSURL>>;
97
98 /// Setter for [`authorizationTokenURL`][Self::authorizationTokenURL].
99 #[unsafe(method(setAuthorizationTokenURL:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn setAuthorizationTokenURL(&self, authorization_token_url: Option<&NSURL>);
102
103 /// A list of permissions for the token request.
104 ///
105 /// The authorization scope is an optional OAuth 2.0 scope parameter the system provides
106 /// when requesting a token.
107 #[unsafe(method(authorizationScope))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn authorizationScope(&self) -> Option<Retained<NSString>>;
110
111 /// Setter for [`authorizationScope`][Self::authorizationScope].
112 #[unsafe(method(setAuthorizationScope:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn setAuthorizationScope(&self, authorization_scope: Option<&NSString>);
115
116 #[unsafe(method(init))]
117 #[unsafe(method_family = init)]
118 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120 #[unsafe(method(new))]
121 #[unsafe(method_family = new)]
122 pub unsafe fn new() -> Retained<Self>;
123 );
124}