#[non_exhaustive]pub struct ServiceDefinitionV2Integrations {
pub opsgenie: Option<ServiceDefinitionV2Opsgenie>,
pub pagerduty: Option<String>,
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<ServiceDefinitionV2Opsgenie>
Opsgenie integration for the service.
pagerduty: Option<String>
PagerDuty service URL for the service.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2Integrations
impl ServiceDefinitionV2Integrations
Sourcepub fn new() -> ServiceDefinitionV2Integrations
pub fn new() -> ServiceDefinitionV2Integrations
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (line 47)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn opsgenie(self, value: ServiceDefinitionV2Opsgenie) -> Self
pub fn opsgenie(self, value: ServiceDefinitionV2Opsgenie) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 48-54)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn pagerduty(self, value: String) -> Self
pub fn pagerduty(self, value: String) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (line 55)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ServiceDefinitionV2Integrations
impl Clone for ServiceDefinitionV2Integrations
Source§fn clone(&self) -> ServiceDefinitionV2Integrations
fn clone(&self) -> ServiceDefinitionV2Integrations
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 ServiceDefinitionV2Integrations
impl<'de> Deserialize<'de> for ServiceDefinitionV2Integrations
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 ServiceDefinitionV2Integrations
impl PartialEq for ServiceDefinitionV2Integrations
Source§fn eq(&self, other: &ServiceDefinitionV2Integrations) -> bool
fn eq(&self, other: &ServiceDefinitionV2Integrations) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ServiceDefinitionV2Integrations
Auto Trait Implementations§
impl Freeze for ServiceDefinitionV2Integrations
impl RefUnwindSafe for ServiceDefinitionV2Integrations
impl Send for ServiceDefinitionV2Integrations
impl Sync for ServiceDefinitionV2Integrations
impl Unpin for ServiceDefinitionV2Integrations
impl UnwindSafe for ServiceDefinitionV2Integrations
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