Struct ServiceDefinitionV2Dot2Integrations

Source
#[non_exhaustive]
pub struct ServiceDefinitionV2Dot2Integrations { pub opsgenie: Option<ServiceDefinitionV2Dot2Opsgenie>, pub pagerduty: Option<ServiceDefinitionV2Dot2Pagerduty>, 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<ServiceDefinitionV2Dot2Opsgenie>

Opsgenie integration for the service.

§pagerduty: Option<ServiceDefinitionV2Dot2Pagerduty>

PagerDuty integration for the service.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl ServiceDefinitionV2Dot2Integrations

Source

pub fn new() -> ServiceDefinitionV2Dot2Integrations

Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2621709423.rs (line 33)
17async fn main() {
18    let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19        ServiceDefinitionV2Dot2::new(
20            "service-exampleservicedefinition".to_string(),
21            ServiceDefinitionV2Dot2Version::V2_2,
22        )
23        .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24            "contact@datadoghq.com".to_string(),
25            "email".to_string(),
26        )
27        .name("Team Email".to_string())])
28        .extensions(BTreeMap::from([(
29            "myorgextension".to_string(),
30            Value::from("extensionvalue"),
31        )]))
32        .integrations(
33            ServiceDefinitionV2Dot2Integrations::new()
34                .opsgenie(
35                    ServiceDefinitionV2Dot2Opsgenie::new(
36                        "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37                            .to_string(),
38                    )
39                    .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40                )
41                .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42                    "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43                )),
44        )
45        .links(vec![
46            ServiceDefinitionV2Dot2Link::new(
47                "Runbook".to_string(),
48                "runbook".to_string(),
49                "https://my-runbook".to_string(),
50            ),
51            ServiceDefinitionV2Dot2Link::new(
52                "Source Code".to_string(),
53                "repo".to_string(),
54                "https://github.com/DataDog/schema".to_string(),
55            )
56            .provider("GitHub".to_string()),
57            ServiceDefinitionV2Dot2Link::new(
58                "Architecture".to_string(),
59                "doc".to_string(),
60                "https://my-runbook".to_string(),
61            )
62            .provider("Gigoogle drivetHub".to_string()),
63        ])
64        .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65        .team("my-team".to_string()),
66    ));
67    let configuration = datadog::Configuration::new();
68    let api = ServiceDefinitionAPI::with_config(configuration);
69    let resp = api.create_or_update_service_definitions(body).await;
70    if let Ok(value) = resp {
71        println!("{:#?}", value);
72    } else {
73        println!("{:#?}", resp.unwrap_err());
74    }
75}
More examples
Hide additional examples
examples/v2_service-definition_CreateOrUpdateServiceDefinitions.rs (line 36)
17async fn main() {
18    let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19        ServiceDefinitionV2Dot2::new(
20            "my-service".to_string(),
21            ServiceDefinitionV2Dot2Version::V2_2,
22        )
23        .application("my-app".to_string())
24        .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25        .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26            "https://teams.microsoft.com/myteam".to_string(),
27            "slack".to_string(),
28        )
29        .name("My team channel".to_string())])
30        .description("My service description".to_string())
31        .extensions(BTreeMap::from([(
32            "myorg/extension".to_string(),
33            Value::from("extensionValue"),
34        )]))
35        .integrations(
36            ServiceDefinitionV2Dot2Integrations::new()
37                .opsgenie(
38                    ServiceDefinitionV2Dot2Opsgenie::new(
39                        "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40                            .to_string(),
41                    )
42                    .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43                )
44                .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45                    "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46                )),
47        )
48        .languages(vec![
49            "dotnet".to_string(),
50            "go".to_string(),
51            "java".to_string(),
52            "js".to_string(),
53            "php".to_string(),
54            "python".to_string(),
55            "ruby".to_string(),
56            "c++".to_string(),
57        ])
58        .lifecycle("sandbox".to_string())
59        .links(vec![ServiceDefinitionV2Dot2Link::new(
60            "Runbook".to_string(),
61            "runbook".to_string(),
62            "https://my-runbook".to_string(),
63        )
64        .provider("Github".to_string())])
65        .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66        .team("my-team".to_string())
67        .tier("High".to_string())
68        .type_("web".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}
Source

pub fn opsgenie(self, value: ServiceDefinitionV2Dot2Opsgenie) -> Self

Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2621709423.rs (lines 34-40)
17async fn main() {
18    let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19        ServiceDefinitionV2Dot2::new(
20            "service-exampleservicedefinition".to_string(),
21            ServiceDefinitionV2Dot2Version::V2_2,
22        )
23        .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24            "contact@datadoghq.com".to_string(),
25            "email".to_string(),
26        )
27        .name("Team Email".to_string())])
28        .extensions(BTreeMap::from([(
29            "myorgextension".to_string(),
30            Value::from("extensionvalue"),
31        )]))
32        .integrations(
33            ServiceDefinitionV2Dot2Integrations::new()
34                .opsgenie(
35                    ServiceDefinitionV2Dot2Opsgenie::new(
36                        "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37                            .to_string(),
38                    )
39                    .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40                )
41                .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42                    "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43                )),
44        )
45        .links(vec![
46            ServiceDefinitionV2Dot2Link::new(
47                "Runbook".to_string(),
48                "runbook".to_string(),
49                "https://my-runbook".to_string(),
50            ),
51            ServiceDefinitionV2Dot2Link::new(
52                "Source Code".to_string(),
53                "repo".to_string(),
54                "https://github.com/DataDog/schema".to_string(),
55            )
56            .provider("GitHub".to_string()),
57            ServiceDefinitionV2Dot2Link::new(
58                "Architecture".to_string(),
59                "doc".to_string(),
60                "https://my-runbook".to_string(),
61            )
62            .provider("Gigoogle drivetHub".to_string()),
63        ])
64        .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65        .team("my-team".to_string()),
66    ));
67    let configuration = datadog::Configuration::new();
68    let api = ServiceDefinitionAPI::with_config(configuration);
69    let resp = api.create_or_update_service_definitions(body).await;
70    if let Ok(value) = resp {
71        println!("{:#?}", value);
72    } else {
73        println!("{:#?}", resp.unwrap_err());
74    }
75}
More examples
Hide additional examples
examples/v2_service-definition_CreateOrUpdateServiceDefinitions.rs (lines 37-43)
17async fn main() {
18    let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19        ServiceDefinitionV2Dot2::new(
20            "my-service".to_string(),
21            ServiceDefinitionV2Dot2Version::V2_2,
22        )
23        .application("my-app".to_string())
24        .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25        .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26            "https://teams.microsoft.com/myteam".to_string(),
27            "slack".to_string(),
28        )
29        .name("My team channel".to_string())])
30        .description("My service description".to_string())
31        .extensions(BTreeMap::from([(
32            "myorg/extension".to_string(),
33            Value::from("extensionValue"),
34        )]))
35        .integrations(
36            ServiceDefinitionV2Dot2Integrations::new()
37                .opsgenie(
38                    ServiceDefinitionV2Dot2Opsgenie::new(
39                        "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40                            .to_string(),
41                    )
42                    .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43                )
44                .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45                    "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46                )),
47        )
48        .languages(vec![
49            "dotnet".to_string(),
50            "go".to_string(),
51            "java".to_string(),
52            "js".to_string(),
53            "php".to_string(),
54            "python".to_string(),
55            "ruby".to_string(),
56            "c++".to_string(),
57        ])
58        .lifecycle("sandbox".to_string())
59        .links(vec![ServiceDefinitionV2Dot2Link::new(
60            "Runbook".to_string(),
61            "runbook".to_string(),
62            "https://my-runbook".to_string(),
63        )
64        .provider("Github".to_string())])
65        .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66        .team("my-team".to_string())
67        .tier("High".to_string())
68        .type_("web".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}
Source

pub fn pagerduty(self, value: ServiceDefinitionV2Dot2Pagerduty) -> Self

Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_2621709423.rs (lines 41-43)
17async fn main() {
18    let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19        ServiceDefinitionV2Dot2::new(
20            "service-exampleservicedefinition".to_string(),
21            ServiceDefinitionV2Dot2Version::V2_2,
22        )
23        .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24            "contact@datadoghq.com".to_string(),
25            "email".to_string(),
26        )
27        .name("Team Email".to_string())])
28        .extensions(BTreeMap::from([(
29            "myorgextension".to_string(),
30            Value::from("extensionvalue"),
31        )]))
32        .integrations(
33            ServiceDefinitionV2Dot2Integrations::new()
34                .opsgenie(
35                    ServiceDefinitionV2Dot2Opsgenie::new(
36                        "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37                            .to_string(),
38                    )
39                    .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40                )
41                .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42                    "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43                )),
44        )
45        .links(vec![
46            ServiceDefinitionV2Dot2Link::new(
47                "Runbook".to_string(),
48                "runbook".to_string(),
49                "https://my-runbook".to_string(),
50            ),
51            ServiceDefinitionV2Dot2Link::new(
52                "Source Code".to_string(),
53                "repo".to_string(),
54                "https://github.com/DataDog/schema".to_string(),
55            )
56            .provider("GitHub".to_string()),
57            ServiceDefinitionV2Dot2Link::new(
58                "Architecture".to_string(),
59                "doc".to_string(),
60                "https://my-runbook".to_string(),
61            )
62            .provider("Gigoogle drivetHub".to_string()),
63        ])
64        .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65        .team("my-team".to_string()),
66    ));
67    let configuration = datadog::Configuration::new();
68    let api = ServiceDefinitionAPI::with_config(configuration);
69    let resp = api.create_or_update_service_definitions(body).await;
70    if let Ok(value) = resp {
71        println!("{:#?}", value);
72    } else {
73        println!("{:#?}", resp.unwrap_err());
74    }
75}
More examples
Hide additional examples
examples/v2_service-definition_CreateOrUpdateServiceDefinitions.rs (lines 44-46)
17async fn main() {
18    let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19        ServiceDefinitionV2Dot2::new(
20            "my-service".to_string(),
21            ServiceDefinitionV2Dot2Version::V2_2,
22        )
23        .application("my-app".to_string())
24        .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25        .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26            "https://teams.microsoft.com/myteam".to_string(),
27            "slack".to_string(),
28        )
29        .name("My team channel".to_string())])
30        .description("My service description".to_string())
31        .extensions(BTreeMap::from([(
32            "myorg/extension".to_string(),
33            Value::from("extensionValue"),
34        )]))
35        .integrations(
36            ServiceDefinitionV2Dot2Integrations::new()
37                .opsgenie(
38                    ServiceDefinitionV2Dot2Opsgenie::new(
39                        "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40                            .to_string(),
41                    )
42                    .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43                )
44                .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45                    "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46                )),
47        )
48        .languages(vec![
49            "dotnet".to_string(),
50            "go".to_string(),
51            "java".to_string(),
52            "js".to_string(),
53            "php".to_string(),
54            "python".to_string(),
55            "ruby".to_string(),
56            "c++".to_string(),
57        ])
58        .lifecycle("sandbox".to_string())
59        .links(vec![ServiceDefinitionV2Dot2Link::new(
60            "Runbook".to_string(),
61            "runbook".to_string(),
62            "https://my-runbook".to_string(),
63        )
64        .provider("Github".to_string())])
65        .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66        .team("my-team".to_string())
67        .tier("High".to_string())
68        .type_("web".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}
Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for ServiceDefinitionV2Dot2Integrations

Source§

fn clone(&self) -> ServiceDefinitionV2Dot2Integrations

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServiceDefinitionV2Dot2Integrations

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServiceDefinitionV2Dot2Integrations

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ServiceDefinitionV2Dot2Integrations

Source§

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 ServiceDefinitionV2Dot2Integrations

Source§

fn eq(&self, other: &ServiceDefinitionV2Dot2Integrations) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ServiceDefinitionV2Dot2Integrations

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ServiceDefinitionV2Dot2Integrations

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,