Skip to main content

web_sys/features/
gen_RequestMediaKeySystemAccessNotification.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "RequestMediaKeySystemAccessNotification"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `RequestMediaKeySystemAccessNotification` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"]
15    pub type RequestMediaKeySystemAccessNotification;
16    #[doc = "Get the `keySystem` field of this object."]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"]
19    #[wasm_bindgen(method, getter = "keySystem")]
20    pub fn get_key_system(
21        this: &RequestMediaKeySystemAccessNotification,
22    ) -> ::alloc::string::String;
23    #[doc = "Change the `keySystem` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"]
26    #[wasm_bindgen(method, setter = "keySystem")]
27    pub fn set_key_system(this: &RequestMediaKeySystemAccessNotification, val: &str);
28    #[cfg(feature = "MediaKeySystemStatus")]
29    #[doc = "Get the `status` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"]
32    #[wasm_bindgen(method, getter = "status")]
33    pub fn get_status(this: &RequestMediaKeySystemAccessNotification) -> MediaKeySystemStatus;
34    #[cfg(feature = "MediaKeySystemStatus")]
35    #[doc = "Change the `status` field of this object."]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"]
38    #[wasm_bindgen(method, setter = "status")]
39    pub fn set_status(this: &RequestMediaKeySystemAccessNotification, val: MediaKeySystemStatus);
40}
41impl RequestMediaKeySystemAccessNotification {
42    #[cfg(feature = "MediaKeySystemStatus")]
43    #[doc = "Construct a new `RequestMediaKeySystemAccessNotification`."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"]
46    pub fn new(key_system: &str, status: MediaKeySystemStatus) -> Self {
47        #[allow(unused_mut)]
48        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
49        ret.set_key_system(key_system);
50        ret.set_status(status);
51        ret
52    }
53    #[deprecated = "Use `set_key_system()` instead."]
54    pub fn key_system(&mut self, val: &str) -> &mut Self {
55        self.set_key_system(val);
56        self
57    }
58    #[cfg(feature = "MediaKeySystemStatus")]
59    #[deprecated = "Use `set_status()` instead."]
60    pub fn status(&mut self, val: MediaKeySystemStatus) -> &mut Self {
61        self.set_status(val);
62        self
63    }
64}