Skip to main content

aws_sdk_inspector/operation/create_exclusions_preview/
_create_exclusions_preview_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateExclusionsPreviewOutput {
6    /// <p>Specifies the unique identifier of the requested exclusions preview. You can use the unique identifier to retrieve the exclusions preview when running the GetExclusionsPreview API.</p>
7    pub preview_token: ::std::string::String,
8    _request_id: Option<String>,
9}
10impl CreateExclusionsPreviewOutput {
11    /// <p>Specifies the unique identifier of the requested exclusions preview. You can use the unique identifier to retrieve the exclusions preview when running the GetExclusionsPreview API.</p>
12    pub fn preview_token(&self) -> &str {
13        use std::ops::Deref;
14        self.preview_token.deref()
15    }
16}
17impl ::aws_types::request_id::RequestId for CreateExclusionsPreviewOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl CreateExclusionsPreviewOutput {
23    /// Creates a new builder-style object to manufacture [`CreateExclusionsPreviewOutput`](crate::operation::create_exclusions_preview::CreateExclusionsPreviewOutput).
24    pub fn builder() -> crate::operation::create_exclusions_preview::builders::CreateExclusionsPreviewOutputBuilder {
25        crate::operation::create_exclusions_preview::builders::CreateExclusionsPreviewOutputBuilder::default()
26    }
27}
28
29/// A builder for [`CreateExclusionsPreviewOutput`](crate::operation::create_exclusions_preview::CreateExclusionsPreviewOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CreateExclusionsPreviewOutputBuilder {
33    pub(crate) preview_token: ::std::option::Option<::std::string::String>,
34    _request_id: Option<String>,
35}
36impl CreateExclusionsPreviewOutputBuilder {
37    /// <p>Specifies the unique identifier of the requested exclusions preview. You can use the unique identifier to retrieve the exclusions preview when running the GetExclusionsPreview API.</p>
38    /// This field is required.
39    pub fn preview_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.preview_token = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>Specifies the unique identifier of the requested exclusions preview. You can use the unique identifier to retrieve the exclusions preview when running the GetExclusionsPreview API.</p>
44    pub fn set_preview_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.preview_token = input;
46        self
47    }
48    /// <p>Specifies the unique identifier of the requested exclusions preview. You can use the unique identifier to retrieve the exclusions preview when running the GetExclusionsPreview API.</p>
49    pub fn get_preview_token(&self) -> &::std::option::Option<::std::string::String> {
50        &self.preview_token
51    }
52    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
53        self._request_id = Some(request_id.into());
54        self
55    }
56
57    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
58        self._request_id = request_id;
59        self
60    }
61    /// Consumes the builder and constructs a [`CreateExclusionsPreviewOutput`](crate::operation::create_exclusions_preview::CreateExclusionsPreviewOutput).
62    /// This method will fail if any of the following fields are not set:
63    /// - [`preview_token`](crate::operation::create_exclusions_preview::builders::CreateExclusionsPreviewOutputBuilder::preview_token)
64    pub fn build(
65        self,
66    ) -> ::std::result::Result<
67        crate::operation::create_exclusions_preview::CreateExclusionsPreviewOutput,
68        ::aws_smithy_types::error::operation::BuildError,
69    > {
70        ::std::result::Result::Ok(crate::operation::create_exclusions_preview::CreateExclusionsPreviewOutput {
71            preview_token: self.preview_token.ok_or_else(|| {
72                ::aws_smithy_types::error::operation::BuildError::missing_field(
73                    "preview_token",
74                    "preview_token was not specified but it is required when building CreateExclusionsPreviewOutput",
75                )
76            })?,
77            _request_id: self._request_id,
78        })
79    }
80}