SharedDashboard

Struct SharedDashboard 

Source
#[non_exhaustive]
pub struct SharedDashboard {
Show 19 fields pub author: Option<SharedDashboardAuthor>, pub created: Option<DateTime<Utc>>, pub dashboard_id: String, pub dashboard_type: DashboardType, pub embeddable_domains: Option<Vec<String>>, pub expiration: Option<Option<DateTime<Utc>>>, pub global_time: Option<DashboardGlobalTime>, pub global_time_selectable_enabled: Option<Option<bool>>, pub invitees: Option<Vec<SharedDashboardInviteesItems>>, pub last_accessed: Option<Option<DateTime<Utc>>>, pub public_url: Option<String>, pub selectable_template_vars: Option<Option<Vec<SelectableTemplateVariableItems>>>, pub share_list: Option<Option<Vec<String>>>, pub share_type: Option<Option<DashboardShareType>>, pub status: Option<SharedDashboardStatus>, pub title: Option<String>, pub token: Option<String>, pub viewing_preferences: Option<ViewingPreferences>, pub additional_properties: BTreeMap<String, Value>, /* private fields */
}
Expand description

The metadata object associated with how a dashboard has been/will be shared.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§author: Option<SharedDashboardAuthor>

User who shared the dashboard.

§created: Option<DateTime<Utc>>

Date the dashboard was shared.

§dashboard_id: String

ID of the dashboard to share.

§dashboard_type: DashboardType

The type of the associated private dashboard.

§embeddable_domains: Option<Vec<String>>

The SharedDashboard embeddable_domains.

§expiration: Option<Option<DateTime<Utc>>>

The time when an OPEN shared dashboard becomes publicly unavailable.

§global_time: Option<DashboardGlobalTime>

Object containing the live span selection for the dashboard.

§global_time_selectable_enabled: Option<Option<bool>>

Whether to allow viewers to select a different global time setting for the shared dashboard.

§invitees: Option<Vec<SharedDashboardInviteesItems>>

The SharedDashboard invitees.

§last_accessed: Option<Option<DateTime<Utc>>>

The last time the shared dashboard was accessed. Null if never accessed.

§public_url: Option<String>

URL of the shared dashboard.

§selectable_template_vars: Option<Option<Vec<SelectableTemplateVariableItems>>>

List of objects representing template variables on the shared dashboard which can have selectable values.

§share_list: Option<Option<Vec<String>>>
👎Deprecated

List of email addresses that can receive an invitation to access to the shared dashboard.

§share_type: Option<Option<DashboardShareType>>

Type of sharing access (either open to anyone who has the public URL or invite-only).

§status: Option<SharedDashboardStatus>

Active means the dashboard is publicly available. Paused means the dashboard is not publicly available.

§title: Option<String>

Title of the shared dashboard.

§token: Option<String>

A unique token assigned to the shared dashboard.

§viewing_preferences: Option<ViewingPreferences>

The viewing preferences for a shared dashboard.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl SharedDashboard

Source

pub fn new( dashboard_id: String, dashboard_type: DashboardType, ) -> SharedDashboard

Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard.rs (line 14)
11async fn main() {
12    // there is a valid "dashboard" in the system
13    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
14    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
15        .global_time(
16            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
17        )
18        .share_type(Some(DashboardShareType::OPEN));
19    let configuration = datadog::Configuration::new();
20    let api = DashboardsAPI::with_config(configuration);
21    let resp = api.create_public_dashboard(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
More examples
Hide additional examples
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 15)
12async fn main() {
13    // there is a valid "dashboard" in the system
14    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16        .global_time(
17            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18        )
19        .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20            .default_value("*".to_string())
21            .name("group_by_var".to_string())
22            .type_(Some("group".to_string()))
23            .visible_tags(Some(vec![
24                "selectableValue1".to_string(),
25                "selectableValue2".to_string(),
26            ]))]))
27        .share_type(Some(DashboardShareType::OPEN));
28    let configuration = datadog::Configuration::new();
29    let api = DashboardsAPI::with_config(configuration);
30    let resp = api.create_public_dashboard(body).await;
31    if let Ok(value) = resp {
32        println!("{:#?}", value);
33    } else {
34        println!("{:#?}", resp.unwrap_err());
35    }
36}
Source

pub fn author(self, value: SharedDashboardAuthor) -> Self

Source

pub fn created(self, value: DateTime<Utc>) -> Self

Source

pub fn embeddable_domains(self, value: Vec<String>) -> Self

Source

pub fn expiration(self, value: Option<DateTime<Utc>>) -> Self

Source

pub fn global_time(self, value: DashboardGlobalTime) -> Self

Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard.rs (lines 15-17)
11async fn main() {
12    // there is a valid "dashboard" in the system
13    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
14    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
15        .global_time(
16            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
17        )
18        .share_type(Some(DashboardShareType::OPEN));
19    let configuration = datadog::Configuration::new();
20    let api = DashboardsAPI::with_config(configuration);
21    let resp = api.create_public_dashboard(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
More examples
Hide additional examples
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (lines 16-18)
12async fn main() {
13    // there is a valid "dashboard" in the system
14    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16        .global_time(
17            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18        )
19        .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20            .default_value("*".to_string())
21            .name("group_by_var".to_string())
22            .type_(Some("group".to_string()))
23            .visible_tags(Some(vec![
24                "selectableValue1".to_string(),
25                "selectableValue2".to_string(),
26            ]))]))
27        .share_type(Some(DashboardShareType::OPEN));
28    let configuration = datadog::Configuration::new();
29    let api = DashboardsAPI::with_config(configuration);
30    let resp = api.create_public_dashboard(body).await;
31    if let Ok(value) = resp {
32        println!("{:#?}", value);
33    } else {
34        println!("{:#?}", resp.unwrap_err());
35    }
36}
Source

pub fn global_time_selectable_enabled(self, value: Option<bool>) -> Self

Source

pub fn invitees(self, value: Vec<SharedDashboardInviteesItems>) -> Self

Source

pub fn last_accessed(self, value: Option<DateTime<Utc>>) -> Self

Source

pub fn public_url(self, value: String) -> Self

Source

pub fn selectable_template_vars( self, value: Option<Vec<SelectableTemplateVariableItems>>, ) -> Self

Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (lines 19-26)
12async fn main() {
13    // there is a valid "dashboard" in the system
14    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16        .global_time(
17            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18        )
19        .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20            .default_value("*".to_string())
21            .name("group_by_var".to_string())
22            .type_(Some("group".to_string()))
23            .visible_tags(Some(vec![
24                "selectableValue1".to_string(),
25                "selectableValue2".to_string(),
26            ]))]))
27        .share_type(Some(DashboardShareType::OPEN));
28    let configuration = datadog::Configuration::new();
29    let api = DashboardsAPI::with_config(configuration);
30    let resp = api.create_public_dashboard(body).await;
31    if let Ok(value) = resp {
32        println!("{:#?}", value);
33    } else {
34        println!("{:#?}", resp.unwrap_err());
35    }
36}
Source

pub fn share_list(self, value: Option<Vec<String>>) -> Self

Source

pub fn share_type(self, value: Option<DashboardShareType>) -> Self

Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard.rs (line 18)
11async fn main() {
12    // there is a valid "dashboard" in the system
13    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
14    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
15        .global_time(
16            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
17        )
18        .share_type(Some(DashboardShareType::OPEN));
19    let configuration = datadog::Configuration::new();
20    let api = DashboardsAPI::with_config(configuration);
21    let resp = api.create_public_dashboard(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
More examples
Hide additional examples
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 27)
12async fn main() {
13    // there is a valid "dashboard" in the system
14    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15    let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16        .global_time(
17            DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18        )
19        .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20            .default_value("*".to_string())
21            .name("group_by_var".to_string())
22            .type_(Some("group".to_string()))
23            .visible_tags(Some(vec![
24                "selectableValue1".to_string(),
25                "selectableValue2".to_string(),
26            ]))]))
27        .share_type(Some(DashboardShareType::OPEN));
28    let configuration = datadog::Configuration::new();
29    let api = DashboardsAPI::with_config(configuration);
30    let resp = api.create_public_dashboard(body).await;
31    if let Ok(value) = resp {
32        println!("{:#?}", value);
33    } else {
34        println!("{:#?}", resp.unwrap_err());
35    }
36}
Source

pub fn status(self, value: SharedDashboardStatus) -> Self

Source

pub fn title(self, value: String) -> Self

Source

pub fn token(self, value: String) -> Self

Source

pub fn viewing_preferences(self, value: ViewingPreferences) -> Self

Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for SharedDashboard

Source§

fn clone(&self) -> SharedDashboard

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SharedDashboard

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SharedDashboard

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SharedDashboard

Source§

fn eq(&self, other: &SharedDashboard) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SharedDashboard

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SharedDashboard

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,