Skip to main content

aws_sdk_cloudextensions/operation/get_extension/
_get_extension_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Identifies the extension and optionally a specific version to retrieve.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetExtensionInput {
7    /// The id of the extension, such as aws:secretsmanager.
8    pub identifier: ::std::option::Option<::std::string::String>,
9    /// The version to retrieve. Omit it to retrieve the latest release.
10    pub extension_version: ::std::option::Option<::std::string::String>,
11}
12impl GetExtensionInput {
13    /// The id of the extension, such as aws:secretsmanager.
14    pub fn identifier(&self) -> ::std::option::Option<&str> {
15        self.identifier.as_deref()
16    }
17    /// The version to retrieve. Omit it to retrieve the latest release.
18    pub fn extension_version(&self) -> ::std::option::Option<&str> {
19        self.extension_version.as_deref()
20    }
21}
22impl GetExtensionInput {
23    /// Creates a new builder-style object to manufacture [`GetExtensionInput`](crate::operation::get_extension::GetExtensionInput).
24    pub fn builder() -> crate::operation::get_extension::builders::GetExtensionInputBuilder {
25        crate::operation::get_extension::builders::GetExtensionInputBuilder::default()
26    }
27}
28
29/// A builder for [`GetExtensionInput`](crate::operation::get_extension::GetExtensionInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetExtensionInputBuilder {
33    pub(crate) identifier: ::std::option::Option<::std::string::String>,
34    pub(crate) extension_version: ::std::option::Option<::std::string::String>,
35}
36impl GetExtensionInputBuilder {
37    /// The id of the extension, such as aws:secretsmanager.
38    /// This field is required.
39    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.identifier = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// The id of the extension, such as aws:secretsmanager.
44    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.identifier = input;
46        self
47    }
48    /// The id of the extension, such as aws:secretsmanager.
49    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
50        &self.identifier
51    }
52    /// The version to retrieve. Omit it to retrieve the latest release.
53    pub fn extension_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.extension_version = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// The version to retrieve. Omit it to retrieve the latest release.
58    pub fn set_extension_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.extension_version = input;
60        self
61    }
62    /// The version to retrieve. Omit it to retrieve the latest release.
63    pub fn get_extension_version(&self) -> &::std::option::Option<::std::string::String> {
64        &self.extension_version
65    }
66    /// Consumes the builder and constructs a [`GetExtensionInput`](crate::operation::get_extension::GetExtensionInput).
67    pub fn build(
68        self,
69    ) -> ::std::result::Result<crate::operation::get_extension::GetExtensionInput, ::aws_smithy_types::error::operation::BuildError> {
70        ::std::result::Result::Ok(crate::operation::get_extension::GetExtensionInput {
71            identifier: self.identifier,
72            extension_version: self.extension_version,
73        })
74    }
75}