aws_sdk_omics/types/_format_options.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Formatting options for a file.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub enum FormatOptions {
7 /// <p>Options for a TSV file.</p>
8 TsvOptions(crate::types::TsvOptions),
9 /// <p>Options for a VCF file.</p>
10 VcfOptions(crate::types::VcfOptions),
11 /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
12 /// An unknown enum variant
13 ///
14 /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
15 /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
16 /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
17 /// To investigate this, consider turning on debug logging to print the raw HTTP response.
18 #[non_exhaustive]
19 Unknown,
20}
21impl FormatOptions {
22 /// Tries to convert the enum instance into [`TsvOptions`](crate::types::FormatOptions::TsvOptions), extracting the inner [`TsvOptions`](crate::types::TsvOptions).
23 /// Returns `Err(&Self)` if it can't be converted.
24 pub fn as_tsv_options(&self) -> ::std::result::Result<&crate::types::TsvOptions, &Self> {
25 if let FormatOptions::TsvOptions(val) = &self {
26 ::std::result::Result::Ok(val)
27 } else {
28 ::std::result::Result::Err(self)
29 }
30 }
31 /// Returns true if this is a [`TsvOptions`](crate::types::FormatOptions::TsvOptions).
32 pub fn is_tsv_options(&self) -> bool {
33 self.as_tsv_options().is_ok()
34 }
35 /// Tries to convert the enum instance into [`VcfOptions`](crate::types::FormatOptions::VcfOptions), extracting the inner [`VcfOptions`](crate::types::VcfOptions).
36 /// Returns `Err(&Self)` if it can't be converted.
37 pub fn as_vcf_options(&self) -> ::std::result::Result<&crate::types::VcfOptions, &Self> {
38 if let FormatOptions::VcfOptions(val) = &self {
39 ::std::result::Result::Ok(val)
40 } else {
41 ::std::result::Result::Err(self)
42 }
43 }
44 /// Returns true if this is a [`VcfOptions`](crate::types::FormatOptions::VcfOptions).
45 pub fn is_vcf_options(&self) -> bool {
46 self.as_vcf_options().is_ok()
47 }
48 /// Returns true if the enum instance is the `Unknown` variant.
49 pub fn is_unknown(&self) -> bool {
50 matches!(self, Self::Unknown)
51 }
52}