#[non_exhaustive]pub struct ServiceDefinitionV2Repo {
pub name: String,
pub provider: Option<String>,
pub url: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Service code repositories.
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
Repository name.
provider: Option<String>
Repository provider.
url: String
Repository URL.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2Repo
impl ServiceDefinitionV2Repo
Sourcepub fn new(name: String, url: String) -> ServiceDefinitionV2Repo
pub fn new(name: String, url: String) -> ServiceDefinitionV2Repo
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 62-65)
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 provider(self, value: String) -> Self
pub fn provider(self, value: String) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (line 66)
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 ServiceDefinitionV2Repo
impl Clone for ServiceDefinitionV2Repo
Source§fn clone(&self) -> ServiceDefinitionV2Repo
fn clone(&self) -> ServiceDefinitionV2Repo
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 ServiceDefinitionV2Repo
impl Debug for ServiceDefinitionV2Repo
Source§impl<'de> Deserialize<'de> for ServiceDefinitionV2Repo
impl<'de> Deserialize<'de> for ServiceDefinitionV2Repo
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 ServiceDefinitionV2Repo
impl PartialEq for ServiceDefinitionV2Repo
Source§impl Serialize for ServiceDefinitionV2Repo
impl Serialize for ServiceDefinitionV2Repo
impl StructuralPartialEq for ServiceDefinitionV2Repo
Auto Trait Implementations§
impl Freeze for ServiceDefinitionV2Repo
impl RefUnwindSafe for ServiceDefinitionV2Repo
impl Send for ServiceDefinitionV2Repo
impl Sync for ServiceDefinitionV2Repo
impl Unpin for ServiceDefinitionV2Repo
impl UnwindSafe for ServiceDefinitionV2Repo
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