Enum aws_sdk_opensearch::model::LogType
source · #[non_exhaustive]
pub enum LogType {
AuditLogs,
EsApplicationLogs,
IndexSlowLogs,
SearchSlowLogs,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against LogType
, it is important to ensure
your code is forward-compatible. That is, if a match arm handles a case for a
feature that is supported by the service but has not been represented as an enum
variant in a current version of SDK, your code should continue to work when you
upgrade SDK to a future version in which the enum does include a variant for that
feature.
Here is an example of how you can make a match expression forward-compatible:
# let logtype = unimplemented!();
match logtype {
LogType::AuditLogs => { /* ... */ },
LogType::EsApplicationLogs => { /* ... */ },
LogType::IndexSlowLogs => { /* ... */ },
LogType::SearchSlowLogs => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when logtype
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant LogType::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
LogType::Unknown(UnknownVariantValue("NewFeature".to_owned()))
and calling as_str
on it yields "NewFeature"
.
This match expression is forward-compatible when executed with a newer
version of SDK where the variant LogType::NewFeature
is defined.
Specifically, when logtype
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on LogType::NewFeature
also yielding "NewFeature"
.
Explicitly matching on the Unknown
variant should
be avoided for two reasons:
- The inner data
UnknownVariantValue
is opaque, and no further information can be extracted. - It might inadvertently shadow other intended match arms.
Type of log file. Can be one of the following:
- INDEX_SLOW_LOGS: Index slow logs contain insert requests that took more time than configured index query log threshold to execute.
- SEARCH_SLOW_LOGS: Search slow logs contain search queries that took more time than configured search query log threshold to execute.
- ES_APPLICATION_LOGS: OpenSearch application logs contain information about errors and warnings raised during the operation of the service and can be useful for troubleshooting.
- AUDIT_LOGS: Audit logs contain records of user requests for access from the domain.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AuditLogs
EsApplicationLogs
IndexSlowLogs
SearchSlowLogs
Unknown(UnknownVariantValue)
Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl LogType
impl LogType
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the &str
value of the enum member.
Examples found in repository?
More examples
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494
pub fn serialize_structure_crate_input_create_domain_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateDomainInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_7) = &input.access_policies {
object.key("AccessPolicies").string(var_7.as_str());
}
if let Some(var_8) = &input.advanced_options {
#[allow(unused_mut)]
let mut object_9 = object.key("AdvancedOptions").start_object();
for (key_10, value_11) in var_8 {
{
object_9.key(key_10.as_str()).string(value_11.as_str());
}
}
object_9.finish();
}
if let Some(var_12) = &input.advanced_security_options {
#[allow(unused_mut)]
let mut object_13 = object.key("AdvancedSecurityOptions").start_object();
crate::json_ser::serialize_structure_crate_model_advanced_security_options_input(
&mut object_13,
var_12,
)?;
object_13.finish();
}
if let Some(var_14) = &input.auto_tune_options {
#[allow(unused_mut)]
let mut object_15 = object.key("AutoTuneOptions").start_object();
crate::json_ser::serialize_structure_crate_model_auto_tune_options_input(
&mut object_15,
var_14,
)?;
object_15.finish();
}
if let Some(var_16) = &input.cluster_config {
#[allow(unused_mut)]
let mut object_17 = object.key("ClusterConfig").start_object();
crate::json_ser::serialize_structure_crate_model_cluster_config(&mut object_17, var_16)?;
object_17.finish();
}
if let Some(var_18) = &input.cognito_options {
#[allow(unused_mut)]
let mut object_19 = object.key("CognitoOptions").start_object();
crate::json_ser::serialize_structure_crate_model_cognito_options(&mut object_19, var_18)?;
object_19.finish();
}
if let Some(var_20) = &input.domain_endpoint_options {
#[allow(unused_mut)]
let mut object_21 = object.key("DomainEndpointOptions").start_object();
crate::json_ser::serialize_structure_crate_model_domain_endpoint_options(
&mut object_21,
var_20,
)?;
object_21.finish();
}
if let Some(var_22) = &input.domain_name {
object.key("DomainName").string(var_22.as_str());
}
if let Some(var_23) = &input.ebs_options {
#[allow(unused_mut)]
let mut object_24 = object.key("EBSOptions").start_object();
crate::json_ser::serialize_structure_crate_model_ebs_options(&mut object_24, var_23)?;
object_24.finish();
}
if let Some(var_25) = &input.encryption_at_rest_options {
#[allow(unused_mut)]
let mut object_26 = object.key("EncryptionAtRestOptions").start_object();
crate::json_ser::serialize_structure_crate_model_encryption_at_rest_options(
&mut object_26,
var_25,
)?;
object_26.finish();
}
if let Some(var_27) = &input.engine_version {
object.key("EngineVersion").string(var_27.as_str());
}
if let Some(var_28) = &input.log_publishing_options {
#[allow(unused_mut)]
let mut object_29 = object.key("LogPublishingOptions").start_object();
for (key_30, value_31) in var_28 {
{
#[allow(unused_mut)]
let mut object_32 = object_29.key(key_30.as_str()).start_object();
crate::json_ser::serialize_structure_crate_model_log_publishing_option(
&mut object_32,
value_31,
)?;
object_32.finish();
}
}
object_29.finish();
}
if let Some(var_33) = &input.node_to_node_encryption_options {
#[allow(unused_mut)]
let mut object_34 = object.key("NodeToNodeEncryptionOptions").start_object();
crate::json_ser::serialize_structure_crate_model_node_to_node_encryption_options(
&mut object_34,
var_33,
)?;
object_34.finish();
}
if let Some(var_35) = &input.snapshot_options {
#[allow(unused_mut)]
let mut object_36 = object.key("SnapshotOptions").start_object();
crate::json_ser::serialize_structure_crate_model_snapshot_options(&mut object_36, var_35)?;
object_36.finish();
}
if let Some(var_37) = &input.tag_list {
let mut array_38 = object.key("TagList").start_array();
for item_39 in var_37 {
{
#[allow(unused_mut)]
let mut object_40 = array_38.value().start_object();
crate::json_ser::serialize_structure_crate_model_tag(&mut object_40, item_39)?;
object_40.finish();
}
}
array_38.finish();
}
if let Some(var_41) = &input.vpc_options {
#[allow(unused_mut)]
let mut object_42 = object.key("VPCOptions").start_object();
crate::json_ser::serialize_structure_crate_model_vpc_options(&mut object_42, var_41)?;
object_42.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_create_outbound_connection_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateOutboundConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_43) = &input.connection_alias {
object.key("ConnectionAlias").string(var_43.as_str());
}
if let Some(var_44) = &input.local_domain_info {
#[allow(unused_mut)]
let mut object_45 = object.key("LocalDomainInfo").start_object();
crate::json_ser::serialize_structure_crate_model_domain_information_container(
&mut object_45,
var_44,
)?;
object_45.finish();
}
if let Some(var_46) = &input.remote_domain_info {
#[allow(unused_mut)]
let mut object_47 = object.key("RemoteDomainInfo").start_object();
crate::json_ser::serialize_structure_crate_model_domain_information_container(
&mut object_47,
var_46,
)?;
object_47.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_create_package_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreatePackageInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_48) = &input.package_description {
object.key("PackageDescription").string(var_48.as_str());
}
if let Some(var_49) = &input.package_name {
object.key("PackageName").string(var_49.as_str());
}
if let Some(var_50) = &input.package_source {
#[allow(unused_mut)]
let mut object_51 = object.key("PackageSource").start_object();
crate::json_ser::serialize_structure_crate_model_package_source(&mut object_51, var_50)?;
object_51.finish();
}
if let Some(var_52) = &input.package_type {
object.key("PackageType").string(var_52.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_domain_auto_tunes_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeDomainAutoTunesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if input.max_results != 0 {
object.key("MaxResults").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_results).into()),
);
}
if let Some(var_53) = &input.next_token {
object.key("NextToken").string(var_53.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_domains_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeDomainsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_54) = &input.domain_names {
let mut array_55 = object.key("DomainNames").start_array();
for item_56 in var_54 {
{
array_55.value().string(item_56.as_str());
}
}
array_55.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_inbound_connections_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeInboundConnectionsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_57) = &input.filters {
let mut array_58 = object.key("Filters").start_array();
for item_59 in var_57 {
{
#[allow(unused_mut)]
let mut object_60 = array_58.value().start_object();
crate::json_ser::serialize_structure_crate_model_filter(&mut object_60, item_59)?;
object_60.finish();
}
}
array_58.finish();
}
if input.max_results != 0 {
object.key("MaxResults").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_results).into()),
);
}
if let Some(var_61) = &input.next_token {
object.key("NextToken").string(var_61.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_outbound_connections_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeOutboundConnectionsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_62) = &input.filters {
let mut array_63 = object.key("Filters").start_array();
for item_64 in var_62 {
{
#[allow(unused_mut)]
let mut object_65 = array_63.value().start_object();
crate::json_ser::serialize_structure_crate_model_filter(&mut object_65, item_64)?;
object_65.finish();
}
}
array_63.finish();
}
if input.max_results != 0 {
object.key("MaxResults").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_results).into()),
);
}
if let Some(var_66) = &input.next_token {
object.key("NextToken").string(var_66.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_packages_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribePackagesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_67) = &input.filters {
let mut array_68 = object.key("Filters").start_array();
for item_69 in var_67 {
{
#[allow(unused_mut)]
let mut object_70 = array_68.value().start_object();
crate::json_ser::serialize_structure_crate_model_describe_packages_filter(
&mut object_70,
item_69,
)?;
object_70.finish();
}
}
array_68.finish();
}
if input.max_results != 0 {
object.key("MaxResults").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_results).into()),
);
}
if let Some(var_71) = &input.next_token {
object.key("NextToken").string(var_71.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_purchase_reserved_instance_offering_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::PurchaseReservedInstanceOfferingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if input.instance_count != 0 {
object.key("InstanceCount").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.instance_count).into()),
);
}
if let Some(var_72) = &input.reservation_name {
object.key("ReservationName").string(var_72.as_str());
}
if let Some(var_73) = &input.reserved_instance_offering_id {
object
.key("ReservedInstanceOfferingId")
.string(var_73.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_remove_tags_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::RemoveTagsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_74) = &input.arn {
object.key("ARN").string(var_74.as_str());
}
if let Some(var_75) = &input.tag_keys {
let mut array_76 = object.key("TagKeys").start_array();
for item_77 in var_75 {
{
array_76.value().string(item_77.as_str());
}
}
array_76.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_start_service_software_update_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::StartServiceSoftwareUpdateInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_78) = &input.domain_name {
object.key("DomainName").string(var_78.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_update_domain_config_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdateDomainConfigInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_79) = &input.access_policies {
object.key("AccessPolicies").string(var_79.as_str());
}
if let Some(var_80) = &input.advanced_options {
#[allow(unused_mut)]
let mut object_81 = object.key("AdvancedOptions").start_object();
for (key_82, value_83) in var_80 {
{
object_81.key(key_82.as_str()).string(value_83.as_str());
}
}
object_81.finish();
}
if let Some(var_84) = &input.advanced_security_options {
#[allow(unused_mut)]
let mut object_85 = object.key("AdvancedSecurityOptions").start_object();
crate::json_ser::serialize_structure_crate_model_advanced_security_options_input(
&mut object_85,
var_84,
)?;
object_85.finish();
}
if let Some(var_86) = &input.auto_tune_options {
#[allow(unused_mut)]
let mut object_87 = object.key("AutoTuneOptions").start_object();
crate::json_ser::serialize_structure_crate_model_auto_tune_options(&mut object_87, var_86)?;
object_87.finish();
}
if let Some(var_88) = &input.cluster_config {
#[allow(unused_mut)]
let mut object_89 = object.key("ClusterConfig").start_object();
crate::json_ser::serialize_structure_crate_model_cluster_config(&mut object_89, var_88)?;
object_89.finish();
}
if let Some(var_90) = &input.cognito_options {
#[allow(unused_mut)]
let mut object_91 = object.key("CognitoOptions").start_object();
crate::json_ser::serialize_structure_crate_model_cognito_options(&mut object_91, var_90)?;
object_91.finish();
}
if let Some(var_92) = &input.domain_endpoint_options {
#[allow(unused_mut)]
let mut object_93 = object.key("DomainEndpointOptions").start_object();
crate::json_ser::serialize_structure_crate_model_domain_endpoint_options(
&mut object_93,
var_92,
)?;
object_93.finish();
}
if let Some(var_94) = &input.dry_run {
object.key("DryRun").boolean(*var_94);
}
if let Some(var_95) = &input.ebs_options {
#[allow(unused_mut)]
let mut object_96 = object.key("EBSOptions").start_object();
crate::json_ser::serialize_structure_crate_model_ebs_options(&mut object_96, var_95)?;
object_96.finish();
}
if let Some(var_97) = &input.encryption_at_rest_options {
#[allow(unused_mut)]
let mut object_98 = object.key("EncryptionAtRestOptions").start_object();
crate::json_ser::serialize_structure_crate_model_encryption_at_rest_options(
&mut object_98,
var_97,
)?;
object_98.finish();
}
if let Some(var_99) = &input.log_publishing_options {
#[allow(unused_mut)]
let mut object_100 = object.key("LogPublishingOptions").start_object();
for (key_101, value_102) in var_99 {
{
#[allow(unused_mut)]
let mut object_103 = object_100.key(key_101.as_str()).start_object();
crate::json_ser::serialize_structure_crate_model_log_publishing_option(
&mut object_103,
value_102,
)?;
object_103.finish();
}
}
object_100.finish();
}
if let Some(var_104) = &input.node_to_node_encryption_options {
#[allow(unused_mut)]
let mut object_105 = object.key("NodeToNodeEncryptionOptions").start_object();
crate::json_ser::serialize_structure_crate_model_node_to_node_encryption_options(
&mut object_105,
var_104,
)?;
object_105.finish();
}
if let Some(var_106) = &input.snapshot_options {
#[allow(unused_mut)]
let mut object_107 = object.key("SnapshotOptions").start_object();
crate::json_ser::serialize_structure_crate_model_snapshot_options(
&mut object_107,
var_106,
)?;
object_107.finish();
}
if let Some(var_108) = &input.vpc_options {
#[allow(unused_mut)]
let mut object_109 = object.key("VPCOptions").start_object();
crate::json_ser::serialize_structure_crate_model_vpc_options(&mut object_109, var_108)?;
object_109.finish();
}
Ok(())
}
Trait Implementations§
source§impl Ord for LogType
impl Ord for LogType
source§impl PartialOrd<LogType> for LogType
impl PartialOrd<LogType> for LogType
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for LogType
impl StructuralEq for LogType
impl StructuralPartialEq for LogType
Auto Trait Implementations§
impl RefUnwindSafe for LogType
impl Send for LogType
impl Sync for LogType
impl Unpin for LogType
impl UnwindSafe for LogType
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.