#[non_exhaustive]pub struct ServiceDefinitionV2Link {
pub name: String,
pub type_: ServiceDefinitionV2LinkType,
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.
type_: ServiceDefinitionV2LinkType
Link type.
url: String
Link URL.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2Link
impl ServiceDefinitionV2Link
Sourcepub fn new(
name: String,
type_: ServiceDefinitionV2LinkType,
url: String,
) -> ServiceDefinitionV2Link
pub fn new( name: String, type_: ServiceDefinitionV2LinkType, url: String, ) -> ServiceDefinitionV2Link
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 57-61)
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 ServiceDefinitionV2Link
impl Clone for ServiceDefinitionV2Link
Source§fn clone(&self) -> ServiceDefinitionV2Link
fn clone(&self) -> ServiceDefinitionV2Link
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 ServiceDefinitionV2Link
impl Debug for ServiceDefinitionV2Link
Source§impl<'de> Deserialize<'de> for ServiceDefinitionV2Link
impl<'de> Deserialize<'de> for ServiceDefinitionV2Link
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 ServiceDefinitionV2Link
impl PartialEq for ServiceDefinitionV2Link
Source§impl Serialize for ServiceDefinitionV2Link
impl Serialize for ServiceDefinitionV2Link
impl StructuralPartialEq for ServiceDefinitionV2Link
Auto Trait Implementations§
impl Freeze for ServiceDefinitionV2Link
impl RefUnwindSafe for ServiceDefinitionV2Link
impl Send for ServiceDefinitionV2Link
impl Sync for ServiceDefinitionV2Link
impl Unpin for ServiceDefinitionV2Link
impl UnwindSafe for ServiceDefinitionV2Link
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