#[non_exhaustive]pub struct CustomDestinationElasticsearchDestinationAuth {
pub password: String,
pub username: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Basic access authentication.
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.password: String
The password of the authentication. This field is not returned by the API.
username: String
The username of the authentication. This field is not returned by the API.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CustomDestinationElasticsearchDestinationAuth
impl CustomDestinationElasticsearchDestinationAuth
Sourcepub fn new(
password: String,
username: String,
) -> CustomDestinationElasticsearchDestinationAuth
pub fn new( password: String, username: String, ) -> CustomDestinationElasticsearchDestinationAuth
Examples found in repository?
examples/v2_logs-custom-destinations_CreateLogsCustomDestination_141236188.rs (lines 22-25)
15async fn main() {
16 let body = CustomDestinationCreateRequest::new()
17 .data(CustomDestinationCreateRequestDefinition::new(
18 CustomDestinationCreateRequestAttributes::new(
19 CustomDestinationForwardDestination::CustomDestinationForwardDestinationElasticsearch(
20 Box::new(
21 CustomDestinationForwardDestinationElasticsearch::new(
22 CustomDestinationElasticsearchDestinationAuth::new(
23 "my-password".to_string(),
24 "my-username".to_string(),
25 ),
26 "https://example.com".to_string(),
27 "nginx-logs".to_string(),
28 CustomDestinationForwardDestinationElasticsearchType::ELASTICSEARCH,
29 )
30 .index_rotation("yyyy-MM-dd".to_string()),
31 ),
32 ),
33 "Nginx logs".to_string(),
34 )
35 .enabled(false)
36 .forward_tags(false)
37 .forward_tags_restriction_list(vec!["datacenter".to_string(), "host".to_string()])
38 .forward_tags_restriction_list_type(
39 CustomDestinationAttributeTagsRestrictionListType::ALLOW_LIST,
40 )
41 .query("source:nginx".to_string()),
42 CustomDestinationType::CUSTOM_DESTINATION,
43 ));
44 let configuration = datadog::Configuration::new();
45 let api = LogsCustomDestinationsAPI::with_config(configuration);
46 let resp = api.create_logs_custom_destination(body).await;
47 if let Ok(value) = resp {
48 println!("{:#?}", value);
49 } else {
50 println!("{:#?}", resp.unwrap_err());
51 }
52}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CustomDestinationElasticsearchDestinationAuth
impl Clone for CustomDestinationElasticsearchDestinationAuth
Source§fn clone(&self) -> CustomDestinationElasticsearchDestinationAuth
fn clone(&self) -> CustomDestinationElasticsearchDestinationAuth
Returns a copy 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 CustomDestinationElasticsearchDestinationAuth
impl<'de> Deserialize<'de> for CustomDestinationElasticsearchDestinationAuth
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 CustomDestinationElasticsearchDestinationAuth
impl PartialEq for CustomDestinationElasticsearchDestinationAuth
Source§fn eq(&self, other: &CustomDestinationElasticsearchDestinationAuth) -> bool
fn eq(&self, other: &CustomDestinationElasticsearchDestinationAuth) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CustomDestinationElasticsearchDestinationAuth
Auto Trait Implementations§
impl Freeze for CustomDestinationElasticsearchDestinationAuth
impl RefUnwindSafe for CustomDestinationElasticsearchDestinationAuth
impl Send for CustomDestinationElasticsearchDestinationAuth
impl Sync for CustomDestinationElasticsearchDestinationAuth
impl Unpin for CustomDestinationElasticsearchDestinationAuth
impl UnwindSafe for CustomDestinationElasticsearchDestinationAuth
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