Skip to main content

aws_sdk_devopsagent/operation/update_asset/
_update_asset_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request structure for updating an asset</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateAssetInput {
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 update</p>
10    pub asset_id: ::std::option::Option<::std::string::String>,
11    /// <p>Metadata fields to update. Only the fields present in this document are updated. Omitted fields retain their current values.</p>
12    pub metadata: ::std::option::Option<::aws_smithy_types::Document>,
13    /// <p>Optional content update. A single file adds or replaces one file; a zip replaces all files; a sourceUrl re-syncs from the original source.</p>
14    pub content: ::std::option::Option<crate::types::AssetContent>,
15    /// <p>A unique, case-sensitive identifier used for idempotent asset update</p>
16    pub client_token: ::std::option::Option<::std::string::String>,
17}
18impl UpdateAssetInput {
19    /// <p>The unique identifier for the agent space containing the asset</p>
20    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
21        self.agent_space_id.as_deref()
22    }
23    /// <p>The unique identifier of the asset to update</p>
24    pub fn asset_id(&self) -> ::std::option::Option<&str> {
25        self.asset_id.as_deref()
26    }
27    /// <p>Metadata fields to update. Only the fields present in this document are updated. Omitted fields retain their current values.</p>
28    pub fn metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
29        self.metadata.as_ref()
30    }
31    /// <p>Optional content update. A single file adds or replaces one file; a zip replaces all files; a sourceUrl re-syncs from the original source.</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 update</p>
36    pub fn client_token(&self) -> ::std::option::Option<&str> {
37        self.client_token.as_deref()
38    }
39}
40impl UpdateAssetInput {
41    /// Creates a new builder-style object to manufacture [`UpdateAssetInput`](crate::operation::update_asset::UpdateAssetInput).
42    pub fn builder() -> crate::operation::update_asset::builders::UpdateAssetInputBuilder {
43        crate::operation::update_asset::builders::UpdateAssetInputBuilder::default()
44    }
45}
46
47/// A builder for [`UpdateAssetInput`](crate::operation::update_asset::UpdateAssetInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct UpdateAssetInputBuilder {
51    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
52    pub(crate) asset_id: ::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 UpdateAssetInputBuilder {
58    /// <p>The unique identifier for the agent space containing the asset</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 containing the asset</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 containing the asset</p>
70    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.agent_space_id
72    }
73    /// <p>The unique identifier of the asset to update</p>
74    /// This field is required.
75    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.asset_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The unique identifier of the asset to update</p>
80    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.asset_id = input;
82        self
83    }
84    /// <p>The unique identifier of the asset to update</p>
85    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.asset_id
87    }
88    /// <p>Metadata fields to update. Only the fields present in this document are updated. Omitted fields retain their current values.</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>Metadata fields to update. Only the fields present in this document are updated. Omitted fields retain their current values.</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>Metadata fields to update. Only the fields present in this document are updated. Omitted fields retain their current values.</p>
99    pub fn get_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
100        &self.metadata
101    }
102    /// <p>Optional content update. A single file adds or replaces one file; a zip replaces all files; a sourceUrl re-syncs from the original source.</p>
103    pub fn content(mut self, input: crate::types::AssetContent) -> Self {
104        self.content = ::std::option::Option::Some(input);
105        self
106    }
107    /// <p>Optional content update. A single file adds or replaces one file; a zip replaces all files; a sourceUrl re-syncs from the original source.</p>
108    pub fn set_content(mut self, input: ::std::option::Option<crate::types::AssetContent>) -> Self {
109        self.content = input;
110        self
111    }
112    /// <p>Optional content update. A single file adds or replaces one file; a zip replaces all files; a sourceUrl re-syncs from the original source.</p>
113    pub fn get_content(&self) -> &::std::option::Option<crate::types::AssetContent> {
114        &self.content
115    }
116    /// <p>A unique, case-sensitive identifier used for idempotent asset update</p>
117    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.client_token = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>A unique, case-sensitive identifier used for idempotent asset update</p>
122    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.client_token = input;
124        self
125    }
126    /// <p>A unique, case-sensitive identifier used for idempotent asset update</p>
127    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
128        &self.client_token
129    }
130    /// Consumes the builder and constructs a [`UpdateAssetInput`](crate::operation::update_asset::UpdateAssetInput).
131    pub fn build(self) -> ::std::result::Result<crate::operation::update_asset::UpdateAssetInput, ::aws_smithy_types::error::operation::BuildError> {
132        ::std::result::Result::Ok(crate::operation::update_asset::UpdateAssetInput {
133            agent_space_id: self.agent_space_id,
134            asset_id: self.asset_id,
135            metadata: self.metadata,
136            content: self.content,
137            client_token: self.client_token,
138        })
139    }
140}