#[non_exhaustive]pub struct ServiceDefinitionV2Dot1Integrations {
pub opsgenie: Option<ServiceDefinitionV2Dot1Opsgenie>,
pub pagerduty: Option<ServiceDefinitionV2Dot1Pagerduty>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Third party integrations that Datadog supports.
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.opsgenie: Option<ServiceDefinitionV2Dot1Opsgenie>
Opsgenie integration for the service.
pagerduty: Option<ServiceDefinitionV2Dot1Pagerduty>
PagerDuty integration for the service.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2Dot1Integrations
impl ServiceDefinitionV2Dot1Integrations
Sourcepub fn new() -> ServiceDefinitionV2Dot1Integrations
pub fn new() -> ServiceDefinitionV2Dot1Integrations
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2619874414.rs (line 40)
20async fn main() {
21 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot1(Box::new(
22 ServiceDefinitionV2Dot1::new(
23 "service-exampleservicedefinition".to_string(),
24 ServiceDefinitionV2Dot1Version::V2_1,
25 )
26 .contacts(vec![
27 ServiceDefinitionV2Dot1Contact::ServiceDefinitionV2Dot1Email(Box::new(
28 ServiceDefinitionV2Dot1Email::new(
29 "contact@datadoghq.com".to_string(),
30 ServiceDefinitionV2Dot1EmailType::EMAIL,
31 )
32 .name("Team Email".to_string()),
33 )),
34 ])
35 .extensions(BTreeMap::from([(
36 "myorgextension".to_string(),
37 Value::from("extensionvalue"),
38 )]))
39 .integrations(
40 ServiceDefinitionV2Dot1Integrations::new()
41 .opsgenie(
42 ServiceDefinitionV2Dot1Opsgenie::new(
43 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
44 .to_string(),
45 )
46 .region(ServiceDefinitionV2Dot1OpsgenieRegion::US),
47 )
48 .pagerduty(ServiceDefinitionV2Dot1Pagerduty::new().service_url(
49 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
50 )),
51 )
52 .links(vec![
53 ServiceDefinitionV2Dot1Link::new(
54 "Runbook".to_string(),
55 ServiceDefinitionV2Dot1LinkType::RUNBOOK,
56 "https://my-runbook".to_string(),
57 ),
58 ServiceDefinitionV2Dot1Link::new(
59 "Source Code".to_string(),
60 ServiceDefinitionV2Dot1LinkType::REPO,
61 "https://github.com/DataDog/schema".to_string(),
62 )
63 .provider("GitHub".to_string()),
64 ServiceDefinitionV2Dot1Link::new(
65 "Architecture".to_string(),
66 ServiceDefinitionV2Dot1LinkType::DOC,
67 "https://my-runbook".to_string(),
68 )
69 .provider("Gigoogle drivetHub".to_string()),
70 ])
71 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
72 .team("my-team".to_string()),
73 ));
74 let configuration = datadog::Configuration::new();
75 let api = ServiceDefinitionAPI::with_config(configuration);
76 let resp = api.create_or_update_service_definitions(body).await;
77 if let Ok(value) = resp {
78 println!("{:#?}", value);
79 } else {
80 println!("{:#?}", resp.unwrap_err());
81 }
82}
Sourcepub fn opsgenie(self, value: ServiceDefinitionV2Dot1Opsgenie) -> Self
pub fn opsgenie(self, value: ServiceDefinitionV2Dot1Opsgenie) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2619874414.rs (lines 41-47)
20async fn main() {
21 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot1(Box::new(
22 ServiceDefinitionV2Dot1::new(
23 "service-exampleservicedefinition".to_string(),
24 ServiceDefinitionV2Dot1Version::V2_1,
25 )
26 .contacts(vec![
27 ServiceDefinitionV2Dot1Contact::ServiceDefinitionV2Dot1Email(Box::new(
28 ServiceDefinitionV2Dot1Email::new(
29 "contact@datadoghq.com".to_string(),
30 ServiceDefinitionV2Dot1EmailType::EMAIL,
31 )
32 .name("Team Email".to_string()),
33 )),
34 ])
35 .extensions(BTreeMap::from([(
36 "myorgextension".to_string(),
37 Value::from("extensionvalue"),
38 )]))
39 .integrations(
40 ServiceDefinitionV2Dot1Integrations::new()
41 .opsgenie(
42 ServiceDefinitionV2Dot1Opsgenie::new(
43 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
44 .to_string(),
45 )
46 .region(ServiceDefinitionV2Dot1OpsgenieRegion::US),
47 )
48 .pagerduty(ServiceDefinitionV2Dot1Pagerduty::new().service_url(
49 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
50 )),
51 )
52 .links(vec![
53 ServiceDefinitionV2Dot1Link::new(
54 "Runbook".to_string(),
55 ServiceDefinitionV2Dot1LinkType::RUNBOOK,
56 "https://my-runbook".to_string(),
57 ),
58 ServiceDefinitionV2Dot1Link::new(
59 "Source Code".to_string(),
60 ServiceDefinitionV2Dot1LinkType::REPO,
61 "https://github.com/DataDog/schema".to_string(),
62 )
63 .provider("GitHub".to_string()),
64 ServiceDefinitionV2Dot1Link::new(
65 "Architecture".to_string(),
66 ServiceDefinitionV2Dot1LinkType::DOC,
67 "https://my-runbook".to_string(),
68 )
69 .provider("Gigoogle drivetHub".to_string()),
70 ])
71 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
72 .team("my-team".to_string()),
73 ));
74 let configuration = datadog::Configuration::new();
75 let api = ServiceDefinitionAPI::with_config(configuration);
76 let resp = api.create_or_update_service_definitions(body).await;
77 if let Ok(value) = resp {
78 println!("{:#?}", value);
79 } else {
80 println!("{:#?}", resp.unwrap_err());
81 }
82}
Sourcepub fn pagerduty(self, value: ServiceDefinitionV2Dot1Pagerduty) -> Self
pub fn pagerduty(self, value: ServiceDefinitionV2Dot1Pagerduty) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2619874414.rs (lines 48-50)
20async fn main() {
21 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot1(Box::new(
22 ServiceDefinitionV2Dot1::new(
23 "service-exampleservicedefinition".to_string(),
24 ServiceDefinitionV2Dot1Version::V2_1,
25 )
26 .contacts(vec![
27 ServiceDefinitionV2Dot1Contact::ServiceDefinitionV2Dot1Email(Box::new(
28 ServiceDefinitionV2Dot1Email::new(
29 "contact@datadoghq.com".to_string(),
30 ServiceDefinitionV2Dot1EmailType::EMAIL,
31 )
32 .name("Team Email".to_string()),
33 )),
34 ])
35 .extensions(BTreeMap::from([(
36 "myorgextension".to_string(),
37 Value::from("extensionvalue"),
38 )]))
39 .integrations(
40 ServiceDefinitionV2Dot1Integrations::new()
41 .opsgenie(
42 ServiceDefinitionV2Dot1Opsgenie::new(
43 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
44 .to_string(),
45 )
46 .region(ServiceDefinitionV2Dot1OpsgenieRegion::US),
47 )
48 .pagerduty(ServiceDefinitionV2Dot1Pagerduty::new().service_url(
49 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
50 )),
51 )
52 .links(vec![
53 ServiceDefinitionV2Dot1Link::new(
54 "Runbook".to_string(),
55 ServiceDefinitionV2Dot1LinkType::RUNBOOK,
56 "https://my-runbook".to_string(),
57 ),
58 ServiceDefinitionV2Dot1Link::new(
59 "Source Code".to_string(),
60 ServiceDefinitionV2Dot1LinkType::REPO,
61 "https://github.com/DataDog/schema".to_string(),
62 )
63 .provider("GitHub".to_string()),
64 ServiceDefinitionV2Dot1Link::new(
65 "Architecture".to_string(),
66 ServiceDefinitionV2Dot1LinkType::DOC,
67 "https://my-runbook".to_string(),
68 )
69 .provider("Gigoogle drivetHub".to_string()),
70 ])
71 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
72 .team("my-team".to_string()),
73 ));
74 let configuration = datadog::Configuration::new();
75 let api = ServiceDefinitionAPI::with_config(configuration);
76 let resp = api.create_or_update_service_definitions(body).await;
77 if let Ok(value) = resp {
78 println!("{:#?}", value);
79 } else {
80 println!("{:#?}", resp.unwrap_err());
81 }
82}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ServiceDefinitionV2Dot1Integrations
impl Clone for ServiceDefinitionV2Dot1Integrations
Source§fn clone(&self) -> ServiceDefinitionV2Dot1Integrations
fn clone(&self) -> ServiceDefinitionV2Dot1Integrations
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de> Deserialize<'de> for ServiceDefinitionV2Dot1Integrations
impl<'de> Deserialize<'de> for ServiceDefinitionV2Dot1Integrations
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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 ServiceDefinitionV2Dot1Integrations
impl PartialEq for ServiceDefinitionV2Dot1Integrations
Source§fn eq(&self, other: &ServiceDefinitionV2Dot1Integrations) -> bool
fn eq(&self, other: &ServiceDefinitionV2Dot1Integrations) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ServiceDefinitionV2Dot1Integrations
Auto Trait Implementations§
impl Freeze for ServiceDefinitionV2Dot1Integrations
impl RefUnwindSafe for ServiceDefinitionV2Dot1Integrations
impl Send for ServiceDefinitionV2Dot1Integrations
impl Sync for ServiceDefinitionV2Dot1Integrations
impl Unpin for ServiceDefinitionV2Dot1Integrations
impl UnwindSafe for ServiceDefinitionV2Dot1Integrations
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more