aws_sdk_codecommit/operation/put_file/
_put_file_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutFileOutput {
6 pub commit_id: ::std::string::String,
8 pub blob_id: ::std::string::String,
10 pub tree_id: ::std::string::String,
12 _request_id: Option<String>,
13}
14impl PutFileOutput {
15 pub fn commit_id(&self) -> &str {
17 use std::ops::Deref;
18 self.commit_id.deref()
19 }
20 pub fn blob_id(&self) -> &str {
22 use std::ops::Deref;
23 self.blob_id.deref()
24 }
25 pub fn tree_id(&self) -> &str {
27 use std::ops::Deref;
28 self.tree_id.deref()
29 }
30}
31impl ::aws_types::request_id::RequestId for PutFileOutput {
32 fn request_id(&self) -> Option<&str> {
33 self._request_id.as_deref()
34 }
35}
36impl PutFileOutput {
37 pub fn builder() -> crate::operation::put_file::builders::PutFileOutputBuilder {
39 crate::operation::put_file::builders::PutFileOutputBuilder::default()
40 }
41}
42
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct PutFileOutputBuilder {
47 pub(crate) commit_id: ::std::option::Option<::std::string::String>,
48 pub(crate) blob_id: ::std::option::Option<::std::string::String>,
49 pub(crate) tree_id: ::std::option::Option<::std::string::String>,
50 _request_id: Option<String>,
51}
52impl PutFileOutputBuilder {
53 pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56 self.commit_id = ::std::option::Option::Some(input.into());
57 self
58 }
59 pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61 self.commit_id = input;
62 self
63 }
64 pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
66 &self.commit_id
67 }
68 pub fn blob_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 self.blob_id = ::std::option::Option::Some(input.into());
72 self
73 }
74 pub fn set_blob_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.blob_id = input;
77 self
78 }
79 pub fn get_blob_id(&self) -> &::std::option::Option<::std::string::String> {
81 &self.blob_id
82 }
83 pub fn tree_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.tree_id = ::std::option::Option::Some(input.into());
87 self
88 }
89 pub fn set_tree_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.tree_id = input;
92 self
93 }
94 pub fn get_tree_id(&self) -> &::std::option::Option<::std::string::String> {
96 &self.tree_id
97 }
98 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
99 self._request_id = Some(request_id.into());
100 self
101 }
102
103 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
104 self._request_id = request_id;
105 self
106 }
107 pub fn build(self) -> ::std::result::Result<crate::operation::put_file::PutFileOutput, ::aws_smithy_types::error::operation::BuildError> {
113 ::std::result::Result::Ok(crate::operation::put_file::PutFileOutput {
114 commit_id: self.commit_id.ok_or_else(|| {
115 ::aws_smithy_types::error::operation::BuildError::missing_field(
116 "commit_id",
117 "commit_id was not specified but it is required when building PutFileOutput",
118 )
119 })?,
120 blob_id: self.blob_id.ok_or_else(|| {
121 ::aws_smithy_types::error::operation::BuildError::missing_field(
122 "blob_id",
123 "blob_id was not specified but it is required when building PutFileOutput",
124 )
125 })?,
126 tree_id: self.tree_id.ok_or_else(|| {
127 ::aws_smithy_types::error::operation::BuildError::missing_field(
128 "tree_id",
129 "tree_id was not specified but it is required when building PutFileOutput",
130 )
131 })?,
132 _request_id: self._request_id,
133 })
134 }
135}