Skip to main content

nominal_api/conjure/objects/authentication/api/
media_mtx_permission.rs

1/// A permission definition for MediaMTX authentication
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct MediaMtxPermission {
17    #[builder(into)]
18    #[serde(rename = "action")]
19    action: String,
20    #[builder(into)]
21    #[serde(rename = "path")]
22    path: String,
23}
24impl MediaMtxPermission {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(action: impl Into<String>, path: impl Into<String>) -> Self {
28        Self::builder().action(action).path(path).build()
29    }
30    /// The action permitted. Allowed values are publish, read, playback, api, metrics, pprof.
31    #[inline]
32    pub fn action(&self) -> &str {
33        &*self.action
34    }
35    /// The stream path this permission applies to (e.g., "stream/test")
36    #[inline]
37    pub fn path(&self) -> &str {
38        &*self.path
39    }
40}