aws_sdk_cloudtrail/operation/start_logging/
_start_logging_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request to CloudTrail to start logging Amazon Web Services API calls for an account.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StartLoggingInput {
7    /// <p>Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.</p>
8    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
9    pub name: ::std::option::Option<::std::string::String>,
10}
11impl StartLoggingInput {
12    /// <p>Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.</p>
13    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
14    pub fn name(&self) -> ::std::option::Option<&str> {
15        self.name.as_deref()
16    }
17}
18impl StartLoggingInput {
19    /// Creates a new builder-style object to manufacture [`StartLoggingInput`](crate::operation::start_logging::StartLoggingInput).
20    pub fn builder() -> crate::operation::start_logging::builders::StartLoggingInputBuilder {
21        crate::operation::start_logging::builders::StartLoggingInputBuilder::default()
22    }
23}
24
25/// A builder for [`StartLoggingInput`](crate::operation::start_logging::StartLoggingInput).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct StartLoggingInputBuilder {
29    pub(crate) name: ::std::option::Option<::std::string::String>,
30}
31impl StartLoggingInputBuilder {
32    /// <p>Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.</p>
33    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
34    /// This field is required.
35    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
36        self.name = ::std::option::Option::Some(input.into());
37        self
38    }
39    /// <p>Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.</p>
40    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
41    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
42        self.name = input;
43        self
44    }
45    /// <p>Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.</p>
46    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
47    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
48        &self.name
49    }
50    /// Consumes the builder and constructs a [`StartLoggingInput`](crate::operation::start_logging::StartLoggingInput).
51    pub fn build(
52        self,
53    ) -> ::std::result::Result<crate::operation::start_logging::StartLoggingInput, ::aws_smithy_types::error::operation::BuildError> {
54        ::std::result::Result::Ok(crate::operation::start_logging::StartLoggingInput { name: self.name })
55    }
56}