Skip to main content

aws_sdk_devopsagent/operation/create_asset/
_create_asset_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request structure for creating a new asset</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateAssetInput {
7    /// <p>The unique identifier for the agent space where the asset will be created</p>
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// <p>The type of asset to create</p>
10    pub asset_type: ::std::option::Option<::std::string::String>,
11    /// <p>The metadata describing this asset</p>
12    pub metadata: ::std::option::Option<::aws_smithy_types::Document>,
13    /// <p>The content for the asset. Provide a single file or a zip bundle.</p>
14    pub content: ::std::option::Option<crate::types::AssetContent>,
15    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
16    pub client_token: ::std::option::Option<::std::string::String>,
17}
18impl CreateAssetInput {
19    /// <p>The unique identifier for the agent space where the asset will be created</p>
20    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
21        self.agent_space_id.as_deref()
22    }
23    /// <p>The type of asset to create</p>
24    pub fn asset_type(&self) -> ::std::option::Option<&str> {
25        self.asset_type.as_deref()
26    }
27    /// <p>The metadata describing this asset</p>
28    pub fn metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
29        self.metadata.as_ref()
30    }
31    /// <p>The content for the asset. Provide a single file or a zip bundle.</p>
32    pub fn content(&self) -> ::std::option::Option<&crate::types::AssetContent> {
33        self.content.as_ref()
34    }
35    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
36    pub fn client_token(&self) -> ::std::option::Option<&str> {
37        self.client_token.as_deref()
38    }
39}
40impl CreateAssetInput {
41    /// Creates a new builder-style object to manufacture [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
42    pub fn builder() -> crate::operation::create_asset::builders::CreateAssetInputBuilder {
43        crate::operation::create_asset::builders::CreateAssetInputBuilder::default()
44    }
45}
46
47/// A builder for [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct CreateAssetInputBuilder {
51    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
52    pub(crate) asset_type: ::std::option::Option<::std::string::String>,
53    pub(crate) metadata: ::std::option::Option<::aws_smithy_types::Document>,
54    pub(crate) content: ::std::option::Option<crate::types::AssetContent>,
55    pub(crate) client_token: ::std::option::Option<::std::string::String>,
56}
57impl CreateAssetInputBuilder {
58    /// <p>The unique identifier for the agent space where the asset will be created</p>
59    /// This field is required.
60    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.agent_space_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The unique identifier for the agent space where the asset will be created</p>
65    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.agent_space_id = input;
67        self
68    }
69    /// <p>The unique identifier for the agent space where the asset will be created</p>
70    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.agent_space_id
72    }
73    /// <p>The type of asset to create</p>
74    /// This field is required.
75    pub fn asset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.asset_type = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The type of asset to create</p>
80    pub fn set_asset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.asset_type = input;
82        self
83    }
84    /// <p>The type of asset to create</p>
85    pub fn get_asset_type(&self) -> &::std::option::Option<::std::string::String> {
86        &self.asset_type
87    }
88    /// <p>The metadata describing this asset</p>
89    pub fn metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
90        self.metadata = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The metadata describing this asset</p>
94    pub fn set_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
95        self.metadata = input;
96        self
97    }
98    /// <p>The metadata describing this asset</p>
99    pub fn get_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
100        &self.metadata
101    }
102    /// <p>The content for the asset. Provide a single file or a zip bundle.</p>
103    /// This field is required.
104    pub fn content(mut self, input: crate::types::AssetContent) -> Self {
105        self.content = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The content for the asset. Provide a single file or a zip bundle.</p>
109    pub fn set_content(mut self, input: ::std::option::Option<crate::types::AssetContent>) -> Self {
110        self.content = input;
111        self
112    }
113    /// <p>The content for the asset. Provide a single file or a zip bundle.</p>
114    pub fn get_content(&self) -> &::std::option::Option<crate::types::AssetContent> {
115        &self.content
116    }
117    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
118    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.client_token = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
123    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.client_token = input;
125        self
126    }
127    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
128    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
129        &self.client_token
130    }
131    /// Consumes the builder and constructs a [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
132    pub fn build(self) -> ::std::result::Result<crate::operation::create_asset::CreateAssetInput, ::aws_smithy_types::error::operation::BuildError> {
133        ::std::result::Result::Ok(crate::operation::create_asset::CreateAssetInput {
134            agent_space_id: self.agent_space_id,
135            asset_type: self.asset_type,
136            metadata: self.metadata,
137            content: self.content,
138            client_token: self.client_token,
139        })
140    }
141}