#[non_exhaustive]pub struct OpsgenieServiceUpdateAttributes {
pub custom_url: Option<Option<String>>,
pub name: Option<String>,
pub opsgenie_api_key: Option<String>,
pub region: Option<OpsgenieServiceRegionType>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The Opsgenie service attributes for an update request.
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.custom_url: Option<Option<String>>
The custom URL for a custom region.
name: Option<String>
The name for the Opsgenie service.
opsgenie_api_key: Option<String>
The Opsgenie API key for your Opsgenie service.
region: Option<OpsgenieServiceRegionType>
The region for the Opsgenie service.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl OpsgenieServiceUpdateAttributes
impl OpsgenieServiceUpdateAttributes
Sourcepub fn new() -> OpsgenieServiceUpdateAttributes
pub fn new() -> OpsgenieServiceUpdateAttributes
Examples found in repository?
examples/v2_opsgenie-integration_UpdateOpsgenieService.rs (line 15)
11async fn main() {
12 // there is a valid "opsgenie_service" in the system
13 let opsgenie_service_data_id = std::env::var("OPSGENIE_SERVICE_DATA_ID").unwrap();
14 let body = OpsgenieServiceUpdateRequest::new(OpsgenieServiceUpdateData::new(
15 OpsgenieServiceUpdateAttributes::new()
16 .name("fake-opsgenie-service-name--updated".to_string())
17 .opsgenie_api_key("00000000-0000-0000-0000-000000000000".to_string())
18 .region(OpsgenieServiceRegionType::EU),
19 opsgenie_service_data_id.clone(),
20 OpsgenieServiceType::OPSGENIE_SERVICE,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = OpsgenieIntegrationAPI::with_config(configuration);
24 let resp = api
25 .update_opsgenie_service(opsgenie_service_data_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
pub fn custom_url(self, value: Option<String>) -> Self
Sourcepub fn name(self, value: String) -> Self
pub fn name(self, value: String) -> Self
Examples found in repository?
examples/v2_opsgenie-integration_UpdateOpsgenieService.rs (line 16)
11async fn main() {
12 // there is a valid "opsgenie_service" in the system
13 let opsgenie_service_data_id = std::env::var("OPSGENIE_SERVICE_DATA_ID").unwrap();
14 let body = OpsgenieServiceUpdateRequest::new(OpsgenieServiceUpdateData::new(
15 OpsgenieServiceUpdateAttributes::new()
16 .name("fake-opsgenie-service-name--updated".to_string())
17 .opsgenie_api_key("00000000-0000-0000-0000-000000000000".to_string())
18 .region(OpsgenieServiceRegionType::EU),
19 opsgenie_service_data_id.clone(),
20 OpsgenieServiceType::OPSGENIE_SERVICE,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = OpsgenieIntegrationAPI::with_config(configuration);
24 let resp = api
25 .update_opsgenie_service(opsgenie_service_data_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
Sourcepub fn opsgenie_api_key(self, value: String) -> Self
pub fn opsgenie_api_key(self, value: String) -> Self
Examples found in repository?
examples/v2_opsgenie-integration_UpdateOpsgenieService.rs (line 17)
11async fn main() {
12 // there is a valid "opsgenie_service" in the system
13 let opsgenie_service_data_id = std::env::var("OPSGENIE_SERVICE_DATA_ID").unwrap();
14 let body = OpsgenieServiceUpdateRequest::new(OpsgenieServiceUpdateData::new(
15 OpsgenieServiceUpdateAttributes::new()
16 .name("fake-opsgenie-service-name--updated".to_string())
17 .opsgenie_api_key("00000000-0000-0000-0000-000000000000".to_string())
18 .region(OpsgenieServiceRegionType::EU),
19 opsgenie_service_data_id.clone(),
20 OpsgenieServiceType::OPSGENIE_SERVICE,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = OpsgenieIntegrationAPI::with_config(configuration);
24 let resp = api
25 .update_opsgenie_service(opsgenie_service_data_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
Sourcepub fn region(self, value: OpsgenieServiceRegionType) -> Self
pub fn region(self, value: OpsgenieServiceRegionType) -> Self
Examples found in repository?
examples/v2_opsgenie-integration_UpdateOpsgenieService.rs (line 18)
11async fn main() {
12 // there is a valid "opsgenie_service" in the system
13 let opsgenie_service_data_id = std::env::var("OPSGENIE_SERVICE_DATA_ID").unwrap();
14 let body = OpsgenieServiceUpdateRequest::new(OpsgenieServiceUpdateData::new(
15 OpsgenieServiceUpdateAttributes::new()
16 .name("fake-opsgenie-service-name--updated".to_string())
17 .opsgenie_api_key("00000000-0000-0000-0000-000000000000".to_string())
18 .region(OpsgenieServiceRegionType::EU),
19 opsgenie_service_data_id.clone(),
20 OpsgenieServiceType::OPSGENIE_SERVICE,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = OpsgenieIntegrationAPI::with_config(configuration);
24 let resp = api
25 .update_opsgenie_service(opsgenie_service_data_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for OpsgenieServiceUpdateAttributes
impl Clone for OpsgenieServiceUpdateAttributes
Source§fn clone(&self) -> OpsgenieServiceUpdateAttributes
fn clone(&self) -> OpsgenieServiceUpdateAttributes
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 OpsgenieServiceUpdateAttributes
impl<'de> Deserialize<'de> for OpsgenieServiceUpdateAttributes
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 OpsgenieServiceUpdateAttributes
impl PartialEq for OpsgenieServiceUpdateAttributes
Source§fn eq(&self, other: &OpsgenieServiceUpdateAttributes) -> bool
fn eq(&self, other: &OpsgenieServiceUpdateAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for OpsgenieServiceUpdateAttributes
Auto Trait Implementations§
impl Freeze for OpsgenieServiceUpdateAttributes
impl RefUnwindSafe for OpsgenieServiceUpdateAttributes
impl Send for OpsgenieServiceUpdateAttributes
impl Sync for OpsgenieServiceUpdateAttributes
impl Unpin for OpsgenieServiceUpdateAttributes
impl UnwindSafe for OpsgenieServiceUpdateAttributes
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