aws_sdk_m2/types/
_batch_job_identifier.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Identifies a specific batch job.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub enum BatchJobIdentifier {
7    /// <p>Specifies a file associated with a specific batch job.</p>
8    FileBatchJobIdentifier(crate::types::FileBatchJobIdentifier),
9    /// <p>Specifies the required information for restart, including <code>executionId</code> and <code>JobStepRestartMarker</code>.</p>
10    RestartBatchJobIdentifier(crate::types::RestartBatchJobIdentifier),
11    /// <p>Specifies an Amazon S3 location that identifies the batch jobs that you want to run. Use this identifier to run ad hoc batch jobs.</p>
12    S3BatchJobIdentifier(crate::types::S3BatchJobIdentifier),
13    /// <p>A batch job identifier in which the batch job to run is identified by the script name.</p>
14    ScriptBatchJobIdentifier(crate::types::ScriptBatchJobIdentifier),
15    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
16    /// An unknown enum variant
17    ///
18    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
19    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
20    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
21    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
22    #[non_exhaustive]
23    Unknown,
24}
25impl BatchJobIdentifier {
26    /// Tries to convert the enum instance into [`FileBatchJobIdentifier`](crate::types::BatchJobIdentifier::FileBatchJobIdentifier), extracting the inner [`FileBatchJobIdentifier`](crate::types::FileBatchJobIdentifier).
27    /// Returns `Err(&Self)` if it can't be converted.
28    pub fn as_file_batch_job_identifier(&self) -> ::std::result::Result<&crate::types::FileBatchJobIdentifier, &Self> {
29        if let BatchJobIdentifier::FileBatchJobIdentifier(val) = &self {
30            ::std::result::Result::Ok(val)
31        } else {
32            ::std::result::Result::Err(self)
33        }
34    }
35    /// Returns true if this is a [`FileBatchJobIdentifier`](crate::types::BatchJobIdentifier::FileBatchJobIdentifier).
36    pub fn is_file_batch_job_identifier(&self) -> bool {
37        self.as_file_batch_job_identifier().is_ok()
38    }
39    /// Tries to convert the enum instance into [`RestartBatchJobIdentifier`](crate::types::BatchJobIdentifier::RestartBatchJobIdentifier), extracting the inner [`RestartBatchJobIdentifier`](crate::types::RestartBatchJobIdentifier).
40    /// Returns `Err(&Self)` if it can't be converted.
41    pub fn as_restart_batch_job_identifier(&self) -> ::std::result::Result<&crate::types::RestartBatchJobIdentifier, &Self> {
42        if let BatchJobIdentifier::RestartBatchJobIdentifier(val) = &self {
43            ::std::result::Result::Ok(val)
44        } else {
45            ::std::result::Result::Err(self)
46        }
47    }
48    /// Returns true if this is a [`RestartBatchJobIdentifier`](crate::types::BatchJobIdentifier::RestartBatchJobIdentifier).
49    pub fn is_restart_batch_job_identifier(&self) -> bool {
50        self.as_restart_batch_job_identifier().is_ok()
51    }
52    /// Tries to convert the enum instance into [`S3BatchJobIdentifier`](crate::types::BatchJobIdentifier::S3BatchJobIdentifier), extracting the inner [`S3BatchJobIdentifier`](crate::types::S3BatchJobIdentifier).
53    /// Returns `Err(&Self)` if it can't be converted.
54    pub fn as_s3_batch_job_identifier(&self) -> ::std::result::Result<&crate::types::S3BatchJobIdentifier, &Self> {
55        if let BatchJobIdentifier::S3BatchJobIdentifier(val) = &self {
56            ::std::result::Result::Ok(val)
57        } else {
58            ::std::result::Result::Err(self)
59        }
60    }
61    /// Returns true if this is a [`S3BatchJobIdentifier`](crate::types::BatchJobIdentifier::S3BatchJobIdentifier).
62    pub fn is_s3_batch_job_identifier(&self) -> bool {
63        self.as_s3_batch_job_identifier().is_ok()
64    }
65    /// Tries to convert the enum instance into [`ScriptBatchJobIdentifier`](crate::types::BatchJobIdentifier::ScriptBatchJobIdentifier), extracting the inner [`ScriptBatchJobIdentifier`](crate::types::ScriptBatchJobIdentifier).
66    /// Returns `Err(&Self)` if it can't be converted.
67    pub fn as_script_batch_job_identifier(&self) -> ::std::result::Result<&crate::types::ScriptBatchJobIdentifier, &Self> {
68        if let BatchJobIdentifier::ScriptBatchJobIdentifier(val) = &self {
69            ::std::result::Result::Ok(val)
70        } else {
71            ::std::result::Result::Err(self)
72        }
73    }
74    /// Returns true if this is a [`ScriptBatchJobIdentifier`](crate::types::BatchJobIdentifier::ScriptBatchJobIdentifier).
75    pub fn is_script_batch_job_identifier(&self) -> bool {
76        self.as_script_batch_job_identifier().is_ok()
77    }
78    /// Returns true if the enum instance is the `Unknown` variant.
79    pub fn is_unknown(&self) -> bool {
80        matches!(self, Self::Unknown)
81    }
82}