Skip to main content

aws_sdk_devopsagent/operation/get_asset/
_get_asset_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request structure for getting an asset</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetAssetInput {
7    /// <p>The unique identifier for the agent space containing the asset</p>
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier of the asset to retrieve</p>
10    pub asset_id: ::std::option::Option<::std::string::String>,
11    /// <p>The specific version of the asset to retrieve. If omitted, the latest version is returned.</p>
12    pub asset_version: ::std::option::Option<i32>,
13}
14impl GetAssetInput {
15    /// <p>The unique identifier for the agent space containing the asset</p>
16    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
17        self.agent_space_id.as_deref()
18    }
19    /// <p>The unique identifier of the asset to retrieve</p>
20    pub fn asset_id(&self) -> ::std::option::Option<&str> {
21        self.asset_id.as_deref()
22    }
23    /// <p>The specific version of the asset to retrieve. If omitted, the latest version is returned.</p>
24    pub fn asset_version(&self) -> ::std::option::Option<i32> {
25        self.asset_version
26    }
27}
28impl GetAssetInput {
29    /// Creates a new builder-style object to manufacture [`GetAssetInput`](crate::operation::get_asset::GetAssetInput).
30    pub fn builder() -> crate::operation::get_asset::builders::GetAssetInputBuilder {
31        crate::operation::get_asset::builders::GetAssetInputBuilder::default()
32    }
33}
34
35/// A builder for [`GetAssetInput`](crate::operation::get_asset::GetAssetInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct GetAssetInputBuilder {
39    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
40    pub(crate) asset_id: ::std::option::Option<::std::string::String>,
41    pub(crate) asset_version: ::std::option::Option<i32>,
42}
43impl GetAssetInputBuilder {
44    /// <p>The unique identifier for the agent space containing the asset</p>
45    /// This field is required.
46    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.agent_space_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The unique identifier for the agent space containing the asset</p>
51    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.agent_space_id = input;
53        self
54    }
55    /// <p>The unique identifier for the agent space containing the asset</p>
56    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.agent_space_id
58    }
59    /// <p>The unique identifier of the asset to retrieve</p>
60    /// This field is required.
61    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.asset_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The unique identifier of the asset to retrieve</p>
66    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.asset_id = input;
68        self
69    }
70    /// <p>The unique identifier of the asset to retrieve</p>
71    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.asset_id
73    }
74    /// <p>The specific version of the asset to retrieve. If omitted, the latest version is returned.</p>
75    pub fn asset_version(mut self, input: i32) -> Self {
76        self.asset_version = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The specific version of the asset to retrieve. If omitted, the latest version is returned.</p>
80    pub fn set_asset_version(mut self, input: ::std::option::Option<i32>) -> Self {
81        self.asset_version = input;
82        self
83    }
84    /// <p>The specific version of the asset to retrieve. If omitted, the latest version is returned.</p>
85    pub fn get_asset_version(&self) -> &::std::option::Option<i32> {
86        &self.asset_version
87    }
88    /// Consumes the builder and constructs a [`GetAssetInput`](crate::operation::get_asset::GetAssetInput).
89    pub fn build(self) -> ::std::result::Result<crate::operation::get_asset::GetAssetInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::get_asset::GetAssetInput {
91            agent_space_id: self.agent_space_id,
92            asset_id: self.asset_id,
93            asset_version: self.asset_version,
94        })
95    }
96}