#[non_exhaustive]pub struct ServiceDefinitionV2Dot1Link {
pub name: String,
pub provider: Option<String>,
pub type_: ServiceDefinitionV2Dot1LinkType,
pub url: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Service’s external links.
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.name: String
Link name.
provider: Option<String>
Link provider.
type_: ServiceDefinitionV2Dot1LinkType
Link type.
url: String
Link URL.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2Dot1Link
impl ServiceDefinitionV2Dot1Link
Sourcepub fn new(
name: String,
type_: ServiceDefinitionV2Dot1LinkType,
url: String,
) -> ServiceDefinitionV2Dot1Link
pub fn new( name: String, type_: ServiceDefinitionV2Dot1LinkType, url: String, ) -> ServiceDefinitionV2Dot1Link
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2619874414.rs (lines 53-57)
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 provider(self, value: String) -> Self
pub fn provider(self, value: String) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2619874414.rs (line 63)
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 ServiceDefinitionV2Dot1Link
impl Clone for ServiceDefinitionV2Dot1Link
Source§fn clone(&self) -> ServiceDefinitionV2Dot1Link
fn clone(&self) -> ServiceDefinitionV2Dot1Link
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 Debug for ServiceDefinitionV2Dot1Link
impl Debug for ServiceDefinitionV2Dot1Link
Source§impl<'de> Deserialize<'de> for ServiceDefinitionV2Dot1Link
impl<'de> Deserialize<'de> for ServiceDefinitionV2Dot1Link
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
impl StructuralPartialEq for ServiceDefinitionV2Dot1Link
Auto Trait Implementations§
impl Freeze for ServiceDefinitionV2Dot1Link
impl RefUnwindSafe for ServiceDefinitionV2Dot1Link
impl Send for ServiceDefinitionV2Dot1Link
impl Sync for ServiceDefinitionV2Dot1Link
impl Unpin for ServiceDefinitionV2Dot1Link
impl UnwindSafe for ServiceDefinitionV2Dot1Link
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